Skip to content

Commit

Permalink
prov/cxi: Remove FI_CXI_COMPAT test changes
Browse files Browse the repository at this point in the history
Signed-off-by: James Swaro <[email protected]>
(cherry picked from commit 459edef)
  • Loading branch information
jswaro authored and j-xiong committed Mar 21, 2024
1 parent b96ffc1 commit 1cde918
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 87 deletions.
3 changes: 0 additions & 3 deletions prov/cxi/src/cxip_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,9 +1226,6 @@ int cxip_alloc_endpoint(struct cxip_domain *cxip_dom, struct fi_info *hints,

/* Save EP attributes from hints */
ep_obj->protocol = hints->ep_attr->protocol;
/* If user is still using CXI_COMPAT point to right protocol */
if (ep_obj->protocol == FI_PROTO_OPX)
ep_obj->protocol = FI_PROTO_CXI;
ep_obj->caps = hints->caps;
ep_obj->ep_attr = *hints->ep_attr;
ep_obj->txq_size = hints->tx_attr->size;
Expand Down
8 changes: 2 additions & 6 deletions prov/cxi/src/cxip_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -1699,16 +1699,12 @@ cxip_getinfo(uint32_t version, const char *node, const char *service,

while (fi_ptr) {
/* If hints protocol is not specified, default to use
* protocol FI_PROTO_CXI/FI_PROTO_CXI_COMPAT. This
* protocol FI_PROTO_CXI. This
* requires that FI_PROTO_CXI_RNR be explicitly
* requested if hints are passed to be used.
*/
if (!hints->ep_attr->protocol) {
/* TODO: Only FI_ADDR_CXI will be supported
* upstream.
*/
proto = fi_ptr->addr_format == FI_ADDR_CXI ?
FI_PROTO_CXI : FI_PROTO_OPX;
proto = FI_PROTO_CXI;
} else {
proto = hints->ep_attr->protocol;
}
Expand Down
6 changes: 0 additions & 6 deletions prov/cxi/test/auth_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,9 +1297,6 @@ Test(auth_key, max_ep_auth_key_null_hints)
int i = 0;
size_t expected_ep_auth_key;

ret = setenv("FI_CXI_COMPAT", "0", 1);
cr_assert(ret == 0);

ret = fi_getinfo(FI_VERSION(FI_MAJOR_VERSION, FI_MINOR_VERSION), "cxi0",
NULL, FI_SOURCE, NULL, &info);
cr_assert_eq(ret, FI_SUCCESS, "fi_getinfo failed: %d", ret);
Expand Down Expand Up @@ -1337,9 +1334,6 @@ Test(auth_key, zero_max_ep_auth_key_null_hint)
int i = 0;
size_t expected_ep_auth_key;

ret = setenv("FI_CXI_COMPAT", "0", 1);
cr_assert(ret == 0);

hints = fi_allocinfo();
cr_assert_not_null(hints, "fi_allocinfo failed");

Expand Down
82 changes: 10 additions & 72 deletions prov/cxi/test/fabric.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ Test(getinfo, invalid_fi_directed_recv_with_multiple_auth_keys_per_ep)
TestSuite(getinfo_infos, .timeout = CXIT_DEFAULT_TIMEOUT);

#define MAX_INFOS 24
#define FI_ADDR_CXI_COMPAT FI_ADDR_OPX

struct info_check {
int mr_mode;
Expand All @@ -397,8 +396,6 @@ Test(getinfo_infos, nohints)
struct fi_info *fi_ptr;
char *dom_name;
char *odp;
char *compat;
int compat_val;
struct info_check infos[MAX_INFOS];
size_t max_ep_auth_key;
uint32_t proto;
Expand All @@ -416,8 +413,6 @@ Test(getinfo_infos, nohints)
}

odp = getenv("FI_CXI_ODP");
compat = getenv("FI_CXI_COMPAT");
compat_val = !compat ? 1 : strtol(compat, NULL, 10);

/* By default when no hints are specified, each interface
* should can have 8 HPC fi_info and 8 CS fi_info.
Expand All @@ -433,18 +428,11 @@ Test(getinfo_infos, nohints)
* are used.
*/
if (i < 2)
proto = compat_val == 2 ? FI_PROTO_OPX : FI_PROTO_CXI;
proto = FI_PROTO_CXI;
else
proto = FI_PROTO_CXI_RNR;

format = FI_ADDR_CXI;
if (compat_val == 2) {
/* CS not valid with only old constants */
if (proto == FI_PROTO_CXI_RNR)
continue;
format = FI_ADDR_CXI_COMPAT;
}

infos[info_per_if].mr_mode = FI_MR_ENDPOINT | FI_MR_ALLOCATED |
FI_MR_PROV_KEY;
infos[info_per_if].format = format;
Expand Down Expand Up @@ -474,28 +462,6 @@ Test(getinfo_infos, nohints)
}
}

/* If we are supporting compatibility with old constants,
* then fi_info are repeated with compatibility constants.
*/
if (!compat || strtol(compat, NULL, 10) == 1) {
for (i = 0; i < info_per_if; i++) {
/* FI_PROTO_CXI_RNR does not require compat */
if (infos[i].protocol == FI_PROTO_CXI_RNR) {
info_per_if = info_per_if + i;
goto done;
}

infos[info_per_if + i].mr_mode =
infos[i].mr_mode;
infos[info_per_if + i].format =
FI_ADDR_CXI_COMPAT;
infos[info_per_if + i].max_ep_auth_key =
infos[i].max_ep_auth_key;
infos[info_per_if + 1].protocol = FI_PROTO_OPX;
}
info_per_if += i;
}
done:
cr_assert(info_per_if <= MAX_INFOS, "Too many infos");

fi_ptr = cxit_fi;
Expand Down Expand Up @@ -549,26 +515,13 @@ void getinfo_infos_hints(uint32_t proto)
int info_per_if = 0;
struct fi_info *fi_ptr;
char *dom_name;
char *compat;
int compat_val;
char *odp;
int odp_val;
struct info_check infos[3];

compat = getenv("FI_CXI_COMPAT");
compat_val = !compat ? 1 : strtol(compat, NULL, 10);
odp = getenv("FI_CXI_ODP");
odp_val = !odp ? 0 : strtol(odp, NULL, 10);

/* When only old compatibility constants are used,
* FI_PROTO_CXI or FI_PROTO_CXI_RNR are not valid.
*/
if (compat_val >= 2 &&
(proto == FI_PROTO_CXI_RNR || proto == FI_PROTO_CXI)) {
cr_assert(true);
return;
}

cr_assert(cxit_fi_hints == NULL, "hints not null");
cxit_setup_getinfo_proto(proto);
cr_assert(cxit_fi_hints != NULL, "hints still null");
Expand All @@ -586,30 +539,15 @@ void getinfo_infos_hints(uint32_t proto)
}

/* We have address format FI_ADDR_CXI */
if (compat_val < 2) {
infos[info_per_if].mr_mode = FI_MR_ENDPOINT;
if (!odp_val)
infos[info_per_if].mr_mode |= FI_MR_ALLOCATED;
if (cxit_prov_key)
infos[info_per_if].mr_mode |= FI_MR_PROV_KEY;

infos[info_per_if].format = FI_ADDR_CXI;
infos[info_per_if].protocol = proto;
info_per_if++;
}

/* Add compat if required */
if (compat_val != 0 && !proto) {
infos[info_per_if].mr_mode = FI_MR_ENDPOINT;
if (!odp_val)
infos[info_per_if].mr_mode |= FI_MR_ALLOCATED;
if (cxit_prov_key)
infos[info_per_if].mr_mode |= FI_MR_PROV_KEY;

infos[info_per_if].format = FI_ADDR_CXI_COMPAT;
infos[info_per_if].protocol = FI_PROTO_OPX;
info_per_if++;
}
infos[info_per_if].mr_mode = FI_MR_ENDPOINT;
if (!odp_val)
infos[info_per_if].mr_mode |= FI_MR_ALLOCATED;
if (cxit_prov_key)
infos[info_per_if].mr_mode |= FI_MR_PROV_KEY;

infos[info_per_if].format = FI_ADDR_CXI;
infos[info_per_if].protocol = proto;
info_per_if++;

fi_ptr = cxit_fi;

Expand Down

0 comments on commit 1cde918

Please sign in to comment.