Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UCT/IB: Fallback to ibv_create_cq() if ibv_create_cq_ex() returns ENOSYS - v1.5.x #3688

Merged
merged 3 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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