libnvme: mi: add libnvme_mi_mi_controller_health_status_poll - #4006
Open
drakedog2008 wants to merge 2 commits into
Open
libnvme: mi: add libnvme_mi_mi_controller_health_status_poll#4006drakedog2008 wants to merge 2 commits into
drakedog2008 wants to merge 2 commits into
Conversation
drakedog2008
force-pushed
the
ctrl-health-poll
branch
from
September 9, 2026 22:42
7d360f1 to
61f71ca
Compare
Add support for the NVMe-MI 2.0 Controller Health Status Poll command (opcode 0x02) to read Controller Health Data Structures from an NVM subsystem. - Add nvme_mi_mi_opcode_ctrl_health_status_poll (0x02) to enum nvme_mi_mi_opcode. - Add NVME_MI_CSTS_TCIDA to enum nvme_mi_csts and NVME_MI_CHSC_* compatibility aliases. - Define struct libnvme_mi_ctrl_health_poll_args to configure command parameters (starting controller ID, clear changed flags, include/filter flags) and output buffers. - Implement libnvme_mi_mi_controller_health_status_poll() with automatic multi-request paging when more than 255 entries are requested. - Implement libnvme_mi_mi_controller_health_status_poll_all() convenience helper. - Export libnvme_mi_mi_controller_health_status_poll in libnvme-mi.ld. - Add unit tests in tests/mi.c covering single-entry query, filter flags, multi-page queries, and error parameter validation. Signed-off-by: Hao Jiang <jianghao@google.com>
Update the controllers subcommand in mi-mctp to display controller health status alongside controller topology and PCI configuration. - Poll all controller health entries using libnvme_mi_mi_controller_health_status_poll_all(). - Group health information by controller ID inside show_ctrl(). - Add show_chsc_flags() to decode active Controller Health Status Changed Flags (CHSCF) whenever the status changed field is non-zero. Signed-off-by: Hao Jiang <jianghao@google.com>
drakedog2008
force-pushed
the
ctrl-health-poll
branch
from
September 9, 2026 22:51
61f71ca to
cc2a1b1
Compare
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.
Port Controller Health Status Poll changes from linux-nvme/libnvme#1144 to libnvme3.
Implement Controller Health Status Poll (Opcode 02h) defined in NVMe-MI 2.0 (Section 5.3 & 5.3.1) for libnvme3:
nvme_mi_mi_opcode_ctrl_health_status_poll(0x02) toenum nvme_mi_mi_opcode.NVME_MI_CSTS_TCIDAtoenum nvme_mi_cstsandNVME_MI_CHSC_*compatibility aliases.struct libnvme_mi_ctrl_health_poll_argswithargs_sizefor ABI safety.libnvme_mi_mi_controller_health_status_poll()with automatic multi-request paging when requesting >255 entries.libnvme_mi_mi_controller_health_status_poll_all()convenience helper.libnvme_mi_mi_controller_health_status_pollinlibnvme-mi.ld(verified bycheck-public-symbolsandcheck-public-headers).libnvme/tests/mi.ccovering single-entry query, filter flags, multi-page chunk boundaries, and error validation.controllerssubcommand inmi-mctpto poll and display controller health status alongside topology and PCI configuration.show_chsc_flags()to decode active changed flags (CHSCF).Signed-off-by: Hao Jiang jianghao@google.com