Commit 8280d5f2 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

nvme: don't queue fabrics CONNECT command



This allows for submitting IO requests before the CONNECT command is
sent and not stopping the connect process due to the CONNECT being
queued.  It could happen once IO qpair connection is asynchronous.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I04e45b1c2f49f9da3412c843ea899341c56a0420
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8624


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent 17f99bbb
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -985,14 +985,19 @@ nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *re

	if (spdk_unlikely(!STAILQ_EMPTY(&qpair->queued_req) && req->num_children == 0)) {
		/*
		 * requests that have no children should be sent to the transport after all
		 * Requests that have no children should be sent to the transport after all
		 * currently queued requests. Requests with chilren will be split and go back
		 * through this path.
		 * through this path.  We need to make an exception for the fabrics commands
		 * while the qpair is connecting to be able to send the connect command
		 * asynchronously.
		 */
		if (req->cmd.opc != SPDK_NVME_OPC_FABRIC ||
		    nvme_qpair_get_state(qpair) != NVME_QPAIR_CONNECTING) {
			STAILQ_INSERT_TAIL(&qpair->queued_req, req, stailq);
			req->queued = true;
			return 0;
		}
	}

	rc = _nvme_qpair_submit_request(qpair, req);
	if (rc == -EAGAIN) {