nvme-tcp: check sgl supported by target
Subsystems (2)
PATCH 1/2 nvme-tcp: check sgl supported by target
SGLs support is mandatory for NVMe/tcp, make sure that the target is aligned to the specification.
--- drivers/nvme/host/tcp.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/nvme/host/tcp.c +5 -0
@@ -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",
Signature · 7 lines
2.25.4 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 2/2 nvme-fc: check sgl supported by target
SGLs support is mandatory for NVMe/tcp, make sure that the target is aligned to the specification.
--- drivers/nvme/host/fc.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/nvme/host/fc.c +5 -0
@@ -3100,6 +3100,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 */
Signature · 7 lines
2.25.4 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Re: [PATCH 2/2] nvme-fc: check sgl supported by target
Quoted 4 lines · Max Gurtovoy
SGLs support is mandatory for NVMe/tcp, make sure that the target is aligned to the specification.
Signed-off-by Max Gurtovoy <[email protected]>
s/"NVMe/tcp"/"NVMe-FC"/ ? if so that can be done by at the time of applying the patch, if not just ignore this comment.
Looks good.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Re: [PATCH 2/2] nvme-fc: check sgl supported by target
Quoted 7 lines · Chaitanya Kulkarni
Quoted 4 lines · Max Gurtovoy
SGLs support is mandatory for NVMe/tcp, make sure that the target is aligned to the specification.
Signed-off-by Max Gurtovoy <[email protected]>s/"NVMe/tcp"/"NVMe-FC"/ ? if so that can be done by at the time of applying the patch, if not just ignore this comment.
Good catch. Yes, this should be updated.
Thanks.
Quoted 6 lines
Looks good.
Reviewed-by Chaitanya Kulkarni <[email protected]>
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 4 lines · Max Gurtovoy
SGLs support is mandatory for NVMe/tcp, make sure that the target is aligned to the specification.
Signed-off-by Max Gurtovoy <[email protected]>
Looks good.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keith Busch
maintainerQuoted 2 lines · Max Gurtovoy
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 12 lines
Signed-off-by Max Gurtovoy <[email protected]>--- drivers/nvme/host/tcp.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/nvme/host/tcp.c +0
-0@@ -1973,6 +1973,11 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new) goto destroy_admin;
drivers/nvme/host/tcp.c static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new) · line 1983
Quoted 10 lines
drivers/nvme/host/tcp.c +5
-0} +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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 8 lines · Keith Busch
Quoted 2 lines · Max Gurtovoy
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?
At least I've not seen any, in case they do exists should we consider adding a quirk if at all any of those controller's start showing up ?
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 4 lines · Chaitanya Kulkarni
Quoted 3 lines · Keith Busch
Quoted 2 lines · Max Gurtovoy
SGLs support is mandatory for NVMe/tcp, make sure that the target is aligned to the specification.
Quoted 8 lines
Quoted 5 lines
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?
At least I've not seen any, in case they do exists should we consider adding a quirk if at all any of those controller's start showing up ?
I also haven't seen controllers with broken ID-CTRL, and adding a quirk in the future is better than ignoring the error and hope for good behavior from the controller.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Thanks,
applied both patches to nvme-5.13.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme