]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvme-fabrics: handle zero MAXCMD without closing the connection
authorMaurizio Lombardi <mlombard@redhat.com>
Fri, 29 Nov 2024 14:17:06 +0000 (15:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:03:17 +0000 (20:03 +0100)
commit845cc4ee8e64a4d61bef271c0fc5d19486d8fc17
treeb72b693cc5517444a3579c7874536d87881990b2
parentf9f2a2739eb3ed685e80695f2aac234d8855ec34
nvme-fabrics: handle zero MAXCMD without closing the connection

[ Upstream commit 88c23a32b851e36adc4ab36f796d9b711f47e2bb ]

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: 4999568184e5 ("nvme-fabrics: check max outstanding commands")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c