From 73ffcefcfca047e5c13a3f81d2cf22eff18732c1 Mon Sep 17 00:00:00 2001 From: Max Gurtovoy Date: Tue, 30 Mar 2021 23:01:19 +0000 Subject: [PATCH] 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 Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig --- drivers/nvme/host/tcp.c | 5 +++++ 1 file changed, 5 insertions(+) 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", -- 2.11.0