Skip to content

Commit

Permalink
prov/verbs: Always return vrb_prov in VERBS_INI
Browse files Browse the repository at this point in the history
Previously NULL was returned if vrb_os_ini() failed. This mainly affected
Windows because the function would always succeed on Linux. On Windows,
the function would fail if the ND driver failed to initialize.

Returning NULL from VEBRS_INI prevents fi_getinfo() from working as
expecetd when the FI_PROV_ATTR_ONLY flags is used. This patch moves the
vrb_os_ini() check to vrb_init_info() which is invoked when fi_getinfo()
is called the first time.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
  • Loading branch information
j-xiong committed Feb 19, 2025
1 parent 75c559e commit 8bac96a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 7 additions & 0 deletions prov/verbs/src/verbs_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,13 @@ static int vrb_init_info(const struct fi_info **all_infos)
initialized = true;
*all_infos = NULL;

if (vrb_os_ini()) {
FI_WARN(&vrb_prov, FI_LOG_FABRIC,
"failed in OS specific device initialization\n");
ret = -FI_ENODATA;
goto done;
}

vrb_prof_func_start("vrb_os_mem_support");
vrb_os_mem_support(&vrb_gl_data.peer_mem_support,
&vrb_gl_data.dmabuf_support);
Expand Down
3 changes: 0 additions & 3 deletions prov/verbs/src/verbs_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,6 @@ VERBS_INI
#endif
ofi_mutex_init(&vrb_init_mutex);

if (vrb_os_ini())
return NULL;

vrb_prof_init();

return &vrb_prov;
Expand Down

0 comments on commit 8bac96a

Please sign in to comment.