[ofa-general] More comments about the dma-mapping.h, ipath_dma.c problem
Ralph Campbell
ralph.campbell at qlogic.com
Thu Jul 31 17:25:11 PDT 2008
Thanks for the additional information. I am able to reproduce your
compile problem. The problem is that XEN has its own dma-mapping.h
file which #if 0 around all the dma_* functions:
/usr/src/kernels/2.6.18-1.2798.fc6-xen-x86_64/include/asm-x86_64/mach-xen/asm/dma-mapping.h
XEN is not a supported kernel so this has not been tested, but
if you want to try it, I did the following:
# git clone git://git.openfabrics.org/ofed_1_3/linux-2.6.git
# cd linux-2.6.git
# ./ofed_scripts/ofed_makedist.sh
# tar zxf ofed_kernel-2.6.18_FC6.tgz
# cd ofed_kernel-2.6.18_FC6
# vi kernel_addons/backport/2.6.18_FC6/include/linux/dma-mapping.h
<remove the #ifndef __x86_64__ and #endif>
# ./configure \
--with-core-mod \
--with-ipoib-mod \
--with-ipoib-cm \
--without-ipoib_debug-mod \
--without-ipoib_debug_data-mod \
--with-sdp-mod \
--without-sdp_debug-mod \
--without-sdp_debug_data-mod \
--with-srp-mod \
--with-srp-target-mod \
--with-user_mad-mod \
--with-user_access-mod \
--with-addr_trans-mod \
--with-mthca-mod \
--without-mthca_debug-mod \
--with-mlx4-mod \
--without-mlx4_debug-mod \
--with-ipath_inf-mod \
--without-iser-mod \
--without-ehca-mod \
--with-rds-mod \
--without-rds_debug-mod \
--with-madeye-mod \
--with-qlgc_vnic-mod \
--without-qlgc_vnic_debug-mod \
--without-qlgc_vnic_stats-mod \
--without-cxgb3-mod \
--without-cxgb3_debug-mod \
--with-nes-mod \
--without-nes_debug-mod \
--without-memtrack \
--with-debug-info
# make
# make install
On Thu, 2008-07-31 at 02:55 -0600, Harold/Carlyn Iuzzolino wrote:
> 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.
> <<<
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
>
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
More information about the general
mailing list