Thread (9 messages) 9 messages, 4 authors, 2021-04-02

Re: [PATCH 1/2] nvme-tcp: check sgl supported by target

From: Keith Busch <kbusch@kernel.org>
Date: 2021-03-31 00:30:30

On Tue, Mar 30, 2021 at 11:01:19PM +0000, Max Gurtovoy wrote:
SGLs support is mandatory for NVMe/tcp, make sure that the target is
aligned to the specification.
Logging an error seems fine. Are there existing controllers that do
this? If so, what currently happens? If they just have a broken Identify
Controller structure but still work with this driver, should we proceed
with trying to use it anyway with the existing assumption?
 
quoted hunk ↗ jump to hunk
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 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 a0f00cb8f9f3..e5fbb921165e 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1973,6 +1973,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",
-- 
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help