All of lore.kernel.org
 help / color / mirror / Atom feed
* [SPDK] RFC: NVMf namespace masking
@ 2021-05-08 13:37 Jonas Pfefferle
  0 siblings, 0 replies; only message in thread
From: Jonas Pfefferle @ 2021-05-08 13:37 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 1808 bytes --]

Hi all,

I would be happy to get some feedback on my NVMf target namespace masking 
implementation using attach/detach:
https://review.spdk.io/gerrit/c/spdk/spdk/+/7821

The patch introduces namespace masking for NVMe-over-fabrics
targets by allowing to (dynamically) attach and detach
controllers to/from namespaces, cf. NVMe spec 1.4 - section 6.1.4.
Since SPDK only supports the dynamic controller model a new
controller is allocated on every fabric connect command.
This allows to attach/detach controllers of a specific
host NQN to/from a namespace. A host can only perform
operations to an active namespace. Inactive namespaces can
be listed (not supported by SPDK) but no additional
information can be retrieved:
"Unless otherwise noted, specifying an inactive NSID in a
command that uses the Namespace Identifier (NSID) field shall
cause the controller to abort the command with status
Invalid Field in Command" - NVMe spec 1.4 - section 6.1.5
Note that this patch does not implement the NVMe namespace
attachment command but allows to attach/detach via RPCs only.
To preserve current behavior all controllers are auto attached.
To not not auto attach controllers the nvmf_subsystem_add_ns
shall be called with "--no-auto-attach". We introduce two new
RPC calls:
- nvmf_ns_attach_ctrlr <subsysNQN> <NSID> [--host <hostNQN>]
- nvmf_ns_detach_ctrlr <subsysNQN> <NSID> [--host <hostNQN>]
If no host NQN is specified all controllers
(new and currently connected) will attach/detach to/from the
namespace specified.
The list in spdk_nvmf_ns is used to keep track of hostNQNs
which controllers should be attached on connect.
The active_ns array in spdk_nvmf_ctrlr is used for fast lookup
to check whether a NSID is active/inactive on command execution.

Thanks,
Jonas

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-08 13:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08 13:37 [SPDK] RFC: NVMf namespace masking Jonas Pfefferle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.