summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Gurtovoy <mgurtovoy@nvidia.com>2024-01-23 17:40:26 +0300
committerKeith Busch <kbusch@kernel.org>2024-03-03 02:18:08 +0300
commit143667ee9a9cb88b6da7fe6a3d0f32bc33d75d71 (patch)
tree7758a6afd3d6c285c2e84c27b15129dc3aef1f20
parent25802f3ab7a589d2b5d9e1266acffad263d9893e (diff)
downloadlinux-143667ee9a9cb88b6da7fe6a3d0f32bc33d75d71.tar.xz
nvmet: compare mqes and sqsize only for IO SQ
According to the NVMe Spec: " MQES: This field indicates the maximum individual queue size that the controller supports. For NVMe over PCIe implementations, this value applies to the I/O Submission Queues and I/O Completion Queues that the host creates. For NVMe over Fabrics implementations, this value applies to only the I/O Submission Queues that the host creates. " Align the target code to compare mqes and sqsize as mentioned in the NVMe Spec. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
-rw-r--r--drivers/nvme/target/fabrics-cmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c
index d8da840a1c0e..4d014c5d0b6a 100644
--- a/drivers/nvme/target/fabrics-cmd.c
+++ b/drivers/nvme/target/fabrics-cmd.c
@@ -157,7 +157,8 @@ static u16 nvmet_install_queue(struct nvmet_ctrl *ctrl, struct nvmet_req *req)
return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR;
}
- if (sqsize > mqes) {
+ /* for fabrics, this value applies to only the I/O Submission Queues */
+ if (qid && sqsize > mqes) {
pr_warn("sqsize %u is larger than MQES supported %u cntlid %d\n",
sqsize, mqes, ctrl->cntlid);
req->error_loc = offsetof(struct nvmf_connect_command, sqsize);