Skip to content

Commit 8bac96a

Browse files
committed
prov/verbs: Always return vrb_prov in VERBS_INI
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 <[email protected]>
1 parent 75c559e commit 8bac96a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

prov/verbs/src/verbs_info.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,13 @@ static int vrb_init_info(const struct fi_info **all_infos)
13661366
initialized = true;
13671367
*all_infos = NULL;
13681368

1369+
if (vrb_os_ini()) {
1370+
FI_WARN(&vrb_prov, FI_LOG_FABRIC,
1371+
"failed in OS specific device initialization\n");
1372+
ret = -FI_ENODATA;
1373+
goto done;
1374+
}
1375+
13691376
vrb_prof_func_start("vrb_os_mem_support");
13701377
vrb_os_mem_support(&vrb_gl_data.peer_mem_support,
13711378
&vrb_gl_data.dmabuf_support);

prov/verbs/src/verbs_init.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,6 @@ VERBS_INI
807807
#endif
808808
ofi_mutex_init(&vrb_init_mutex);
809809

810-
if (vrb_os_ini())
811-
return NULL;
812-
813810
vrb_prof_init();
814811

815812
return &vrb_prov;

0 commit comments

Comments
 (0)