Whamcloud - gitweb
LU-6215 ofed: strengthen ib_create_cq test in 4.2+ kernels 42/16342/3
authorJames Simmons <uja.ornl@yahoo.com>
Wed, 9 Sep 2015 15:28:52 +0000 (11:28 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 15 Sep 2015 16:59:06 +0000 (16:59 +0000)
External infinband stacks tend to keep their kernel
headers in sync with the latest kernels but this is
not the case with the driver code itself. Since this
is the case we can not trust testing for API changes
using OFED headers but need to be test driver code
API changes. Update the autoconf test to see if
ib_create_cq() uses struct ib_cq_init_attr.

Change-Id: I9875b6787723589b9cbdb55ef088b146b6900b2a
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/16342
Tested-by: Jenkins
Reviewed-by: Alexander Boyko <alexander.boyko@seagate.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/autoconf/lustre-lnet.m4

index 40595d7..4398253 100644 (file)
@@ -329,10 +329,14 @@ AS_IF([test $ENABLEO2IB != "no"], [
        ])
 ])
 #
        ])
 ])
 #
-# 4.2 introduced struct ib_cq_init_attr
+# 4.2 introduced struct ib_cq_init_attr which is used
+# by ib_create_cq(). Note some OFED stacks only keep
+# their headers in sync with latest kernels but not
+# the functionality which means for infiniband testing
+# we need to always test functionality testings.
 #
 AS_IF([test $ENABLEO2IB != "no"], [
 #
 AS_IF([test $ENABLEO2IB != "no"], [
-       LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' exist],
+       LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
        ib_cq_init_attr, [
                #ifdef HAVE_COMPAT_RDMA
                #include <linux/compat-2.6.h>
        ib_cq_init_attr, [
                #ifdef HAVE_COMPAT_RDMA
                #include <linux/compat-2.6.h>
@@ -341,10 +345,10 @@ AS_IF([test $ENABLEO2IB != "no"], [
        ],[
                struct ib_cq_init_attr cq_attr;
 
        ],[
                struct ib_cq_init_attr cq_attr;
 
-               cq_attr.comp_vector = NULL;
+               ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
        ],[
                AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
        ],[
                AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
-                       [struct ib_cq_init_attr exist])
+                       [struct ib_cq_init_attr is used by ib_create_cq])
        ])
 ])
 ]) # LN_CONFIG_O2IB
        ])
 ])
 ]) # LN_CONFIG_O2IB