Whamcloud - gitweb
LU-6215 o2iblnd: ib_alloc_fast_reg_mr() removed in 4.3
[fs/lustre-release.git] / lnet / autoconf / lustre-lnet.m4
index 4398253..0e86a56 100644 (file)
@@ -206,7 +206,7 @@ AS_IF([test $ENABLEO2IB = "no"], [
                        AC_MSG_RESULT([yes])
                        compatrdma_found=true
                        AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
-                       EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -include ${O2IBPATH}/include/linux/compat-2.6.h"
+                       EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
                        if test -f "$O2IBPATH/include/linux/compat_autoconf.h"; then
                                COMPAT_AUTOCONF="$O2IBPATH/include/linux/compat_autoconf.h"
                        fi
@@ -234,19 +234,6 @@ AS_IF([test $ENABLEO2IB = "no"], [
                        fi
                fi
 
-               LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
-               linux_kthread_worker, [
-                       #include <linux/kthread.h>
-               ],[
-                       struct kthread_work     *kth_wrk __attribute__ ((unused));
-                       flush_kthread_work(kth_wrk);
-               ],[
-                       AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
-                       if test -z "$COMPAT_AUTOCONF"; then
-                               EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
-                       fi
-               ])
-
                AC_MSG_CHECKING([whether to use any OFED backport headers])
                if test -n "$BACKPORT_INCLUDES"; then
                        AC_MSG_RESULT([yes])
@@ -262,6 +249,12 @@ AS_IF([test $ENABLEO2IB = "no"], [
                LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
                openib_gen2_support, [
                        #ifdef HAVE_COMPAT_RDMA
+                       #undef PACKAGE_NAME
+                       #undef PACKAGE_TARNAME
+                       #undef PACKAGE_VERSION
+                       #undef PACKAGE_STRING
+                       #undef PACKAGE_BUGREPORT
+                       #undef PACKAGE_URL
                        #include <linux/compat-2.6.h>
                        #endif
                        #include <linux/version.h>
@@ -306,11 +299,34 @@ AS_IF([test $ENABLEO2IB = "no"], [
                                AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
                        fi
                fi
+
+               LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
+               linux_kthread_worker, [
+                       #ifdef HAVE_COMPAT_RDMA
+                       #undef PACKAGE_NAME
+                       #undef PACKAGE_TARNAME
+                       #undef PACKAGE_VERSION
+                       #undef PACKAGE_STRING
+                       #undef PACKAGE_BUGREPORT
+                       #undef PACKAGE_URL
+                       #include <linux/compat-2.6.h>
+                       #endif
+                       #include <linux/kthread.h>
+               ],[
+                       struct kthread_work     *kth_wrk __attribute__ ((unused));
+                       flush_kthread_work(kth_wrk);
+               ],[
+                       AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
+                       if test -z "$COMPAT_AUTOCONF"; then
+                               EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
+                       fi
+               ])
        fi
 ])
+AC_SUBST(EXTRA_OFED_CONFIG)
 AC_SUBST(EXTRA_OFED_INCLUDE)
 AC_SUBST(O2IBLND)
-AC_SUBST(O2IBPATHS)
+AC_SUBST(O2IBPATH)
 AC_SUBST(ENABLEO2IB)
 
 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
@@ -318,6 +334,12 @@ AS_IF([test $ENABLEO2IB != "no"], [
        LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
        rdma_create_id_4args, [
                #ifdef HAVE_COMPAT_RDMA
+               #undef PACKAGE_NAME
+               #undef PACKAGE_TARNAME
+               #undef PACKAGE_VERSION
+               #undef PACKAGE_STRING
+               #undef PACKAGE_BUGREPORT
+               #undef PACKAGE_URL
                #include <linux/compat-2.6.h>
                #endif
                #include <rdma/rdma_cm.h>
@@ -339,6 +361,12 @@ AS_IF([test $ENABLEO2IB != "no"], [
        LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
        ib_cq_init_attr, [
                #ifdef HAVE_COMPAT_RDMA
+               #undef PACKAGE_NAME
+               #undef PACKAGE_TARNAME
+               #undef PACKAGE_VERSION
+               #undef PACKAGE_STRING
+               #undef PACKAGE_BUGREPORT
+               #undef PACKAGE_URL
                #include <linux/compat-2.6.h>
                #endif
                #include <rdma/ib_verbs.h>
@@ -351,6 +379,28 @@ AS_IF([test $ENABLEO2IB != "no"], [
                        [struct ib_cq_init_attr is used by ib_create_cq])
        ])
 ])
+
+# 4.3 removed ib_alloc_fast_reg_mr()
+AS_IF([test $ENABLEO2IB != "no"], [
+       LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
+       ib_alloc_fast_reg_mr, [
+               #ifdef HAVE_COMPAT_RDMA
+               #undef PACKAGE_NAME
+               #undef PACKAGE_TARNAME
+               #undef PACKAGE_VERSION
+               #undef PACKAGE_STRING
+               #undef PACKAGE_BUGREPORT
+               #undef PACKAGE_URL
+               #include <linux/compat-2.6.h>
+               #endif
+               #include <rdma/ib_verbs.h>
+       ],[
+               ib_alloc_fast_reg_mr(NULL, 0);
+       ],[
+               AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
+                       [ib_alloc_fast_reg_mr is defined])
+       ])
+])
 ]) # LN_CONFIG_O2IB
 
 #
@@ -422,6 +472,12 @@ AC_DEFUN([LN_CONFIG_SK_SLEEP], [
 LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
 sk_sleep, [
        #ifdef HAVE_COMPAT_RDMA
+       #undef PACKAGE_NAME
+       #undef PACKAGE_TARNAME
+       #undef PACKAGE_VERSION
+       #undef PACKAGE_STRING
+       #undef PACKAGE_BUGREPORT
+       #undef PACKAGE_URL
        #include <linux/compat-2.6.h>
        #endif
        #include <net/sock.h>
@@ -443,6 +499,15 @@ tmp_flags="$EXTRA_KCFLAGS"
 EXTRA_KCFLAGS="-Werror"
 LB_CHECK_COMPILE([if 'tcp_sendpage' first parameter is socket],
 tcp_sendpage_socket, [
+       #ifdef HAVE_COMPAT_RDMA
+       #undef PACKAGE_NAME
+       #undef PACKAGE_TARNAME
+       #undef PACKAGE_VERSION
+       #undef PACKAGE_STRING
+       #undef PACKAGE_BUGREPORT
+       #undef PACKAGE_URL
+       #include <linux/compat-2.6.h>
+       #endif
        #include <linux/net.h>
        #include <net/tcp.h>
 ],[
@@ -464,6 +529,15 @@ tmp_flags="$EXTRA_KCFLAGS"
 EXTRA_KCFLAGS="-Werror"
 LB_CHECK_COMPILE([if 'sk_data_ready' takes only one argument],
 sk_data_ready, [
+       #ifdef HAVE_COMPAT_RDMA
+       #undef PACKAGE_NAME
+       #undef PACKAGE_TARNAME
+       #undef PACKAGE_VERSION
+       #undef PACKAGE_STRING
+       #undef PACKAGE_BUGREPORT
+       #undef PACKAGE_URL
+       #include <linux/compat-2.6.h>
+       #endif
        #include <linux/net.h>
        #include <net/sock.h>
 ],[
@@ -476,6 +550,33 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LN_CONFIG_SK_DATA_READY
 
 #
+# LN_CONFIG_IB_INC_RKEY
+#
+AC_DEFUN([LN_CONFIG_IB_INC_RKEY], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if function 'ib_inc_rkey' is defined],
+ib_inc_rkey, [
+       #ifdef HAVE_COMPAT_RDMA
+       #undef PACKAGE_NAME
+       #undef PACKAGE_TARNAME
+       #undef PACKAGE_VERSION
+       #undef PACKAGE_STRING
+       #undef PACKAGE_BUGREPORT
+       #undef PACKAGE_URL
+       #include <linux/compat-2.6.h>
+       #endif
+       #include <rdma/ib_verbs.h>
+],[
+       (void)ib_inc_rkey(0);
+],[
+       AC_DEFINE(HAVE_IB_INC_RKEY, 1,
+                 [function ib_inc_rkey exist])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LN_CONFIG_IB_INC_RKEY
+
+#
 # LN_PROG_LINUX
 #
 # LNet linux kernel checks
@@ -488,6 +589,7 @@ LN_CONFIG_AFFINITY
 LN_CONFIG_BACKOFF
 LN_CONFIG_O2IB
 LN_CONFIG_GNILND
+LN_CONFIG_IB_INC_RKEY
 # 2.6.35
 LN_CONFIG_SK_SLEEP
 # 2.6.36