Repository navigation
libnvme: mi: add libnvme_mi_mi_controller_health_status_poll - #4006
drakedog2008 wants to merge 2 commits into
Conversation
7d360f1 to
61f71ca
Compare
61f71ca to
cc2a1b1
Compare
|
FTR, we are working on getting the libnvme1 submission in shape first. |
cc2a1b1 to
8cadd5c
Compare
|
Following the review on linux-nvme/libnvme#1144 (comment), I applied the same struct layout change here:
|
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>
8cadd5c to
69ca5f6
Compare
|
Same follow-up as linux-nvme/libnvme#1144: the |
| bool filter_cwarn; | ||
| struct nvme_mi_ctrl_health_status *entries; | ||
| unsigned int *num_entries; | ||
| }; |
There was a problem hiding this comment.
For nvme-cli 3 we removed this type of API (struct args) because it is a PITA for ABI stability.
Instead we are using static line function which do not introduce a stable library ABI interface, see nvme-cmds-base.h. I think something like this should be used here as well.
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