Skip to content

Implement NVMe Namespace Descriptor Identification

Johannes Thumshirn linux-fsdevel linux-nvme lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest10 patches 34 repliesIn review
  2. v59 patches 8 repliesSuperseded
  3. v48 patches 25 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v38 patches8 repliesSuperseded
v28 patches5 repliesSuperseded
v17 patches9 repliesSuperseded

Changes to v5 from the cover letter

* Change '\0' to 0 in sg_zerroout_area()s memset (Sagi)
* Fix uinitialized variable in version setting (Guan)
* Renamed struct nvme_ns_identifier_hdr to nvme_ns_id_desc (Sagi)
* Move all users of dev_(warn|err)\(ctrl->dev to ctrl->device (Sagi)
* Add Max's R-b

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10scatterlist: add sg_zeroout_area() helperinclude/linux/scatterlist.h lib/scatterlist.c+40 -03 replies
2/10nvmet: use NVME_IDENTIFY_DATA_SIZEdrivers/nvme/target/admin-cmd.c drivers/nvme/target/discovery.c include/linux/nvme.h+5 -31 reply
3/10nvme: introduce NVMe Namespace Identification Descriptor structuresinclude/linux/nvme.h+17 -01 reply
4/10nvme: rename uuid to nguid in nvme_nsdrivers/nvme/host/core.c drivers/nvme/host/nvme.h+6 -60 replies
5/10nvmet: implement namespace identify descriptor listdrivers/nvme/target/admin-cmd.c drivers/nvme/target/core.c drivers/nvme/target/nvmet.h+64 -17 replies
6/10nvmet: add uuid field to nvme_ns and populate via configfsdrivers/nvme/target/configfs.c+31 -01 reply
7/10nvme: get list of namespace descriptorsdrivers/nvme/host/core.c drivers/nvme/host/nvme.h+80 -01 reply
8/10nvme: provide UUID value to userspacedrivers/nvme/host/core.c+24 -10 replies
9/10nvmet: allow overriding the NVMe VS via configfsdrivers/nvme/target/configfs.c include/linux/nvme.h+41 -01 reply
10/10nvme: use ctrl->device consistently for loggingdrivers/nvme/host/core.c drivers/nvme/host/fc.c+11 -111 reply

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchMax GurtovoySagi GrimbergHannes ReineckeChristoph HellwigGuan Junxiong
1/10R-b R-b
2/10R-b R-b R-b R-b
3/10R-b R-b R-b R-b
4/10R-b R-b R-b
5/10R-b R-b R-b R-b
6/10R-b R-b R-b R-b
7/10R-b R-b
8/10R-b R-b R-b
9/10R-b R-b R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v6 thread

Cover letter [PATCH v6 00/10] Implement NVMe Namespace Descriptor Identification

This patchset implemets NVMe Namespace Descriptor Identification as of NVMe 1.3. The Namespace Descriptor Identification allows a NVMe host to query several Namespace Identification mechanisms, such as EUI-64, NGUID and UUID from the target. If more than one value is set by the target, it can transmit all set values to the host.

The Namespace Identification Descriptor list is the only way a target can identify itself via the newly introduced UUID to the host (in addition to the EUI-64 or NGUID).

Both the Host and Target side are implemented. In order to get the Linux Host to send the Linux target implementation a Namespace Descriptor Identification command, you have to change the target's announced version code to at least 1.3.

Unfortunately the host side already did have a sysfs attribute called 'uuid' which represented the NGUID, so precautions have been taken to not break any existing userspace.

The code is tested using the nvme-loop loopback target and cut against Christoph's uuid/for-next branch.

A patch for nvmetcli and nvme-cli will follow shortly.

Changes to v5:
* Change '\0' to 0 in sg_zerroout_area()s memset (Sagi)
* Fix uinitialized variable in version setting (Guan)
* Renamed struct nvme_ns_identifier_hdr to nvme_ns_id_desc (Sagi)
* Move all users of dev_(warn|err)\(ctrl->dev to ctrl->device (Sagi)
* Add Max's R-b

Changes to v4:
* Add nvmet_copy_ns_identifier() helper (Christoph)
* Move 'nvmet: use NVME_IDENTIFY_DATA_SIZE' to beginning of series (Christoph)
* Protect subsystem version with nvmet_config_sem (Christoph)
* Get rid of local variables in nvmet_subsys_version_show (Christoph)
* Included dots in subsystem version (Sagi)
* Merge nvme_parse_ns_descs() into nvme_identify_ns_descs() (Christoph)
* Skip unknown NS descriptors in nvme_identify_ns_descs() (Christoph)
* Add sg_zeroout_area() helper to lib/scatterlist.c (Christoph)
* I'm not sure if I shall use nvme_ns_identifier_hdr or nvme_ns_id_desc
* Rebased on Christoph's uuid/for-next branch
* Collected Acks

Changes to v3:
* Autogenerate UUID on target NS allocation (Sagi)

Changes to v2:
* Added Max's Reviewed-by
* Make series bisectable

Changes to v1:
* Added Reviewed-by tags from Christoph and Hannes for unchanged patches
* Added patch introducing new structs at the beginning (Christoph)
* Dropped SZ_4K patch
* Got rid of dynamic memory allocation on the target side (Christoph)
* Reworked host side parser (Christoph)
* Check length inside type check in the host parser (Max)

Changes to v0:
* Fixed wrong size of 4069 and replaced it with SZ_4K (Max)
* Add constants for UUID, NGUID and EUI-64 length (Max)
* Drop EUI-64 Support on target side (Christoph)
* Use uuid_be instead of u8[] (Christoph)
* Add ability to override target's version (Hannes)
* Change hard coded magic 4096 and 0x1000 to SZ_4k in drivers/nvme/*

Johannes Thumshirn (10):
scatterlist: add sg_zeroout_area() helper
nvmet: use NVME_IDENTIFY_DATA_SIZE
nvme: introduce NVMe Namespace Identification Descriptor structures
nvme: rename uuid to nguid in nvme_ns
nvmet: implement namespace identify descriptor list
nvmet: add uuid field to nvme_ns and populate via configfs
nvme: get list of namespace descriptors
nvme: provide UUID value to userspace
nvmet: allow overriding the NVMe VS via configfs
nvme: use ctrl->device consistently for logging

 drivers/nvme/host/core.c        | 120 +++++++++++++++++++++++++++++++++++++---
 drivers/nvme/host/fc.c          |  12 ++--
 drivers/nvme/host/nvme.h        |   1 +
 drivers/nvme/target/admin-cmd.c |  65 +++++++++++++++++++++-
 drivers/nvme/target/configfs.c  |  68 +++++++++++++++++++++++
 drivers/nvme/target/core.c      |   3 +-
 drivers/nvme/target/discovery.c |   2 +-
 drivers/nvme/target/nvmet.h     |   1 +
 include/linux/nvme.h            |  23 ++++++++
 include/linux/scatterlist.h     |   3 +
 lib/scatterlist.c               |  37 +++++++++++++
 11 files changed, 316 insertions(+), 19 deletions(-)
Signature · 1 line
2.12.3