Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 64e5642

Browse files
committed
Merge pull request #450 from jsquyres/pr/v2.x-usnic-updates2
Pr/v2.x usnic updates2
2 parents e00eb11 + 0365de0 commit 64e5642

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

opal/mca/btl/usnic/btl_usnic_module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,7 @@ static int init_one_channel(opal_btl_usnic_module_t *module,
16091609
channel->fastsend_wqe_thresh = sd_num - 10;
16101610

16111611
channel->credits = sd_num;
1612+
channel->rx_post_cnt = 0;
16121613

16131614
/* We did math up in component_init() to know that there should be
16141615
enough CQs available. So if create_cq() fails, then either the

opal/mca/btl/usnic/btl_usnic_module.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ typedef struct opal_btl_usnic_channel_t {
6969
int chan_sd_num;
7070

7171
int credits; /* RFXXX until libfab credits fixed */
72+
uint32_t rx_post_cnt;
7273

7374
/* fastsend enabled if num_credits_available >= fastsend_wqe_thresh */
7475
unsigned fastsend_wqe_thresh;

opal/mca/btl/usnic/btl_usnic_recv.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,27 @@ void opal_btl_usnic_recv_call(opal_btl_usnic_module_t *module,
2323
static inline int
2424
opal_btl_usnic_post_recv_list(opal_btl_usnic_channel_t *channel)
2525
{
26+
struct iovec iov;
27+
struct fi_msg msg;
28+
uint64_t flag;
2629
opal_btl_usnic_recv_segment_t *rseg;
2730
int rc;
2831

32+
msg.msg_iov = &iov;
33+
msg.iov_count = 1;
2934
for (rseg = channel->repost_recv_head; NULL != rseg; rseg = rseg->rs_next) {
30-
rc = fi_recv(channel->ep, rseg->rs_protocol_header,
31-
rseg->rs_len, NULL, FI_ADDR_UNSPEC, rseg);
35+
msg.context = rseg;
36+
iov.iov_base = rseg->rs_protocol_header;
37+
iov.iov_len = rseg->rs_len;
38+
39+
++channel->rx_post_cnt;
40+
if (OPAL_UNLIKELY((channel->rx_post_cnt & 15) == 0)) {
41+
flag = 0;
42+
} else {
43+
flag = FI_MORE;
44+
}
45+
46+
rc = fi_recvmsg(channel->ep, &msg, flag);
3247
if (0 != rc) {
3348
return rc;
3449
}

opal/mca/btl/usnic/configure.m4

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ AC_DEFUN([MCA_opal_btl_usnic_CONFIG],[
4747
])
4848

4949
AC_DEFUN([_OPAL_BTL_USNIC_DO_CONFIG],[
50-
OPAL_VAR_SCOPE_PUSH([unit_tests opal_btl_usnic_CPPFLAGS_save])
50+
OPAL_VAR_SCOPE_PUSH([unit_tests])
5151

5252
# see README.test for information about this scheme
5353
AC_ARG_ENABLE([opal-btl-usnic-unit-tests],
@@ -99,6 +99,26 @@ AC_DEFUN([_OPAL_BTL_USNIC_DO_CONFIG],[
9999
[opal_btl_usnic_happy=yes],
100100
[opal_btl_usnic_happy=no])
101101

102+
# The usnic BTL requires at least libfabric v1.1 (there was a
103+
# critical bug in libfabric v1.0).
104+
AS_IF([test "$opal_btl_usnic_happy" = "yes"],
105+
[AC_MSG_CHECKING([whether libfabric is >= v1.1])
106+
opal_btl_usnic_CPPFLAGS_save=$CPPFLAGS
107+
CPPFLAGS="$opal_common_libfabric_CPPFLAGS $CPPFLAGS"
108+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <rdma/fabric.h>]],
109+
[[
110+
#if !defined(FI_MAJOR_VERSION)
111+
#error your version of libfabric is too old
112+
#elif FI_VERSION(FI_MAJOR_VERSION, FI_MINOR_VERSION) < FI_VERSION(1, 1)
113+
#error your version of libfabric is too old
114+
#endif
115+
]])],
116+
[opal_btl_usnic_happy=yes],
117+
[opal_btl_usnic_happy=no])
118+
AC_MSG_RESULT([$opal_btl_usnic_happy])
119+
CPPFLAGS=$opal_btl_usnic_CPPFLAGS_save
120+
])
121+
102122
# Make sure we can find the libfabric usnic extensions header
103123
AS_IF([test "$opal_btl_usnic_happy" = "yes" ],
104124
[opal_btl_usnic_CPPFLAGS_save=$CPPFLAGS

0 commit comments

Comments
 (0)