Page MenuHomeFreeBSD

nvmf: Factor out most of nvmf_rescan_ns into a helper routine
ClosedPublic

Authored by jhb on Jun 2 2024, 6:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 6:12 AM
Unknown Object (File)
Wed, Oct 16, 7:57 PM
Unknown Object (File)
Tue, Oct 15, 7:04 AM
Unknown Object (File)
Sun, Oct 13, 1:20 PM
Unknown Object (File)
Sat, Oct 12, 10:55 PM
Unknown Object (File)
Sat, Oct 12, 3:37 AM
Unknown Object (File)
Thu, Oct 10, 8:21 PM
Unknown Object (File)
Thu, Oct 10, 3:43 PM
Subscribers
None

Details

Summary

This function accepts a namespace ID and associated namespace data
from IDENTIFY and takes care of updating nvmeXnsY and ndaZ.

Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Jun 2 2024, 6:44 PM
jhb created this revision.

I think this looks good... Agree again on the locking, unless we're seralized somehow... but maybe the locking needs to be more reference-county rather than just pure locking because what does one do with the namespace pointers? And what use of them might need protection against the dying namespace we can't quite free yet issue that I see lurking. Thankfully, namespace changes are super rare, so we have time to work it out.

sys/dev/nvmf/host/nvmf.c
801–802

So what are the other threads that are racing this?

This revision is now accepted and ready to land.Jun 2 2024, 7:03 PM
sys/dev/nvmf/host/nvmf.c
801–802

A rescan can be triggered either by an AEN for the active NS log page or a reconnect request (and you can only have a single connection). I don't think you can really get concurrent AENs, but it is theoretically possible to get one while you are doing the rescan after a reconnect. That seems very unlikely. I would probably just use the existing sc->connection_lock SX lock to protect the array if I added locking. The reconnect case already holds that, so it would really just be adding that lock to the AEN handler.