aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/tcp.c
diff options
context:
space:
mode:
authorMax Gurtovoy <mgurtovoy@nvidia.com>2021-03-30 23:01:19 +0000
committerChristoph Hellwig <hch@lst.de>2021-04-02 18:48:28 +0200
commit73ffcefcfca047e5c13a3f81d2cf22eff18732c1 (patch)
treecaac7ac28686a50ac7341a6620123d36c24eadaf /drivers/nvme/host/tcp.c
parentnvmet-tcp: enable optional queue idle period tracking (diff)
downloadlinux-dev-73ffcefcfca047e5c13a3f81d2cf22eff18732c1.tar.xz
linux-dev-73ffcefcfca047e5c13a3f81d2cf22eff18732c1.zip
nvme-tcp: check sgl supported by target
SGLs support is mandatory for NVMe/tcp, make sure that the target is aligned to the specification. Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/tcp.c')
-rw-r--r--drivers/nvme/host/tcp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index b9e8ea3a7501..8e55d8bc0c50 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1966,6 +1966,11 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new)
goto destroy_admin;
}
+ if (!(ctrl->sgls & ((1 << 0) | (1 << 1)))) {
+ dev_err(ctrl->device, "Mandatory sgls are not supported!\n");
+ goto destroy_admin;
+ }
+
if (opts->queue_size > ctrl->sqsize + 1)
dev_warn(ctrl->device,
"queue_size %zu > ctrl sqsize %u, clamping down\n",