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

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478320 (master)

(cherry picked from commit 71159819b0)
Change-Id: I72ab7fe33c03e60ea9f20a9c8afd7c79c40843aa
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478586
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Alexey Marchuk 2019-12-18 16:02:49 +03:00 committed by Tomasz Zawadzki
parent 0a5c002bb0
commit 16282e8fc3

View File

@ -2074,7 +2074,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);