Skip to contentSkip to conversation

nvme-fabrics: check max outstanding commands

PATCH Applied Guixin Liu 3 participants 3 messages Feb 28, 2024 NVMe

lore
Share & tools
lore

Guixin Liu

author
#0 lore raw

PATCH v2 1/1 nvme-fabrics: check max outstanding commands

Maxcmd is mandatory for fabrics, check it early to identify the root cause instead of waiting for it to propagate to "sqsize" and "allocing queue".

By the way, change nvme_check_ctrl_fabric_info() to nvmf_validate_identify_ctrl().

---
Changes from v1 to v2:
- Revert nvme_check_ctrl_fabric_info() function name change.

 drivers/nvme/host/core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/nvme/host/core.c +5 -0
index 0a96362912ce..7c247b849bbb 100644
@@ -3117,6 +3117,11 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct
 		return -EINVAL;
 	}
 
+	if (!ctrl->maxcmd) {
+		dev_err(ctrl->device, "Maximum outstanding commands is 0\n");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Guixin Liu

Maxcmd is mandatory for fabrics, check it early to identify the root cause instead of waiting for it to propagate to "sqsize" and "allocing queue".

Quoted 8 lines

By the way, change nvme_check_ctrl_fabric_info() to nvmf_validate_identify_ctrl().

---
Changes from v1 to v2:
- Revert nvme_check_ctrl_fabric_info() function name change.

Looks good.

-ck