Skip to content

Commit c80e9eb

Browse files
maurizio-lombardiSasha Levin
authored andcommitted
nvme-fabrics: handle zero MAXCMD without closing the connection
[ Upstream 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 37ed77b commit c80e9eb

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
@@ -3251,8 +3251,9 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct
32513251
}
32523252

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

32583259
return 0;

0 commit comments

Comments
 (0)