Skip to content

Commit 88c23a3

Browse files
maurizio-lombardikeithbusch
authored andcommitted
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 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]>
1 parent b0de545 commit 88c23a3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/nvme/host/core.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -3233,8 +3233,9 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct
32333233
}
32343234

32353235
if (!ctrl->maxcmd) {
3236-
dev_err(ctrl->device, "Maximum outstanding commands is 0\n");
3237-
return -EINVAL;
3236+
dev_warn(ctrl->device,
3237+
"Firmware bug: maximum outstanding commands is 0\n");
3238+
ctrl->maxcmd = ctrl->sqsize + 1;
32383239
}
32393240

32403241
return 0;

0 commit comments

Comments
 (0)