Commit b10e3050 authored by Ben Walker's avatar Ben Walker Committed by Tomasz Zawadzki
Browse files

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: default avatarBen Walker <benjamin.walker@intel.com>
Change-Id: Ibc95e2578e9a95296f5fbc6023af3b542e954781
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5015


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent c642e8e2
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -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);
	}