aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Gurtovoy <[email protected]>2021-03-30 23:01:19 +0000
committerChristoph Hellwig <[email protected]>2021-04-02 18:48:28 +0200
commit73ffcefcfca047e5c13a3f81d2cf22eff18732c1 (patch)
treecaac7ac28686a50ac7341a6620123d36c24eadaf
parentd8e7b462f5b8b93920c6c6a191be887b32306e6b (diff)
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 <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
-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",