[ofa-general] More comments about the dma-mapping.h, ipath_dma.c problem

Harold/Carlyn Iuzzolino iuzzolin at nmia.com
Thu Jul 31 01:55:36 PDT 2008


Dear Openfabrics, (in particular Ralph Campbell <ralph.campbell at qlogic.com>)
 general at lists.openfabrics.org

On Mon, 28 Jul 2008, Ralph Campbell wrote:

> After looking at this somewhat, I don't see what the bug is.
> The various OFED-1.4 files in:
> kernel_addons/backport/*/include/linux/dma-mapping.h
> either have or don't have #ifndef __x86_64__
> depending on whether valid_dma_direction() is defined in
> include/asm-x86_64/dma-mapping.h or not.
> For the kernel-devel-2.6.18-1.2798.fc6.x86_64.rpm,
> include/asm-x86_64/dma-mapping.h does define valid_dma_direction()
> and OFED-1.4
> kernel_addons/backport/backport/2.6.18_FC6/include/linux/dma-mapping.h
> does correctly ifndef __x86_64__ valid_dma_direction().
>
> I don't have an FC6 system handy so I can't reproduce this.
>
> Are you sure that you aren't installing on a patched kernel?
> You can check by looking at:
> cd /lib/modules/`uname -r`/build/include
> grep valid_dma_direction asm-x86_64/dma-mapping.h linux/dma-mapping.h


I'm using a clean Fedora 6 with NO UPDATES. I had to install the kernel-devel...rpm as well as some other rpms before I ran the OFED install.pl

[root at elrond ~]# ls /lib/modules/
2.6.18-1.2798.fc6xen      <--------- Only one directory

[root at elrond ~]# uname -a
Linux elrond 2.6.18-1.2798.fc6xen #1 SMP Mon Oct 16 14:59:01 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux
[root at elrond ~]# uname -r
2.6.18-1.2798.fc6xen

[root at elrond include]# cd /lib/modules/`uname -r`/build/include
[root at elrond include]# pwd
/lib/modules/2.6.18-1.2798.fc6xen/build/include   <----------- that's correct

[root at elrond include]# ll
lrwxrwxrwx   1 root root    10 Jul  2 08:48 asm -> asm-x86_64
drwxr-xr-x   3 root root  4096 Jul  2 08:48 asm-generic
drwxr-xr-x  11 root root  4096 Jul  2 08:48 asm-i386
drwxr-xr-x   3 root root  4096 Jul  2 08:48 asm-x86_64

[root at elrond include]# more asm-x86_64/dma-mapping.h      

You are correct that the file asm-x86_64/dma-mapping.h DOES have a definition
of valid_dma_direction(int dma_direction) and it ISN'T ifndef'd out.




-------------------------------------

However, here is the compile command from /tmp/OFED.4905.logs/ofa_kernel.rpmbuild.log
of the subroutine ipath_dma.c, the one that has the complaint.

 gcc -Wp,-MD,/var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/drivers/infiniband/hw/ipath/.ipath_dma.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include -Iinclude/asm/mach-xen -D__KERNEL__ \
-include include/linux/autoconf.h \
-include /var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/include/linux/autoconf.h \
-I/var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/kernel_addons/backport/2.6.18_FC6/include/ \          <--------------------------------- PROBLEM IS HERE
 \
 \
-I/var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/include \
-I/var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/drivers/infiniband/debug \
-I/usr/local/include/scst \
-I/var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/drivers/infiniband/ulp/srpt \
-I/var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/drivers/net/cxgb3 \
-Iinclude \
 \ -D__XEN_INTERFACE_VERSION__=0x00030203 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wstrict-prototypes -Wundef -Werror-implicit-function-declaration -Os  -mtune=generic -m64 -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -Wno-sign-compare -fno-asynchronous-unwind-tables -funit-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fomit-frame-pointer -g
-fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DIPATH_IDSTR='"QLogic kernel.org driver"' -DIPATH_KERN_TYPE=0  -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(ipath_dma)"  -D"KBUILD_MODNAME=KBUILD_STR(ib_ipath)" -c -o /var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/drivers/infiniband/hw/ipath/.tmp_ipath_dma.o /var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/drivers/infiniband/hw/ipath/ipath_dma.c

Notice that there is no -I/lib/modules/2.6.18-1.2798.fc6xen/build/include 
in the above gcc statement. According to what you said, that directory
has the correct dma-mapping.h file. The one that's being used, (see below)
has the static inline int valid_dma_direction(int dma_direction) code
#ifndef __x86_64__ around it.

Now, here's the complaint

/var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/drivers/infiniband/hw/ipath/ipath_dma.c: In function 'ipath_dma_map_single':
/var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/drivers/infiniband/hw/ipath/ipath_dma.c:58: error: implicit declaration of function 'valid_dma_direction'
make[4]: *** [/var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/drivers/infiniband/hw/ipath/ipath_dma.o] Error 1



I think the problem is in this include directory

-I/var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/kernel_addons/backport/2.6.18_FC6/include/ \          <--------------------------------- PROBLEM IS HERE


[root at elrond include]# ll /var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/kernel_addons/backport/2.6.18_FC6/include/
total 28
drwxr-xr-x 7 root root 4096 Jul 24 07:10 .
drwxr-xr-x 3 root root 4096 Jul 24 07:10 ..
drwxr-xr-x 2 root root 4096 Jul 24 07:10 asm
drwxr-xr-x 3 root root 4096 Jul 24 07:10 linux
drwxr-xr-x 2 root root 4096 Jul 24 07:10 net
drwxr-xr-x 2 root root 4096 Jul 24 07:10 scsi
drwxr-xr-x 2 root root 4096 Jul 24 07:10 src


-----------------

[root at elrond include]# ll /var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/kernel_addons/backport/2.6.18_FC6/include/linux/dma-mapping.h
-rw-r--r-- 1 root root 1076 Jul 24 07:10 /var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/kernel_addons/backport/2.6.18_FC6/include/linux/dma-mapping.h

-----------------

[root at elrond include]# more /var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/kernel_addons/backport/2.6.18_FC6/include/linux/dma-mapping.h

#include_next <linux/dma-mapping.h>
 
#ifndef __x86_64__
 
/* x86_64 was the only architecture that had valid_dma_direction
 * before 2.6.18 */
static inline int valid_dma_direction(int dma_direction)
{
        return ((dma_direction == DMA_BIDIRECTIONAL) ||
                (dma_direction == DMA_TO_DEVICE) ||
                (dma_direction == DMA_FROM_DEVICE));
}
#endif
 
#endif
 

COMMENT: I don't think the directory /lib/modules/2.6.18-1.2798.fc6xen/build/include   
or the file /lib/modules/2.6.18-1.2798.fc6xen/build/include/asm-x86_64/dma-mapping.h or
/lib/modules/2.6.18-1.2798.fc6xen/build/include/linux/dma-mapping.h

is being used at all.

Instead, the file /var/tmp/OFED_topdir/BUILD/ofa_kernel-1.4/kernel_addons/backport/2.6.18_FC6/include/linux/dma-mapping.h
is being used and it DOES have the definition #ifndef __x86_64__'d out
because this IS a 64 bit machine.




Now, this is a clean install of Fedora 6 and NOTHING has been updated, on
purpose. I used the install.pl script as is. So there's something in that
install script that makes it use the wrong directory for the include files.


Carlyn

<<<      Q: How do you make one burn?
<<<      A: Differentiate a log fire.
<<< 



More information about the general mailing list