Skip to content

Commit 8082f63

Browse files
committed
usnic: remove some legacy libfabric 1.0/1.1 code
We only support running with libfabric v1.3 or greater. So it's safe to remove the legacy/adaptive cq_readerr() behavior. Signed-off-by: Jeff Squyres <[email protected]> (cherry picked from commit 8b77359)
1 parent 712ccaa commit 8082f63

File tree

2 files changed

+6
-48
lines changed

2 files changed

+6
-48
lines changed

opal/mca/btl/usnic/btl_usnic.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,6 @@ typedef struct opal_btl_usnic_component_t {
217217
the prefix is non-NULL) */
218218
char *connectivity_map_prefix;
219219

220-
/** Expected return value from fi_cq_readerr() upon success. In
221-
libfabric v1.0.0 / API v1.0, the usnic provider returned
222-
sizeof(fi_cq_err_entry) upon success. In libfabric >=v1.1 /
223-
API >=v1.1, the usnic provider returned 1 upon success. */
224-
ssize_t cq_readerr_success_value;
225-
ssize_t cq_readerr_try_again_value;
226-
227220
/** Offset into the send buffer where the payload will go. For
228221
libfabric v1.0.0 / API v1.0, this is 0. For libfabric >=v1.1
229222
/ API >=v1.1, this is the endpoint.msg_prefix_size (i.e.,

opal/mca/btl/usnic/btl_usnic_component.c

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules,
622622
/* There are multiple dimensions to consider when requesting an
623623
API version number from libfabric:
624624
625-
1. This code understands libfabric API versions v1.0 through
625+
1. This code understands libfabric API versions v1.3 through
626626
v1.4.
627627
628628
2. Open MPI may be *compiled* against one version of libfabric,
@@ -670,18 +670,7 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules,
670670
NOTE: The configure.m4 in this component will require libfabric
671671
>= v1.1.0 (i.e., it won't accept v1.0.0) because it needs
672672
access to the usNIC extension header structures that only
673-
became available in v1.1.0.
674-
675-
All that being said, the compatibility code with libfabric
676-
v1.0.0 in the usNIC BTL has been retained, for two reasons:
677-
678-
1. It's not harmful, nor overly complicated. So the
679-
compatibility code was not ripped out.
680-
2. At least some versions of Cisco Open MPI are shipping with
681-
an embedded (libfabric v1.0.0+critical bug fix).
682-
683-
Someday, #2 may no longer be true, and we may therefore rip out
684-
the libfabric v1.0.0 compatibility code. */
673+
became available in v1.1.0.*/
685674

686675
/* First, check to see if the libfabric we are running with is <=
687676
libfabric v1.3. If so, don't bother going further. */
@@ -747,29 +736,6 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules,
747736
opal_output_verbose(5, USNIC_OUT,
748737
"btl:usnic: usNIC fabrics found");
749738

750-
/* Due to ambiguities in documentation, in libfabric v1.0.0 (i.e.,
751-
API v1.0) the usnic provider returned sizeof(struct
752-
fi_cq_err_entry) from fi_cq_readerr() upon success.
753-
754-
The ambiguities were clarified in libfabric v1.1.0 (i.e., API
755-
v1.1); the usnic provider returned 1 from fi_cq_readerr() upon
756-
success.
757-
758-
So query to see what version of the libfabric API we are
759-
running with, and adapt accordingly. */
760-
libfabric_api = fi_version();
761-
if (1 == FI_MAJOR(libfabric_api) &&
762-
0 == FI_MINOR(libfabric_api)) {
763-
// Old fi_cq_readerr() behavior: success=sizeof(...), try again=0
764-
mca_btl_usnic_component.cq_readerr_success_value =
765-
sizeof(struct fi_cq_err_entry);
766-
mca_btl_usnic_component.cq_readerr_try_again_value = 0;
767-
} else {
768-
// New fi_cq_readerr() behavior: success=1, try again=-FI_EAGAIN
769-
mca_btl_usnic_component.cq_readerr_success_value = 1;
770-
mca_btl_usnic_component.cq_readerr_try_again_value = -FI_EAGAIN;
771-
}
772-
773739
opal_proc_t *me = opal_proc_local_get();
774740
opal_process_name_t *name = &(me->proc_name);
775741
mca_btl_usnic_component.my_hashed_rte_name =
@@ -1261,12 +1227,11 @@ usnic_handle_cq_error(opal_btl_usnic_module_t* module,
12611227
}
12621228

12631229
rc = fi_cq_readerr(channel->cq, &err_entry, 0);
1264-
if (rc == mca_btl_usnic_component.cq_readerr_try_again_value) {
1230+
if (rc == -FI_EAGAIN) {
12651231
return;
1266-
} else if (rc != mca_btl_usnic_component.cq_readerr_success_value) {
1267-
BTL_ERROR(("%s: cq_readerr ret = %d (expected %d)",
1268-
module->linux_device_name, rc,
1269-
(int) mca_btl_usnic_component.cq_readerr_success_value));
1232+
} else if (rc != 1) {
1233+
BTL_ERROR(("%s: cq_readerr ret = %d (expected 1)",
1234+
module->linux_device_name, rc));
12701235
channel->chan_error = true;
12711236
}
12721237

0 commit comments

Comments
 (0)