From e7cf1b761d2e268b2ae79a70885789912d58005f Mon Sep 17 00:00:00 2001 From: Yossi Itigin Date: Tue, 11 Jun 2019 12:40:24 +0000 Subject: [PATCH] UCT/IB: Fallback to ibv_create_cq() if ibv_create_cq_ex() returns ENOSYS --- NEWS | 1 + src/uct/ib/base/ib_iface.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index e7e2a58e13f..90dc718e159 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,7 @@ Bugfixes: - Fixing the wrong name of aliases - Fix data race in UCP wireup - Fix segfault when libuct.so is reloaded - issue #3558 +- Fallback to ibv_create_cq() if ibv_create_cq_ex() returns ENOSYS Tested configurations: - RDMA: MLNX_OFED 4.5, distribution inbox drivers, rdma-core 22.1 diff --git a/src/uct/ib/base/ib_iface.c b/src/uct/ib/base/ib_iface.c index 1be435a06a6..707197636b2 100644 --- a/src/uct/ib/base/ib_iface.c +++ b/src/uct/ib/base/ib_iface.c @@ -588,16 +588,19 @@ ucs_status_t uct_ib_verbs_create_cq(struct ibv_context *context, int cqe, } cq = ibv_cq_ex_to_cq(ibv_create_cq_ex(context, &cq_attr)); -#else - cq = ibv_create_cq(context, cqe, NULL, channel, comp_vector); + if (!cq && (errno == ENOSYS)) #endif + { + *inl = 0; + cq = ibv_create_cq(context, cqe, NULL, channel, comp_vector); + } + if (!cq) { ucs_error("ibv_create_cq(cqe=%d) failed: %m", cqe); return UCS_ERR_IO_ERROR; } *cq_p = cq; - *inl = 0; return UCS_OK; }