From 8fdbd949ef464aa57b13743ab087ea72f035fbc3 Mon Sep 17 00:00:00 2001 From: Arlin Davis Date: Mon, 24 May 2010 16:28:05 -0700 Subject: [PATCH] config: add conditional check for new verbs port_attr.link_layer Check for link_layer type ETHERNET and set global for GID configuration on modify QP. Signed-off-by: Arlin Davis --- Makefile.am | 4 ++++ configure.in | 7 +++++++ dapl/openib_common/util.c | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/Makefile.am b/Makefile.am index bef95ec..0be6298 100755 --- a/Makefile.am +++ b/Makefile.am @@ -23,6 +23,10 @@ XFLAGS = XPROGRAMS = endif +if DEFINE_ATTR_LINK_LAYER +XFLAGS += -DDEFINE_ATTR_LINK_LAYER +endif + if DEBUG AM_CFLAGS = -g -Wall -D_GNU_SOURCE -DDAPL_DBG -DDAT_CONF="\"$(sysconfdir)/dat.conf\"" else diff --git a/configure.in b/configure.in index 0979cae..76339c1 100644 --- a/configure.in +++ b/configure.in @@ -32,6 +32,13 @@ AC_CHECK_HEADER(infiniband/verbs.h, [], AC_MSG_ERROR([ not found. Is libibverbs installed?])) fi +if test "$disable_libcheck" != "yes" +then +AC_CHECK_MEMBER(struct ibv_port_attr.link_layer, + AM_CONDITIONAL(DEFINE_ATTR_LINK_LAYER, test "yes" = "yes"), + [], [#include ]) +fi + AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script, if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then ac_cv_version_script=yes diff --git a/dapl/openib_common/util.c b/dapl/openib_common/util.c index dd1454e..b83f609 100644 --- a/dapl/openib_common/util.c +++ b/dapl/openib_common/util.c @@ -321,6 +321,16 @@ DAT_RETURN dapls_ib_query_hca(IN DAPL_HCA * hca_ptr, hca_ptr->ib_trans.named_attr.value = dapl_ib_mtu_str(hca_ptr->ib_trans.mtu); +#ifdef DEFINE_ATTR_LINK_LAYER +#ifndef _OPENIB_CMA_ + if (port_attr.link_layer == IBV_LINK_LAYER_ETHERNET) + hca_ptr->ib_trans.global = 1; + + dapl_log(DAPL_DBG_TYPE_UTIL, + " query_hca: port.link_layer = 0x%x\n", + port_attr.link_layer); +#endif +#endif dapl_log(DAPL_DBG_TYPE_UTIL, " query_hca: (%x.%x) eps %d, sz %d evds %d," " sz %d mtu %d\n", -- 2.46.0