From a65af6d0793719101fde29d2bb87a2480babbd65 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Mon, 2 May 2016 17:13:33 -0600 Subject: [PATCH] btl/openib: fix check for exp verbs struct members This commit fixes a compilation issue with some versions of exp verbs. In some cases struct ibv_exp_device_attr does not have either the exp_atom or exp_atomic_cap fields. It is fine to drop one check and fall back to the non-exp attribute check on the other. Signed-off-by: Nathan Hjelm --- config/opal_check_openfabrics.m4 | 2 ++ opal/mca/btl/openib/btl_openib_component.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/opal_check_openfabrics.m4 b/config/opal_check_openfabrics.m4 index 5719df5ac6..fbadab8a1d 100644 --- a/config/opal_check_openfabrics.m4 +++ b/config/opal_check_openfabrics.m4 @@ -412,6 +412,8 @@ AC_DEFUN([OPAL_CHECK_EXP_VERBS],[ AC_DEFINE_UNQUOTED([HAVE_EXP_VERBS], [$have_struct_ibv_exp_send_wr], [Experimental verbs]) AC_CHECK_DECLS([IBV_EXP_ATOMIC_HCA_REPLY_BE, IBV_EXP_QP_CREATE_ATOMIC_BE_REPLY, ibv_exp_create_qp, ibv_exp_query_device, IBV_EXP_QP_INIT_ATTR_ATOMICS_ARG], [], [], [#include ]) + AC_CHECK_MEMBERS([struct ibv_exp_device_attr.ext_atom, struct ibv_exp_device_attr.ext_atomic_cap], [], [], + [[#include ]]) AS_IF([test '$have_struct_ibv_exp_send_wr' = 1], [$1], [$2]) OPAL_VAR_SCOPE_POP ])dnl diff --git a/opal/mca/btl/openib/btl_openib_component.c b/opal/mca/btl/openib/btl_openib_component.c index d056e17ae5..829a77dbff 100644 --- a/opal/mca/btl/openib/btl_openib_component.c +++ b/opal/mca/btl/openib/btl_openib_component.c @@ -781,7 +781,7 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_device_t *device, #if HAVE_DECL_IBV_ATOMIC_HCA openib_btl->atomic_ops_be = false; -#if HAVE_DECL_IBV_EXP_QUERY_DEVICE +#if HAVE_STRUCT_IBV_EXP_DEVICE_ATTR_EXT_ATOM /* check that 8-byte atomics are supported */ if (!(device->ib_exp_dev_attr.ext_atom.log_atomic_arg_sizes & (1<<3ull))) { openib_btl->super.btl_flags &= ~MCA_BTL_FLAGS_ATOMIC_FOPS; @@ -791,7 +791,7 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_device_t *device, } #endif -#if HAVE_DECL_IBV_EXP_QUERY_DEVICE +#if HAVE_STRUCT_IBV_EXP_DEVICE_ATTR_EXT_ATOMIC_CAP switch (openib_btl->device->ib_exp_dev_attr.exp_atomic_cap) #else switch (openib_btl->device->ib_dev_attr.atomic_cap)