nvmf_tgt: Create pollers for poll groups on same core

Create the poller for a given poll group from the core
we intend to use it from.

Change-Id: I8bfb970f31f86b8b29f7fe89d82178b3f27da50b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387680
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Ben Walker 2017-11-14 13:47:12 -07:00
parent 95bbc6bf29
commit 8cd7252f04
2 changed files with 8 additions and 9 deletions

View File

@ -266,7 +266,7 @@ nvmf_tgt_create_poll_group_done(void *arg1, void *arg2)
if (pg->group == NULL) {
g_tgt.state = NVMF_TGT_ERROR;
} else {
g_tgt.state = NVMF_TGT_INIT_START_POLLER;
g_tgt.state = NVMF_TGT_INIT_CREATE_POLL_GROUP_DONE;
}
nvmf_tgt_advance_state(NULL, NULL);
@ -286,6 +286,11 @@ nvmf_tgt_create_poll_group(void *arg1, void *arg2)
SPDK_ERRLOG("Failed to create poll group for core %u\n", g_tgt.core);
}
spdk_poller_register(&pg->poller,
nvmf_tgt_poll_group_poll, pg,
spdk_env_get_current_core(), 0);
g_active_poll_groups++;
spdk_event_call(event);
}
@ -347,13 +352,7 @@ nvmf_tgt_advance_state(void *arg1, void *arg2)
spdk_event_call(event);
break;
}
case NVMF_TGT_INIT_START_POLLER: {
struct nvmf_tgt_poll_group *pg = &g_poll_groups[g_tgt.core];
spdk_poller_register(&pg->poller,
nvmf_tgt_poll_group_poll, pg,
g_tgt.core, 0);
g_active_poll_groups++;
case NVMF_TGT_INIT_CREATE_POLL_GROUP_DONE: {
g_tgt.core = spdk_env_get_next_core(g_tgt.core);
if (g_tgt.core != UINT32_MAX) {
g_tgt.state = NVMF_TGT_INIT_CREATE_POLL_GROUP;

View File

@ -65,7 +65,7 @@ enum nvmf_tgt_state {
NVMF_TGT_INIT_NONE = 0,
NVMF_TGT_INIT_PARSE_CONFIG,
NVMF_TGT_INIT_CREATE_POLL_GROUP,
NVMF_TGT_INIT_START_POLLER,
NVMF_TGT_INIT_CREATE_POLL_GROUP_DONE,
NVMF_TGT_INIT_START_ACCEPTOR,
NVMF_TGT_RUNNING,
NVMF_TGT_FINI_STOP_ACCEPTOR,