From d7223c0ccda11f120e50cd0195d84583d6ee4a29 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Wed, 9 Sep 2015 11:28:52 -0400 Subject: [PATCH] LU-6215 ofed: strengthen ib_create_cq test in 4.2+ kernels 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 Reviewed-on: http://review.whamcloud.com/16342 Tested-by: Jenkins Reviewed-by: Alexander Boyko Reviewed-by: frank zago Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Oleg Drokin --- lnet/autoconf/lustre-lnet.m4 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 40595d7..4398253 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -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"], [ - 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 @@ -341,10 +345,10 @@ AS_IF([test $ENABLEO2IB != "no"], [ ],[ 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, - [struct ib_cq_init_attr exist]) + [struct ib_cq_init_attr is used by ib_create_cq]) ]) ]) ]) # LN_CONFIG_O2IB -- 1.8.3.1