Commit 71159819 authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

nvme/pcie: Don't use contig SGL commands for admin qpair



Command with cns SPDK_NVME_IDENTIFY_ACTIVE_NS_LIST is issued during
controller initialization and if the controller supports SGL,
this command will be built as a contig SGL. This leads
to a failed completion with the following status:
INVALID FIELD (00/02) sqid:0 cid:95 cdw0:0 sqhd:0004 p:1 m:0 dnr:0
The first identify command SPDK_NVME_IDENTIFY_CTRLR passed since
it was built as a PRP command - we didn't know that the controller
supported SGL at that time. Fix - do not build SGL requests
for admin qpair

Change-Id: I72ab7fe33c03e60ea9f20a9c8afd7c79c40843aa
Signed-off-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478320


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 0e3dbd9a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2065,7 +2065,10 @@ nvme_pcie_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_reques
		/* Null payload - leave PRP fields untouched */
		rc = 0;
	} else if (nvme_payload_type(&req->payload) == NVME_PAYLOAD_TYPE_CONTIG) {
		if (ctrlr->flags & SPDK_NVME_CTRLR_SGL_SUPPORTED) {
		/* Some NVME drives can't handle SGL request submitted to the admin qpair
		 * even if they report SGL support */
		if ((ctrlr->flags & SPDK_NVME_CTRLR_SGL_SUPPORTED) != 0 &&
		    !nvme_qpair_is_admin_queue(qpair)) {
			rc = nvme_pcie_qpair_build_contig_hw_sgl_request(qpair, req, tr);
		} else {
			rc = nvme_pcie_qpair_build_contig_request(qpair, req, tr);