Whamcloud - gitweb
b=16792
[fs/lustre-release.git] / lnet / autoconf / lustre-lnet.m4
index 3443063..f73004e 100644 (file)
@@ -127,6 +127,9 @@ else
        if test "$BOCD" != 0 ; then
                AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
                AC_MSG_RESULT(yes)
+               if grep rto_max $LINUX/include/linux/tcp.h|grep -q __u16; then
+                   AC_DEFINE(SOCKNAL_BACKOFF_MS, 1, [tunable backoff TCP in ms])
+               fi
        else
                AC_MSG_RESULT([no (no kernel support)])
        fi
@@ -516,37 +519,61 @@ else
                        O2IBLND=""
                        O2IBCPPFLAGS=""
                ])
-
                # we know at this point that the found OFED source is good
-               if test \( $ENABLEO2IB = 3 \); then
-                       if test \( -f $O2IBPATH/Module.symvers \); then
-                               AC_MSG_NOTICE([adding $O2IBPATH/Module.symvers to $PWD/$SYMVERFILE])
+               O2IB_SYMVER=""
+               if test $ENABLEO2IB -eq 3 ; then
+                       # OFED default rpm not handle sles10 Modules.symvers name
+                       for name in Module.symvers Modules.symvers; do
+                               if test -f $O2IBPATH/$name; then
+                                       O2IB_SYMVER=$name;
+                                       break;
+                               fi
+                       done
+                       if test -n $O2IB_SYMVER ; then
+                               AC_MSG_NOTICE([adding $O2IBPATH/$O2IB_SYMVER to $PWD/$SYMVERFILE])
                                # strip out the existing symbols versions first
-                               touch $O2IBPATH/Module.symvers
-                               egrep -v $(echo $(awk '{ print $2 }' $O2IBPATH/Module.symvers) | tr ' ' '|') $PWD/$SYMVERFILE > $PWD/$SYMVERFILE.old
-                               cat $PWD/$SYMVERFILE.old $O2IBPATH/Module.symvers > $PWD/$SYMVERFILE
+                               egrep -v $(echo $(awk '{ print $2 }' $O2IBPATH/$O2IB_SYMVER) | tr ' ' '|') $PWD/$SYMVERFILE > $PWD/$SYMVERFILE.old
+                               cat $PWD/$SYMVERFILE.old $O2IBPATH/$O2IB_SYMVER > $PWD/$SYMVERFILE
                        else
                                AC_MSG_ERROR([an external source tree was specified for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
                        fi
                fi
 
-               # version checking is a hack and isn't reliable,
-               # we need verify it with each new ofed release
-
-               if grep -q ib_dma_map_single \
-                       ${O2IBPATH}/include/rdma/ib_verbs.h; then
-                       if grep -q comp_vector \
-                               ${O2IBPATH}/include/rdma/ib_verbs.h; then
-                               IBLND_OFED_VERSION="1025"
-                       else
-                               IBLND_OFED_VERSION="1020"
-                       fi
-               else
-                       IBLND_OFED_VERSION="1010"
-               fi
+               LB_LINUX_TRY_COMPILE([
+                       #include <linux/version.h>
+                       #include <linux/pci.h>
+                       #if !HAVE_GFP_T
+                       typedef int gfp_t;
+                       #endif
+                       #include <rdma/ib_verbs.h>
+               ],[
+                       ib_dma_map_single(NULL, NULL, 0, 0);
+                       return 0;
+               ],[
+                       AC_MSG_RESULT(yes)
+                       AC_DEFINE(HAVE_OFED_IB_DMA_MAP, 1,
+                                 [ib_dma_map_single defined])
+               ],[
+                       AC_MSG_RESULT(no)
+               ])
 
-               AC_DEFINE_UNQUOTED(IBLND_OFED_VERSION, $IBLND_OFED_VERSION,
-                                  [OFED version])
+               LB_LINUX_TRY_COMPILE([
+                       #include <linux/version.h>
+                       #include <linux/pci.h>
+                       #if !HAVE_GFP_T
+                       typedef int gfp_t;
+                       #endif
+                       #include <rdma/ib_verbs.h>
+               ],[
+                       ib_create_cq(NULL, NULL, NULL, NULL, 0, 0);
+                       return 0;
+               ],[
+                       AC_MSG_RESULT(yes)
+                       AC_DEFINE(HAVE_OFED_IB_COMP_VECTOR, 1,
+                                 [has completion vector])
+               ],[
+                       AC_MSG_RESULT(no)
+               ])
 
                EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
        fi