nvme-fabrics: don't check ioccsz/iorcsz for discovery
PATCH 1/1 nvme-fabrics: don't check ioccsz/iorcsz for discovery
IOCCSZ and IORCSZ are reserved for discovery controllers. Avoid checking their values during identify controller phase.
--- drivers/nvme/host/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +2 -2
@@ -3068,14 +3068,14 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ctreturn -EINVAL ; } -if (ctrl->ioccsz <4 ) { +if (!nvme_discovery_ctrl (ctrl) && ctrl->ioccsz <4 ) {dev_err (ctrl->device,"I/O queue command capsule supported size %d < 4\n" , ctrl->ioccsz);return -EINVAL ; } -if (ctrl->iorcsz <1 ) { +if (!nvme_discovery_ctrl (ctrl) && ctrl->iorcsz <1 ) {dev_err (ctrl->device,"I/O queue response capsule supported size %d < 1\n" , ctrl->iorcsz);
Signature · 1 line
2.18.1
Sagi Grimberg
maintainerQuoted 23 lines
IOCCSZ and IORCSZ are reserved for discovery controllers. Avoid checking their values during identify controller phase.
Fixes 2fcd3ab39826 ("nvme-fabrics: check ioccsz and iorcsz")Reported-by Daniel Wagner <[email protected]>Tested-by Daniel Wagner <[email protected]>Signed-off-by Max Gurtovoy <[email protected]>--- drivers/nvme/host/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/nvme/host/core.c +1
-1@@ -3068,14 +3068,14 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ctreturn -EINVAL ; } -if (ctrl->ioccsz <4 ) { +if (!nvme_discovery_ctrl (ctrl) && ctrl->ioccsz <4 ) { dev_err(ctrl->device,
drivers/nvme/host/core.c static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct · line 3081
Quoted 10 lines
drivers/nvme/host/core.c +1
-1"I/O queue command capsule supported size %d < 4\n" , ctrl->ioccsz);return -EINVAL ; } -if (ctrl->iorcsz <1 ) { +if (!nvme_discovery_ctrl (ctrl) && ctrl->iorcsz <1 ) {dev_err (ctrl->device,"I/O queue response capsule supported size %d < 1\n" , ctrl->iorcsz);
I still think we should at least warn (and ignore) for discovery controllers.
Why? As Max points out, the base NVMe spec says those fields are reserved for discovery controllers.
Quoted 38 lines · Sagi Grimberg
Quoted 24 lines
IOCCSZ and IORCSZ are reserved for discovery controllers. Avoid checking their values during identify controller phase.
Fixes 2fcd3ab39826 ("nvme-fabrics: check ioccsz and iorcsz")Reported-by Daniel Wagner <[email protected]>Tested-by Daniel Wagner <[email protected]>Signed-off-by Max Gurtovoy <[email protected]>--- drivers/nvme/host/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/nvme/host/core.c +1
-1@@ -3068,14 +3068,14 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ctreturn -EINVAL ; } -if (ctrl->ioccsz <4 ) { +if (!nvme_discovery_ctrl (ctrl) && ctrl->ioccsz <4 ) { dev_err(ctrl->device,drivers/nvme/host/core.c static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct · line 3081
Quoted 10 lines
drivers/nvme/host/core.c +1
-1"I/O queue command capsule supported size %d < 4\n" , ctrl->ioccsz);return -EINVAL ; } -if (ctrl->iorcsz <1 ) { +if (!nvme_discovery_ctrl (ctrl) && ctrl->iorcsz <1 ) {dev_err (ctrl->device,"I/O queue response capsule supported size %d < 1\n" , ctrl->iorcsz);I still think we should at least warn (and ignore) for discovery controllers.
Sagi Grimberg
maintainerQuoted 3 lines
Why? As Max points out, the base NVMe spec says those fields are reserved for discovery controllers.
Oh, didn't understand that it was already the case, I thought that the intention was to made it as such. Can you point us to this part in the spec?
Quoted 8 lines · Sagi Grimberg
Quoted 4 lines
Why? As Max points out, the base NVMe spec says those fields are reserved for discovery controllers.
Oh, didn't understand that it was already the case, I thought that the intention was to made it as such. Can you point us to this part in the spec?
https://nvmexpress.org/wp-content/uploads/NVM-Express-Base-Specification-2.0c-2022.10.04-Ratified.pdf
Figure 275: Identify – Identify Controller Data Structure, I/O Command Set Independent
Both fields IOCCSZ and IORCSZ have "R" in the "Disc" column, indicating that they are reserved for discovery controllers.
Keith Busch
maintainerQuoted 10 lines · Caleb Sander
Quoted 8 lines · Sagi Grimberg
Quoted 4 lines
Why? As Max points out, the base NVMe spec says those fields are reserved for discovery controllers.
Oh, didn't understand that it was already the case, I thought that the intention was to made it as such. Can you point us to this part in the spec?
Quoted 5 lines
https://nvmexpress.org/wp-content/uploads/NVM-Express-Base-Specification-2.0c-2022.10.04-Ratified.pdf
Figure 275: Identify – Identify Controller Data Structure, I/O Command Set Independent
Both fields IOCCSZ and IORCSZ have "R" in the "Disc" column, indicating that they are reserved for discovery controllers.
Sounds good to me. I've applied for nvme-6.8.
Sagi Grimberg
maintainerQuoted 8 lines
Quoted 7 lines
Quoted 3 lines
Why? As Max points out, the base NVMe spec says those fields are reserved for discovery controllers.
Oh, didn't understand that it was already the case, I thought that the intention was to made it as such. Can you point us to this part in the spec?
Quoted 5 lines
https://nvmexpress.org/wp-content/uploads/NVM-Express-Base-Specification-2.0c-2022.10.04-Ratified.pdf
Figure 275: Identify – Identify Controller Data Structure, I/O Command Set Independent
Both fields IOCCSZ and IORCSZ have "R" in the "Disc" column, indicating that they are reserved for discovery controllers.
Thanks Caleb.