Whamcloud - gitweb
LU-6215 o2iblnd: rdma_create_id() takes extra parameter 59/18759/6
authorLi Dongyang <dongyang.li@anu.edu.au>
Sat, 2 Apr 2016 00:26:46 +0000 (20:26 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 28 Apr 2016 04:23:18 +0000 (04:23 +0000)
4.4 kernel added network namespace parameter to rdma_create_id().
This patch handles the API change.

Linux-commit: fa20105e09e97e81aadf02f722c31195e4a75c84

Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
Change-Id: I3f3792e70e91ac3b3d9fefdd58cc9e7e4d1c25c6
Reviewed-on: http://review.whamcloud.com/18759
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/autoconf/lustre-lnet.m4
lnet/klnds/o2iblnd/o2iblnd.h

index 0e86a56..253d590 100644 (file)
@@ -401,6 +401,28 @@ AS_IF([test $ENABLEO2IB != "no"], [
                        [ib_alloc_fast_reg_mr is defined])
        ])
 ])
                        [ib_alloc_fast_reg_mr is defined])
        ])
 ])
+
+# 4.4 added network namespace parameter for rdma_create_id()
+AS_IF([test $ENABLEO2IB != "no"], [
+       LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
+       rdma_create_id_5args, [
+               #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>
+       ],[
+               rdma_create_id(NULL, NULL, NULL, 0, 0);
+       ],[
+               AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
+                       [rdma_create_id wants 5 args])
+       ])
+])
 ]) # LN_CONFIG_O2IB
 
 #
 ]) # LN_CONFIG_O2IB
 
 #
index 56195b3..3a8d5f6 100644 (file)
@@ -125,10 +125,17 @@ extern kib_tunables_t  kiblnd_tunables;
                                        IBLND_CREDIT_HIGHWATER_V1 : \
                                        t->lnd_peercredits_hiw)
 
                                        IBLND_CREDIT_HIGHWATER_V1 : \
                                        t->lnd_peercredits_hiw)
 
-#ifdef HAVE_RDMA_CREATE_ID_4ARG
-#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps, qpt)
+#ifdef HAVE_RDMA_CREATE_ID_5ARG
+# define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(current->nsproxy->net_ns, \
+                                                               cb, dev, \
+                                                               ps, qpt)
 #else
 #else
-#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps)
+# ifdef HAVE_RDMA_CREATE_ID_4ARG
+#  define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, \
+                                                                ps, qpt)
+# else
+#  define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps)
+# endif
 #endif
 
 /* 2 OOB shall suffice for 1 keepalive and 1 returning credits */
 #endif
 
 /* 2 OOB shall suffice for 1 keepalive and 1 returning credits */