nvmf: poll the NVMe subsystem once under more sessions case

Change-Id: Ie13a787eb0ff3b6b95fb6796871ac0b747b992ad
Signed-off-by: GangCao <gang.cao@intel.com>
This commit is contained in:
GangCao 2017-02-04 12:33:30 +08:00 committed by Daniel Verkamp
parent b3d229e02a
commit 200217a47e
4 changed files with 10 additions and 10 deletions

View File

@ -105,7 +105,7 @@ struct spdk_nvmf_ctrlr_ops {
/** /**
* Poll for completions. * Poll for completions.
*/ */
void (*poll_for_completions)(struct spdk_nvmf_session *session); void (*poll_for_completions)(struct spdk_nvmf_subsystem *subsystem);
/** /**
* Detach the controller. * Detach the controller.

View File

@ -51,10 +51,10 @@ nvmf_direct_ctrlr_get_data(struct spdk_nvmf_session *session)
} }
static void static void
nvmf_direct_ctrlr_poll_for_completions(struct spdk_nvmf_session *session) nvmf_direct_ctrlr_poll_for_completions(struct spdk_nvmf_subsystem *subsystem)
{ {
spdk_nvme_ctrlr_process_admin_completions(session->subsys->dev.direct.ctrlr); spdk_nvme_ctrlr_process_admin_completions(subsystem->dev.direct.ctrlr);
spdk_nvme_qpair_process_completions(session->subsys->dev.direct.io_qpair, 0); spdk_nvme_qpair_process_completions(subsystem->dev.direct.io_qpair, 0);
} }
static void static void

View File

@ -132,12 +132,12 @@ spdk_nvmf_subsystem_poll(struct spdk_nvmf_subsystem *subsystem)
{ {
struct spdk_nvmf_session *session; struct spdk_nvmf_session *session;
TAILQ_FOREACH(session, &subsystem->sessions, link) { /* For NVMe subsystems, check the backing physical device for completions. */
/* For NVMe subsystems, check the backing physical device for completions. */ if (subsystem->subtype == SPDK_NVMF_SUBTYPE_NVME) {
if (subsystem->subtype == SPDK_NVMF_SUBTYPE_NVME) { subsystem->ops->poll_for_completions(subsystem);
session->subsys->ops->poll_for_completions(session); }
}
TAILQ_FOREACH(session, &subsystem->sessions, link) {
/* For each connection in the session, check for completions */ /* For each connection in the session, check for completions */
spdk_nvmf_session_poll(session); spdk_nvmf_session_poll(session);
} }

View File

@ -112,7 +112,7 @@ nvmf_virtual_ctrlr_get_data(struct spdk_nvmf_session *session)
} }
static void static void
nvmf_virtual_ctrlr_poll_for_completions(struct spdk_nvmf_session *session) nvmf_virtual_ctrlr_poll_for_completions(struct spdk_nvmf_subsystem *subsystem)
{ {
return; return;
} }