OSDN Git Service

nvme-tcp: check sgl supported by target
authorMax Gurtovoy <mgurtovoy@nvidia.com>
Tue, 30 Mar 2021 23:01:19 +0000 (23:01 +0000)
committerChristoph Hellwig <hch@lst.de>
Fri, 2 Apr 2021 16:48:28 +0000 (18:48 +0200)
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>
drivers/nvme/host/tcp.c

index b9e8ea3..8e55d8b 100644 (file)
@@ -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",