Skip to content

Commit 60ca212

Browse files
committed
nvme-fabrics: handle zero MAXCMD without closing the connection
jira LE-3460 Rebuild_History Non-Buildable kernel-6.12.0-55.18.1.el10_0 commit-author Maurizio Lombardi <[email protected]> commit 88c23a3 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 implementation closes the connection in such cases, completely preventing the host from connecting to the target. Fix the issue by printing a clear error 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. Fixes: 4999568 ("nvme-fabrics: check max outstanding commands") Signed-off-by: Maurizio Lombardi <[email protected]> Reviewed-by: Laurence Oberman <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]> (cherry picked from commit 88c23a3) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 60871a9 commit 60ca212

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/nvme/host/core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,8 +3250,9 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct
32503250
}
32513251

32523252
if (!ctrl->maxcmd) {
3253-
dev_err(ctrl->device, "Maximum outstanding commands is 0\n");
3254-
return -EINVAL;
3253+
dev_warn(ctrl->device,
3254+
"Firmware bug: maximum outstanding commands is 0\n");
3255+
ctrl->maxcmd = ctrl->sqsize + 1;
32553256
}
32563257

32573258
return 0;

0 commit comments

Comments
 (0)