Skip to content

Commit 143667e

Browse files
mgurtovoykeithbusch
authored andcommitted
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>
1 parent 25802f3 commit 143667e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/nvme/target/fabrics-cmd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ static u16 nvmet_install_queue(struct nvmet_ctrl *ctrl, struct nvmet_req *req)
157157
return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR;
158158
}
159159

160-
if (sqsize > mqes) {
160+
/* for fabrics, this value applies to only the I/O Submission Queues */
161+
if (qid && sqsize > mqes) {
161162
pr_warn("sqsize %u is larger than MQES supported %u cntlid %d\n",
162163
sqsize, mqes, ctrl->cntlid);
163164
req->error_loc = offsetof(struct nvmf_connect_command, sqsize);

0 commit comments

Comments
 (0)