Skip to content

Commit 195f046

Browse files
authored
Merge pull request #3688 from yosefe/topic/ibv-create-cq-ex-fallback-v1.5.x
UCT/IB: Fallback to ibv_create_cq() if ibv_create_cq_ex() returns ENOSYS - v1.5.x
2 parents f4e3e2b + 7df80a0 commit 195f046

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Bugfixes:
1515
- Fix segfault when libuct.so is reloaded - issue #3558
1616
- Fix ucx_info crash when printing configuration alias
1717
- Fix static checker errors
18+
- Fallback to ibv_create_cq() if ibv_create_cq_ex() returns ENOSYS
1819

1920
## 1.5.1 (April 1, 2019)
2021
Bugfixes:

src/uct/ib/base/ib_iface.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,9 @@ struct ibv_cq *uct_ib_create_cq(struct ibv_context *context, int cqe,
624624
struct ibv_comp_channel *channel,
625625
int comp_vector, int ignore_overrun)
626626
{
627-
struct ibv_cq *cq;
628627
#if HAVE_DECL_IBV_CREATE_CQ_ATTR_IGNORE_OVERRUN
629628
struct ibv_cq_init_attr_ex cq_attr = {};
629+
struct ibv_cq_ex *cq_ex;
630630

631631
cq_attr.cqe = cqe;
632632
cq_attr.channel = channel;
@@ -636,11 +636,16 @@ struct ibv_cq *uct_ib_create_cq(struct ibv_context *context, int cqe,
636636
cq_attr.flags = IBV_CREATE_CQ_ATTR_IGNORE_OVERRUN;
637637
}
638638

639-
cq = ibv_cq_ex_to_cq(ibv_create_cq_ex(context, &cq_attr));
640-
#else
641-
cq = ibv_create_cq(context, cqe, NULL, channel, comp_vector);
639+
cq_ex = ibv_create_cq_ex(context, &cq_attr);
640+
if (cq_ex) {
641+
return ibv_cq_ex_to_cq(cq_ex);
642+
} else if (errno != ENOSYS) {
643+
return NULL;
644+
}
645+
646+
/* if ibv_create_cq_ex returned ENOSYS, fallback to ibv_create_cq */
642647
#endif
643-
return cq;
648+
return ibv_create_cq(context, cqe, NULL, channel, comp_vector);
644649
}
645650

646651
static ucs_status_t uct_ib_iface_create_cq(uct_ib_iface_t *iface, int cq_length,

ucx.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ rm -f %{buildroot}%{_libdir}/*.la
8282
%postun -p /sbin/ldconfig
8383

8484
%changelog
85-
* Sat Jun 04 2019 Yossi Itigin <yosefe@mellanox.com> 1.5.2-1
85+
* Tue Jun 04 2019 Yossi Itigin <yosefe@mellanox.com> 1.5.2-1
8686
- Bump version to 1.5.2
8787
- See NEWS for details
8888
* Sat Mar 23 2019 Yossi Itigin <yosefe@mellanox.com> 1.5.1-1

0 commit comments

Comments
 (0)