Skip to content

Commit

Permalink
UCT/IB: Fallback to ibv_create_cq() if ibv_create_cq_ex() returns ENOSYS
Browse files Browse the repository at this point in the history
  • Loading branch information
yosefe committed Jun 11, 2019
1 parent 451d3b8 commit fb814ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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
16 changes: 11 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,17 @@ 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;
} else
/* if ibv_create_cq_ex returns 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

0 comments on commit fb814ea

Please sign in to comment.