Skip to content

nvme types and commands header cleanup#3397

Open
igaw wants to merge 10 commits into
linux-nvme:masterfrom
igaw:nvme-header-cleanup
Open

nvme types and commands header cleanup#3397
igaw wants to merge 10 commits into
linux-nvme:masterfrom
igaw:nvme-header-cleanup

Conversation

@igaw
Copy link
Copy Markdown
Collaborator

@igaw igaw commented May 29, 2026

Update the NVMe types and command headers to match the latest release version. The consistency check was done using Claude with the /nvme-spec skill which should be soonish available.

@igaw igaw force-pushed the nvme-header-cleanup branch 2 times, most recently from 550660e to 9dfebed Compare May 29, 2026 14:14
@igaw igaw requested a review from Copilot May 29, 2026 14:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates NVMe/libnvme type and command headers toward newer spec naming, documentation, and bitfield accessor conventions.

Changes:

  • Renames reservation notification mask symbols/helpers and updates call sites/tests.
  • Renames NBFT types header and updates build/doc/test references.
  • Adds/refactors NVMe type enums, masks, accessors, and normalizes kernel-doc return text.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
nvme.c Updates feature CLI name/FID for reservation notification mask.
nvme-print.c Updates feature string switch to new FID name.
nvme-print-stdout.c Updates stdout feature display switch to new FID name.
nvme-print-json.c Renames JSON reservation mask helper and switch case.
libnvme/test/test.c Updates smoke test helper and output text.
libnvme/test/meson.build Updates header self-test list for renamed/new type headers.
libnvme/test/ioctl/features.c Updates ioctl feature tests to new reservation notification mask names.
libnvme/src/nvme/util.h Normalizes return documentation.
libnvme/src/nvme/tree.h Normalizes return documentation.
libnvme/src/nvme/private.h Normalizes internal return documentation.
libnvme/src/nvme/private-fabrics.h Normalizes fabrics helper documentation.
libnvme/src/nvme/nvme-types.h Adds NBFT types to umbrella include.
libnvme/src/nvme/nvme-types-zns.h Adds ZNS spec notes and new bitfield enums/accessors.
libnvme/src/nvme/nvme-types-nvm.h Adds NVM spec notes, enums, and accessors.
libnvme/src/nvme/nvme-types-nbft.h Renames/updates NBFT type documentation and descriptor enum.
libnvme/src/nvme/nvme-types-mi.h Adds MI spec notes, enums/accessors, and removes compatibility aliases.
libnvme/src/nvme/nvme-types-fabrics.h Adds fabrics spec notes, discovery log docs, and TREQ accessors.
libnvme/src/nvme/nvme-types-base.h Refactors/adds many base spec masks, shifts, accessors, and docs.
libnvme/src/nvme/nvme-cmds.h Normalizes command return documentation.
libnvme/src/nvme/nvme-cmds.c Updates feature length switch to new FID.
libnvme/src/nvme/nvme-cmds-nvm.h Fixes inline helper return documentation.
libnvme/src/nvme/nvme-cmds-base.h Renames reservation notification feature init helpers and docs.
libnvme/src/nvme/nbft.h Updates renamed NBFT type include and return docs.
libnvme/src/nvme/mi.h Normalizes MI API return documentation.
libnvme/src/nvme/mi-types.h Adds MI wire-protocol overview docs and return doc normalization.
libnvme/src/nvme/linux.h Normalizes Linux helper return documentation.
libnvme/src/nvme/lib.h Normalizes library open return documentation.
libnvme/src/nvme/ioctl.h Normalizes ioctl passthrough return documentation.
libnvme/src/nvme/fabrics.h Normalizes fabrics API return documentation and spacing.
libnvme/src/meson.build Updates installed fabrics header path for renamed NBFT types.
libnvme/doc/meson.build Updates documentation input file for renamed NBFT types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libnvme/src/nvme/nvme-types-fabrics.h Outdated
Comment thread libnvme/src/nvme/nvme-types-nvm.h
Comment thread libnvme/src/nvme/nvme-types-base.h
Comment thread libnvme/src/nvme/nvme-types-base.h
Comment thread libnvme/src/nvme/nvme-types-base.h
Comment thread libnvme/src/nvme/tree.h Outdated
Comment thread libnvme/src/nvme/tree.h Outdated
Comment thread libnvme/src/nvme/tree.h Outdated
Comment thread libnvme/src/nvme/nvme-types.h Outdated
Comment thread libnvme/src/nvme/mi-types.h Outdated
igaw added 10 commits June 1, 2026 09:07
Add references on which version of the spec the header is based on.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Add missing documentation to the base and fabrics types.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Add or update all missing types, shift/masks and accessors to sync it up
with the current specification.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Drop these for the upcoming major release.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
The established name is rsvd instead of reserved.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Drop the depricated mask for the next major version.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
The naming pattern is not correct for this feature. It should include
the notification part in the name to be consistent.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
The nvme types are defined in the nvme-types-*.h headers.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Update the nvme-types-nbft header to the latest spec version.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Fix the return documentation where it is outdated due to the way errors
are reported with the new API. Use the same wording everywhere.

While at it also drop return text for void functions.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
@igaw igaw force-pushed the nvme-header-cleanup branch from 9dfebed to 237ab0b Compare June 1, 2026 08:18
@igaw igaw requested a review from Copilot June 1, 2026 08:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 30 out of 30 changed files in this pull request and generated 13 comments.

Comment thread libnvme/src/nvme/nvme-types-nvm.h
Comment on lines +234 to +235
#define NVMF_TREQ_SECTYPE(treq) NVMF_GET(treq, NVMF_TREQ_SECTYPE)
#define NVMF_TREQ_DISABLE_SQFLOW_BIT(treq) NVMF_GET(treq, NVMF_TREQ_DISABLE_SQFLOW)
Comment on lines +2635 to +2637
#define NVME_CTRL_TRATTR_THMCS(trattr) NVME_GET(trattr, CTRL_TRATTR_THMCS)
#define NVME_CTRL_TRATTR_TUDCS(trattr) NVME_GET(trattr, CTRL_TRATTR_TUDCS)
#define NVME_CTRL_TRATTR_MRTLL(trattr) NVME_GET(trattr, CTRL_TRATTR_MTRLL)
Comment on lines +1964 to +1965
#define NVME_CTRL_CRCAP_RRSUP(crcap) NVME_GET(crcap, CTRL_CRCAP_RRSUP)
#define NVME_CTRL_CRCAP_RGICS(crcap) NVME_GET(crcap, CTRL_CRCAP_RGIDC)
Comment on lines +8518 to +8522
#define NVME_LM_CREATE_CDQ_PC(fields) NVME_GET(fields, LM_CREATE_CDQ_PC)
#define NVME_LM_CREATE_CNTLID(fields) NVME_GET(fields, LM_CREATE_CNTLID)

#define NVME_LM_DELETE_CDQ_CDQID(fields) NVME_GET(fields, LM_DELETE_CDQ_CDQID)
#define NVME_LM_CREATE_CDQ_CDQID(fields) NVME_GET(fields, LM_DELETE_CDQ_CDQID)
Comment on lines 3045 to 3046
* Initializes the passthru command buffer for the Get Features command with
* FID value %NVME_FEAT_FID_RESV_MASK
Comment thread nvme.c
Comment on lines 299 to 302
VAL_BYTE("sw-progress", NVME_FEAT_FID_SW_PROGRESS),
VAL_BYTE("host-id", NVME_FEAT_FID_HOST_ID),
VAL_BYTE("resv-mask", NVME_FEAT_FID_RESV_MASK),
VAL_BYTE("resv-nf-mask", NVME_FEAT_FID_RESV_NF_MASK),
VAL_BYTE("resv-persist", NVME_FEAT_FID_RESV_PERSIST),
Comment on lines +130 to 131
* Calculate The size of the "struct nvmf_ext_attr" needed to hold
* a value of size @val_len.
Comment on lines +39 to +40
NVME_ZNS_ZOC_VZC = 0x0,
NVME_ZNS_ZOC_VZE = 0x1,
* @NVME_ZNS_ZCTRATT_MASK: Mask to get Zoned Controller Attributes
* @NVME_ZNS_ZCTRATT_ZNRM: Zoned Namespace Resource Management
*/
enum nvme_zns_zai {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants