nvme-fabrics: handle zero MAXCMD without closing the connection
PATCH v2 1/1 nvme-fabrics: handle zero MAXCMD without closing the connection
The NVMe specification states that MAXCMD is mandatory
for NVMe-over-Fabrics implementations. However, some NVMe/TCP and NVMe/FC arrays from major vendors have buggy firmware that reports MAXCMD as zero in the Identify Controller data structure.
Currently, the host implementation returns an error in such cases, completely preventing the host from connecting to the target.
Fix the issue by printing a clear warning message about the firmware bug and allowing the connection to proceed. It assumes that the target supports a MAXCMD value of SQSIZE + 1. If any issues arise, the user can manually adjust SQSIZE to mitigate them.
---
V2: replace dev_err() with dev_warn()
drivers/nvme/host/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +3 -2
@@ -3260,8 +3260,9 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct }if (!ctrl->maxcmd) { -dev_err (ctrl->device,"Maximum outstanding commands is 0\n" ); -return -EINVAL ; +dev_warn (ctrl->device, +"Firmware bug: maximum outstanding commands is 0\n" ); + ctrl->maxcmd = ctrl->sqsize +1 ; }return 0 ;
Signature · 1 line
2.43.5
Looks good:
Quoted 5 lines · Maurizio Lombardi
The NVMe specification states that MAXCMD is mandatory
for NVMe-over-Fabrics implementations. However, some NVMe/TCP and NVMe/FC arrays from major vendors have buggy firmware that reports MAXCMD as zero in the Identify Controller data structure.
Quoted 7 lines
Currently, the host implementation returns an error in such cases, completely preventing the host from connecting to the target.
Fix the issue by printing a clear warning message about the firmware bug and allowing the connection to proceed. It assumes that the target supports a MAXCMD value of SQSIZE + 1. If any issues arise, the user can manually adjust SQSIZE to mitigate them.
Thanks, applied to nvme-6.13.