Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bffd2b61 authored by Max Gurtovoy's avatar Max Gurtovoy Committed by Keith Busch
Browse files

nvmet: fix PSDT field check in command format



PSDT field section according to NVM_Express-1.3:
"This field specifies whether PRPs or SGLs are used for any data
transfer associated with the command. PRPs shall be used for all
Admin commands for NVMe over PCIe. SGLs shall be used for all Admin
and I/O commands for NVMe over Fabrics. This field shall be set to
01b for NVMe over Fabrics 1.0 implementations.

Suggested-by: default avatarIdan Burstein <idanb@mellanox.com>
Signed-off-by: default avatarMax Gurtovoy <maxg@mellanox.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
parent 9bd82b1a
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -520,9 +520,12 @@ bool nvmet_req_init(struct nvmet_req *req, struct nvmet_cq *cq,
		goto fail;
		goto fail;
	}
	}


	/* either variant of SGLs is fine, as we don't support metadata */
	/*
	if (unlikely((flags & NVME_CMD_SGL_ALL) != NVME_CMD_SGL_METABUF &&
	 * For fabrics, PSDT field shall describe metadata pointer (MPTR) that
		     (flags & NVME_CMD_SGL_ALL) != NVME_CMD_SGL_METASEG)) {
	 * contains an address of a single contiguous physical buffer that is
	 * byte aligned.
	 */
	if (unlikely((flags & NVME_CMD_SGL_ALL) != NVME_CMD_SGL_METABUF)) {
		status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
		status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
		goto fail;
		goto fail;
	}
	}