Skip to content

Commit

Permalink
prov/verbs: Fix issue while displaying addresses with fi_info -a <add…
Browse files Browse the repository at this point in the history
…r_format>

This commit addresses issue ofiwg#9443 for verbs provider.
Address format matching needs to happen for each info
in the linked list which was not happening earlier.
This check has been moved to the end of vrb_getinfo().

Signed-off-by: Juee Himalbhai Desai <[email protected]>
  • Loading branch information
Juee14Desai committed Jul 22, 2024
1 parent d8e3834 commit 1fcd908
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions prov/verbs/src/verbs_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,24 @@ void vrb_alter_info(const struct fi_info *hints, struct fi_info *info)
}
}

static void vrb_filter_info_by_addr_format(struct fi_info **info, int addr_format)
{
struct fi_info *cur, *prev= NULL, *next = NULL;
for (cur = *info; cur; cur = next) {
next = cur->next;
if (!ofi_match_addr_format(cur->addr_format, addr_format)) {
if (prev)
prev->next = cur->next;
else
*info = cur->next;
cur->next = NULL;
fi_freeinfo(cur);
} else {
prev = cur;
}
}
}

int vrb_getinfo(uint32_t version, const char *node, const char *service,
uint64_t flags, const struct fi_info *hints,
struct fi_info **info)
Expand All @@ -1910,6 +1928,8 @@ int vrb_getinfo(uint32_t version, const char *node, const char *service,
ofi_alter_info(*info, hints, version);

vrb_alter_info(hints, *info);

vrb_filter_info_by_addr_format(info, hints->addr_format);
out:
vrb_prof_func_end(__func__);
if (!ret || ret == -FI_ENOMEM || ret == -FI_ENODEV)
Expand Down

0 comments on commit 1fcd908

Please sign in to comment.