]> www.infradead.org Git - nvme.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)
committerKeith Busch <kbusch@kernel.org>
Wed, 4 Dec 2024 17:19:54 +0000 (09:19 -0800)
commit88c23a32b851e36adc4ab36f796d9b711f47e2bb
tree35f0bdaa9190d6ca6eb1971c7b72b8783ecb167a
parentb0de5456e201c475d6a860ceeb3ed8ee2923695a
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: 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>
drivers/nvme/host/core.c