[PATCH v3 0/4] nvme-fc: fix blktests nvme/041

Daniel Wagner posted 4 patches 5 months, 1 week ago
drivers/nvme/host/fabrics.c |  40 ++++++++-
drivers/nvme/host/fabrics.h |   9 +-
drivers/nvme/host/fc.c      | 212 ++++++++++++++++++++++----------------------
drivers/nvme/host/rdma.c    |  18 ++--
drivers/nvme/host/tcp.c     |  21 +++--
drivers/nvme/target/loop.c  |  19 ++--
6 files changed, 192 insertions(+), 127 deletions(-)
[PATCH v3 0/4] nvme-fc: fix blktests nvme/041
Posted by Daniel Wagner 5 months, 1 week ago
Another attempt to get the nvme/041 fixed. I've decided to make the
synchronous connect an opt-in feature, so that we don't break existing
users. I need to do some changes for libnvme and nvme-cli so all works
fine when users update either the userspace or kernel.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
v3:
 - rebased to current master
 - use explicit initial connect flag to distiguish between retry and
   initial connect. Necessary to keep nvme/061 working.
 - added 'nvme-fc: refactore nvme_fc_reconnect_or_delete'
 - updated commit messages

v2:
 - renamed flag to connect_async, default false
 - add info to commit message why nvme-fc is different
 - merged connect_async with 'nvme-fc: wait for
   initial connect attempt to finish'
 - https://lore.kernel.org/all/20240221132404.6311-1-dwagner@suse.de/

v1:
 - renamed 'nvme-fc: redesign locking and refcounting'
   to 'nvme-fc: reorder ctrl ref counting and cleanup code path'
 - testing with scsi/nvme dev_loss_tmo on real hw
 - removed rport ref counting part
 - collected RB tags
 - https://lore.kernel.org/linux-nvme/20240219131531.15134-1-dwagner@suse.de/

v0:
 - initial version
 - https://lore.kernel.org/linux-nvme/20240216084526.14133-1-dwagner@suse.de/

---
Daniel Wagner (4):
      nvme-fabrics: introduce ref-counting for nvmf_ctrl_options
      nvme-fc: reorganize ctrl ref-counting and cleanup code
      nvme-fc: refactore nvme_fc_reconnect_or_delete
      nvme-fc: wait for initial connect attempt to finish

 drivers/nvme/host/fabrics.c |  40 ++++++++-
 drivers/nvme/host/fabrics.h |   9 +-
 drivers/nvme/host/fc.c      | 212 ++++++++++++++++++++++----------------------
 drivers/nvme/host/rdma.c    |  18 ++--
 drivers/nvme/host/tcp.c     |  21 +++--
 drivers/nvme/target/loop.c  |  19 ++--
 6 files changed, 192 insertions(+), 127 deletions(-)
---
base-commit: c17b750b3ad9f45f2b6f7e6f7f4679844244f0b9
change-id: 20250828-nvme-fc-sync-bbc73a36255d

Best regards,
-- 
Daniel Wagner <wagi@kernel.org>
Re: [PATCH v3 0/4] nvme-fc: fix blktests nvme/041
Posted by Justin Tee 3 months, 1 week ago
Hi Daniel,

Broadcom is currently evaluating this patchset and will provide feedback.

Thanks,
Justin
Re: [PATCH v3 0/4] nvme-fc: fix blktests nvme/041
Posted by Justin Tee 3 months ago
Hi Daniel,

Taking a different approach than this patch set, may we see if the
following singular patch resolves the nvme/041 blktest?

[PATCH 1/1] nvme-fabrics: add ENOKEY to no retry criteria for
authentication failures

With authentication, in addition to EKEYREJECTED there is also no point in
retrying reconnects when status is ENOKEY.  Thus, add -ENOKEY as another
criteria to determine when to stop retries.

Signed-off-by: Justin Tee <justintee8345@gmail.com>
---
 drivers/nvme/host/fabrics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 3d4d6d8e88c4..fb7765bf0cdf 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -594,7 +594,7 @@ bool nvmf_should_reconnect(struct nvme_ctrl *ctrl,
int status)
        if (status > 0 && (status & NVME_STATUS_DNR))
                return false;

-       if (status == -EKEYREJECTED)
+       if (status == -EKEYREJECTED || status == -ENOKEY)
                return false;

        if (ctrl->opts->max_reconnects == -1 ||
--
2.38.0

Regards,
Justin