aboutsummaryrefslogtreecommitdiff
path: root/drivers/nvme/host
diff options
context:
space:
mode:
authorGravatar Guixin Liu <kanie@linux.alibaba.com> 2024-02-28 10:37:59 +0800
committerGravatar Keith Busch <kbusch@kernel.org> 2024-03-02 15:18:09 -0800
commit4999568184e5d68903e6d0e49609979cd6ef01d7 (patch)
treef766280b4dd506606cc60a0b65eca8285eb78443 /drivers/nvme/host
parentnvmet-rdma: set max_queue_size for RDMA transport (diff)
downloadlinux-4999568184e5d68903e6d0e49609979cd6ef01d7.tar.gz
linux-4999568184e5d68903e6d0e49609979cd6ef01d7.tar.bz2
linux-4999568184e5d68903e6d0e49609979cd6ef01d7.zip
nvme-fabrics: check max outstanding commands
Maxcmd is mandatory for fabrics, check it early to identify the root cause instead of waiting for it to propagate to "sqsize" and "allocing queue". By the way, change nvme_check_ctrl_fabric_info() to nvmf_validate_identify_ctrl(). Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers/nvme/host')
-rw-r--r--drivers/nvme/host/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index eed3e22e24d9..cb13f7c79eaf 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3119,6 +3119,11 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct
return -EINVAL;
}
+ if (!ctrl->maxcmd) {
+ dev_err(ctrl->device, "Maximum outstanding commands is 0\n");
+ return -EINVAL;
+ }
+
return 0;
}