Skip to content

Commit

Permalink
Merge pull request #3688 from yosefe/topic/ibv-create-cq-ex-fallback-…
Browse files Browse the repository at this point in the history
…v1.5.x

UCT/IB: Fallback to ibv_create_cq() if ibv_create_cq_ex() returns ENOSYS - v1.5.x
  • Loading branch information
yosefe authored Jun 12, 2019
2 parents f4e3e2b + 7df80a0 commit 195f046
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Bugfixes:
- Fix segfault when libuct.so is reloaded - issue #3558
- Fix ucx_info crash when printing configuration alias
- Fix static checker errors
- Fallback to ibv_create_cq() if ibv_create_cq_ex() returns ENOSYS

## 1.5.1 (April 1, 2019)
Bugfixes:
Expand Down
15 changes: 10 additions & 5 deletions src/uct/ib/base/ib_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,9 +624,9 @@ struct ibv_cq *uct_ib_create_cq(struct ibv_context *context, int cqe,
struct ibv_comp_channel *channel,
int comp_vector, int ignore_overrun)
{
struct ibv_cq *cq;
#if HAVE_DECL_IBV_CREATE_CQ_ATTR_IGNORE_OVERRUN
struct ibv_cq_init_attr_ex cq_attr = {};
struct ibv_cq_ex *cq_ex;

cq_attr.cqe = cqe;
cq_attr.channel = channel;
Expand All @@ -636,11 +636,16 @@ struct ibv_cq *uct_ib_create_cq(struct ibv_context *context, int cqe,
cq_attr.flags = IBV_CREATE_CQ_ATTR_IGNORE_OVERRUN;
}

cq = ibv_cq_ex_to_cq(ibv_create_cq_ex(context, &cq_attr));
#else
cq = ibv_create_cq(context, cqe, NULL, channel, comp_vector);
cq_ex = ibv_create_cq_ex(context, &cq_attr);
if (cq_ex) {
return ibv_cq_ex_to_cq(cq_ex);
} else if (errno != ENOSYS) {
return NULL;
}

/* if ibv_create_cq_ex returned ENOSYS, fallback to ibv_create_cq */
#endif
return cq;
return ibv_create_cq(context, cqe, NULL, channel, comp_vector);
}

static ucs_status_t uct_ib_iface_create_cq(uct_ib_iface_t *iface, int cq_length,
Expand Down
2 changes: 1 addition & 1 deletion ucx.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ rm -f %{buildroot}%{_libdir}/*.la
%postun -p /sbin/ldconfig

%changelog
* Sat Jun 04 2019 Yossi Itigin <yosefe@mellanox.com> 1.5.2-1
* Tue Jun 04 2019 Yossi Itigin <yosefe@mellanox.com> 1.5.2-1
- Bump version to 1.5.2
- See NEWS for details
* Sat Mar 23 2019 Yossi Itigin <yosefe@mellanox.com> 1.5.1-1
Expand Down

0 comments on commit 195f046

Please sign in to comment.