nvmf: In spdk_nvmf_request_exec, reverse order of subsystem and qpair
checks Check if the subsystem is paused before checking whether the qpair is active. The order of these checks doesn't really matter, but in the next patch it will be more convenient to check the subsystem first. Signed-off-by: Ben Walker <benjamin.walker@intel.com> Change-Id: Ibc95e2578e9a95296f5fbc6023af3b542e954781 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5015 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
c642e8e2ee
commit
b10e305010
@ -3430,6 +3430,15 @@ spdk_nvmf_request_exec(struct spdk_nvmf_request *req)
|
||||
sgroup = nvmf_subsystem_pg_from_connect_cmd(req);
|
||||
}
|
||||
|
||||
/* Check if the subsystem is paused (if there is a subsystem) */
|
||||
if (sgroup != NULL) {
|
||||
if (sgroup->state != SPDK_NVMF_SUBSYSTEM_ACTIVE) {
|
||||
/* The subsystem is not currently active. Queue this request. */
|
||||
TAILQ_INSERT_TAIL(&sgroup->queued, req, link);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (qpair->state != SPDK_NVMF_QPAIR_ACTIVE) {
|
||||
req->rsp->nvme_cpl.status.sct = SPDK_NVME_SCT_GENERIC;
|
||||
req->rsp->nvme_cpl.status.sc = SPDK_NVME_SC_COMMAND_SEQUENCE_ERROR;
|
||||
@ -3443,15 +3452,6 @@ spdk_nvmf_request_exec(struct spdk_nvmf_request *req)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check if the subsystem is paused (if there is a subsystem) */
|
||||
if (sgroup != NULL) {
|
||||
if (sgroup->state != SPDK_NVMF_SUBSYSTEM_ACTIVE) {
|
||||
/* The subsystem is not currently active. Queue this request. */
|
||||
TAILQ_INSERT_TAIL(&sgroup->queued, req, link);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (SPDK_DEBUGLOG_FLAG_ENABLED("nvmf")) {
|
||||
spdk_nvme_print_command(qpair->qid, &req->cmd->nvme_cmd);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user