Skip to content
Open
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
11 changes: 10 additions & 1 deletion fabtests/common/shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,8 +1564,17 @@ int ft_av_insert(struct fid_av *av, void *addr, size_t count, fi_addr_t *fi_addr
uint64_t flags, void *context)
{
int ret;
void *addr_ptr;

ret = fi_av_insert(av, addr, count, fi_addr, flags, context);
/*
* When using the FI_ADDR_STR format, the addr parameter should reference
* an array of strings (char **).
* Ensure we try to insert only one addrress in such format
*/
assert((fi->addr_format == FI_ADDR_STR && count == 1) ||
fi->addr_format != FI_ADDR_STR);
addr_ptr = (fi->addr_format == FI_ADDR_STR) ? &addr : addr;
ret = fi_av_insert(av, addr_ptr, count, fi_addr, flags, context);
if (ret < 0) {
FT_PRINTERR("fi_av_insert", ret);
return ret;
Expand Down
1 change: 1 addition & 0 deletions fabtests/test_configs/shm/shm.exclude
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ inject_test
-e msg
^fi_dgram
-e dgram
^fi_rdm g00n13s

# Exclude tests that use sread/polling
rdm_cntr_pingpong
Expand Down
7 changes: 6 additions & 1 deletion prov/efa/src/efa_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ int efa_conn_rdm_insert_shm_av(struct efa_av *av, struct efa_conn *conn)
int err, ret;
char smr_name[EFA_SHM_NAME_MAX];
size_t smr_name_len;
void *addr_ptr;


assert(av->domain->info_type == EFA_INFO_RDM);
Expand Down Expand Up @@ -365,7 +366,11 @@ int efa_conn_rdm_insert_shm_av(struct efa_av *av, struct efa_conn *conn)
* through shm ep.
*/
conn->shm_fi_addr = conn->fi_addr;
ret = fi_av_insert(av->shm_rdm_av, smr_name, 1, &conn->shm_fi_addr, FI_AV_USER_ID, NULL);
/*
* shm provider uses FI_ADDR_STR address format wich must be passed as (char**)
*/
addr_ptr = &smr_name;
ret = fi_av_insert(av->shm_rdm_av, addr_ptr, 1, &conn->shm_fi_addr, FI_AV_USER_ID, NULL);
if (OFI_UNLIKELY(ret != 1)) {
EFA_WARN(FI_LOG_AV,
"Failed to insert address to shm provider's av: %s\n",
Expand Down
7 changes: 4 additions & 3 deletions prov/shm/src/smr_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,18 @@ static int smr_av_insert(struct fid_av *av_fid, const void *addr, size_t count,
int64_t shm_id = -1;
int i, ret;
int succ_count = 0;
const char **string_names = (void *)addr;

util_av = container_of(av_fid, struct util_av, av_fid);
smr_av = container_of(util_av, struct smr_av, util_av);

for (i = 0; i < count; i++, addr = (char *) addr + strlen(addr) + 1) {
FI_INFO(&smr_prov, FI_LOG_AV, "%s\n", (const char *) addr);
for (i = 0; i < count; i++) {
FI_INFO(&smr_prov, FI_LOG_AV, "%s\n", (const char *) string_names[i]);

util_addr = FI_ADDR_NOTAVAIL;
if (smr_av->used < SMR_MAX_PEERS) {
ret = smr_map_add(&smr_prov, &smr_av->smr_map,
addr, &shm_id);
string_names[i], &shm_id);
if (!ret) {
ofi_genlock_lock(&util_av->lock);
ret = ofi_av_insert_addr(util_av, &shm_id,
Expand Down
29 changes: 18 additions & 11 deletions util/pingpong.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,21 +1565,19 @@ static int pp_init_ep(struct ct_pingpong *ct)
return 0;
}

static int pp_av_insert(struct fid_av *av, void *addr, size_t count,
fi_addr_t *fi_addr, uint64_t flags, void *context)
static int pp_av_insert(struct fid_av *av, void *addr, fi_addr_t *fi_addr,
uint64_t flags, void *context)
{
int ret;

PP_DEBUG("Connection-less endpoint: inserting new address in vector\n");

ret = fi_av_insert(av, addr, count, fi_addr, flags, context);
ret = fi_av_insert(av, addr, 1, fi_addr, flags, context);
if (ret < 0) {
PP_PRINTERR("fi_av_insert", ret);
return ret;
} else if (ret != count) {
PP_ERR("fi_av_insert: number of addresses inserted = %d;"
" number of addresses given = %zd\n",
ret, count);
} else if (ret != 1) {
PP_ERR("fi_av_insert: cannot insert address");
return -EXIT_FAILURE;
}

Expand Down Expand Up @@ -1777,6 +1775,7 @@ static int pp_client_connect(struct ct_pingpong *ct)
static int pp_init_fabric(struct ct_pingpong *ct)
{
int ret;
void *addrs;

ret = pp_ctrl_init(ct);
if (ret)
Expand Down Expand Up @@ -1841,21 +1840,29 @@ static int pp_init_fabric(struct ct_pingpong *ct)

if (ct->opts.dst_addr) {
/* Set */
ret = pp_av_insert(ct->av, ct->rem_name, 1, &(ct->remote_fi_addr), 0,
addrs = ct->hints->addr_format == FI_ADDR_STR ?
&ct->rem_name : ct->rem_name;
ret = pp_av_insert(ct->av, addrs, &(ct->remote_fi_addr), 0,
NULL);
if (ret)
return ret;
addrs = ct->hints->addr_format == FI_ADDR_STR ?
&ct->local_name : ct->local_name;
if (ct->fi->domain_attr->caps & FI_LOCAL_COMM)
ret = pp_av_insert(ct->av, ct->local_name, 1,
ret = pp_av_insert(ct->av, addrs,
&(ct->local_fi_addr), 0, NULL);
} else {
if (ct->fi->domain_attr->caps & FI_LOCAL_COMM) {
ret = pp_av_insert(ct->av, ct->local_name, 1,
addrs = ct->hints->addr_format == FI_ADDR_STR ?
&ct->local_name : ct->local_name;
ret = pp_av_insert(ct->av, addrs,
&(ct->local_fi_addr), 0, NULL);
if (ret)
return ret;
}
ret = pp_av_insert(ct->av, ct->rem_name, 1, &(ct->remote_fi_addr), 0,
addrs = ct->hints->addr_format == FI_ADDR_STR ?
&ct->rem_name : ct->rem_name;
ret = pp_av_insert(ct->av, addrs, &(ct->remote_fi_addr), 0,
NULL);
}
if (ret)
Expand Down