nvme types and commands header cleanup#3397
Open
igaw wants to merge 10 commits into
Open
Conversation
550660e to
9dfebed
Compare
There was a problem hiding this comment.
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.
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>
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 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.