From: Daniel Wagner <wagi@kernel.org>
To: James Smart <james.smart@broadcom.com>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>
Cc: Hannes Reinecke <hare@suse.de>, Keith Busch <kbusch@kernel.org>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
Daniel Wagner <wagi@kernel.org>
Subject: [PATCH v5 00/14] nvmet-fcloop: track resources via reference counting
Date: Wed, 23 Apr 2025 15:21:43 +0200 [thread overview]
Message-ID: <20250423-nvmet-fcloop-v5-0-3d7f968728a5@kernel.org> (raw)
This is just a rebase to nvme/nvme-6.15 which ships the first part of the
original series. The rest is still the same, thus:
The main changes are the reordering (so that the tests pass for each
patch) and holding the lock in fcloop_nport_alloc. Also I've
splitted the different changes so that it is simpler to follow, e.g.
'nvmet-fcloop: refactor fcloop_delete_local_port'
Note blktests nvme/030 test is likely to fail if the
70-nvmf-autoconnect.rules is active. In this case two discovery are
running in parallel and nvme-cli/libnvme gets out of sync. I don't see a
problem in blktests, but maybe I am just blind:
nvme/030 (tr=fc) (ensure the discovery generation counter is updated appropriately) [failed]
runtime 1.843s ... 1.719s
--- tests/nvme/030.out 2023-08-30 08:39:08.428409596 +0000
+++ /tmp/blktests/nodev_tr_fc/nvme/030.out.bad 2025-04-10 10:56:05.146372112 +0000
@@ -1,2 +1,6 @@
Running nvme/030
+Failed to open ctrl nvme1, errno 11
+Failed to open ctrl nvme1, errno 11
+failed to get discovery log: Bad file descriptor
The host, target and fcloop work just fine:
[ 1434.556136] run blktests nvme/030 at 2025-04-10 10:56:03
[ 1434.779180] nvmet: adding nsid 1 to subsystem blktests-subsystem-1
[ 1434.858814] nvme nvme1: NVME-FC{0}: create association : host wwpn 0x20001100aa000001 rport wwpn 0x20001100ab000001: NQN "nqn.2014-08.org.nvmexpress.discovery"
[ 1434.860275] (NULL device *): {0:0} Association created
[ 1434.861773] nvmet: Created discovery controller 1 for subsystem nqn.2014-08.org.nvmexpress.discovery for NQN nqn.2014-08.org.nvmexpress:uuid:a94a718e-09b2-4b5b-898a-116845846761.
[ 1434.864704] nvme nvme1: NVME-FC{0}: controller connect complete
[ 1434.865082] nvme nvme1: NVME-FC{0}: new ctrl: NQN "nqn.2014-08.org.nvmexpress.discovery", hostnqn: nqn.2014-08.org.nvmexpress:uuid:a94a718e-09b2-4b5b-898a-116845846761
[ 1434.871357] nvme nvme1: Removing ctrl: NQN "nqn.2014-08.org.nvmexpress.discovery"
[ 1434.953940] nvmet: adding nsid 1 to subsystem blktests-subsystem-2
[ 1434.954581] (NULL device *): {0:0} Association deleted
[ 1435.007936] (NULL device *): {0:0} Association freed
[ 1435.009560] (NULL device *): Disconnect LS failed: No Association
[ 1435.060507] nvme nvme2: NVME-FC{1}: create association : host wwpn 0x20001100aa000001 rport wwpn 0x20001100ab000001: NQN "nqn.2014-08.org.nvmexpress.discovery"
[ 1435.061682] (NULL device *): {0:0} Association created
[ 1435.062499] nvmet: Created discovery controller 1 for subsystem nqn.2014-08.org.nvmexpress.discovery for NQN nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349.
[ 1435.064831] nvme nvme2: NVME-FC{1}: controller connect complete
[ 1435.065244] nvme nvme2: NVME-FC{1}: new ctrl: NQN "nqn.2014-08.org.nvmexpress.discovery", hostnqn: nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349
[ 1435.070407] nvme nvme2: Removing ctrl: NQN "nqn.2014-08.org.nvmexpress.discovery"
[ 1435.143134] (NULL device *): {0:0} Association deleted
[ 1435.181772] (NULL device *): {0:0} Association freed
[ 1435.182360] (NULL device *): Disconnect LS failed: No Association
When disabling the udev rule this test will pass. Tracking this
at https://github.com/linux-nvme/nvme-cli/issues/2781
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
Changes in v5:
- rebased to nvme/nvme-6.15
- Link to v4: https://patch.msgid.link/20250410-nvmet-fcloop-v4-0-7e5c42b7b2cb@kernel.org
Changes in v4:
- reordered patches so that they pass the tests each on of its own
- addressed feedback from Christop, Hannes and James.
- hold lock while looking up nport and insert nport operation in fcloop_nport_alloc
- dropped patches from 20250408-nvmet-fcloop-part-one-v1-0-382ec97ab7eb@kernel.org
- Link to v3: https://lore.kernel.org/r/20250318-nvmet-fcloop-v3-0-05fec0fc02f6@kernel.org
Changes in v3:
- fixed memory leaks
- allocates fcloop_lsreq in fcloop directly
- prevent double free due to unregister race
- collected tags
- Link to v2: https://lore.kernel.org/r/20250311-nvmet-fcloop-v2-0-fc40cb64edea@kernel.org
Changes in v2:
- drop tport and rport ref counting, use implicit synchronisation
- a bunch of additional fixes in existing ref countig
- replaced kref with refcount
- Link to v1: https://lore.kernel.org/r/20250226-nvmet-fcloop-v1-0-c0bd83d43e6a@kernel.org
---
Daniel Wagner (14):
nvmet-fcloop: track ref counts for nports
nvmet-fcloop: remove nport from list on last user
nvmet-fcloop: refactor fcloop_nport_alloc and track lport
nvmet-fcloop: refactor fcloop_delete_local_port
nvmet-fcloop: update refs on tfcp_req
nvmet-fcloop: add missing fcloop_callback_host_done
nvmet-fcloop: access fcpreq only when holding reqlock
nvmet-fcloop: prevent double port deletion
nvmet-fcloop: allocate/free fcloop_lsreq directly
nvmet-fcloop: don't wait for lport cleanup
nvmet-fcloop: drop response if targetport is gone
nvmet-fc: free pending reqs on tgtport unregister
nvmet-fc: take tgtport refs for portentry
nvme-fc: do not reference lsrsp after failure
drivers/nvme/host/fc.c | 13 +-
drivers/nvme/target/fc.c | 85 +++++++--
drivers/nvme/target/fcloop.c | 437 ++++++++++++++++++++++++++++---------------
3 files changed, 364 insertions(+), 171 deletions(-)
---
base-commit: 3d7aa0c7b4e96cd460826d932e44710cdeb3378b
change-id: 20250214-nvmet-fcloop-a649738b7e6e
Best regards,
--
Daniel Wagner <wagi@kernel.org>
next reply other threads:[~2025-04-23 13:21 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 13:21 Daniel Wagner [this message]
2025-04-23 13:21 ` [PATCH v5 01/14] nvmet-fcloop: track ref counts for nports Daniel Wagner
2025-04-24 10:08 ` Hannes Reinecke
2025-04-24 11:13 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 02/14] nvmet-fcloop: remove nport from list on last user Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 03/14] nvmet-fcloop: refactor fcloop_nport_alloc and track lport Daniel Wagner
2025-04-24 10:09 ` Hannes Reinecke
2025-04-23 13:21 ` [PATCH v5 04/14] nvmet-fcloop: refactor fcloop_delete_local_port Daniel Wagner
2025-04-24 10:10 ` Hannes Reinecke
2025-04-24 11:16 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 05/14] nvmet-fcloop: update refs on tfcp_req Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 06/14] nvmet-fcloop: add missing fcloop_callback_host_done Daniel Wagner
2025-04-24 10:13 ` Hannes Reinecke
2025-04-24 11:26 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 07/14] nvmet-fcloop: access fcpreq only when holding reqlock Daniel Wagner
2025-04-24 10:15 ` Hannes Reinecke
2025-04-24 11:31 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 08/14] nvmet-fcloop: prevent double port deletion Daniel Wagner
2025-04-24 10:17 ` Hannes Reinecke
2025-04-24 11:32 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 09/14] nvmet-fcloop: allocate/free fcloop_lsreq directly Daniel Wagner
2025-04-24 10:18 ` Hannes Reinecke
2025-05-07 10:48 ` kernel test robot
2025-04-23 13:21 ` [PATCH v5 10/14] nvmet-fcloop: don't wait for lport cleanup Daniel Wagner
2025-04-24 10:21 ` Hannes Reinecke
2025-04-24 11:48 ` Daniel Wagner
2025-04-24 12:10 ` Hannes Reinecke
2025-04-24 12:58 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 11/14] nvmet-fcloop: drop response if targetport is gone Daniel Wagner
2025-04-24 10:21 ` Hannes Reinecke
2025-04-23 13:21 ` [PATCH v5 12/14] nvmet-fc: free pending reqs on tgtport unregister Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 13/14] nvmet-fc: take tgtport refs for portentry Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 14/14] nvme-fc: do not reference lsrsp after failure Daniel Wagner
2025-05-06 16:36 ` [PATCH v5 00/14] nvmet-fcloop: track resources via reference counting Daniel Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250423-nvmet-fcloop-v5-0-3d7f968728a5@kernel.org \
--to=wagi@kernel.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=james.smart@broadcom.com \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®