]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nvme-fc: check sgl supported by target
authorMax Gurtovoy <mgurtovoy@nvidia.com>
Tue, 30 Mar 2021 23:01:20 +0000 (23:01 +0000)
committerChristoph Hellwig <hch@lst.de>
Fri, 2 Apr 2021 16:48:29 +0000 (18:48 +0200)
SGLs support is mandatory for NVMe/FC, 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/fc.c

index f54ffb792acc9b68ad17de5ef4a4393a3b17f4d3..921b3315c2f1e0fe18de19ee99ae73a646c00cb4 100644 (file)
@@ -3099,6 +3099,11 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
        }
 
        /* FC-NVME supports normal SGL Data Block Descriptors */
+       if (!(ctrl->ctrl.sgls & ((1 << 0) | (1 << 1)))) {
+               dev_err(ctrl->ctrl.device,
+                       "Mandatory sgls are not supported!\n");
+               goto out_disconnect_admin_queue;
+       }
 
        if (opts->queue_size > ctrl->ctrl.maxcmd) {
                /* warn if maxcmd is lower than queue_size */