Page MenuHomeFreeBSD

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

Authored by jhb on Sun, Jun 2, 6:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 11, 9:19 PM
Unknown Object (File)
Tue, Jun 11, 3:28 PM
Unknown Object (File)
Tue, Jun 11, 11:18 AM
Unknown Object (File)
Fri, Jun 7, 11:17 AM
Unknown Object (File)
Fri, Jun 7, 10:07 AM
Unknown Object (File)
Fri, Jun 7, 10:01 AM
Unknown Object (File)
Thu, Jun 6, 10:46 PM
Unknown Object (File)
Wed, Jun 5, 8:32 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.Sun, Jun 2, 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.Sun, Jun 2, 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.