iscsi: Move poll_group init to the end of iSCSI subsystem init
iSCSI poll_group initialization must be completed before starting JSON-RPC. This doesn't have any dependency to the other iSCSI subsystem initialization and completes asynchronously. Hence thisis good to be placed at the end of iSCSI subsystem initialization. Besides, object creation of iSCSI configurable components started after poll_group initialization by .INI config file is aggregated into a function spdk_iscsi_parse_iscsi_configuration(). Naming rule was adopted from NVMf-tgt. The purpose of the patch series is - to separate iSCSI subsystem initialization and iSCSI subsystem configuration, and - to develop a new JSON-RPC by reusing the separated iSCSI subsystem initialization. Change-Id: I44421803268361f53840a7e47f07ce95c13d1139 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/403145 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
43062f2245
commit
a11b2f3058
@ -860,12 +860,6 @@ spdk_iscsi_poll_group_handle_nop(void *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
iscsi_create_poll_group_done(void *ctx)
|
||||
{
|
||||
spdk_iscsi_init_complete(0);
|
||||
}
|
||||
|
||||
static void
|
||||
iscsi_create_poll_group(void *ctx)
|
||||
{
|
||||
@ -915,6 +909,32 @@ spdk_initialize_iscsi_poll_group(spdk_thread_fn cpl)
|
||||
spdk_for_each_thread(iscsi_create_poll_group, NULL, cpl);
|
||||
}
|
||||
|
||||
static void
|
||||
spdk_iscsi_parse_iscsi_configuration(void *ctx)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = spdk_iscsi_portal_grp_array_create();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_portal_grp_array_create() failed\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
rc = spdk_iscsi_init_grp_array_create();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_init_grp_array_create() failed\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
rc = spdk_iscsi_init_tgt_nodes();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_init_tgt_nodes() failed\n");
|
||||
}
|
||||
|
||||
end:
|
||||
spdk_iscsi_init_complete(rc);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_iscsi_init(spdk_iscsi_init_cb cb_fn, void *cb_arg)
|
||||
{
|
||||
@ -938,28 +958,7 @@ spdk_iscsi_init(spdk_iscsi_init_cb cb_fn, void *cb_arg)
|
||||
return;
|
||||
}
|
||||
|
||||
rc = spdk_iscsi_portal_grp_array_create();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_portal_grp_array_create() failed\n");
|
||||
spdk_iscsi_init_complete(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
rc = spdk_iscsi_init_grp_array_create();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_init_grp_array_create() failed\n");
|
||||
spdk_iscsi_init_complete(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
rc = spdk_iscsi_init_tgt_nodes();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_init_tgt_nodes() failed\n");
|
||||
spdk_iscsi_init_complete(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
spdk_initialize_iscsi_poll_group(iscsi_create_poll_group_done);
|
||||
spdk_initialize_iscsi_poll_group(spdk_iscsi_parse_iscsi_configuration);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user