From a8123060e6717f82ee27efca50c7d2daf4392809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 13:11:06 +0200 Subject: Merging upstream version 2.9.1. Signed-off-by: Daniel Baumann --- .github/workflows/appimage.yml | 2 +- Documentation/nvme-admin-passthru.1 | 12 +- Documentation/nvme-admin-passthru.html | 10 +- Documentation/nvme-admin-passthru.txt | 8 +- Documentation/nvme-ana-log.1 | 4 +- Documentation/nvme-ana-log.html | 2 +- Documentation/nvme-attach-ns.1 | 4 +- Documentation/nvme-attach-ns.html | 2 +- Documentation/nvme-boot-part-log.1 | 4 +- Documentation/nvme-boot-part-log.html | 2 +- Documentation/nvme-capacity-mgmt.1 | 4 +- Documentation/nvme-capacity-mgmt.html | 2 +- Documentation/nvme-changed-ns-list-log.1 | 4 +- Documentation/nvme-changed-ns-list-log.html | 2 +- Documentation/nvme-cmdset-ind-id-ns.1 | 4 +- Documentation/nvme-cmdset-ind-id-ns.html | 2 +- Documentation/nvme-compare.1 | 4 +- Documentation/nvme-compare.html | 2 +- Documentation/nvme-connect-all.1 | 4 +- Documentation/nvme-connect-all.html | 2 +- Documentation/nvme-connect.1 | 4 +- Documentation/nvme-connect.html | 2 +- Documentation/nvme-copy.1 | 4 +- Documentation/nvme-copy.html | 2 +- Documentation/nvme-create-ns.1 | 4 +- Documentation/nvme-create-ns.html | 2 +- Documentation/nvme-delete-ns.1 | 4 +- Documentation/nvme-delete-ns.html | 2 +- Documentation/nvme-dera-stat.1 | 4 +- Documentation/nvme-dera-stat.html | 2 +- Documentation/nvme-detach-ns.1 | 4 +- Documentation/nvme-detach-ns.html | 2 +- Documentation/nvme-device-self-test.1 | 4 +- Documentation/nvme-device-self-test.html | 2 +- Documentation/nvme-dim.1 | 4 +- Documentation/nvme-dim.html | 2 +- Documentation/nvme-dir-receive.1 | 4 +- Documentation/nvme-dir-receive.html | 2 +- Documentation/nvme-dir-send.1 | 4 +- Documentation/nvme-dir-send.html | 2 +- Documentation/nvme-disconnect-all.1 | 4 +- Documentation/nvme-disconnect-all.html | 2 +- Documentation/nvme-disconnect.1 | 4 +- Documentation/nvme-disconnect.html | 2 +- Documentation/nvme-discover.1 | 4 +- Documentation/nvme-discover.html | 2 +- Documentation/nvme-dsm.1 | 4 +- Documentation/nvme-dsm.html | 2 +- Documentation/nvme-effects-log.1 | 4 +- Documentation/nvme-effects-log.html | 2 +- Documentation/nvme-endurance-event-agg-log.1 | 4 +- Documentation/nvme-endurance-event-agg-log.html | 2 +- Documentation/nvme-endurance-log.1 | 4 +- Documentation/nvme-endurance-log.html | 2 +- Documentation/nvme-error-log.1 | 4 +- Documentation/nvme-error-log.html | 2 +- Documentation/nvme-fdp-configs.1 | 4 +- Documentation/nvme-fdp-configs.html | 2 +- Documentation/nvme-fdp-events.1 | 4 +- Documentation/nvme-fdp-events.html | 2 +- Documentation/nvme-fdp-set-events.1 | 4 +- Documentation/nvme-fdp-set-events.html | 2 +- Documentation/nvme-fdp-stats.1 | 4 +- Documentation/nvme-fdp-stats.html | 2 +- Documentation/nvme-fdp-status.1 | 4 +- Documentation/nvme-fdp-status.html | 2 +- Documentation/nvme-fdp-update.1 | 4 +- Documentation/nvme-fdp-update.html | 2 +- Documentation/nvme-fdp-usage.1 | 4 +- Documentation/nvme-fdp-usage.html | 2 +- Documentation/nvme-fid-support-effects-log.1 | 4 +- Documentation/nvme-fid-support-effects-log.html | 2 +- Documentation/nvme-flush.1 | 4 +- Documentation/nvme-flush.html | 2 +- Documentation/nvme-format.1 | 4 +- Documentation/nvme-format.html | 2 +- Documentation/nvme-fw-commit.1 | 4 +- Documentation/nvme-fw-commit.html | 2 +- Documentation/nvme-fw-download.1 | 4 +- Documentation/nvme-fw-download.html | 2 +- Documentation/nvme-fw-log.1 | 4 +- Documentation/nvme-fw-log.html | 2 +- Documentation/nvme-gen-hostnqn.1 | 4 +- Documentation/nvme-gen-hostnqn.html | 2 +- Documentation/nvme-get-feature.1 | 10 +- Documentation/nvme-get-feature.html | 9 +- Documentation/nvme-get-feature.txt | 5 +- Documentation/nvme-get-lba-status.1 | 4 +- Documentation/nvme-get-lba-status.html | 2 +- Documentation/nvme-get-log.1 | 4 +- Documentation/nvme-get-log.html | 2 +- Documentation/nvme-get-ns-id.1 | 4 +- Documentation/nvme-get-ns-id.html | 2 +- Documentation/nvme-get-property.1 | 6 +- Documentation/nvme-get-property.html | 6 +- Documentation/nvme-get-property.txt | 4 +- Documentation/nvme-get-reg.txt | 138 ++ Documentation/nvme-help.1 | 4 +- Documentation/nvme-help.html | 2 +- Documentation/nvme-huawei-id-ctrl.1 | 4 +- Documentation/nvme-huawei-id-ctrl.html | 2 +- Documentation/nvme-huawei-list.1 | 4 +- Documentation/nvme-huawei-list.html | 2 +- Documentation/nvme-id-ctrl.1 | 4 +- Documentation/nvme-id-ctrl.html | 2 +- Documentation/nvme-id-domain.1 | 4 +- Documentation/nvme-id-domain.html | 2 +- Documentation/nvme-id-iocs.1 | 4 +- Documentation/nvme-id-iocs.html | 2 +- Documentation/nvme-id-ns-granularity.txt | 0 Documentation/nvme-id-ns.1 | 4 +- Documentation/nvme-id-ns.html | 2 +- Documentation/nvme-id-nvmset.1 | 4 +- Documentation/nvme-id-nvmset.html | 2 +- Documentation/nvme-id-uuid.txt | 0 Documentation/nvme-inspur-nvme-vendor-log.1 | 4 +- Documentation/nvme-inspur-nvme-vendor-log.html | 2 +- Documentation/nvme-intel-id-ctrl.1 | 4 +- Documentation/nvme-intel-id-ctrl.html | 2 +- Documentation/nvme-intel-internal-log.1 | 4 +- Documentation/nvme-intel-internal-log.html | 2 +- Documentation/nvme-intel-lat-stats.1 | 4 +- Documentation/nvme-intel-lat-stats.html | 2 +- Documentation/nvme-intel-market-name.1 | 4 +- Documentation/nvme-intel-market-name.html | 2 +- Documentation/nvme-intel-smart-log-add.1 | 4 +- Documentation/nvme-intel-smart-log-add.html | 2 +- Documentation/nvme-intel-temp-stats.1 | 4 +- Documentation/nvme-intel-temp-stats.html | 2 +- Documentation/nvme-io-mgmt-recv.1 | 4 +- Documentation/nvme-io-mgmt-recv.html | 2 +- Documentation/nvme-io-mgmt-send.1 | 4 +- Documentation/nvme-io-mgmt-send.html | 2 +- Documentation/nvme-io-passthru.1 | 15 +- Documentation/nvme-io-passthru.html | 14 +- Documentation/nvme-io-passthru.txt | 10 +- Documentation/nvme-lba-status-log.1 | 4 +- Documentation/nvme-lba-status-log.html | 2 +- Documentation/nvme-list-ctrl.1 | 4 +- Documentation/nvme-list-ctrl.html | 2 +- Documentation/nvme-list-endgrp.1 | 4 +- Documentation/nvme-list-endgrp.html | 2 +- Documentation/nvme-list-ns.1 | 4 +- Documentation/nvme-list-ns.html | 2 +- Documentation/nvme-list-secondary.txt | 0 Documentation/nvme-list-subsys.1 | 4 +- Documentation/nvme-list-subsys.html | 2 +- Documentation/nvme-list.1 | 4 +- Documentation/nvme-list.html | 2 +- Documentation/nvme-lockdown.1 | 4 +- Documentation/nvme-lockdown.html | 2 +- Documentation/nvme-mi-cmd-support-effects-log.1 | 4 +- Documentation/nvme-mi-cmd-support-effects-log.html | 2 +- Documentation/nvme-micron-clear-pcie-errors.1 | 4 +- Documentation/nvme-micron-clear-pcie-errors.html | 2 +- Documentation/nvme-micron-internal-log.1 | 4 +- Documentation/nvme-micron-internal-log.html | 2 +- Documentation/nvme-micron-nand-stats.1 | 4 +- Documentation/nvme-micron-nand-stats.html | 2 +- Documentation/nvme-micron-pcie-stats.1 | 4 +- Documentation/nvme-micron-pcie-stats.html | 2 +- Documentation/nvme-micron-selective-download.1 | 4 +- Documentation/nvme-micron-selective-download.html | 2 +- Documentation/nvme-micron-smart-add-log.1 | 4 +- Documentation/nvme-micron-smart-add-log.html | 2 +- Documentation/nvme-micron-temperature-stats.1 | 4 +- Documentation/nvme-micron-temperature-stats.html | 2 +- Documentation/nvme-netapp-ontapdevices.1 | 4 +- Documentation/nvme-netapp-ontapdevices.html | 2 +- Documentation/nvme-netapp-smdevices.1 | 4 +- Documentation/nvme-netapp-smdevices.html | 2 +- Documentation/nvme-ns-descs.1 | 4 +- Documentation/nvme-ns-descs.html | 2 +- Documentation/nvme-ns-rescan.1 | 4 +- Documentation/nvme-ns-rescan.html | 2 +- Documentation/nvme-nvm-id-ctrl.1 | 4 +- Documentation/nvme-nvm-id-ctrl.html | 2 +- Documentation/nvme-nvme-mi-recv.1 | 4 +- Documentation/nvme-nvme-mi-recv.html | 2 +- Documentation/nvme-nvme-mi-recv.txt | 0 Documentation/nvme-nvme-mi-send.1 | 4 +- Documentation/nvme-nvme-mi-send.html | 2 +- Documentation/nvme-nvme-mi-send.txt | 0 Documentation/nvme-ocp-clear-fw-activate-history.1 | 4 +- .../nvme-ocp-clear-fw-activate-history.html | 2 +- ...vme-ocp-clear-pcie-correctable-error-counters.1 | 4 +- ...-ocp-clear-pcie-correctable-error-counters.html | 2 +- Documentation/nvme-ocp-eol-plp-failure-mode.1 | 4 +- Documentation/nvme-ocp-eol-plp-failure-mode.html | 2 +- .../nvme-ocp-get-dssd-async-event-config.txt | 53 + Documentation/nvme-ocp-latency-monitor-log.1 | 4 +- Documentation/nvme-ocp-latency-monitor-log.html | 2 +- .../nvme-ocp-set-dssd-async-event-config.txt | 48 + Documentation/nvme-ocp-set-telemetry-profile.txt | 43 + Documentation/nvme-ocp-smart-add-log.1 | 4 +- Documentation/nvme-ocp-smart-add-log.html | 2 +- Documentation/nvme-persistent-event-log.1 | 4 +- Documentation/nvme-persistent-event-log.html | 2 +- Documentation/nvme-pred-lat-event-agg-log.1 | 4 +- Documentation/nvme-pred-lat-event-agg-log.html | 2 +- Documentation/nvme-predictable-lat-log.1 | 4 +- Documentation/nvme-predictable-lat-log.html | 2 +- Documentation/nvme-primary-ctrl-caps.1 | 4 +- Documentation/nvme-primary-ctrl-caps.html | 2 +- Documentation/nvme-read.1 | 4 +- Documentation/nvme-read.html | 2 +- Documentation/nvme-reset.1 | 4 +- Documentation/nvme-reset.html | 2 +- Documentation/nvme-resv-acquire.1 | 4 +- Documentation/nvme-resv-acquire.html | 2 +- Documentation/nvme-resv-notif-log.1 | 4 +- Documentation/nvme-resv-notif-log.html | 2 +- Documentation/nvme-resv-register.1 | 4 +- Documentation/nvme-resv-register.html | 2 +- Documentation/nvme-resv-release.1 | 4 +- Documentation/nvme-resv-release.html | 2 +- Documentation/nvme-resv-report.1 | 4 +- Documentation/nvme-resv-report.html | 2 +- Documentation/nvme-rpmb.1 | 4 +- Documentation/nvme-rpmb.html | 2 +- Documentation/nvme-sanitize-log.1 | 4 +- Documentation/nvme-sanitize-log.html | 2 +- Documentation/nvme-sanitize.1 | 4 +- Documentation/nvme-sanitize.html | 2 +- .../nvme-seagate-clear-fw-activate-history.1 | 4 +- .../nvme-seagate-clear-fw-activate-history.html | 2 +- .../nvme-seagate-clear-pcie-correctable-errors.1 | 4 +- ...nvme-seagate-clear-pcie-correctable-errors.html | 2 +- .../nvme-seagate-cloud-SSD-plugin-version.1 | 4 +- .../nvme-seagate-cloud-SSD-plugin-version.html | 2 +- Documentation/nvme-seagate-get-ctrl-tele.1 | 4 +- Documentation/nvme-seagate-get-ctrl-tele.html | 2 +- Documentation/nvme-seagate-get-host-tele.1 | 4 +- Documentation/nvme-seagate-get-host-tele.html | 2 +- Documentation/nvme-seagate-help.1 | 4 +- Documentation/nvme-seagate-help.html | 2 +- Documentation/nvme-seagate-plugin-version.1 | 4 +- Documentation/nvme-seagate-plugin-version.html | 2 +- Documentation/nvme-seagate-version.1 | 4 +- Documentation/nvme-seagate-version.html | 2 +- .../nvme-seagate-vs-fw-activate-history.1 | 4 +- .../nvme-seagate-vs-fw-activate-history.html | 2 +- Documentation/nvme-seagate-vs-internal-log.1 | 4 +- Documentation/nvme-seagate-vs-internal-log.html | 2 +- Documentation/nvme-seagate-vs-log-page-sup.1 | 4 +- Documentation/nvme-seagate-vs-log-page-sup.html | 2 +- Documentation/nvme-seagate-vs-pcie-stats.1 | 4 +- Documentation/nvme-seagate-vs-pcie-stats.html | 2 +- Documentation/nvme-seagate-vs-smart-add-log.1 | 4 +- Documentation/nvme-seagate-vs-smart-add-log.html | 2 +- Documentation/nvme-seagate-vs-temperature-stats.1 | 4 +- .../nvme-seagate-vs-temperature-stats.html | 2 +- Documentation/nvme-security-recv.1 | 4 +- Documentation/nvme-security-recv.html | 2 +- Documentation/nvme-security-send.1 | 4 +- Documentation/nvme-security-send.html | 2 +- Documentation/nvme-self-test-log.1 | 4 +- Documentation/nvme-self-test-log.html | 2 +- Documentation/nvme-set-feature.1 | 10 +- Documentation/nvme-set-feature.html | 16 +- Documentation/nvme-set-feature.txt | 5 + Documentation/nvme-set-property.1 | 10 +- Documentation/nvme-set-property.html | 12 +- Documentation/nvme-set-property.txt | 8 +- Documentation/nvme-set-reg.txt | 102 ++ Documentation/nvme-show-hostnqn.1 | 4 +- Documentation/nvme-show-hostnqn.html | 2 +- Documentation/nvme-show-regs.1 | 4 +- Documentation/nvme-show-regs.html | 2 +- Documentation/nvme-show-topology.1 | 4 +- Documentation/nvme-show-topology.html | 2 +- Documentation/nvme-smart-log.1 | 4 +- Documentation/nvme-smart-log.html | 2 +- Documentation/nvme-subsystem-reset.1 | 4 +- Documentation/nvme-subsystem-reset.html | 2 +- Documentation/nvme-supported-log-pages.1 | 4 +- Documentation/nvme-supported-log-pages.html | 2 +- Documentation/nvme-telemetry-log.1 | 4 +- Documentation/nvme-telemetry-log.html | 2 +- Documentation/nvme-tls-key.txt | 69 + .../nvme-toshiba-clear-pcie-correctable-errors.1 | 4 +- ...nvme-toshiba-clear-pcie-correctable-errors.html | 2 +- Documentation/nvme-toshiba-vs-internal-log.1 | 4 +- Documentation/nvme-toshiba-vs-internal-log.html | 2 +- Documentation/nvme-toshiba-vs-smart-add-log.1 | 4 +- Documentation/nvme-toshiba-vs-smart-add-log.html | 2 +- Documentation/nvme-transcend-badblock.1 | 4 +- Documentation/nvme-transcend-badblock.html | 2 +- Documentation/nvme-transcend-healthvalue.1 | 4 +- Documentation/nvme-transcend-healthvalue.html | 2 +- Documentation/nvme-verify.1 | 4 +- Documentation/nvme-verify.html | 2 +- Documentation/nvme-virt-mgmt.txt | 0 .../nvme-virtium-save-smart-to-vtview-log.1 | 4 +- .../nvme-virtium-save-smart-to-vtview-log.html | 2 +- Documentation/nvme-virtium-show-identify.1 | 4 +- Documentation/nvme-virtium-show-identify.html | 2 +- Documentation/nvme-wdc-cap-diag.1 | 4 +- Documentation/nvme-wdc-cap-diag.html | 2 +- Documentation/nvme-wdc-capabilities.1 | 4 +- Documentation/nvme-wdc-capabilities.html | 2 +- Documentation/nvme-wdc-clear-assert-dump.1 | 4 +- Documentation/nvme-wdc-clear-assert-dump.html | 2 +- Documentation/nvme-wdc-clear-fw-activate-history.1 | 4 +- .../nvme-wdc-clear-fw-activate-history.html | 2 +- .../nvme-wdc-clear-pcie-correctable-errors.1 | 4 +- .../nvme-wdc-clear-pcie-correctable-errors.html | 2 +- Documentation/nvme-wdc-cloud-SSD-plugin-version.1 | 4 +- .../nvme-wdc-cloud-SSD-plugin-version.html | 2 +- Documentation/nvme-wdc-cloud-boot-SSD-version.1 | 4 +- Documentation/nvme-wdc-cloud-boot-SSD-version.html | 2 +- Documentation/nvme-wdc-drive-essentials.1 | 4 +- Documentation/nvme-wdc-drive-essentials.html | 2 +- Documentation/nvme-wdc-drive-log.1 | 4 +- Documentation/nvme-wdc-drive-log.html | 2 +- Documentation/nvme-wdc-drive-resize.1 | 4 +- Documentation/nvme-wdc-drive-resize.html | 2 +- Documentation/nvme-wdc-enc-get-log.1 | 4 +- Documentation/nvme-wdc-enc-get-log.html | 2 +- Documentation/nvme-wdc-get-crash-dump.1 | 4 +- Documentation/nvme-wdc-get-crash-dump.html | 2 +- Documentation/nvme-wdc-get-dev-capabilities-log.1 | 4 +- .../nvme-wdc-get-dev-capabilities-log.html | 2 +- Documentation/nvme-wdc-get-drive-status.1 | 4 +- Documentation/nvme-wdc-get-drive-status.html | 2 +- Documentation/nvme-wdc-get-error-recovery-log.1 | 4 +- Documentation/nvme-wdc-get-error-recovery-log.html | 2 +- Documentation/nvme-wdc-get-latency-monitor-log.1 | 4 +- .../nvme-wdc-get-latency-monitor-log.html | 2 +- Documentation/nvme-wdc-get-pfail-dump.1 | 4 +- Documentation/nvme-wdc-get-pfail-dump.html | 2 +- Documentation/nvme-wdc-get-unsupported-reqs-log.1 | 4 +- .../nvme-wdc-get-unsupported-reqs-log.html | 2 +- Documentation/nvme-wdc-id-ctrl.1 | 4 +- Documentation/nvme-wdc-id-ctrl.html | 2 +- Documentation/nvme-wdc-log-page-directory.1 | 4 +- Documentation/nvme-wdc-log-page-directory.html | 2 +- Documentation/nvme-wdc-namespace-resize.1 | 4 +- Documentation/nvme-wdc-namespace-resize.html | 2 +- Documentation/nvme-wdc-purge-monitor.1 | 4 +- Documentation/nvme-wdc-purge-monitor.html | 2 +- Documentation/nvme-wdc-purge.1 | 4 +- Documentation/nvme-wdc-purge.html | 2 +- Documentation/nvme-wdc-vs-cloud-log.1 | 4 +- Documentation/nvme-wdc-vs-cloud-log.html | 2 +- Documentation/nvme-wdc-vs-device-waf.1 | 4 +- Documentation/nvme-wdc-vs-device-waf.html | 2 +- Documentation/nvme-wdc-vs-drive-info.1 | 4 +- Documentation/nvme-wdc-vs-drive-info.html | 2 +- .../nvme-wdc-vs-error-reason-identifier.1 | 4 +- .../nvme-wdc-vs-error-reason-identifier.html | 2 +- Documentation/nvme-wdc-vs-fw-activate-history.1 | 4 +- Documentation/nvme-wdc-vs-fw-activate-history.html | 2 +- Documentation/nvme-wdc-vs-hw-rev-log.1 | 4 +- Documentation/nvme-wdc-vs-hw-rev-log.html | 2 +- Documentation/nvme-wdc-vs-internal-log.1 | 4 +- Documentation/nvme-wdc-vs-internal-log.html | 2 +- Documentation/nvme-wdc-vs-nand-stats.1 | 4 +- Documentation/nvme-wdc-vs-nand-stats.html | 2 +- Documentation/nvme-wdc-vs-smart-add-log.1 | 4 +- Documentation/nvme-wdc-vs-smart-add-log.html | 2 +- .../nvme-wdc-vs-telemetry-controller-option.1 | 4 +- .../nvme-wdc-vs-telemetry-controller-option.html | 2 +- Documentation/nvme-wdc-vs-temperature-stats.1 | 4 +- Documentation/nvme-wdc-vs-temperature-stats.html | 2 +- Documentation/nvme-write-uncor.1 | 4 +- Documentation/nvme-write-uncor.html | 2 +- Documentation/nvme-write-zeroes.1 | 4 +- Documentation/nvme-write-zeroes.html | 2 +- Documentation/nvme-write.1 | 4 +- Documentation/nvme-write.html | 2 +- Documentation/nvme-zns-changed-zone-list.1 | 4 +- Documentation/nvme-zns-changed-zone-list.html | 2 +- Documentation/nvme-zns-close-zone.1 | 4 +- Documentation/nvme-zns-close-zone.html | 2 +- Documentation/nvme-zns-finish-zone.1 | 4 +- Documentation/nvme-zns-finish-zone.html | 2 +- Documentation/nvme-zns-id-ctrl.1 | 4 +- Documentation/nvme-zns-id-ctrl.html | 2 +- Documentation/nvme-zns-id-ns.1 | 4 +- Documentation/nvme-zns-id-ns.html | 2 +- Documentation/nvme-zns-offline-zone.1 | 4 +- Documentation/nvme-zns-offline-zone.html | 2 +- Documentation/nvme-zns-open-zone.1 | 4 +- Documentation/nvme-zns-open-zone.html | 2 +- Documentation/nvme-zns-report-zones.1 | 4 +- Documentation/nvme-zns-report-zones.html | 2 +- Documentation/nvme-zns-reset-zone.1 | 4 +- Documentation/nvme-zns-reset-zone.html | 2 +- Documentation/nvme-zns-set-zone-desc.1 | 4 +- Documentation/nvme-zns-set-zone-desc.html | 2 +- Documentation/nvme-zns-zone-append.1 | 4 +- Documentation/nvme-zns-zone-append.html | 2 +- Documentation/nvme-zns-zone-mgmt-recv.1 | 4 +- Documentation/nvme-zns-zone-mgmt-recv.html | 2 +- Documentation/nvme-zns-zone-mgmt-send.1 | 4 +- Documentation/nvme-zns-zone-mgmt-send.html | 2 +- Documentation/nvme.1 | 4 +- Documentation/nvme.html | 2 +- common.h | 23 +- completions/_nvme | 111 ++ completions/bash-nvme-completion.sh | 29 +- fabrics.c | 80 +- meson.build | 8 +- nbft.c | 182 ++- nbft.h | 2 +- nvme-builtin.h | 3 + nvme-print-json.c | 358 ++++- nvme-print-stdout.c | 947 ++++++------ nvme-print.c | 371 +++-- nvme-print.h | 12 +- nvme-wrap.c | 21 +- nvme-wrap.h | 8 +- nvme.c | 1118 +++++++++++--- nvme.h | 5 +- nvme.spec.in | 2 + .../systemd/nvmefc-boot-connections.service.in | 12 + .../systemd/nvmf-autoconnect.service.in | 12 + .../systemd/nvmf-connect-nbft.service.in | 12 + nvmf-autoconnect/systemd/nvmf-connect@.service.in | 12 + .../udev-rules/70-nvmf-autoconnect.rules.in | 6 +- plugins/memblaze/memblaze-nvme.c | 882 ++++++++--- plugins/memblaze/memblaze-nvme.h | 42 +- plugins/meson.build | 3 +- plugins/micron/micron-nvme.c | 36 +- plugins/nbft/nbft-plugin.c | 22 +- plugins/netapp/netapp-nvme.c | 43 +- plugins/ocp/ocp-clear-features.c | 2 +- plugins/ocp/ocp-fw-activation-history.c | 6 +- plugins/ocp/ocp-nvme.c | 1526 +++++++++++--------- plugins/ocp/ocp-nvme.h | 3 + plugins/ocp/ocp-utils.c | 27 +- plugins/ocp/ocp-utils.h | 22 +- plugins/sed/sedopal_cmd.c | 19 +- plugins/solidigm/solidigm-garbage-collection.c | 4 +- plugins/solidigm/solidigm-latency-tracking.c | 4 +- plugins/solidigm/solidigm-log-page-dir.c | 74 +- plugins/solidigm/solidigm-nvme.h | 2 +- plugins/solidigm/solidigm-smart.c | 4 +- plugins/solidigm/solidigm-temp-stats.c | 34 +- plugins/solidigm/solidigm-util.c | 33 +- plugins/solidigm/solidigm-util.h | 5 +- plugins/ssstc/ssstc-nvme.c | 430 ++++++ plugins/ssstc/ssstc-nvme.h | 16 + plugins/wdc/wdc-nvme.c | 327 ++--- plugins/wdc/wdc-nvme.h | 2 +- plugins/wdc/wdc-utils.c | 2 +- subprojects/libnvme.wrap | 2 +- util/logging.c | 138 ++ util/logging.h | 12 + util/meson.build | 1 + 451 files changed, 5974 insertions(+), 2812 deletions(-) create mode 100644 Documentation/nvme-get-reg.txt mode change 100755 => 100644 Documentation/nvme-id-ns-granularity.txt mode change 100755 => 100644 Documentation/nvme-id-uuid.txt mode change 100755 => 100644 Documentation/nvme-list-secondary.txt mode change 100755 => 100644 Documentation/nvme-nvme-mi-recv.txt mode change 100755 => 100644 Documentation/nvme-nvme-mi-send.txt create mode 100644 Documentation/nvme-ocp-get-dssd-async-event-config.txt create mode 100644 Documentation/nvme-ocp-set-dssd-async-event-config.txt create mode 100644 Documentation/nvme-ocp-set-telemetry-profile.txt create mode 100644 Documentation/nvme-set-reg.txt create mode 100644 Documentation/nvme-tls-key.txt mode change 100755 => 100644 Documentation/nvme-virt-mgmt.txt create mode 100644 plugins/ssstc/ssstc-nvme.c create mode 100644 plugins/ssstc/ssstc-nvme.h create mode 100644 util/logging.c create mode 100644 util/logging.h diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 6c0d3e5..53fed3a 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -42,7 +42,7 @@ jobs: workflow: ${{ github.event.workflow_run.workflow_id }} workflow_conclusion: success - name: FTP Deployer - uses: sand4rt/ftp-deployer@v1.7 + uses: sand4rt/ftp-deployer@v1.8 with: sftp: true host: ${{ secrets.SFTP_SERVER }} diff --git a/Documentation/nvme-admin-passthru.1 b/Documentation/nvme-admin-passthru.1 index b057dec..dfdc6d5 100644 --- a/Documentation/nvme-admin-passthru.1 +++ b/Documentation/nvme-admin-passthru.1 @@ -2,12 +2,12 @@ .\" Title: nvme-admin-passthru .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ADMIN\-PASSTHR" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ADMIN\-PASSTHR" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -35,10 +35,10 @@ nvme-admin-passthru \- Submit an arbitrary admin command, return results \fInvme\-admin\-passthru\fR [\-\-opcode= | \-O ] [\-\-flags= | \-f ] [\-rsvd= | \-R ] [\-\-namespace\-id= | \-n ] [\-\-cdw2= | \-2 ] - [\-\-cdw3= | \-3 ] [\-\-cdw10= | \-4 ] - [\-\-cdw11= | \-5 ] [\-\-cdw12= | \-6 ] - [\-\-cdw13= | \-7 ] [\-\-cdw14= | \-8 ] - [\-\-cdw15= | \-9 ] + [\-\-cdw3= | \-3 ] [\-\-cdw10= | \-4 ] + [\-\-cdw11= | \-5 ] [\-\-cdw12= | \-6 ] + [\-\-cdw13= | \-7 ] [\-\-cdw14= | \-8 ] + [\-\-cdw15= | \-9 ] [\-\-data\-len= | \-l ] [\-\-metadata\-len= | \-m ] [\-\-input\-file= | \-i ] diff --git a/Documentation/nvme-admin-passthru.html b/Documentation/nvme-admin-passthru.html index 7a4f6ac..9b0e6fe 100644 --- a/Documentation/nvme-admin-passthru.html +++ b/Documentation/nvme-admin-passthru.html @@ -752,10 +752,10 @@ nvme-admin-passthru(1) Manual Page
nvme-admin-passthru <device> [--opcode=<opcode> | -O <opcode>]
                         [--flags=<flags> | -f <flags>] [-rsvd=<rsvd> | -R <rsvd>]
                         [--namespace-id=<nsid> | -n <nsid>] [--cdw2=<cdw2> | -2 <cdw2>]
-                        [--cdw3=<cdw3> | -3 <cdw3>] [--cdw10=<cdw10> | -4 <cdw4>]
-                        [--cdw11=<cdw11> | -5 <cdw5>] [--cdw12=<cdw12> | -6 <cdw6>]
-                        [--cdw13=<cdw13> | -7 <cdw7>] [--cdw14=<cdw14> | -8 <cdw8>]
-                        [--cdw15=<cdw15> | -9 <cdw9>]
+                        [--cdw3=<cdw3> | -3 <cdw3>] [--cdw10=<cdw10> | -4 <cdw10>]
+                        [--cdw11=<cdw11> | -5 <cdw11>] [--cdw12=<cdw12> | -6 <cdw12>]
+                        [--cdw13=<cdw13> | -7 <cdw13>] [--cdw14=<cdw14> | -8 <cdw14>]
+                        [--cdw15=<cdw15> | -9 <cdw15>]
                         [--data-len=<data-len> | -l <data-len>]
                         [--metadata-len=<len> | -m <len>]
                         [--input-file=<file> | -i <file>]
@@ -1027,7 +1027,7 @@ Or if you want to save that structure to a file:
 
 
diff --git a/Documentation/nvme-admin-passthru.txt b/Documentation/nvme-admin-passthru.txt
index 22559db..51e9e07 100644
--- a/Documentation/nvme-admin-passthru.txt
+++ b/Documentation/nvme-admin-passthru.txt
@@ -11,10 +11,10 @@ SYNOPSIS
 'nvme-admin-passthru'  [--opcode= | -O ]
 			[--flags= | -f ] [-rsvd= | -R ]
 			[--namespace-id= | -n ] [--cdw2= | -2 ]
-			[--cdw3= | -3 ] [--cdw10= | -4 ]
-			[--cdw11= | -5 ] [--cdw12= | -6 ]
-			[--cdw13= | -7 ] [--cdw14= | -8 ]
-			[--cdw15= | -9 ]
+			[--cdw3= | -3 ] [--cdw10= | -4 ]
+			[--cdw11= | -5 ] [--cdw12= | -6 ]
+			[--cdw13= | -7 ] [--cdw14= | -8 ]
+			[--cdw15= | -9 ]
 			[--data-len= | -l ]
 			[--metadata-len= | -m ]
 			[--input-file= | -i ]
diff --git a/Documentation/nvme-ana-log.1 b/Documentation/nvme-ana-log.1
index eb3042a..a3be9dc 100644
--- a/Documentation/nvme-ana-log.1
+++ b/Documentation/nvme-ana-log.1
@@ -2,12 +2,12 @@
 .\"     Title: nvme-ana-log
 .\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
 .\" Generator: DocBook XSL Stylesheets vsnapshot 
-.\"      Date: 02/14/2024
+.\"      Date: 05/03/2024
 .\"    Manual: NVMe Manual
 .\"    Source: NVMe
 .\"  Language: English
 .\"
-.TH "NVME\-ANA\-LOG" "1" "02/14/2024" "NVMe" "NVMe Manual"
+.TH "NVME\-ANA\-LOG" "1" "05/03/2024" "NVMe" "NVMe Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff --git a/Documentation/nvme-ana-log.html b/Documentation/nvme-ana-log.html
index 2adec9f..758400d 100644
--- a/Documentation/nvme-ana-log.html
+++ b/Documentation/nvme-ana-log.html
@@ -835,7 +835,7 @@ Print the ANA log page in a human readable format:
 
 
diff --git a/Documentation/nvme-attach-ns.1 b/Documentation/nvme-attach-ns.1
index 0eb5c2c..89ce4e6 100644
--- a/Documentation/nvme-attach-ns.1
+++ b/Documentation/nvme-attach-ns.1
@@ -2,12 +2,12 @@
 .\"     Title: nvme-attach-ns
 .\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
 .\" Generator: DocBook XSL Stylesheets vsnapshot 
-.\"      Date: 02/14/2024
+.\"      Date: 05/03/2024
 .\"    Manual: NVMe Manual
 .\"    Source: NVMe
 .\"  Language: English
 .\"
-.TH "NVME\-ATTACH\-NS" "1" "02/14/2024" "NVMe" "NVMe Manual"
+.TH "NVME\-ATTACH\-NS" "1" "05/03/2024" "NVMe" "NVMe Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff --git a/Documentation/nvme-attach-ns.html b/Documentation/nvme-attach-ns.html
index eae3957..04eba16 100644
--- a/Documentation/nvme-attach-ns.html
+++ b/Documentation/nvme-attach-ns.html
@@ -841,7 +841,7 @@ controller identifiers.

diff --git a/Documentation/nvme-boot-part-log.1 b/Documentation/nvme-boot-part-log.1 index 6bbd3a3..59a8aa4 100644 --- a/Documentation/nvme-boot-part-log.1 +++ b/Documentation/nvme-boot-part-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-boot-part-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-BOOT\-PART\-LO" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-BOOT\-PART\-LO" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-boot-part-log.html b/Documentation/nvme-boot-part-log.html index 64a79e5..66eba37 100644 --- a/Documentation/nvme-boot-part-log.html +++ b/Documentation/nvme-boot-part-log.html @@ -846,7 +846,7 @@ Retrieve Boot Partition data to boot_part_log.bin diff --git a/Documentation/nvme-capacity-mgmt.1 b/Documentation/nvme-capacity-mgmt.1 index 19593c4..d5827a4 100644 --- a/Documentation/nvme-capacity-mgmt.1 +++ b/Documentation/nvme-capacity-mgmt.1 @@ -2,12 +2,12 @@ .\" Title: nvme-capacity-mgmt .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CAPACITY\-MGMT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-CAPACITY\-MGMT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-capacity-mgmt.html b/Documentation/nvme-capacity-mgmt.html index 29cc903..6c61b6c 100644 --- a/Documentation/nvme-capacity-mgmt.html +++ b/Documentation/nvme-capacity-mgmt.html @@ -863,7 +863,7 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-changed-ns-list-log.1 b/Documentation/nvme-changed-ns-list-log.1 index 2ab0d3b..2856bd2 100644 --- a/Documentation/nvme-changed-ns-list-log.1 +++ b/Documentation/nvme-changed-ns-list-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-changed-ns-list-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CHANGED\-NS\-L" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-CHANGED\-NS\-L" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-changed-ns-list-log.html b/Documentation/nvme-changed-ns-list-log.html index 2b7aa28..c63e40a 100644 --- a/Documentation/nvme-changed-ns-list-log.html +++ b/Documentation/nvme-changed-ns-list-log.html @@ -846,7 +846,7 @@ Print the raw Changed Namespace List log to a file: diff --git a/Documentation/nvme-cmdset-ind-id-ns.1 b/Documentation/nvme-cmdset-ind-id-ns.1 index 7d6053d..eff07d1 100644 --- a/Documentation/nvme-cmdset-ind-id-ns.1 +++ b/Documentation/nvme-cmdset-ind-id-ns.1 @@ -2,12 +2,12 @@ .\" Title: nvme-cmdset-ind-id-ns .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CMDSET\-IND\-I" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-CMDSET\-IND\-I" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-cmdset-ind-id-ns.html b/Documentation/nvme-cmdset-ind-id-ns.html index 59a36f0..86766cc 100644 --- a/Documentation/nvme-cmdset-ind-id-ns.html +++ b/Documentation/nvme-cmdset-ind-id-ns.html @@ -889,7 +889,7 @@ Have the program return the raw structure in binary: diff --git a/Documentation/nvme-compare.1 b/Documentation/nvme-compare.1 index 68b0f75..0448c13 100644 --- a/Documentation/nvme-compare.1 +++ b/Documentation/nvme-compare.1 @@ -2,12 +2,12 @@ .\" Title: nvme-compare .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-COMPARE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-COMPARE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-compare.html b/Documentation/nvme-compare.html index e05cb8a..76a5ac6 100644 --- a/Documentation/nvme-compare.html +++ b/Documentation/nvme-compare.html @@ -1116,7 +1116,7 @@ metadata is passes.

diff --git a/Documentation/nvme-connect-all.1 b/Documentation/nvme-connect-all.1 index 3ee4f6d..996276f 100644 --- a/Documentation/nvme-connect-all.1 +++ b/Documentation/nvme-connect-all.1 @@ -2,12 +2,12 @@ .\" Title: nvme-connect-all .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CONNECT\-ALL" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-CONNECT\-ALL" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-connect-all.html b/Documentation/nvme-connect-all.html index 5a3ef23..8e544ec 100644 --- a/Documentation/nvme-connect-all.html +++ b/Documentation/nvme-connect-all.html @@ -1276,7 +1276,7 @@ nvme-connect(1)

diff --git a/Documentation/nvme-connect.1 b/Documentation/nvme-connect.1 index 0210d8a..d52f721 100644 --- a/Documentation/nvme-connect.1 +++ b/Documentation/nvme-connect.1 @@ -2,12 +2,12 @@ .\" Title: nvme-connect .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CONNECT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-CONNECT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-connect.html b/Documentation/nvme-connect.html index a3e1ff5..0b13a38 100644 --- a/Documentation/nvme-connect.html +++ b/Documentation/nvme-connect.html @@ -1219,7 +1219,7 @@ and Christoph Hellwig

diff --git a/Documentation/nvme-copy.1 b/Documentation/nvme-copy.1 index 6e0c67d..75e9068 100644 --- a/Documentation/nvme-copy.1 +++ b/Documentation/nvme-copy.1 @@ -2,12 +2,12 @@ .\" Title: nvme-copy .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-COPY" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-COPY" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-copy.html b/Documentation/nvme-copy.html index 54921be..bcd1f4e 100644 --- a/Documentation/nvme-copy.html +++ b/Documentation/nvme-copy.html @@ -1030,7 +1030,7 @@ logical block ranges to a single consecutive destination logical block range.

diff --git a/Documentation/nvme-create-ns.1 b/Documentation/nvme-create-ns.1 index b4818bd..85fd6c4 100644 --- a/Documentation/nvme-create-ns.1 +++ b/Documentation/nvme-create-ns.1 @@ -2,12 +2,12 @@ .\" Title: nvme-create-ns .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CREATE\-NS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-CREATE\-NS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-create-ns.html b/Documentation/nvme-create-ns.html index c3a9ece..dcdeb3b 100644 --- a/Documentation/nvme-create-ns.html +++ b/Documentation/nvme-create-ns.html @@ -1071,7 +1071,7 @@ Create a namespace: diff --git a/Documentation/nvme-delete-ns.1 b/Documentation/nvme-delete-ns.1 index 80454d1..15451d1 100644 --- a/Documentation/nvme-delete-ns.1 +++ b/Documentation/nvme-delete-ns.1 @@ -2,12 +2,12 @@ .\" Title: nvme-id-ns .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-NS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-NS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-delete-ns.html b/Documentation/nvme-delete-ns.html index eb379d3..abc5c6f 100644 --- a/Documentation/nvme-delete-ns.html +++ b/Documentation/nvme-delete-ns.html @@ -823,7 +823,7 @@ The '--namespace-id' option is mandatory.

diff --git a/Documentation/nvme-dera-stat.1 b/Documentation/nvme-dera-stat.1 index 5469c14..4c769ef 100644 --- a/Documentation/nvme-dera-stat.1 +++ b/Documentation/nvme-dera-stat.1 @@ -2,12 +2,12 @@ .\" Title: nvme-dera-stat .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DERA\-STAT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-DERA\-STAT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-dera-stat.html b/Documentation/nvme-dera-stat.html index c265ee7..ed01f01 100644 --- a/Documentation/nvme-dera-stat.html +++ b/Documentation/nvme-dera-stat.html @@ -797,7 +797,7 @@ Print the Dera Device status and Additional SMART log page in a human readable f diff --git a/Documentation/nvme-detach-ns.1 b/Documentation/nvme-detach-ns.1 index 70c29a4..35a40d5 100644 --- a/Documentation/nvme-detach-ns.1 +++ b/Documentation/nvme-detach-ns.1 @@ -2,12 +2,12 @@ .\" Title: nvme-detach-ns .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DETACH\-NS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-DETACH\-NS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-detach-ns.html b/Documentation/nvme-detach-ns.html index 28d2c7c..79e524b 100644 --- a/Documentation/nvme-detach-ns.html +++ b/Documentation/nvme-detach-ns.html @@ -834,7 +834,7 @@ controller identifiers.

diff --git a/Documentation/nvme-device-self-test.1 b/Documentation/nvme-device-self-test.1 index 605baf8..a97f4fb 100644 --- a/Documentation/nvme-device-self-test.1 +++ b/Documentation/nvme-device-self-test.1 @@ -2,12 +2,12 @@ .\" Title: nvme-device-self-test .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DEVICE\-SELF\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-DEVICE\-SELF\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-device-self-test.html b/Documentation/nvme-device-self-test.html index ea0cb13..468765c 100644 --- a/Documentation/nvme-device-self-test.html +++ b/Documentation/nvme-device-self-test.html @@ -872,7 +872,7 @@ Abort the device self-test operation in the namespace-id 1: diff --git a/Documentation/nvme-dim.1 b/Documentation/nvme-dim.1 index f9245ea..5ae4d80 100644 --- a/Documentation/nvme-dim.1 +++ b/Documentation/nvme-dim.1 @@ -2,12 +2,12 @@ .\" Title: nvme-dim .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DIM" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-DIM" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-dim.html b/Documentation/nvme-dim.html index 2678197..1561b78 100644 --- a/Documentation/nvme-dim.html +++ b/Documentation/nvme-dim.html @@ -885,7 +885,7 @@ Deregister from Central Discovery Controller (CDC) associated with nvme4 diff --git a/Documentation/nvme-dir-receive.1 b/Documentation/nvme-dir-receive.1 index 2d62d2d..0eaeb41 100644 --- a/Documentation/nvme-dir-receive.1 +++ b/Documentation/nvme-dir-receive.1 @@ -2,12 +2,12 @@ .\" Title: nvme-dir-receive .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DIR\-RECEIVE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-DIR\-RECEIVE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-dir-receive.html b/Documentation/nvme-dir-receive.html index 49d29f9..07c49d2 100644 --- a/Documentation/nvme-dir-receive.html +++ b/Documentation/nvme-dir-receive.html @@ -989,7 +989,7 @@ Get streams directive status : diff --git a/Documentation/nvme-dir-send.1 b/Documentation/nvme-dir-send.1 index 482c777..2655e9f 100644 --- a/Documentation/nvme-dir-send.1 +++ b/Documentation/nvme-dir-send.1 @@ -2,12 +2,12 @@ .\" Title: nvme-dir-send .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DIR\-SEND" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-DIR\-SEND" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-dir-send.html b/Documentation/nvme-dir-send.html index a8182fa..63c7e69 100644 --- a/Documentation/nvme-dir-send.html +++ b/Documentation/nvme-dir-send.html @@ -1002,7 +1002,7 @@ Release stream ID 3 : diff --git a/Documentation/nvme-disconnect-all.1 b/Documentation/nvme-disconnect-all.1 index 9652365..4af7e9d 100644 --- a/Documentation/nvme-disconnect-all.1 +++ b/Documentation/nvme-disconnect-all.1 @@ -2,12 +2,12 @@ .\" Title: nvme-disconnect-all .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DISCONNECT\-AL" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-DISCONNECT\-AL" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-disconnect-all.html b/Documentation/nvme-disconnect-all.html index 59b545e..9b286ad 100644 --- a/Documentation/nvme-disconnect-all.html +++ b/Documentation/nvme-disconnect-all.html @@ -825,7 +825,7 @@ Disconnect all existing nvme controllers: diff --git a/Documentation/nvme-disconnect.1 b/Documentation/nvme-disconnect.1 index 2fcf331..85f31aa 100644 --- a/Documentation/nvme-disconnect.1 +++ b/Documentation/nvme-disconnect.1 @@ -2,12 +2,12 @@ .\" Title: nvme-disconnect .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DISCONNECT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-DISCONNECT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-disconnect.html b/Documentation/nvme-disconnect.html index 486efb4..019dfa1 100644 --- a/Documentation/nvme-disconnect.html +++ b/Documentation/nvme-disconnect.html @@ -862,7 +862,7 @@ Disconnect the controller nvme4 diff --git a/Documentation/nvme-discover.1 b/Documentation/nvme-discover.1 index c099d1a..cdb694e 100644 --- a/Documentation/nvme-discover.1 +++ b/Documentation/nvme-discover.1 @@ -2,12 +2,12 @@ .\" Title: nvme-discover .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DISCOVER" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-DISCOVER" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-discover.html b/Documentation/nvme-discover.html index 0d5f6a9..53fe875 100644 --- a/Documentation/nvme-discover.html +++ b/Documentation/nvme-discover.html @@ -1325,7 +1325,7 @@ nvme-connect-all(1)

diff --git a/Documentation/nvme-dsm.1 b/Documentation/nvme-dsm.1 index ba3b709..6681d5f 100644 --- a/Documentation/nvme-dsm.1 +++ b/Documentation/nvme-dsm.1 @@ -2,12 +2,12 @@ .\" Title: nvme-dsm .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DSM" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-DSM" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-dsm.html b/Documentation/nvme-dsm.html index f5b4de2..b4af212 100644 --- a/Documentation/nvme-dsm.html +++ b/Documentation/nvme-dsm.html @@ -918,7 +918,7 @@ any settings from the flags may have provided.

diff --git a/Documentation/nvme-effects-log.1 b/Documentation/nvme-effects-log.1 index 112c264..4adf0bd 100644 --- a/Documentation/nvme-effects-log.1 +++ b/Documentation/nvme-effects-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-effects-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-EFFECTS\-LOG" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-EFFECTS\-LOG" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-effects-log.html b/Documentation/nvme-effects-log.html index b7570a9..effc5d8 100644 --- a/Documentation/nvme-effects-log.html +++ b/Documentation/nvme-effects-log.html @@ -857,7 +857,7 @@ Have the program return the raw structure in binary: diff --git a/Documentation/nvme-endurance-event-agg-log.1 b/Documentation/nvme-endurance-event-agg-log.1 index 08c22e9..ec21f43 100644 --- a/Documentation/nvme-endurance-event-agg-log.1 +++ b/Documentation/nvme-endurance-event-agg-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-endurance-event-agg-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ENDURANCE\-EVE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ENDURANCE\-EVE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-endurance-event-agg-log.html b/Documentation/nvme-endurance-event-agg-log.html index 0bfc9e1..b990748 100644 --- a/Documentation/nvme-endurance-event-agg-log.html +++ b/Documentation/nvme-endurance-event-agg-log.html @@ -862,7 +862,7 @@ Print the raw Endurance log to a file: diff --git a/Documentation/nvme-endurance-log.1 b/Documentation/nvme-endurance-log.1 index 91cbdc1..5ec9a68 100644 --- a/Documentation/nvme-endurance-log.1 +++ b/Documentation/nvme-endurance-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-endurance-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ENDURANCE\-LOG" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ENDURANCE\-LOG" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-endurance-log.html b/Documentation/nvme-endurance-log.html index 49ee586..b59945b 100644 --- a/Documentation/nvme-endurance-log.html +++ b/Documentation/nvme-endurance-log.html @@ -845,7 +845,7 @@ Print the raw Endurance log to a file: diff --git a/Documentation/nvme-error-log.1 b/Documentation/nvme-error-log.1 index b710a06..7758f3e 100644 --- a/Documentation/nvme-error-log.1 +++ b/Documentation/nvme-error-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-error-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ERROR\-LOG" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ERROR\-LOG" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-error-log.html b/Documentation/nvme-error-log.html index acf35fc..54267eb 100644 --- a/Documentation/nvme-error-log.html +++ b/Documentation/nvme-error-log.html @@ -860,7 +860,7 @@ Print the raw output to a file: diff --git a/Documentation/nvme-fdp-configs.1 b/Documentation/nvme-fdp-configs.1 index 1fdb44b..61d1250 100644 --- a/Documentation/nvme-fdp-configs.1 +++ b/Documentation/nvme-fdp-configs.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fdp-configs .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-CONFIGS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-CONFIGS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fdp-configs.html b/Documentation/nvme-fdp-configs.html index dfcc5aa..50c71c4 100644 --- a/Documentation/nvme-fdp-configs.html +++ b/Documentation/nvme-fdp-configs.html @@ -826,7 +826,7 @@ the possible configurations for Flexible Data Placement.

diff --git a/Documentation/nvme-fdp-events.1 b/Documentation/nvme-fdp-events.1 index 03c6ef2..91a7824 100644 --- a/Documentation/nvme-fdp-events.1 +++ b/Documentation/nvme-fdp-events.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fdp-events .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-EVENTS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-EVENTS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fdp-events.html b/Documentation/nvme-fdp-events.html index 79fffaf..36de06a 100644 --- a/Documentation/nvme-fdp-events.html +++ b/Documentation/nvme-fdp-events.html @@ -825,7 +825,7 @@ Units and media usage in an Endurance Group.

diff --git a/Documentation/nvme-fdp-set-events.1 b/Documentation/nvme-fdp-set-events.1 index 66aaa7e..d6fb3c5 100644 --- a/Documentation/nvme-fdp-set-events.1 +++ b/Documentation/nvme-fdp-set-events.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fdp-set-events .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-SET\-EVEN" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-SET\-EVEN" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fdp-set-events.html b/Documentation/nvme-fdp-set-events.html index 4615772..c3ee010 100644 --- a/Documentation/nvme-fdp-set-events.html +++ b/Documentation/nvme-fdp-set-events.html @@ -816,7 +816,7 @@ Handle.

diff --git a/Documentation/nvme-fdp-stats.1 b/Documentation/nvme-fdp-stats.1 index fb11832..2ac48b5 100644 --- a/Documentation/nvme-fdp-stats.1 +++ b/Documentation/nvme-fdp-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fdp-stats .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-STATS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-STATS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fdp-stats.html b/Documentation/nvme-fdp-stats.html index 009bb38..3f671d8 100644 --- a/Documentation/nvme-fdp-stats.html +++ b/Documentation/nvme-fdp-stats.html @@ -814,7 +814,7 @@ the life of the FDP configuration in an Endurance Group.

diff --git a/Documentation/nvme-fdp-status.1 b/Documentation/nvme-fdp-status.1 index 362f4b1..abe49af 100644 --- a/Documentation/nvme-fdp-status.1 +++ b/Documentation/nvme-fdp-status.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fdp-status .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-STATUS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-STATUS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fdp-status.html b/Documentation/nvme-fdp-status.html index a073a94..bbc4d87 100644 --- a/Documentation/nvme-fdp-status.html +++ b/Documentation/nvme-fdp-status.html @@ -814,7 +814,7 @@ are accessible by the specified namespace.

diff --git a/Documentation/nvme-fdp-update.1 b/Documentation/nvme-fdp-update.1 index ca7e39a..371c4f4 100644 --- a/Documentation/nvme-fdp-update.1 +++ b/Documentation/nvme-fdp-update.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fdp-update .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-UPDATE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-UPDATE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fdp-update.html b/Documentation/nvme-fdp-update.html index 2ad566f..8fd528c 100644 --- a/Documentation/nvme-fdp-update.html +++ b/Documentation/nvme-fdp-update.html @@ -802,7 +802,7 @@ a different Reclaim Unit accessible by the specified namespace.

diff --git a/Documentation/nvme-fdp-usage.1 b/Documentation/nvme-fdp-usage.1 index 912d0fd..6ac434b 100644 --- a/Documentation/nvme-fdp-usage.1 +++ b/Documentation/nvme-fdp-usage.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fdp-usage .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-USAGE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-USAGE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fdp-usage.html b/Documentation/nvme-fdp-usage.html index aaa349b..3b3d858 100644 --- a/Documentation/nvme-fdp-usage.html +++ b/Documentation/nvme-fdp-usage.html @@ -815,7 +815,7 @@ Endurance Group.

diff --git a/Documentation/nvme-fid-support-effects-log.1 b/Documentation/nvme-fid-support-effects-log.1 index 82417b4..c7147e6 100644 --- a/Documentation/nvme-fid-support-effects-log.1 +++ b/Documentation/nvme-fid-support-effects-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fid-support-effects-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FID\-SUPPORT\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FID\-SUPPORT\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fid-support-effects-log.html b/Documentation/nvme-fid-support-effects-log.html index d23d711..9041531 100644 --- a/Documentation/nvme-fid-support-effects-log.html +++ b/Documentation/nvme-fid-support-effects-log.html @@ -825,7 +825,7 @@ raw buffer may be printed to stdout.

diff --git a/Documentation/nvme-flush.1 b/Documentation/nvme-flush.1 index a5ca384..1528b6d 100644 --- a/Documentation/nvme-flush.1 +++ b/Documentation/nvme-flush.1 @@ -2,12 +2,12 @@ .\" Title: nvme-flush .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FLUSH" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FLUSH" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-flush.html b/Documentation/nvme-flush.html index b008b96..a7aa1a8 100644 --- a/Documentation/nvme-flush.html +++ b/Documentation/nvme-flush.html @@ -824,7 +824,7 @@ any namespace.

diff --git a/Documentation/nvme-format.1 b/Documentation/nvme-format.1 index 6837f23..5e3ab4f 100644 --- a/Documentation/nvme-format.1 +++ b/Documentation/nvme-format.1 @@ -2,12 +2,12 @@ .\" Title: nvme-format .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FORMAT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FORMAT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-format.html b/Documentation/nvme-format.html index f462649..eb73f4e 100644 --- a/Documentation/nvme-format.html +++ b/Documentation/nvme-format.html @@ -1056,7 +1056,7 @@ information: diff --git a/Documentation/nvme-fw-commit.1 b/Documentation/nvme-fw-commit.1 index 62e46ee..f97ecdc 100644 --- a/Documentation/nvme-fw-commit.1 +++ b/Documentation/nvme-fw-commit.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fw-commit .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FW\-COMMIT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FW\-COMMIT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fw-commit.html b/Documentation/nvme-fw-commit.html index 5f02e38..772d658 100644 --- a/Documentation/nvme-fw-commit.html +++ b/Documentation/nvme-fw-commit.html @@ -929,7 +929,7 @@ commit the last downloaded fw to slot 1. diff --git a/Documentation/nvme-fw-download.1 b/Documentation/nvme-fw-download.1 index 18a87ca..b13b4c8 100644 --- a/Documentation/nvme-fw-download.1 +++ b/Documentation/nvme-fw-download.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fw-download .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FW\-DOWNLOAD" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FW\-DOWNLOAD" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fw-download.html b/Documentation/nvme-fw-download.html index 278bb7a..cc49e87 100644 --- a/Documentation/nvme-fw-download.html +++ b/Documentation/nvme-fw-download.html @@ -876,7 +876,7 @@ Transfer a firmware size 128KiB at a time: diff --git a/Documentation/nvme-fw-log.1 b/Documentation/nvme-fw-log.1 index 03776a7..23eef95 100644 --- a/Documentation/nvme-fw-log.1 +++ b/Documentation/nvme-fw-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-fw-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FW\-LOG" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-FW\-LOG" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-fw-log.html b/Documentation/nvme-fw-log.html index 92fd8f0..e3b8a9a 100644 --- a/Documentation/nvme-fw-log.html +++ b/Documentation/nvme-fw-log.html @@ -846,7 +846,7 @@ Print the log firmware to a file: diff --git a/Documentation/nvme-gen-hostnqn.1 b/Documentation/nvme-gen-hostnqn.1 index 843a8a8..6297604 100644 --- a/Documentation/nvme-gen-hostnqn.1 +++ b/Documentation/nvme-gen-hostnqn.1 @@ -2,12 +2,12 @@ .\" Title: nvme-gen-hostnqn .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GEN\-HOSTNQN" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-GEN\-HOSTNQN" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-gen-hostnqn.html b/Documentation/nvme-gen-hostnqn.html index a6d5fda..d322bda 100644 --- a/Documentation/nvme-gen-hostnqn.html +++ b/Documentation/nvme-gen-hostnqn.html @@ -809,7 +809,7 @@ and prints it to stdout.

diff --git a/Documentation/nvme-get-feature.1 b/Documentation/nvme-get-feature.1 index c183514..1968c81 100644 --- a/Documentation/nvme-get-feature.1 +++ b/Documentation/nvme-get-feature.1 @@ -2,12 +2,12 @@ .\" Title: nvme-get-feature .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GET\-FEATURE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-GET\-FEATURE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,11 +33,11 @@ nvme-get-feature \- Gets an NVMe feature, returns applicable results .sp .nf \fInvme get\-feature\fR [\-\-namespace\-id= | \-n ] - [\-\-feature\-id= | \-f ] [\-\-cdw11=] + [\-\-feature\-id= | \-f ] [\-\-uuid\-index= | \-U ] [\-\-data\-len= | \-l ] [\-\-sel=] - [\-\-raw\-binary | \-b] + [\-\-raw\-binary | \-b] [\-\-cdw11= | \-c ] [\-\-human\-readable | \-H] [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi @@ -115,7 +115,7 @@ UUID Index of the feature The data length for the buffer returned for this feature\&. Most known features do not use this value\&. The exception is LBA Range Type .RE .PP -\-\-cdw11= +\-c , \-\-cdw11= .RS 4 The value for command dword 11, if applicable\&. .RE diff --git a/Documentation/nvme-get-feature.html b/Documentation/nvme-get-feature.html index 920a5e3..387c51b 100644 --- a/Documentation/nvme-get-feature.html +++ b/Documentation/nvme-get-feature.html @@ -750,11 +750,11 @@ nvme-get-feature(1) Manual Page
nvme get-feature <device> [--namespace-id=<nsid> | -n <nsid>]
-                        [--feature-id=<fid> | -f <fid>] [--cdw11=<cdw11>]
+                        [--feature-id=<fid> | -f <fid>]
                         [--uuid-index=<uuid-index> | -U <uuid_index>]
                         [--data-len=<data-len> | -l <data-len>]
                         [--sel=<select> | -s <select>]
-                        [--raw-binary | -b]
+                        [--raw-binary | -b] [--cdw11=<cdw11> | -c <cdw11>]
                         [--human-readable | -H]
                         [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -876,6 +876,9 @@ cellspacing="0" cellpadding="4">

+-c <cdw11> +
+
--cdw11=<cdw11>
@@ -1001,7 +1004,7 @@ format: diff --git a/Documentation/nvme-get-feature.txt b/Documentation/nvme-get-feature.txt index 6477bc6..5abbb47 100644 --- a/Documentation/nvme-get-feature.txt +++ b/Documentation/nvme-get-feature.txt @@ -9,11 +9,11 @@ SYNOPSIS -------- [verse] 'nvme get-feature' [--namespace-id= | -n ] - [--feature-id= | -f ] [--cdw11=] + [--feature-id= | -f ] [--uuid-index= | -U ] [--data-len= | -l ] [--sel=] - [--raw-binary | -b] + [--raw-binary | -b] [--cdw11= | -c ] [--human-readable | -H] [--output-format= | -o ] [--verbose | -v] @@ -69,6 +69,7 @@ OPTIONS known features do not use this value. The exception is LBA Range Type +-c :: --cdw11=:: The value for command dword 11, if applicable. diff --git a/Documentation/nvme-get-lba-status.1 b/Documentation/nvme-get-lba-status.1 index 473a5b9..244400d 100644 --- a/Documentation/nvme-get-lba-status.1 +++ b/Documentation/nvme-get-lba-status.1 @@ -2,12 +2,12 @@ .\" Title: nvme-get-lba-status .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GET\-LBA\-STAT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-GET\-LBA\-STAT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-get-lba-status.html b/Documentation/nvme-get-lba-status.html index fe45726..39a42df 100644 --- a/Documentation/nvme-get-lba-status.html +++ b/Documentation/nvme-get-lba-status.html @@ -907,7 +907,7 @@ Get LBA Status of the namespace 1 from SLBA 10 for the max Dwords of 0x1000 diff --git a/Documentation/nvme-get-log.1 b/Documentation/nvme-get-log.1 index 1f189c3..a6d7e16 100644 --- a/Documentation/nvme-get-log.1 +++ b/Documentation/nvme-get-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-get-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GET\-LOG" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-GET\-LOG" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-get-log.html b/Documentation/nvme-get-log.html index 0d86eb2..11a5bdb 100644 --- a/Documentation/nvme-get-log.html +++ b/Documentation/nvme-get-log.html @@ -997,7 +997,7 @@ Have the program return the raw log page in binary: diff --git a/Documentation/nvme-get-ns-id.1 b/Documentation/nvme-get-ns-id.1 index cb12425..a25d52a 100644 --- a/Documentation/nvme-get-ns-id.1 +++ b/Documentation/nvme-get-ns-id.1 @@ -2,12 +2,12 @@ .\" Title: nvme-get-ns-id .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GET\-NS\-ID" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-GET\-NS\-ID" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-get-ns-id.html b/Documentation/nvme-get-ns-id.html index 07e9814..7975554 100644 --- a/Documentation/nvme-get-ns-id.html +++ b/Documentation/nvme-get-ns-id.html @@ -818,7 +818,7 @@ Shows the namespace id for the given block device: diff --git a/Documentation/nvme-get-property.1 b/Documentation/nvme-get-property.1 index 8053cc1..18db4ad 100644 --- a/Documentation/nvme-get-property.1 +++ b/Documentation/nvme-get-property.1 @@ -2,12 +2,12 @@ .\" Title: nvme-get-property .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GET\-PROPERTY" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-GET\-PROPERTY" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,7 +41,7 @@ nvme-get-property \- Reads and shows the defined NVMe controller property for NV Reads and shows the defined NVMe controller property for NVMe over Fabric\&. .SH "OPTIONS" .PP -\-O, \-\-offset +\-O , \-\-offset= .RS 4 The offset of the property\&. One of CAP=0x0, VS=0x8, CC=0x14, CSTS=0x1c, NSSR=0x20 .RE diff --git a/Documentation/nvme-get-property.html b/Documentation/nvme-get-property.html index f19907c..165273c 100644 --- a/Documentation/nvme-get-property.html +++ b/Documentation/nvme-get-property.html @@ -767,10 +767,10 @@ nvme-get-property(1) Manual Page
--O +-O <offset>
---offset +--offset=<offset>

@@ -867,7 +867,7 @@ Then look for NVMe Fabrics command (0x7f) at trace

diff --git a/Documentation/nvme-get-property.txt b/Documentation/nvme-get-property.txt index 601b8a4..bee65d1 100644 --- a/Documentation/nvme-get-property.txt +++ b/Documentation/nvme-get-property.txt @@ -19,8 +19,8 @@ Reads and shows the defined NVMe controller property for NVMe over Fabric. OPTIONS ------- --O:: ---offset:: +-O :: +--offset=:: The offset of the property. One of CAP=0x0, VS=0x8, CC=0x14, CSTS=0x1c, NSSR=0x20 -H:: diff --git a/Documentation/nvme-get-reg.txt b/Documentation/nvme-get-reg.txt new file mode 100644 index 0000000..b0d133e --- /dev/null +++ b/Documentation/nvme-get-reg.txt @@ -0,0 +1,138 @@ +nvme-get-reg(1) +=============== + +NAME +---- +nvme-get-reg - Read and show the defined NVMe controller register + +SYNOPSIS +-------- +[verse] +'nvme get-reg' [--offset=, -O ] [--human-readable | -H] + [--cap] [--vs] [--cmbloc] [--cmbsz] [--bpinfo] + [--cmbsts] [--cmbebs] [--cmbswtp] [--crto] [--pmrcap] + [--pmrsts] [--pmrebs] [--pmrswtp] [--intms] [--intmc] + [--cc] [--csts] [--nssr] [--aqa] [--asq] [--acq] + [--bprsel] [--bpmbl] [--cmbmsc] [--nssd] [--pmrctl] + [--pmrmscl] [--pmrmscu] + [--output-format= | -o ] [--verbose | -v] + +DESCRIPTION +----------- +Read and show the defined NVMe controller register. + +OPTIONS +------- +-O :: +--offset=:: + offset of the requested register + +-H:: +--human-readable:: + show register in readable format + +--cap:: + CAP=0x0 register offset + +--vs:: + VS=0x8 register offset + +--cmbloc:: + CMBLOC=0x38 register offset + +--cmbsz:: + CMBSZ=0x3c register offset + +--bpinfo:: + BPINFO=0x40 register offset + +--cmbsts:: + CMBSTS=0x58 register offset + +--cmbebs:: + CMBEBS=0x5c register offset + +--cmbswtp:: + CMBSWTP=0x60 register offset + +--crto:: + CRTO=0x68 register offset + +--pmrcap:: + PMRCAP=0xe00 register offset + +--pmrsts:: + PMRSTS=0xe08 register offset + +--pmrebs:: + PMREBS=0xe0c register offset + +--pmrswtp:: + PMRSWTP=0xe10 register offset + +--intms:: + INTMS=0xc register offset + +--intmc:: + INTMC=0x10 register offset + +--cc:: + CC=0x14 register offset + +--csts:: + CSTS=0x1c register offset + +--nssr:: + NSSR=0x20 register offset + +--aqa:: + AQA=0x24 register offset + +--asq:: + ASQ=0x28 register offset + +--acq:: + ACQ=0x30 register offset + +--bprsel:: + BPRSEL=0x44 register offset + +--bpmbl:: + BPMBL=0x48 register offset + +--cmbmsc:: + CMBMSC=0x50 register offset + +--nssd:: + NSSD=0x64 register offset + +--pmrctl:: + PMRCTL=0xe04 register offset + +--pmrmscl:: + PMRMSCL=0xe14 register offset + +--pmrmscu:: + PMRMSCU=0xe18 register offset + +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json' or 'binary'. Only one + output format can be used at a time. + +-v:: +--verbose:: + Increase the information detail in the output. + +EXAMPLES +-------- +* The following will run the get-reg command with CC=0x14 register offset ++ +------------ +# nvme get-reg /dev/nvme0 --cc +register: 0x0014 (Controller Configuration), value: 0x460001 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-help.1 b/Documentation/nvme-help.1 index f88439a..8071ddc 100644 --- a/Documentation/nvme-help.1 +++ b/Documentation/nvme-help.1 @@ -2,12 +2,12 @@ .\" Title: nvme-help .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-HELP" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-HELP" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-help.html b/Documentation/nvme-help.html index ef591a7..d34afd8 100644 --- a/Documentation/nvme-help.html +++ b/Documentation/nvme-help.html @@ -794,7 +794,7 @@ Show help for nvme smart log: diff --git a/Documentation/nvme-huawei-id-ctrl.1 b/Documentation/nvme-huawei-id-ctrl.1 index 39c7a01..b32f3eb 100644 --- a/Documentation/nvme-huawei-id-ctrl.1 +++ b/Documentation/nvme-huawei-id-ctrl.1 @@ -2,12 +2,12 @@ .\" Title: nvme-huawei-id-ctrl .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-HUAWEI\-ID\-CT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-HUAWEI\-ID\-CT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-huawei-id-ctrl.html b/Documentation/nvme-huawei-id-ctrl.html index b04dd72..fdb6652 100644 --- a/Documentation/nvme-huawei-id-ctrl.html +++ b/Documentation/nvme-huawei-id-ctrl.html @@ -855,7 +855,7 @@ fields in a human readable format: diff --git a/Documentation/nvme-huawei-list.1 b/Documentation/nvme-huawei-list.1 index f3c0bb2..e66aef2 100644 --- a/Documentation/nvme-huawei-list.1 +++ b/Documentation/nvme-huawei-list.1 @@ -2,12 +2,12 @@ .\" Title: nvme-list .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LIST" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-LIST" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-huawei-list.html b/Documentation/nvme-huawei-list.html index 5d3bbaa..a3c7b83 100644 --- a/Documentation/nvme-huawei-list.html +++ b/Documentation/nvme-huawei-list.html @@ -797,7 +797,7 @@ for those Huawei devices as well as some pertinent information about them.

diff --git a/Documentation/nvme-id-ctrl.1 b/Documentation/nvme-id-ctrl.1 index 97214b6..bdd522f 100644 --- a/Documentation/nvme-id-ctrl.1 +++ b/Documentation/nvme-id-ctrl.1 @@ -2,12 +2,12 @@ .\" Title: nvme-id-ctrl .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-CTRL" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-CTRL" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-id-ctrl.html b/Documentation/nvme-id-ctrl.html index 9c00c75..01c107a 100644 --- a/Documentation/nvme-id-ctrl.html +++ b/Documentation/nvme-id-ctrl.html @@ -921,7 +921,7 @@ int main(int argc, char **argv) diff --git a/Documentation/nvme-id-domain.1 b/Documentation/nvme-id-domain.1 index f905dd6..e51f4a0 100644 --- a/Documentation/nvme-id-domain.1 +++ b/Documentation/nvme-id-domain.1 @@ -2,12 +2,12 @@ .\" Title: nvme-id-domain .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-DOMAIN" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-DOMAIN" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-id-domain.html b/Documentation/nvme-id-domain.html index dffc249..3d6b411 100644 --- a/Documentation/nvme-id-domain.html +++ b/Documentation/nvme-id-domain.html @@ -823,7 +823,7 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-id-iocs.1 b/Documentation/nvme-id-iocs.1 index e6918cd..58ffade 100644 --- a/Documentation/nvme-id-iocs.1 +++ b/Documentation/nvme-id-iocs.1 @@ -2,12 +2,12 @@ .\" Title: nvme-id-iocs .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-IOCS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-IOCS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-id-iocs.html b/Documentation/nvme-id-iocs.html index 704ddae..5e7caae 100644 --- a/Documentation/nvme-id-iocs.html +++ b/Documentation/nvme-id-iocs.html @@ -855,7 +855,7 @@ show the fields in human readable format diff --git a/Documentation/nvme-id-ns-granularity.txt b/Documentation/nvme-id-ns-granularity.txt old mode 100755 new mode 100644 diff --git a/Documentation/nvme-id-ns.1 b/Documentation/nvme-id-ns.1 index 1a44058..0d1d4b8 100644 --- a/Documentation/nvme-id-ns.1 +++ b/Documentation/nvme-id-ns.1 @@ -2,12 +2,12 @@ .\" Title: nvme-id-ns .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-NS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-NS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-id-ns.html b/Documentation/nvme-id-ns.html index 20044bc..57657f8 100644 --- a/Documentation/nvme-id-ns.html +++ b/Documentation/nvme-id-ns.html @@ -966,7 +966,7 @@ int main(int argc, char **argv) diff --git a/Documentation/nvme-id-nvmset.1 b/Documentation/nvme-id-nvmset.1 index 4a5f82c..0cf58ce 100644 --- a/Documentation/nvme-id-nvmset.1 +++ b/Documentation/nvme-id-nvmset.1 @@ -2,12 +2,12 @@ .\" Title: nvme-id-nvmset .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-NVMSET" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-NVMSET" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-id-nvmset.html b/Documentation/nvme-id-nvmset.html index 535bb73..29238d4 100644 --- a/Documentation/nvme-id-nvmset.html +++ b/Documentation/nvme-id-nvmset.html @@ -862,7 +862,7 @@ as shown in the above example, or you can 'cat' a saved output buff diff --git a/Documentation/nvme-id-uuid.txt b/Documentation/nvme-id-uuid.txt old mode 100755 new mode 100644 diff --git a/Documentation/nvme-inspur-nvme-vendor-log.1 b/Documentation/nvme-inspur-nvme-vendor-log.1 index 4ccea25..9b17f19 100644 --- a/Documentation/nvme-inspur-nvme-vendor-log.1 +++ b/Documentation/nvme-inspur-nvme-vendor-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-inspur-nvme-vendor-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INSPUR\-NVME\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-INSPUR\-NVME\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-inspur-nvme-vendor-log.html b/Documentation/nvme-inspur-nvme-vendor-log.html index 424c26d..cb9f85f 100644 --- a/Documentation/nvme-inspur-nvme-vendor-log.html +++ b/Documentation/nvme-inspur-nvme-vendor-log.html @@ -796,7 +796,7 @@ Print the Inspur Device Vendor log page in a human readable format: diff --git a/Documentation/nvme-intel-id-ctrl.1 b/Documentation/nvme-intel-id-ctrl.1 index 2c1a4d9..0ad6f17 100644 --- a/Documentation/nvme-intel-id-ctrl.1 +++ b/Documentation/nvme-intel-id-ctrl.1 @@ -2,12 +2,12 @@ .\" Title: nvme-intel-id-ctrl .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-ID\-CTR" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-ID\-CTR" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-intel-id-ctrl.html b/Documentation/nvme-intel-id-ctrl.html index aabaa2f..d22113e 100644 --- a/Documentation/nvme-intel-id-ctrl.html +++ b/Documentation/nvme-intel-id-ctrl.html @@ -853,7 +853,7 @@ fields in a human readable format: diff --git a/Documentation/nvme-intel-internal-log.1 b/Documentation/nvme-intel-internal-log.1 index 0bec162..b477eb5 100644 --- a/Documentation/nvme-intel-internal-log.1 +++ b/Documentation/nvme-intel-internal-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-intel-internal-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-INTERNA" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-INTERNA" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-intel-internal-log.html b/Documentation/nvme-intel-internal-log.html index aca2133..adec8f4 100644 --- a/Documentation/nvme-intel-internal-log.html +++ b/Documentation/nvme-intel-internal-log.html @@ -873,7 +873,7 @@ Gets the event log from the device and saves to defined file: diff --git a/Documentation/nvme-intel-lat-stats.1 b/Documentation/nvme-intel-lat-stats.1 index 7b04288..2a90ec1 100644 --- a/Documentation/nvme-intel-lat-stats.1 +++ b/Documentation/nvme-intel-lat-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-intel-lat-stats .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-LAT\-ST" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-LAT\-ST" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-intel-lat-stats.html b/Documentation/nvme-intel-lat-stats.html index 837e17e..db8470b 100644 --- a/Documentation/nvme-intel-lat-stats.html +++ b/Documentation/nvme-intel-lat-stats.html @@ -832,7 +832,7 @@ Get the write statistics diff --git a/Documentation/nvme-intel-market-name.1 b/Documentation/nvme-intel-market-name.1 index b77c38b..76752f1 100644 --- a/Documentation/nvme-intel-market-name.1 +++ b/Documentation/nvme-intel-market-name.1 @@ -2,12 +2,12 @@ .\" Title: nvme-intel-market-name .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-MARKET\" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-MARKET\" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-intel-market-name.html b/Documentation/nvme-intel-market-name.html index 817a255..1a2cb40 100644 --- a/Documentation/nvme-intel-market-name.html +++ b/Documentation/nvme-intel-market-name.html @@ -813,7 +813,7 @@ Get the marketing name diff --git a/Documentation/nvme-intel-smart-log-add.1 b/Documentation/nvme-intel-smart-log-add.1 index 539d9bf..ace0e71 100644 --- a/Documentation/nvme-intel-smart-log-add.1 +++ b/Documentation/nvme-intel-smart-log-add.1 @@ -2,12 +2,12 @@ .\" Title: nvme-intel-smart-log-add .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-SMART\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-SMART\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-intel-smart-log-add.html b/Documentation/nvme-intel-smart-log-add.html index f5b1b5e..9b0b8bb 100644 --- a/Documentation/nvme-intel-smart-log-add.html +++ b/Documentation/nvme-intel-smart-log-add.html @@ -849,7 +849,7 @@ Print the raw Intel Additional SMART log to a file: diff --git a/Documentation/nvme-intel-temp-stats.1 b/Documentation/nvme-intel-temp-stats.1 index 15434bb..c359d87 100644 --- a/Documentation/nvme-intel-temp-stats.1 +++ b/Documentation/nvme-intel-temp-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-intel-temp-stats .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-TEMP\-S" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-TEMP\-S" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-intel-temp-stats.html b/Documentation/nvme-intel-temp-stats.html index c03b0a0..6093d9d 100644 --- a/Documentation/nvme-intel-temp-stats.html +++ b/Documentation/nvme-intel-temp-stats.html @@ -822,7 +822,7 @@ Print the raw SMART log to a file: diff --git a/Documentation/nvme-io-mgmt-recv.1 b/Documentation/nvme-io-mgmt-recv.1 index df8eda9..aa0b587 100644 --- a/Documentation/nvme-io-mgmt-recv.1 +++ b/Documentation/nvme-io-mgmt-recv.1 @@ -2,12 +2,12 @@ .\" Title: nvme-io-mgmt-recv .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-IO\-MGMT\-RECV" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-IO\-MGMT\-RECV" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-io-mgmt-recv.html b/Documentation/nvme-io-mgmt-recv.html index bed1c31..a1df10e 100644 --- a/Documentation/nvme-io-mgmt-recv.html +++ b/Documentation/nvme-io-mgmt-recv.html @@ -869,7 +869,7 @@ a hex dump, or binary.

diff --git a/Documentation/nvme-io-mgmt-send.1 b/Documentation/nvme-io-mgmt-send.1 index 3206738..6cb17a1 100644 --- a/Documentation/nvme-io-mgmt-send.1 +++ b/Documentation/nvme-io-mgmt-send.1 @@ -2,12 +2,12 @@ .\" Title: nvme-io-mgmt-send .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-IO\-MGMT\-SEND" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-IO\-MGMT\-SEND" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-io-mgmt-send.html b/Documentation/nvme-io-mgmt-send.html index 42e1548..2614bf0 100644 --- a/Documentation/nvme-io-mgmt-send.html +++ b/Documentation/nvme-io-mgmt-send.html @@ -868,7 +868,7 @@ convenience parameters to produce the binary payload.

diff --git a/Documentation/nvme-io-passthru.1 b/Documentation/nvme-io-passthru.1 index a5c6d39..909b74c 100644 --- a/Documentation/nvme-io-passthru.1 +++ b/Documentation/nvme-io-passthru.1 @@ -2,12 +2,12 @@ .\" Title: nvme-io-passthru .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-IO\-PASSTHRU" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-IO\-PASSTHRU" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,10 +34,11 @@ nvme-io-passthru \- Submit an arbitrary io command, return results .nf \fInvme\-io\-passthru\fR [\-\-opcode= | \-O ] [\-\-flags= | \-f ] [\-rsvd= | \-R ] - [\-\-namespace\-id= | \-nsid ] - [\-\-cdw2=] [\-\-cdw3=] [\-\-cdw10=] - [\-\-cdw11=] [\-\-cdw12=] [\-\-cdw13=] - [\-\-cdw14=] [\-\-cdw15=] + [\-\-namespace\-id= | \-n ] [\-\-cdw2= | \-2 ] + [\-\-cdw3= | \-3 ] [\-\-cdw10= | \-4 ] + [\-\-cdw11= | \-5 ] [\-\-cdw12= | \-6 ] + [\-\-cdw13= | \-7 ] [\-\-cdw14= | \-8 ] + [\-\-cdw15= | \-9 ] [\-\-data\-len= | \-l ] [\-\-metadata\-len= | \-m ] [\-\-read | \-r] [\-\-write | \-w] @@ -79,7 +80,7 @@ The value for the ns\-id in the command\&. Defaults to \fI0\fR\&. .RE .PP -\-\-cdw[2\-3,10\-15]= +\-[2\-9] , \-\-cdw[2\-3,10\-15]= .RS 4 Specifies the command dword value for that specified entry in the command .RE diff --git a/Documentation/nvme-io-passthru.html b/Documentation/nvme-io-passthru.html index da443ea..ff08fdd 100644 --- a/Documentation/nvme-io-passthru.html +++ b/Documentation/nvme-io-passthru.html @@ -751,10 +751,11 @@ nvme-io-passthru(1) Manual Page
nvme-io-passthru <device> [--opcode=<opcode> | -O <opcode>]
                         [--flags=<flags> | -f <flags>] [-rsvd=<rsvd> | -R <rsvd>]
-                        [--namespace-id=<nsid> | -nsid <nsid>]
-                        [--cdw2=<cdw2>] [--cdw3=<cdw3>] [--cdw10=<cdw10>]
-                        [--cdw11=<cdw11>] [--cdw12=<cdw12>] [--cdw13=<cdw13>]
-                        [--cdw14=<cdw14>] [--cdw15=<cdw15>]
+                        [--namespace-id=<nsid> | -n <nsid>] [--cdw2=<cdw2> | -2 <cdw2>]
+                        [--cdw3=<cdw3> | -3 <cdw3>] [--cdw10=<cdw10> | -4 <cdw10>]
+                        [--cdw11=<cdw11> | -5 <cdw11>] [--cdw12=<cdw12> | -6 <cdw12>]
+                        [--cdw13=<cdw13> | -7 <cdw13>] [--cdw14=<cdw14> | -8 <cdw14>]
+                        [--cdw15=<cdw15> | -9 <cdw15>]
                         [--data-len=<data-len> | -l <data-len>]
                         [--metadata-len=<len> | -m <len>]
                         [--read | -r] [--write | -w]
@@ -833,6 +834,9 @@ printed to stdout for another program to parse.

+-[2-9] <cdw> +
+
--cdw[2-3,10-15]=<cdw>
@@ -1015,7 +1019,7 @@ printed to stdout for another program to parse.

diff --git a/Documentation/nvme-io-passthru.txt b/Documentation/nvme-io-passthru.txt index 3ad5231..bbc34eb 100644 --- a/Documentation/nvme-io-passthru.txt +++ b/Documentation/nvme-io-passthru.txt @@ -10,10 +10,11 @@ SYNOPSIS [verse] 'nvme-io-passthru' [--opcode= | -O ] [--flags= | -f ] [-rsvd= | -R ] - [--namespace-id= | -nsid ] - [--cdw2=] [--cdw3=] [--cdw10=] - [--cdw11=] [--cdw12=] [--cdw13=] - [--cdw14=] [--cdw15=] + [--namespace-id= | -n ] [--cdw2= | -2 ] + [--cdw3= | -3 ] [--cdw10= | -4 ] + [--cdw11= | -5 ] [--cdw12= | -6 ] + [--cdw13= | -7 ] [--cdw14= | -8 ] + [--cdw15= | -9 ] [--data-len= | -l ] [--metadata-len= | -m ] [--read | -r] [--write | -w] @@ -58,6 +59,7 @@ OPTIONS --namespace-id=:: The value for the ns-id in the command. Defaults to '0'. +-[2-9] :: --cdw[2-3,10-15]=:: Specifies the command dword value for that specified entry in the command diff --git a/Documentation/nvme-lba-status-log.1 b/Documentation/nvme-lba-status-log.1 index a6466d3..54d410b 100644 --- a/Documentation/nvme-lba-status-log.1 +++ b/Documentation/nvme-lba-status-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-lba-status-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LBA\-STATUS\-L" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-LBA\-STATUS\-L" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-lba-status-log.html b/Documentation/nvme-lba-status-log.html index 2f60ffb..d63139f 100644 --- a/Documentation/nvme-lba-status-log.html +++ b/Documentation/nvme-lba-status-log.html @@ -843,7 +843,7 @@ NVME
diff --git a/Documentation/nvme-list-ctrl.1 b/Documentation/nvme-list-ctrl.1 index e504b78..0695802 100644 --- a/Documentation/nvme-list-ctrl.1 +++ b/Documentation/nvme-list-ctrl.1 @@ -2,12 +2,12 @@ .\" Title: nvme-list-ctrl .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LIST\-CTRL" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-LIST\-CTRL" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-list-ctrl.html b/Documentation/nvme-list-ctrl.html index b0f1a16..cb77b1f 100644 --- a/Documentation/nvme-list-ctrl.html +++ b/Documentation/nvme-list-ctrl.html @@ -842,7 +842,7 @@ identifier.

diff --git a/Documentation/nvme-list-endgrp.1 b/Documentation/nvme-list-endgrp.1 index 345eb9e..883f75c 100644 --- a/Documentation/nvme-list-endgrp.1 +++ b/Documentation/nvme-list-endgrp.1 @@ -2,12 +2,12 @@ .\" Title: nvme-list-endgrp .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LIST\-ENDGRP" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-LIST\-ENDGRP" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-list-endgrp.html b/Documentation/nvme-list-endgrp.html index eb2a318..0e0079a 100644 --- a/Documentation/nvme-list-endgrp.html +++ b/Documentation/nvme-list-endgrp.html @@ -826,7 +826,7 @@ than or equal to the value specified in the CDW11.ENDGID field.

diff --git a/Documentation/nvme-list-ns.1 b/Documentation/nvme-list-ns.1 index 49cabd4..1146a98 100644 --- a/Documentation/nvme-list-ns.1 +++ b/Documentation/nvme-list-ns.1 @@ -2,12 +2,12 @@ .\" Title: nvme-id-ns .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-NS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-NS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-list-ns.html b/Documentation/nvme-list-ns.html index 7d7ffdc..1fa0e56 100644 --- a/Documentation/nvme-list-ns.html +++ b/Documentation/nvme-list-ns.html @@ -871,7 +871,7 @@ Print the namespaces present for NVM Command Set in normal format diff --git a/Documentation/nvme-list-secondary.txt b/Documentation/nvme-list-secondary.txt old mode 100755 new mode 100644 diff --git a/Documentation/nvme-list-subsys.1 b/Documentation/nvme-list-subsys.1 index 15212a1..1bf21ea 100644 --- a/Documentation/nvme-list-subsys.1 +++ b/Documentation/nvme-list-subsys.1 @@ -2,12 +2,12 @@ .\" Title: nvme-list-subsys .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LIST\-SUBSYS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-LIST\-SUBSYS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-list-subsys.html b/Documentation/nvme-list-subsys.html index eb55027..525c079 100644 --- a/Documentation/nvme-list-subsys.html +++ b/Documentation/nvme-list-subsys.html @@ -865,7 +865,7 @@ nvme-subsys1 - NQN=nvmf-test2 diff --git a/Documentation/nvme-list.1 b/Documentation/nvme-list.1 index 400aefa..60623b4 100644 --- a/Documentation/nvme-list.1 +++ b/Documentation/nvme-list.1 @@ -2,12 +2,12 @@ .\" Title: nvme-list .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LIST" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-LIST" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-list.html b/Documentation/nvme-list.html index c90b3eb..1d87621 100644 --- a/Documentation/nvme-list.html +++ b/Documentation/nvme-list.html @@ -816,7 +816,7 @@ for those devices as well as some pertinent information about them.

diff --git a/Documentation/nvme-lockdown.1 b/Documentation/nvme-lockdown.1 index 48fe02a..0e47f9a 100644 --- a/Documentation/nvme-lockdown.1 +++ b/Documentation/nvme-lockdown.1 @@ -2,12 +2,12 @@ .\" Title: nvme-lockdown .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LOCKDOWN" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-LOCKDOWN" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-lockdown.html b/Documentation/nvme-lockdown.html index d04aa9d..089c65f 100644 --- a/Documentation/nvme-lockdown.html +++ b/Documentation/nvme-lockdown.html @@ -874,7 +874,7 @@ Identifier.

diff --git a/Documentation/nvme-mi-cmd-support-effects-log.1 b/Documentation/nvme-mi-cmd-support-effects-log.1 index 8d18e62..2d22dc2 100644 --- a/Documentation/nvme-mi-cmd-support-effects-log.1 +++ b/Documentation/nvme-mi-cmd-support-effects-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-mi-cmd-support-effects-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MI\-CMD\-SUPPO" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-MI\-CMD\-SUPPO" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-mi-cmd-support-effects-log.html b/Documentation/nvme-mi-cmd-support-effects-log.html index c70a8b0..e85baf2 100644 --- a/Documentation/nvme-mi-cmd-support-effects-log.html +++ b/Documentation/nvme-mi-cmd-support-effects-log.html @@ -826,7 +826,7 @@ raw buffer may be printed to stdout.

diff --git a/Documentation/nvme-micron-clear-pcie-errors.1 b/Documentation/nvme-micron-clear-pcie-errors.1 index 3d76b45..f3ca7b7 100644 --- a/Documentation/nvme-micron-clear-pcie-errors.1 +++ b/Documentation/nvme-micron-clear-pcie-errors.1 @@ -2,12 +2,12 @@ .\" Title: nvme-micron-clear-pcie-errors .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-CLEAR\" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-CLEAR\" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-micron-clear-pcie-errors.html b/Documentation/nvme-micron-clear-pcie-errors.html index b7b9e1a..868586d 100644 --- a/Documentation/nvme-micron-clear-pcie-errors.html +++ b/Documentation/nvme-micron-clear-pcie-errors.html @@ -798,7 +798,7 @@ Retrieve NAND statistics information diff --git a/Documentation/nvme-micron-internal-log.1 b/Documentation/nvme-micron-internal-log.1 index 97428fd..76f6415 100644 --- a/Documentation/nvme-micron-internal-log.1 +++ b/Documentation/nvme-micron-internal-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-micron-internal-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-INTERN" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-INTERN" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-micron-internal-log.html b/Documentation/nvme-micron-internal-log.html index 6e288c1..74fc15e 100644 --- a/Documentation/nvme-micron-internal-log.html +++ b/Documentation/nvme-micron-internal-log.html @@ -814,7 +814,7 @@ Gets the logs from the device and saves to micron_logs.zip file diff --git a/Documentation/nvme-micron-nand-stats.1 b/Documentation/nvme-micron-nand-stats.1 index bb73919..c79c942 100644 --- a/Documentation/nvme-micron-nand-stats.1 +++ b/Documentation/nvme-micron-nand-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-micron-nand-stats .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-NAND\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-NAND\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-micron-nand-stats.html b/Documentation/nvme-micron-nand-stats.html index 57806b0..5ea78c0 100644 --- a/Documentation/nvme-micron-nand-stats.html +++ b/Documentation/nvme-micron-nand-stats.html @@ -799,7 +799,7 @@ Retrieve NAND statistics information diff --git a/Documentation/nvme-micron-pcie-stats.1 b/Documentation/nvme-micron-pcie-stats.1 index 3c1875a..4ba3b15 100644 --- a/Documentation/nvme-micron-pcie-stats.1 +++ b/Documentation/nvme-micron-pcie-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-micron-pcie-stats .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-PCIE\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-PCIE\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-micron-pcie-stats.html b/Documentation/nvme-micron-pcie-stats.html index d81e4a7..0dfc554 100644 --- a/Documentation/nvme-micron-pcie-stats.html +++ b/Documentation/nvme-micron-pcie-stats.html @@ -799,7 +799,7 @@ Retrieve PCIe error information diff --git a/Documentation/nvme-micron-selective-download.1 b/Documentation/nvme-micron-selective-download.1 index da20310..03d66ff 100644 --- a/Documentation/nvme-micron-selective-download.1 +++ b/Documentation/nvme-micron-selective-download.1 @@ -2,12 +2,12 @@ .\" Title: nvme-micron-selective-download .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-SELECT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-SELECT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-micron-selective-download.html b/Documentation/nvme-micron-selective-download.html index 84774ec..1f492f9 100644 --- a/Documentation/nvme-micron-selective-download.html +++ b/Documentation/nvme-micron-selective-download.html @@ -869,7 +869,7 @@ Update eeprom, OOB and main firmware diff --git a/Documentation/nvme-micron-smart-add-log.1 b/Documentation/nvme-micron-smart-add-log.1 index 3ef3f17..33a23df 100644 --- a/Documentation/nvme-micron-smart-add-log.1 +++ b/Documentation/nvme-micron-smart-add-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-micron-smart-add-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-SMART\" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-SMART\" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-micron-smart-add-log.html b/Documentation/nvme-micron-smart-add-log.html index 34a21dd..611657e 100644 --- a/Documentation/nvme-micron-smart-add-log.html +++ b/Documentation/nvme-micron-smart-add-log.html @@ -817,7 +817,7 @@ Retrieve NAND/extended SMART data and display in json format diff --git a/Documentation/nvme-micron-temperature-stats.1 b/Documentation/nvme-micron-temperature-stats.1 index ee8a62b..8a9dda1 100644 --- a/Documentation/nvme-micron-temperature-stats.1 +++ b/Documentation/nvme-micron-temperature-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-micron-temperature-stats .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-TEMPER" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-TEMPER" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-micron-temperature-stats.html b/Documentation/nvme-micron-temperature-stats.html index 7fa023f..fabb51b 100644 --- a/Documentation/nvme-micron-temperature-stats.html +++ b/Documentation/nvme-micron-temperature-stats.html @@ -799,7 +799,7 @@ Retrieve temperature information diff --git a/Documentation/nvme-netapp-ontapdevices.1 b/Documentation/nvme-netapp-ontapdevices.1 index 0dda702..8fc6864 100644 --- a/Documentation/nvme-netapp-ontapdevices.1 +++ b/Documentation/nvme-netapp-ontapdevices.1 @@ -2,12 +2,12 @@ .\" Title: nvme-netapp-ontapdevices .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NETAPP\-ONTAPD" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-NETAPP\-ONTAPD" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-netapp-ontapdevices.html b/Documentation/nvme-netapp-ontapdevices.html index 38ef119..4697207 100644 --- a/Documentation/nvme-netapp-ontapdevices.html +++ b/Documentation/nvme-netapp-ontapdevices.html @@ -807,7 +807,7 @@ Display information, in a column-based format, for ONTAP devices. diff --git a/Documentation/nvme-netapp-smdevices.1 b/Documentation/nvme-netapp-smdevices.1 index 8f19522..12b8039 100644 --- a/Documentation/nvme-netapp-smdevices.1 +++ b/Documentation/nvme-netapp-smdevices.1 @@ -2,12 +2,12 @@ .\" Title: nvme-netapp-smdevices .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NETAPP\-SMDEVI" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-NETAPP\-SMDEVI" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-netapp-smdevices.html b/Documentation/nvme-netapp-smdevices.html index 2fb4830..ac6d3a2 100644 --- a/Documentation/nvme-netapp-smdevices.html +++ b/Documentation/nvme-netapp-smdevices.html @@ -809,7 +809,7 @@ namespace. diff --git a/Documentation/nvme-ns-descs.1 b/Documentation/nvme-ns-descs.1 index cc5a192..f28e33a 100644 --- a/Documentation/nvme-ns-descs.1 +++ b/Documentation/nvme-ns-descs.1 @@ -2,12 +2,12 @@ .\" Title: nvme-ns-descs .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NS\-DESCS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-NS\-DESCS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-ns-descs.html b/Documentation/nvme-ns-descs.html index 02dc1fc..f6e1421 100644 --- a/Documentation/nvme-ns-descs.html +++ b/Documentation/nvme-ns-descs.html @@ -867,7 +867,7 @@ Have the program return the raw structure in binary: diff --git a/Documentation/nvme-ns-rescan.1 b/Documentation/nvme-ns-rescan.1 index 4d62049..19ce268 100644 --- a/Documentation/nvme-ns-rescan.1 +++ b/Documentation/nvme-ns-rescan.1 @@ -2,12 +2,12 @@ .\" Title: nvme-ns-rescan .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NS\-RESCAN" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-NS\-RESCAN" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-ns-rescan.html b/Documentation/nvme-ns-rescan.html index 622dfbd..c3732d5 100644 --- a/Documentation/nvme-ns-rescan.html +++ b/Documentation/nvme-ns-rescan.html @@ -818,7 +818,7 @@ Rescans the nvme namespaces. diff --git a/Documentation/nvme-nvm-id-ctrl.1 b/Documentation/nvme-nvm-id-ctrl.1 index 343724d..ef198d9 100644 --- a/Documentation/nvme-nvm-id-ctrl.1 +++ b/Documentation/nvme-nvm-id-ctrl.1 @@ -2,12 +2,12 @@ .\" Title: nvme-nvm-id-ctrl .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NVM\-ID\-CTRL" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-NVM\-ID\-CTRL" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-nvm-id-ctrl.html b/Documentation/nvme-nvm-id-ctrl.html index 4024a80..e4bdd73 100644 --- a/Documentation/nvme-nvm-id-ctrl.html +++ b/Documentation/nvme-nvm-id-ctrl.html @@ -832,7 +832,7 @@ Show the output in json format diff --git a/Documentation/nvme-nvme-mi-recv.1 b/Documentation/nvme-nvme-mi-recv.1 index 789d620..2c40649 100644 --- a/Documentation/nvme-nvme-mi-recv.1 +++ b/Documentation/nvme-nvme-mi-recv.1 @@ -2,12 +2,12 @@ .\" Title: nvme-nvme-mi-recv .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NVME\-MI\-RECV" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-NVME\-MI\-RECV" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-nvme-mi-recv.html b/Documentation/nvme-nvme-mi-recv.html index 758e4fc..e9ca302 100644 --- a/Documentation/nvme-nvme-mi-recv.html +++ b/Documentation/nvme-nvme-mi-recv.html @@ -905,7 +905,7 @@ Has the program issue a nvme-mi-recv to execute the VPD read. diff --git a/Documentation/nvme-nvme-mi-recv.txt b/Documentation/nvme-nvme-mi-recv.txt old mode 100755 new mode 100644 diff --git a/Documentation/nvme-nvme-mi-send.1 b/Documentation/nvme-nvme-mi-send.1 index 31317d8..c62416b 100644 --- a/Documentation/nvme-nvme-mi-send.1 +++ b/Documentation/nvme-nvme-mi-send.1 @@ -2,12 +2,12 @@ .\" Title: nvme-nvme-mi-send .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NVME\-MI\-SEND" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-NVME\-MI\-SEND" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-nvme-mi-send.html b/Documentation/nvme-nvme-mi-send.html index 85aef3a..4f05adc 100644 --- a/Documentation/nvme-nvme-mi-send.html +++ b/Documentation/nvme-nvme-mi-send.html @@ -905,7 +905,7 @@ Has the program issue a nvme-mi-send to execute the VPD write. diff --git a/Documentation/nvme-nvme-mi-send.txt b/Documentation/nvme-nvme-mi-send.txt old mode 100755 new mode 100644 diff --git a/Documentation/nvme-ocp-clear-fw-activate-history.1 b/Documentation/nvme-ocp-clear-fw-activate-history.1 index 29e9e95..7c56258 100644 --- a/Documentation/nvme-ocp-clear-fw-activate-history.1 +++ b/Documentation/nvme-ocp-clear-fw-activate-history.1 @@ -2,12 +2,12 @@ .\" Title: nvme-ocp-clear-fw-activate-history .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-OCP\-CLEAR\-FW" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-OCP\-CLEAR\-FW" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-ocp-clear-fw-activate-history.html b/Documentation/nvme-ocp-clear-fw-activate-history.html index a2035db..5448629 100644 --- a/Documentation/nvme-ocp-clear-fw-activate-history.html +++ b/Documentation/nvme-ocp-clear-fw-activate-history.html @@ -817,7 +817,7 @@ Clears OCP Firmware Activation History Log for the device: diff --git a/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.1 b/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.1 index 9652db5..a833306 100644 --- a/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.1 +++ b/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.1 @@ -2,12 +2,12 @@ .\" Title: nvme-ocp-clear-pcie-correctable-error-counters .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-OCP\-CLEAR\-PC" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-OCP\-CLEAR\-PC" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.html b/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.html index c05eb8d..dc7788e 100644 --- a/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.html +++ b/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.html @@ -817,7 +817,7 @@ Clears PCIe correctable error counters Log for the device: diff --git a/Documentation/nvme-ocp-eol-plp-failure-mode.1 b/Documentation/nvme-ocp-eol-plp-failure-mode.1 index dbefc04..6ff639e 100644 --- a/Documentation/nvme-ocp-eol-plp-failure-mode.1 +++ b/Documentation/nvme-ocp-eol-plp-failure-mode.1 @@ -2,12 +2,12 @@ .\" Title: nvme-ocp-eol-plp-failure-mode .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-OCP\-EOL\-PLP\" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-OCP\-EOL\-PLP\" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-ocp-eol-plp-failure-mode.html b/Documentation/nvme-ocp-eol-plp-failure-mode.html index ce22f5f..f99cfd1 100644 --- a/Documentation/nvme-ocp-eol-plp-failure-mode.html +++ b/Documentation/nvme-ocp-eol-plp-failure-mode.html @@ -886,7 +886,7 @@ Has the program issue a eol-plp-failure-mode to retrieve the 0xC2 get features. diff --git a/Documentation/nvme-ocp-get-dssd-async-event-config.txt b/Documentation/nvme-ocp-get-dssd-async-event-config.txt new file mode 100644 index 0000000..2254818 --- /dev/null +++ b/Documentation/nvme-ocp-get-dssd-async-event-config.txt @@ -0,0 +1,53 @@ +nvme-ocp-get-dssd-async-event-config(1) +======================================= + +NAME +---- +nvme-ocp-get-dssd-async-event-config - Get dssd-async-event-config value + +SYNOPSIS +-------- +[verse] +'nvme ocp get-dssd-async-event-config' [--sel=] + +DESCRIPTION +----------- +Get dssd-async-event-config. + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1). + +This will only work on OCP compliant devices supporting this feature. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +OPTIONS +------- + +-s :: + Select (SEL): This field specifies which value of the attributes + to return in the provided data: ++ +[] +|================== +|Select|Description +|0|Current +|1|Default +|2|Saved +|3|Supported capabilities +|4-7|Reserved +|================== + +EXAMPLES +-------- +* Has the program issue a get-dssd-async-event-config to retrieve the saved 0xC9 get features. ++ +------------ +# nvme ocp get-dssd-async-event-config /dev/nvme0 -s 2 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-ocp-latency-monitor-log.1 b/Documentation/nvme-ocp-latency-monitor-log.1 index 7fa607e..1433343 100644 --- a/Documentation/nvme-ocp-latency-monitor-log.1 +++ b/Documentation/nvme-ocp-latency-monitor-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-ocp-latency-monitor-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-OCP\-LATENCY\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-OCP\-LATENCY\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-ocp-latency-monitor-log.html b/Documentation/nvme-ocp-latency-monitor-log.html index a6cae12..94dd5c1 100644 --- a/Documentation/nvme-ocp-latency-monitor-log.html +++ b/Documentation/nvme-ocp-latency-monitor-log.html @@ -811,7 +811,7 @@ Displays the get latency monitor log for the device: diff --git a/Documentation/nvme-ocp-set-dssd-async-event-config.txt b/Documentation/nvme-ocp-set-dssd-async-event-config.txt new file mode 100644 index 0000000..de60bbf --- /dev/null +++ b/Documentation/nvme-ocp-set-dssd-async-event-config.txt @@ -0,0 +1,48 @@ +nvme-ocp-set-dssd-async-event-config(1) +======================================= + +NAME +---- +nvme-ocp-set-dssd-async-event-config - Set DSSD asynchronous event configuration + +SYNOPSIS +-------- +[verse] +'nvme ocp set-dssd-async-event-config' [--enable-panic-notices | -e] [--save | -s] + + +DESCRIPTION +----------- +Set DSSD asynchronous event configuration + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1). + +This will only work on OCP compliant devices supporting this feature. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-e:: +--enable-panic-notices:: + Set enable panic notices [0] + +-s:: +--save:: + Save the attribute so that it persists through all power states and resets. + + +EXAMPLES +-------- +* Has the program issue a set-dssd-async-event-config to enable panic notices, +persisting through power states. ++ +------------ +# nvme ocp set-dssd-async-event-config /dev/nvme0 -e -s +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-ocp-set-telemetry-profile.txt b/Documentation/nvme-ocp-set-telemetry-profile.txt new file mode 100644 index 0000000..bc244cf --- /dev/null +++ b/Documentation/nvme-ocp-set-telemetry-profile.txt @@ -0,0 +1,43 @@ +nvme-ocp-set-telemetry-profile(1) +================================= + +NAME +---- +nvme-ocp-set-telemetry-profile - Set Telemetry Profile + +SYNOPSIS +-------- +[verse] +'nvme ocp set-telemetry-profile' + [--telemetry-profile-select= | -t ] + +DESCRIPTION +----------- +For the NVMe device given, sets the OCP Set Telemetry Profile Feature + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1). + +This will only work on OCP compliant devices supporting this feature. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-t :: +--tps=:: + Telemetry Profile Select. The device shall collect debug data per the + specified profile number. + +EXAMPLES +-------- +* Has the program issue a set-telemetry-profile command to use profile five. ++ +------------ +# nvme ocp set-telemetry-profile /dev/nvme0 -t 5 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-ocp-smart-add-log.1 b/Documentation/nvme-ocp-smart-add-log.1 index 092321e..354718c 100644 --- a/Documentation/nvme-ocp-smart-add-log.1 +++ b/Documentation/nvme-ocp-smart-add-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-ocp-smart-add-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-OCP\-SMART\-AD" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-OCP\-SMART\-AD" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-ocp-smart-add-log.html b/Documentation/nvme-ocp-smart-add-log.html index fa10b95..73c7a14 100644 --- a/Documentation/nvme-ocp-smart-add-log.html +++ b/Documentation/nvme-ocp-smart-add-log.html @@ -812,7 +812,7 @@ Has the program issue a smart-add-log command to retrieve the 0xC0 log page. diff --git a/Documentation/nvme-persistent-event-log.1 b/Documentation/nvme-persistent-event-log.1 index 4781586..035efcf 100644 --- a/Documentation/nvme-persistent-event-log.1 +++ b/Documentation/nvme-persistent-event-log.1 @@ -2,12 +2,12 @@ .\" Title: persistent-event-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "PERSISTENT\-EVENT\-L" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "PERSISTENT\-EVENT\-L" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-persistent-event-log.html b/Documentation/nvme-persistent-event-log.html index f4998f4..5059770 100644 --- a/Documentation/nvme-persistent-event-log.html +++ b/Documentation/nvme-persistent-event-log.html @@ -877,7 +877,7 @@ Print the raw persistent event log to a file: diff --git a/Documentation/nvme-pred-lat-event-agg-log.1 b/Documentation/nvme-pred-lat-event-agg-log.1 index d3e76d9..3119771 100644 --- a/Documentation/nvme-pred-lat-event-agg-log.1 +++ b/Documentation/nvme-pred-lat-event-agg-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-pred-lat-event-agg-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-PRED\-LAT\-EVE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-PRED\-LAT\-EVE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-pred-lat-event-agg-log.html b/Documentation/nvme-pred-lat-event-agg-log.html index 3f18097..bfdba6e 100644 --- a/Documentation/nvme-pred-lat-event-agg-log.html +++ b/Documentation/nvme-pred-lat-event-agg-log.html @@ -864,7 +864,7 @@ Print the raw Predictable Latency Event Aggregate log to a file: diff --git a/Documentation/nvme-predictable-lat-log.1 b/Documentation/nvme-predictable-lat-log.1 index df39fd8..9dce5f8 100644 --- a/Documentation/nvme-predictable-lat-log.1 +++ b/Documentation/nvme-predictable-lat-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-predictable-lat-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-PREDICTABLE\-L" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-PREDICTABLE\-L" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-predictable-lat-log.html b/Documentation/nvme-predictable-lat-log.html index b4f699d..cacd2b2 100644 --- a/Documentation/nvme-predictable-lat-log.html +++ b/Documentation/nvme-predictable-lat-log.html @@ -861,7 +861,7 @@ Print the raw Predictable latency per NVM set log to a file: diff --git a/Documentation/nvme-primary-ctrl-caps.1 b/Documentation/nvme-primary-ctrl-caps.1 index 37303b1..6746009 100644 --- a/Documentation/nvme-primary-ctrl-caps.1 +++ b/Documentation/nvme-primary-ctrl-caps.1 @@ -2,12 +2,12 @@ .\" Title: nvme-primary-ctrl-caps .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-PRIMARY\-CTRL\" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-PRIMARY\-CTRL\" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-primary-ctrl-caps.html b/Documentation/nvme-primary-ctrl-caps.html index 5343c77..7ad2609 100644 --- a/Documentation/nvme-primary-ctrl-caps.html +++ b/Documentation/nvme-primary-ctrl-caps.html @@ -846,7 +846,7 @@ fields in a human readable format: diff --git a/Documentation/nvme-read.1 b/Documentation/nvme-read.1 index 85cc1e3..1d4a002 100644 --- a/Documentation/nvme-read.1 +++ b/Documentation/nvme-read.1 @@ -2,12 +2,12 @@ .\" Title: nvme-read .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-READ" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-READ" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-read.html b/Documentation/nvme-read.html index ff4ab43..1a2ef57 100644 --- a/Documentation/nvme-read.html +++ b/Documentation/nvme-read.html @@ -1087,7 +1087,7 @@ metadata is passes.

diff --git a/Documentation/nvme-reset.1 b/Documentation/nvme-reset.1 index d9fa8e6..0e871df 100644 --- a/Documentation/nvme-reset.1 +++ b/Documentation/nvme-reset.1 @@ -2,12 +2,12 @@ .\" Title: nvme-reset .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESET" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-RESET" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-reset.html b/Documentation/nvme-reset.html index 1ce4b8d..7a0a9d1 100644 --- a/Documentation/nvme-reset.html +++ b/Documentation/nvme-reset.html @@ -818,7 +818,7 @@ Resets the controller. diff --git a/Documentation/nvme-resv-acquire.1 b/Documentation/nvme-resv-acquire.1 index f308bf3..8967d2a 100644 --- a/Documentation/nvme-resv-acquire.1 +++ b/Documentation/nvme-resv-acquire.1 @@ -2,12 +2,12 @@ .\" Title: nvme-resv-acquire .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESV\-ACQUIRE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-RESV\-ACQUIRE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-resv-acquire.html b/Documentation/nvme-resv-acquire.html index 35719ee..5571095 100644 --- a/Documentation/nvme-resv-acquire.html +++ b/Documentation/nvme-resv-acquire.html @@ -971,7 +971,7 @@ cellspacing="0" cellpadding="4"> diff --git a/Documentation/nvme-resv-notif-log.1 b/Documentation/nvme-resv-notif-log.1 index 655ee09..4e7a5e5 100644 --- a/Documentation/nvme-resv-notif-log.1 +++ b/Documentation/nvme-resv-notif-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-resv-notif-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESV\-NOTIF\-L" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-RESV\-NOTIF\-L" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-resv-notif-log.html b/Documentation/nvme-resv-notif-log.html index e814928..25cc838 100644 --- a/Documentation/nvme-resv-notif-log.html +++ b/Documentation/nvme-resv-notif-log.html @@ -833,7 +833,7 @@ Print the output in json format: diff --git a/Documentation/nvme-resv-register.1 b/Documentation/nvme-resv-register.1 index 3a86f7c..4bd8b8f 100644 --- a/Documentation/nvme-resv-register.1 +++ b/Documentation/nvme-resv-register.1 @@ -2,12 +2,12 @@ .\" Title: nvme-resv-register .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESV\-REGISTER" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-RESV\-REGISTER" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-resv-register.html b/Documentation/nvme-resv-register.html index fb78ac7..8ebc682 100644 --- a/Documentation/nvme-resv-register.html +++ b/Documentation/nvme-resv-register.html @@ -960,7 +960,7 @@ cellspacing="0" cellpadding="4"> diff --git a/Documentation/nvme-resv-release.1 b/Documentation/nvme-resv-release.1 index 06ed2e7..efa7da3 100644 --- a/Documentation/nvme-resv-release.1 +++ b/Documentation/nvme-resv-release.1 @@ -2,12 +2,12 @@ .\" Title: nvme-resv-release .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESV\-RELEASE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-RESV\-RELEASE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-resv-release.html b/Documentation/nvme-resv-release.html index d166276..9b44606 100644 --- a/Documentation/nvme-resv-release.html +++ b/Documentation/nvme-resv-release.html @@ -953,7 +953,7 @@ cellspacing="0" cellpadding="4"> diff --git a/Documentation/nvme-resv-report.1 b/Documentation/nvme-resv-report.1 index 0b8e78c..ae74f7c 100644 --- a/Documentation/nvme-resv-report.1 +++ b/Documentation/nvme-resv-report.1 @@ -2,12 +2,12 @@ .\" Title: nvme-resv-report .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESV\-REPORT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-RESV\-REPORT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-resv-report.html b/Documentation/nvme-resv-report.html index 7e22653..7f85198 100644 --- a/Documentation/nvme-resv-report.html +++ b/Documentation/nvme-resv-report.html @@ -865,7 +865,7 @@ Controller data structure for each such controller).

diff --git a/Documentation/nvme-rpmb.1 b/Documentation/nvme-rpmb.1 index cedee9a..bac244e 100644 --- a/Documentation/nvme-rpmb.1 +++ b/Documentation/nvme-rpmb.1 @@ -2,12 +2,12 @@ .\" Title: nvme-rpmb .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RPMB" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-RPMB" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-rpmb.html b/Documentation/nvme-rpmb.html index 82c503b..d11772c 100644 --- a/Documentation/nvme-rpmb.html +++ b/Documentation/nvme-rpmb.html @@ -1024,7 +1024,7 @@ data onto output.bin diff --git a/Documentation/nvme-sanitize-log.1 b/Documentation/nvme-sanitize-log.1 index 11ce433..bd45bed 100644 --- a/Documentation/nvme-sanitize-log.1 +++ b/Documentation/nvme-sanitize-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-sanitize-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SANITIZE\-LOG" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SANITIZE\-LOG" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-sanitize-log.html b/Documentation/nvme-sanitize-log.html index 6872560..d5074e7 100644 --- a/Documentation/nvme-sanitize-log.html +++ b/Documentation/nvme-sanitize-log.html @@ -903,7 +903,7 @@ Has the program issue Sanitize-log Command : diff --git a/Documentation/nvme-sanitize.1 b/Documentation/nvme-sanitize.1 index e5c815f..945a98c 100644 --- a/Documentation/nvme-sanitize.1 +++ b/Documentation/nvme-sanitize.1 @@ -2,12 +2,12 @@ .\" Title: nvme-sanitize .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SANITIZE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SANITIZE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-sanitize.html b/Documentation/nvme-sanitize.html index 4469620..c4f19d4 100644 --- a/Documentation/nvme-sanitize.html +++ b/Documentation/nvme-sanitize.html @@ -960,7 +960,7 @@ Has the program issue Sanitize Command : diff --git a/Documentation/nvme-seagate-clear-fw-activate-history.1 b/Documentation/nvme-seagate-clear-fw-activate-history.1 index b5eb66a..c800caf 100644 --- a/Documentation/nvme-seagate-clear-fw-activate-history.1 +++ b/Documentation/nvme-seagate-clear-fw-activate-history.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-clear-fw-activate-history .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-CLEAR" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-CLEAR" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-clear-fw-activate-history.html b/Documentation/nvme-seagate-clear-fw-activate-history.html index 5502b59..ec6f0ae 100644 --- a/Documentation/nvme-seagate-clear-fw-activate-history.html +++ b/Documentation/nvme-seagate-clear-fw-activate-history.html @@ -792,7 +792,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-clear-pcie-correctable-errors.1 b/Documentation/nvme-seagate-clear-pcie-correctable-errors.1 index 8aaf4f5..d316f98 100644 --- a/Documentation/nvme-seagate-clear-pcie-correctable-errors.1 +++ b/Documentation/nvme-seagate-clear-pcie-correctable-errors.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-clear-pcie-correctable-errors .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-CLEAR" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-CLEAR" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-clear-pcie-correctable-errors.html b/Documentation/nvme-seagate-clear-pcie-correctable-errors.html index 08ef87d..bbfa6ea 100644 --- a/Documentation/nvme-seagate-clear-pcie-correctable-errors.html +++ b/Documentation/nvme-seagate-clear-pcie-correctable-errors.html @@ -802,7 +802,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-cloud-SSD-plugin-version.1 b/Documentation/nvme-seagate-cloud-SSD-plugin-version.1 index 88f683b..3a25d20 100644 --- a/Documentation/nvme-seagate-cloud-SSD-plugin-version.1 +++ b/Documentation/nvme-seagate-cloud-SSD-plugin-version.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-cloud-SSD-plugin-version .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-CLOUD" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-CLOUD" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-cloud-SSD-plugin-version.html b/Documentation/nvme-seagate-cloud-SSD-plugin-version.html index e8628ad..0ce76a1 100644 --- a/Documentation/nvme-seagate-cloud-SSD-plugin-version.html +++ b/Documentation/nvme-seagate-cloud-SSD-plugin-version.html @@ -787,7 +787,7 @@ nvme-seagate-cloud-SSD-plugin-version (1) Manual Page diff --git a/Documentation/nvme-seagate-get-ctrl-tele.1 b/Documentation/nvme-seagate-get-ctrl-tele.1 index e4f0af6..16aa347 100644 --- a/Documentation/nvme-seagate-get-ctrl-tele.1 +++ b/Documentation/nvme-seagate-get-ctrl-tele.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-get-ctrl-tele .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-GET\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-GET\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-get-ctrl-tele.html b/Documentation/nvme-seagate-get-ctrl-tele.html index 6b9e4e3..c29bcd4 100644 --- a/Documentation/nvme-seagate-get-ctrl-tele.html +++ b/Documentation/nvme-seagate-get-ctrl-tele.html @@ -813,7 +813,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-get-host-tele.1 b/Documentation/nvme-seagate-get-host-tele.1 index 398c2a4..f97752c 100644 --- a/Documentation/nvme-seagate-get-host-tele.1 +++ b/Documentation/nvme-seagate-get-host-tele.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-get-host-tele .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-GET\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-GET\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-get-host-tele.html b/Documentation/nvme-seagate-get-host-tele.html index 8549d55..0aa20a4 100644 --- a/Documentation/nvme-seagate-get-host-tele.html +++ b/Documentation/nvme-seagate-get-host-tele.html @@ -826,7 +826,7 @@ commands work across all product families.

diff --git a/Documentation/nvme-seagate-help.1 b/Documentation/nvme-seagate-help.1 index 3f3a9aa..5dc4755 100644 --- a/Documentation/nvme-seagate-help.1 +++ b/Documentation/nvme-seagate-help.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-help .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-HELP" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-HELP" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-help.html b/Documentation/nvme-seagate-help.html index fba2dc8..997cdd8 100644 --- a/Documentation/nvme-seagate-help.html +++ b/Documentation/nvme-seagate-help.html @@ -812,7 +812,7 @@ help Display this help diff --git a/Documentation/nvme-seagate-plugin-version.1 b/Documentation/nvme-seagate-plugin-version.1 index 702b64e..f0f5ab8 100644 --- a/Documentation/nvme-seagate-plugin-version.1 +++ b/Documentation/nvme-seagate-plugin-version.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-plugin-version .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-PLUGI" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-PLUGI" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-plugin-version.html b/Documentation/nvme-seagate-plugin-version.html index d72265a..b0adb8c 100644 --- a/Documentation/nvme-seagate-plugin-version.html +++ b/Documentation/nvme-seagate-plugin-version.html @@ -787,7 +787,7 @@ nvme-seagate-plugin-version(1) Manual Page diff --git a/Documentation/nvme-seagate-version.1 b/Documentation/nvme-seagate-version.1 index 912d947..9792495 100644 --- a/Documentation/nvme-seagate-version.1 +++ b/Documentation/nvme-seagate-version.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-version .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VERSI" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VERSI" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-version.html b/Documentation/nvme-seagate-version.html index 44c9960..7ad801a 100644 --- a/Documentation/nvme-seagate-version.html +++ b/Documentation/nvme-seagate-version.html @@ -787,7 +787,7 @@ nvme-seagate-version(1) Manual Page diff --git a/Documentation/nvme-seagate-vs-fw-activate-history.1 b/Documentation/nvme-seagate-vs-fw-activate-history.1 index cf43aa0..938b2a4 100644 --- a/Documentation/nvme-seagate-vs-fw-activate-history.1 +++ b/Documentation/nvme-seagate-vs-fw-activate-history.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-vs-fw-activate-history .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-F" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-F" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-vs-fw-activate-history.html b/Documentation/nvme-seagate-vs-fw-activate-history.html index a45e9ec..e8fbb7f 100644 --- a/Documentation/nvme-seagate-vs-fw-activate-history.html +++ b/Documentation/nvme-seagate-vs-fw-activate-history.html @@ -813,7 +813,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-vs-internal-log.1 b/Documentation/nvme-seagate-vs-internal-log.1 index 18c5a1b..af85939 100644 --- a/Documentation/nvme-seagate-vs-internal-log.1 +++ b/Documentation/nvme-seagate-vs-internal-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-vs-internal-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-I" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-I" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-vs-internal-log.html b/Documentation/nvme-seagate-vs-internal-log.html index 9eb5b72..d7d3e9c 100644 --- a/Documentation/nvme-seagate-vs-internal-log.html +++ b/Documentation/nvme-seagate-vs-internal-log.html @@ -814,7 +814,7 @@ specified device.

diff --git a/Documentation/nvme-seagate-vs-log-page-sup.1 b/Documentation/nvme-seagate-vs-log-page-sup.1 index 470e2b5..811a82f 100644 --- a/Documentation/nvme-seagate-vs-log-page-sup.1 +++ b/Documentation/nvme-seagate-vs-log-page-sup.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-vs-log-page-sup .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-L" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-L" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-vs-log-page-sup.html b/Documentation/nvme-seagate-vs-log-page-sup.html index da0d05b..d6aba9d 100644 --- a/Documentation/nvme-seagate-vs-log-page-sup.html +++ b/Documentation/nvme-seagate-vs-log-page-sup.html @@ -814,7 +814,7 @@ LogPage-Id LogPage-Name diff --git a/Documentation/nvme-seagate-vs-pcie-stats.1 b/Documentation/nvme-seagate-vs-pcie-stats.1 index 20650e4..d971dfc 100644 --- a/Documentation/nvme-seagate-vs-pcie-stats.1 +++ b/Documentation/nvme-seagate-vs-pcie-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-vs-pcie-stats .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-P" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-P" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-vs-pcie-stats.html b/Documentation/nvme-seagate-vs-pcie-stats.html index 7b8d5ec..91e8ea2 100644 --- a/Documentation/nvme-seagate-vs-pcie-stats.html +++ b/Documentation/nvme-seagate-vs-pcie-stats.html @@ -802,7 +802,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-vs-smart-add-log.1 b/Documentation/nvme-seagate-vs-smart-add-log.1 index 5a833f5..537c3a3 100644 --- a/Documentation/nvme-seagate-vs-smart-add-log.1 +++ b/Documentation/nvme-seagate-vs-smart-add-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-vs-smart-add-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-S" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-S" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-vs-smart-add-log.html b/Documentation/nvme-seagate-vs-smart-add-log.html index 54912cf..5ba2e6d 100644 --- a/Documentation/nvme-seagate-vs-smart-add-log.html +++ b/Documentation/nvme-seagate-vs-smart-add-log.html @@ -830,7 +830,7 @@ all commands work across all product families.

diff --git a/Documentation/nvme-seagate-vs-temperature-stats.1 b/Documentation/nvme-seagate-vs-temperature-stats.1 index 0de2ec1..bd935b0 100644 --- a/Documentation/nvme-seagate-vs-temperature-stats.1 +++ b/Documentation/nvme-seagate-vs-temperature-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-seagate-vs-temperature-stats .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-T" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-T" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-vs-temperature-stats.html b/Documentation/nvme-seagate-vs-temperature-stats.html index 22f13c4..3aa1056 100644 --- a/Documentation/nvme-seagate-vs-temperature-stats.html +++ b/Documentation/nvme-seagate-vs-temperature-stats.html @@ -802,7 +802,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-security-recv.1 b/Documentation/nvme-security-recv.1 index 21503cb..027fa4c 100644 --- a/Documentation/nvme-security-recv.1 +++ b/Documentation/nvme-security-recv.1 @@ -2,12 +2,12 @@ .\" Title: nvme-security-recv .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SECURITY\-RECV" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SECURITY\-RECV" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-security-recv.html b/Documentation/nvme-security-recv.html index 58da38d..d701690 100644 --- a/Documentation/nvme-security-recv.html +++ b/Documentation/nvme-security-recv.html @@ -909,7 +909,7 @@ controller reset occurs.

diff --git a/Documentation/nvme-security-send.1 b/Documentation/nvme-security-send.1 index d463f85..ec0cc20 100644 --- a/Documentation/nvme-security-send.1 +++ b/Documentation/nvme-security-send.1 @@ -2,12 +2,12 @@ .\" Title: nvme-security-send .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SECURITY\-SEND" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SECURITY\-SEND" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-security-send.html b/Documentation/nvme-security-send.html index 4ff43d9..3b560fc 100644 --- a/Documentation/nvme-security-send.html +++ b/Documentation/nvme-security-send.html @@ -896,7 +896,7 @@ Receive command is Security Protocol field dependent as defined in SPC-4.

diff --git a/Documentation/nvme-self-test-log.1 b/Documentation/nvme-self-test-log.1 index 0fe2ec5..b7db93f 100644 --- a/Documentation/nvme-self-test-log.1 +++ b/Documentation/nvme-self-test-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-self-test-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SELF\-TEST\-LO" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SELF\-TEST\-LO" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-self-test-log.html b/Documentation/nvme-self-test-log.html index 4945aa6..f27533f 100644 --- a/Documentation/nvme-self-test-log.html +++ b/Documentation/nvme-self-test-log.html @@ -858,7 +858,7 @@ Get the self-test-log and print it in a json format: diff --git a/Documentation/nvme-set-feature.1 b/Documentation/nvme-set-feature.1 index 5b635c7..3a149de 100644 --- a/Documentation/nvme-set-feature.1 +++ b/Documentation/nvme-set-feature.1 @@ -2,12 +2,12 @@ .\" Title: nvme-set-feature .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SET\-FEATURE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SET\-FEATURE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -38,6 +38,7 @@ nvme-set-feature \- Sets an NVMe feature, returns applicable results [\-\-data\-len= | \-l ] [\-\-data= | \-d ] [\-\-save | \-s] [\-\-output\-format= | \-o ] [\-\-verbose | \-v] + [\-\-cdw12= | \-c ] .fi .SH "DESCRIPTION" .sp @@ -96,6 +97,11 @@ or .RS 4 Increase the information detail in the output\&. .RE +.PP +\-c , \-\-cdw12= +.RS 4 +The value for command dword 12, if applicable\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-set-feature.html b/Documentation/nvme-set-feature.html index 7da6fae..d7b044b 100644 --- a/Documentation/nvme-set-feature.html +++ b/Documentation/nvme-set-feature.html @@ -754,7 +754,8 @@ nvme-set-feature(1) Manual Page [--uuid-index=<uuid-index> | -U <uuid_index>] [--data-len=<data-len> | -l <data-len>] [--data=<data-file> | -d <data-file>] [--save | -s] - [--output-format=<fmt> | -o <fmt>] [--verbose | -v] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v] + [--cdw12=<cdw12> | -c <cdw12>]
@@ -882,6 +883,17 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

+
+-c <cdw12> +
+
+--cdw12=<cdw12> +
+
+

+ The value for command dword 12, if applicable. +

+
@@ -922,7 +934,7 @@ Sets the host id to the ascii string. diff --git a/Documentation/nvme-set-feature.txt b/Documentation/nvme-set-feature.txt index 05c2210..a36385e 100644 --- a/Documentation/nvme-set-feature.txt +++ b/Documentation/nvme-set-feature.txt @@ -14,6 +14,7 @@ SYNOPSIS [--data-len= | -l ] [--data= | -d ] [--save | -s] [--output-format= | -o ] [--verbose | -v] + [--cdw12= | -c ] DESCRIPTION ----------- @@ -73,6 +74,10 @@ OPTIONS --verbose:: Increase the information detail in the output. +-c :: +--cdw12=:: + The value for command dword 12, if applicable. + EXAMPLES -------- * Sets the Power State (PS) to 1 in feature id 2: diff --git a/Documentation/nvme-set-property.1 b/Documentation/nvme-set-property.1 index b66fa30..8821376 100644 --- a/Documentation/nvme-set-property.1 +++ b/Documentation/nvme-set-property.1 @@ -2,12 +2,12 @@ .\" Title: nvme-set-property .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SET\-PROPERTY" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SET\-PROPERTY" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,14 +41,14 @@ nvme-set-property \- Writes and shows the defined NVMe controller property for N Writes and shows the defined NVMe controller property for NVMe over Fabric\&. .SH "OPTIONS" .PP -\-O, \-\-offset +\-O , \-\-offset= .RS 4 The offset of the property\&. .RE .PP -\-V +\-V , \-\-value= .RS 4 -\-\-value: The value of the property to be set\&. +The value of the property to be set\&. .RE .PP \-o , \-\-output\-format= diff --git a/Documentation/nvme-set-property.html b/Documentation/nvme-set-property.html index 88bda56..3686ef5 100644 --- a/Documentation/nvme-set-property.html +++ b/Documentation/nvme-set-property.html @@ -767,10 +767,10 @@ nvme-set-property(1) Manual Page
--O +-O <offset>
---offset +--offset=<offset>

@@ -778,11 +778,13 @@ nvme-set-property(1) Manual Page

--V +-V <val> +
+
+--value=<val>

---value: The value of the property to be set.

@@ -829,7 +831,7 @@ nvme-set-property(1) Manual Page diff --git a/Documentation/nvme-set-property.txt b/Documentation/nvme-set-property.txt index 22a513c..5785037 100644 --- a/Documentation/nvme-set-property.txt +++ b/Documentation/nvme-set-property.txt @@ -19,12 +19,12 @@ Writes and shows the defined NVMe controller property for NVMe over Fabric. OPTIONS ------- --O:: ---offset:: +-O :: +--offset=:: The offset of the property. --V:: ---value: +-V :: +--value=:: The value of the property to be set. -o :: diff --git a/Documentation/nvme-set-reg.txt b/Documentation/nvme-set-reg.txt new file mode 100644 index 0000000..6fd6a49 --- /dev/null +++ b/Documentation/nvme-set-reg.txt @@ -0,0 +1,102 @@ +nvme-set-reg(1) +=============== + +NAME +---- +nvme-set-reg - Writes and shows the defined NVMe controller register + +SYNOPSIS +-------- +[verse] +'nvme set-reg' [--offset=, -O ] + [--value= | -V ] [--mmio32 | -m] + [--intms=] [--intmc=] [--cc=] + [--csts=] [--nssr=] [--aqa=] + [--asq=] [--acq=] [--bprsel=] + [--bpmbl=] [--cmbmsc=] [--nssd=] + [--pmrctl=] [--pmrmscl=] [--pmrmscu=] + [--output-format= | -o ] [--verbose | -v] + +DESCRIPTION +----------- +Writes and shows the defined NVMe controller register. + +OPTIONS +------- +-O :: +--offset=:: + offset of the requested register + +-V :: +--value=:: + the value of the register to be set + +--mmio32:: +-m:: + Access 64-bit registers as 2 32-bit + +--intms=:: + INTMS=0xc register offset + +--intmc=:: + INTMC=0x10 register offset + +--cc=:: + CC=0x14 register offset + +--csts=:: + CSTS=0x1c register offset + +--nssr=:: + NSSR=0x20 register offset + +--aqa=:: + AQA=0x24 register offset + +--asq=:: + ASQ=0x28 register offset + +--acq=:: + ACQ=0x30 register offset + +--bprsel=:: + BPRSEL=0x44 register offset + +--bpmbl=:: + BPMBL=0x48 register offset + +--cmbmsc=:: + CMBMSC=0x50 register offset + +--nssd=:: + NSSD=0x64 register offset + +--pmrctl=:: + PMRCTL=0xe04 register offset + +--pmrmscl=:: + PMRMSCL=0xe14 register offset + +--pmrmscu=:: + PMRMSCU=0xe18 register offset + +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json' or 'binary'. Only one + output format can be used at a time. + +-v:: +--verbose:: + Increase the information detail in the output. + +EXAMPLES +-------- +* The following will run the set-reg command with offset 0x14 and value 0x460000 ++ +------------ +# nvme set-reg /dev/nvme0 -O 0x14 -V 0x460000 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-show-hostnqn.1 b/Documentation/nvme-show-hostnqn.1 index 618ad0f..ed83aed 100644 --- a/Documentation/nvme-show-hostnqn.1 +++ b/Documentation/nvme-show-hostnqn.1 @@ -2,12 +2,12 @@ .\" Title: nvme-show-hostnqn .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SHOW\-HOSTNQN" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SHOW\-HOSTNQN" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-show-hostnqn.html b/Documentation/nvme-show-hostnqn.html index c948837..a7e7277 100644 --- a/Documentation/nvme-show-hostnqn.html +++ b/Documentation/nvme-show-hostnqn.html @@ -809,7 +809,7 @@ this will show the systemd-generated host NQN for the system.

diff --git a/Documentation/nvme-show-regs.1 b/Documentation/nvme-show-regs.1 index 115a00d..c60e88d 100644 --- a/Documentation/nvme-show-regs.1 +++ b/Documentation/nvme-show-regs.1 @@ -2,12 +2,12 @@ .\" Title: nvme-id-ns .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-NS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-NS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-show-regs.html b/Documentation/nvme-show-regs.html index 0fbe431..bf1c3b7 100644 --- a/Documentation/nvme-show-regs.html +++ b/Documentation/nvme-show-regs.html @@ -859,7 +859,7 @@ in a json format: diff --git a/Documentation/nvme-show-topology.1 b/Documentation/nvme-show-topology.1 index cde2d83..f50418f 100644 --- a/Documentation/nvme-show-topology.1 +++ b/Documentation/nvme-show-topology.1 @@ -2,12 +2,12 @@ .\" Title: nvme-show-topology .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SHOW\-TOPOLOGY" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SHOW\-TOPOLOGY" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-show-topology.html b/Documentation/nvme-show-topology.html index 51196db..9807124 100644 --- a/Documentation/nvme-show-topology.html +++ b/Documentation/nvme-show-topology.html @@ -845,7 +845,7 @@ nvme-show-topology(1) Manual Page diff --git a/Documentation/nvme-smart-log.1 b/Documentation/nvme-smart-log.1 index abb0ed7..7a6cbf0 100644 --- a/Documentation/nvme-smart-log.1 +++ b/Documentation/nvme-smart-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-smart-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SMART\-LOG" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SMART\-LOG" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-smart-log.html b/Documentation/nvme-smart-log.html index 989675d..228dee6 100644 --- a/Documentation/nvme-smart-log.html +++ b/Documentation/nvme-smart-log.html @@ -861,7 +861,7 @@ Print the raw SMART log to a file: diff --git a/Documentation/nvme-subsystem-reset.1 b/Documentation/nvme-subsystem-reset.1 index 7bdae5b..80404e6 100644 --- a/Documentation/nvme-subsystem-reset.1 +++ b/Documentation/nvme-subsystem-reset.1 @@ -2,12 +2,12 @@ .\" Title: nvme-subsystem-reset .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SUBSYSTEM\-RES" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SUBSYSTEM\-RES" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-subsystem-reset.html b/Documentation/nvme-subsystem-reset.html index 4847ad4..17ce8ea 100644 --- a/Documentation/nvme-subsystem-reset.html +++ b/Documentation/nvme-subsystem-reset.html @@ -819,7 +819,7 @@ Resets the subsystem. diff --git a/Documentation/nvme-supported-log-pages.1 b/Documentation/nvme-supported-log-pages.1 index 4d2574f..11f08f8 100644 --- a/Documentation/nvme-supported-log-pages.1 +++ b/Documentation/nvme-supported-log-pages.1 @@ -2,12 +2,12 @@ .\" Title: nvme-supported-log-pages .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SUPPORTED\-LOG" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-SUPPORTED\-LOG" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-supported-log-pages.html b/Documentation/nvme-supported-log-pages.html index 5073a61..3c5075d 100644 --- a/Documentation/nvme-supported-log-pages.html +++ b/Documentation/nvme-supported-log-pages.html @@ -813,7 +813,7 @@ for each command that is supported.

diff --git a/Documentation/nvme-telemetry-log.1 b/Documentation/nvme-telemetry-log.1 index 4522c5b..b125757 100644 --- a/Documentation/nvme-telemetry-log.1 +++ b/Documentation/nvme-telemetry-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-telemetry-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TELEMETRY\-LOG" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-TELEMETRY\-LOG" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-telemetry-log.html b/Documentation/nvme-telemetry-log.html index 7d5f95c..263a22a 100644 --- a/Documentation/nvme-telemetry-log.html +++ b/Documentation/nvme-telemetry-log.html @@ -862,7 +862,7 @@ Retrieve Telemetry Host-Initiated data to telemetry_log.bin diff --git a/Documentation/nvme-tls-key.txt b/Documentation/nvme-tls-key.txt new file mode 100644 index 0000000..15942a4 --- /dev/null +++ b/Documentation/nvme-tls-key.txt @@ -0,0 +1,69 @@ +nvme-tls-key(1) +====================== + +NAME +---- +nvme-tls-key - Manage NVMe TLS PSKs + +SYNOPSIS +-------- +[verse] +'nvme tls-key' [--keyring= | -k ] + [--keytype= | -t ] + [--keyfile= | -f ] + [--import | -i] [--export | -e] + [--verbose | -v] + +DESCRIPTION +----------- +Import or export NVMe TLS pre-shared keys (PSKs) from the +system keystore. When the '--export' option is given, all +NVMe TLS PSKs are exported in the form + + + +where '' is the key description from the +exported key and '' is the key data in PSK interchange +format 'NVMeTLSkey-1:01::'. +Each key is exported in a single line. +When the '--import' option is given key data is read in the +same format and imported into the kernel keystore. + +OPTIONS +------- +-k :: +--keyring=:: + Name of the keyring into which the 'retained' TLS key should be + stored. Default is '.nvme'. + +-t :: +--keytype=:: + Type of the key for resulting TLS key. + Default is 'psk'. + +-k :: +--keyfile=:: + File to read the keys from or write the keys to instead of + stdin / stdout. + +-i:: +--import:: + Read the key data from the file specified by '--keyfile' + or stdin if not present. + +-e:: +--export:: + Write the key data to the file specified by '--keyfile' + or stdou if not present. + +-v:: +--verbose:: + Increase the information detail in the output. + +EXAMPLES +-------- +No Examples + +NVME +---- +Part of the nvme-user suite diff --git a/Documentation/nvme-toshiba-clear-pcie-correctable-errors.1 b/Documentation/nvme-toshiba-clear-pcie-correctable-errors.1 index cfa6106..b64f30a 100644 --- a/Documentation/nvme-toshiba-clear-pcie-correctable-errors.1 +++ b/Documentation/nvme-toshiba-clear-pcie-correctable-errors.1 @@ -2,12 +2,12 @@ .\" Title: nvme-toshiba-clear-pcie-correctable-errors .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TOSHIBA\-CLEAR" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-TOSHIBA\-CLEAR" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-toshiba-clear-pcie-correctable-errors.html b/Documentation/nvme-toshiba-clear-pcie-correctable-errors.html index 94ead34..50bb8c3 100644 --- a/Documentation/nvme-toshiba-clear-pcie-correctable-errors.html +++ b/Documentation/nvme-toshiba-clear-pcie-correctable-errors.html @@ -791,7 +791,7 @@ Clear the PCIe correctable errors count: diff --git a/Documentation/nvme-toshiba-vs-internal-log.1 b/Documentation/nvme-toshiba-vs-internal-log.1 index 68ba681..6b0ff47 100644 --- a/Documentation/nvme-toshiba-vs-internal-log.1 +++ b/Documentation/nvme-toshiba-vs-internal-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-toshiba-vs-internal-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TOSHIBA\-VS\-I" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-TOSHIBA\-VS\-I" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-toshiba-vs-internal-log.html b/Documentation/nvme-toshiba-vs-internal-log.html index e079c4d..639ba7c 100644 --- a/Documentation/nvme-toshiba-vs-internal-log.html +++ b/Documentation/nvme-toshiba-vs-internal-log.html @@ -837,7 +837,7 @@ Get the previous log from the device and save to a binary file: diff --git a/Documentation/nvme-toshiba-vs-smart-add-log.1 b/Documentation/nvme-toshiba-vs-smart-add-log.1 index 22e8a18..4b4cd39 100644 --- a/Documentation/nvme-toshiba-vs-smart-add-log.1 +++ b/Documentation/nvme-toshiba-vs-smart-add-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-toshiba-vs-smart-add-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TOSHIBA\-VS\-S" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-TOSHIBA\-VS\-S" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-toshiba-vs-smart-add-log.html b/Documentation/nvme-toshiba-vs-smart-add-log.html index ef4a80b..286bed0 100644 --- a/Documentation/nvme-toshiba-vs-smart-add-log.html +++ b/Documentation/nvme-toshiba-vs-smart-add-log.html @@ -841,7 +841,7 @@ Get the contents of log page 0xC0 from the device and save to a binary file: diff --git a/Documentation/nvme-transcend-badblock.1 b/Documentation/nvme-transcend-badblock.1 index 86774bd..4b08e27 100644 --- a/Documentation/nvme-transcend-badblock.1 +++ b/Documentation/nvme-transcend-badblock.1 @@ -2,12 +2,12 @@ .\" Title: nvme-transcend-badblock .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TRANSCEND\-BAD" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-TRANSCEND\-BAD" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-transcend-badblock.html b/Documentation/nvme-transcend-badblock.html index 4e3130a..6f7bc96 100644 --- a/Documentation/nvme-transcend-badblock.html +++ b/Documentation/nvme-transcend-badblock.html @@ -796,7 +796,7 @@ Print the Transcend device’s bad blocks in a human readable format: diff --git a/Documentation/nvme-transcend-healthvalue.1 b/Documentation/nvme-transcend-healthvalue.1 index d222a03..d041bae 100644 --- a/Documentation/nvme-transcend-healthvalue.1 +++ b/Documentation/nvme-transcend-healthvalue.1 @@ -2,12 +2,12 @@ .\" Title: nvme-transcend-healthvalue .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TRANSCEND\-HEA" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-TRANSCEND\-HEA" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-transcend-healthvalue.html b/Documentation/nvme-transcend-healthvalue.html index 8c0cf97..a8044fa 100644 --- a/Documentation/nvme-transcend-healthvalue.html +++ b/Documentation/nvme-transcend-healthvalue.html @@ -797,7 +797,7 @@ Print the Transcend Device health value in a human readable format: diff --git a/Documentation/nvme-verify.1 b/Documentation/nvme-verify.1 index d56d554..6d43ef5 100644 --- a/Documentation/nvme-verify.1 +++ b/Documentation/nvme-verify.1 @@ -2,12 +2,12 @@ .\" Title: nvme-verify .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-VERIFY" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-VERIFY" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-verify.html b/Documentation/nvme-verify.html index 8581e22..1cc3f2b 100644 --- a/Documentation/nvme-verify.html +++ b/Documentation/nvme-verify.html @@ -976,7 +976,7 @@ metadata is passes.

diff --git a/Documentation/nvme-virt-mgmt.txt b/Documentation/nvme-virt-mgmt.txt old mode 100755 new mode 100644 diff --git a/Documentation/nvme-virtium-save-smart-to-vtview-log.1 b/Documentation/nvme-virtium-save-smart-to-vtview-log.1 index 15ba0a5..56c634e 100644 --- a/Documentation/nvme-virtium-save-smart-to-vtview-log.1 +++ b/Documentation/nvme-virtium-save-smart-to-vtview-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-virtium-save-smart-to-vtview-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-VIRTIUM\-SAVE\" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-VIRTIUM\-SAVE\" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-virtium-save-smart-to-vtview-log.html b/Documentation/nvme-virtium-save-smart-to-vtview-log.html index 5edfd37..7f00b3d 100644 --- a/Documentation/nvme-virtium-save-smart-to-vtview-log.html +++ b/Documentation/nvme-virtium-save-smart-to-vtview-log.html @@ -878,7 +878,7 @@ Just logging: Default logging is run for 20 hours and log every 10 hours. diff --git a/Documentation/nvme-virtium-show-identify.1 b/Documentation/nvme-virtium-show-identify.1 index 10f9697..87b28fd 100644 --- a/Documentation/nvme-virtium-show-identify.1 +++ b/Documentation/nvme-virtium-show-identify.1 @@ -2,12 +2,12 @@ .\" Title: nvme-virtium-show-identify .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-VIRTIUM\-SHOW\" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-VIRTIUM\-SHOW\" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-virtium-show-identify.html b/Documentation/nvme-virtium-show-identify.html index 9e03e8d..62e5247 100644 --- a/Documentation/nvme-virtium-show-identify.html +++ b/Documentation/nvme-virtium-show-identify.html @@ -798,7 +798,7 @@ Show Identify Device: diff --git a/Documentation/nvme-wdc-cap-diag.1 b/Documentation/nvme-wdc-cap-diag.1 index b6a50aa..d9be7d8 100644 --- a/Documentation/nvme-wdc-cap-diag.1 +++ b/Documentation/nvme-wdc-cap-diag.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-cap-diag .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CAP\-DIAG" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CAP\-DIAG" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-cap-diag.html b/Documentation/nvme-wdc-cap-diag.html index f25b31c..a5b1910 100644 --- a/Documentation/nvme-wdc-cap-diag.html +++ b/Documentation/nvme-wdc-cap-diag.html @@ -856,7 +856,7 @@ Gets the capture diagnostics log from the device transferring the data in 16k ch diff --git a/Documentation/nvme-wdc-capabilities.1 b/Documentation/nvme-wdc-capabilities.1 index 3bf216b..6c8f80c 100644 --- a/Documentation/nvme-wdc-capabilities.1 +++ b/Documentation/nvme-wdc-capabilities.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-capabilities .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CAPABILIT" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CAPABILIT" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-capabilities.html b/Documentation/nvme-wdc-capabilities.html index 5768612..f2df9ec 100644 --- a/Documentation/nvme-wdc-capabilities.html +++ b/Documentation/nvme-wdc-capabilities.html @@ -789,7 +789,7 @@ Displays the capabilities for the device: diff --git a/Documentation/nvme-wdc-clear-assert-dump.1 b/Documentation/nvme-wdc-clear-assert-dump.1 index 08267d7..07917a0 100644 --- a/Documentation/nvme-wdc-clear-assert-dump.1 +++ b/Documentation/nvme-wdc-clear-assert-dump.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-clear-assert-dump .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CLEAR\-AS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CLEAR\-AS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-clear-assert-dump.html b/Documentation/nvme-wdc-clear-assert-dump.html index 2a8ab95..e436bcc 100644 --- a/Documentation/nvme-wdc-clear-assert-dump.html +++ b/Documentation/nvme-wdc-clear-assert-dump.html @@ -798,7 +798,7 @@ Clears the assert dump (if present): diff --git a/Documentation/nvme-wdc-clear-fw-activate-history.1 b/Documentation/nvme-wdc-clear-fw-activate-history.1 index 592336d..906d43f 100644 --- a/Documentation/nvme-wdc-clear-fw-activate-history.1 +++ b/Documentation/nvme-wdc-clear-fw-activate-history.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-clear-fw-activate-history .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CLEAR\-FW" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CLEAR\-FW" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-clear-fw-activate-history.html b/Documentation/nvme-wdc-clear-fw-activate-history.html index 6fc6434..fcc0f61 100644 --- a/Documentation/nvme-wdc-clear-fw-activate-history.html +++ b/Documentation/nvme-wdc-clear-fw-activate-history.html @@ -797,7 +797,7 @@ Clears the firmware activate history table: diff --git a/Documentation/nvme-wdc-clear-pcie-correctable-errors.1 b/Documentation/nvme-wdc-clear-pcie-correctable-errors.1 index b3cff45..2944326 100644 --- a/Documentation/nvme-wdc-clear-pcie-correctable-errors.1 +++ b/Documentation/nvme-wdc-clear-pcie-correctable-errors.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-clear-pcie-correctable-errors .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CLEAR\-PC" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CLEAR\-PC" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-clear-pcie-correctable-errors.html b/Documentation/nvme-wdc-clear-pcie-correctable-errors.html index 30e109f..5a3ee58 100644 --- a/Documentation/nvme-wdc-clear-pcie-correctable-errors.html +++ b/Documentation/nvme-wdc-clear-pcie-correctable-errors.html @@ -799,7 +799,7 @@ Clears the PCIe Correctable Error Count field returned in the smart-log-add comm diff --git a/Documentation/nvme-wdc-cloud-SSD-plugin-version.1 b/Documentation/nvme-wdc-cloud-SSD-plugin-version.1 index 8f1147a..18752d0 100644 --- a/Documentation/nvme-wdc-cloud-SSD-plugin-version.1 +++ b/Documentation/nvme-wdc-cloud-SSD-plugin-version.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-cloud-SSD-plugin-version .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CLOUD\-SS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CLOUD\-SS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-cloud-SSD-plugin-version.html b/Documentation/nvme-wdc-cloud-SSD-plugin-version.html index 314631e..f8084aa 100644 --- a/Documentation/nvme-wdc-cloud-SSD-plugin-version.html +++ b/Documentation/nvme-wdc-cloud-SSD-plugin-version.html @@ -790,7 +790,7 @@ Displays the cloud ssd plugin version for the device: diff --git a/Documentation/nvme-wdc-cloud-boot-SSD-version.1 b/Documentation/nvme-wdc-cloud-boot-SSD-version.1 index a79a715..c8f506b 100644 --- a/Documentation/nvme-wdc-cloud-boot-SSD-version.1 +++ b/Documentation/nvme-wdc-cloud-boot-SSD-version.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-cloud-boot-SSD-version .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CLOUD\-BO" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CLOUD\-BO" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-cloud-boot-SSD-version.html b/Documentation/nvme-wdc-cloud-boot-SSD-version.html index 7369c48..5633d02 100644 --- a/Documentation/nvme-wdc-cloud-boot-SSD-version.html +++ b/Documentation/nvme-wdc-cloud-boot-SSD-version.html @@ -790,7 +790,7 @@ Displays the cloud boot ssd version for the device: diff --git a/Documentation/nvme-wdc-drive-essentials.1 b/Documentation/nvme-wdc-drive-essentials.1 index 850d63b..4f66c4e 100644 --- a/Documentation/nvme-wdc-drive-essentials.1 +++ b/Documentation/nvme-wdc-drive-essentials.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-drive-essentials .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-DRIVE\-ES" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-DRIVE\-ES" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-drive-essentials.html b/Documentation/nvme-wdc-drive-essentials.html index 40dad8a..18e3844 100644 --- a/Documentation/nvme-wdc-drive-essentials.html +++ b/Documentation/nvme-wdc-drive-essentials.html @@ -822,7 +822,7 @@ Gets the drive essentials data files from the device and saves the tar file to s diff --git a/Documentation/nvme-wdc-drive-log.1 b/Documentation/nvme-wdc-drive-log.1 index 845e59f..f92e9f7 100644 --- a/Documentation/nvme-wdc-drive-log.1 +++ b/Documentation/nvme-wdc-drive-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-drive-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-DRIVE\-LO" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-DRIVE\-LO" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-drive-log.html b/Documentation/nvme-wdc-drive-log.html index 625c6be..57fe1de 100644 --- a/Documentation/nvme-wdc-drive-log.html +++ b/Documentation/nvme-wdc-drive-log.html @@ -829,7 +829,7 @@ Gets the drive log from the device and saves to defined file with pathname (e.g. diff --git a/Documentation/nvme-wdc-drive-resize.1 b/Documentation/nvme-wdc-drive-resize.1 index 4eca4e3..9e6f46b 100644 --- a/Documentation/nvme-wdc-drive-resize.1 +++ b/Documentation/nvme-wdc-drive-resize.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-drive-resize .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-DRIVE\-RE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-DRIVE\-RE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-drive-resize.html b/Documentation/nvme-wdc-drive-resize.html index 7cdc9c2..5915777 100644 --- a/Documentation/nvme-wdc-drive-resize.html +++ b/Documentation/nvme-wdc-drive-resize.html @@ -810,7 +810,7 @@ Has the program issue WDC Resize Vendor Unique Command : diff --git a/Documentation/nvme-wdc-enc-get-log.1 b/Documentation/nvme-wdc-enc-get-log.1 index 36429ee..6de5dd7 100644 --- a/Documentation/nvme-wdc-enc-get-log.1 +++ b/Documentation/nvme-wdc-enc-get-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-enc-get-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-ENC\-GET\" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-ENC\-GET\" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-enc-get-log.html b/Documentation/nvme-wdc-enc-get-log.html index 1d94744..d04d8a5 100644 --- a/Documentation/nvme-wdc-enc-get-log.html +++ b/Documentation/nvme-wdc-enc-get-log.html @@ -837,7 +837,7 @@ Gets the enclosure log from the device based on the log id(0xd2) with default tr diff --git a/Documentation/nvme-wdc-get-crash-dump.1 b/Documentation/nvme-wdc-get-crash-dump.1 index 803596c..a6e7cf8 100644 --- a/Documentation/nvme-wdc-get-crash-dump.1 +++ b/Documentation/nvme-wdc-get-crash-dump.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-get-crash-dump .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-CRAS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-CRAS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-get-crash-dump.html b/Documentation/nvme-wdc-get-crash-dump.html index 22eaaa4..2516997 100644 --- a/Documentation/nvme-wdc-get-crash-dump.html +++ b/Documentation/nvme-wdc-get-crash-dump.html @@ -830,7 +830,7 @@ Gets the crash dump from the device and saves to defined file with pathname (e.g diff --git a/Documentation/nvme-wdc-get-dev-capabilities-log.1 b/Documentation/nvme-wdc-get-dev-capabilities-log.1 index a838f03..ea4d9c6 100644 --- a/Documentation/nvme-wdc-get-dev-capabilities-log.1 +++ b/Documentation/nvme-wdc-get-dev-capabilities-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-get-dev-capabilities-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-DEV\" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-DEV\" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-get-dev-capabilities-log.html b/Documentation/nvme-wdc-get-dev-capabilities-log.html index 4f1869f..c391d2d 100644 --- a/Documentation/nvme-wdc-get-dev-capabilities-log.html +++ b/Documentation/nvme-wdc-get-dev-capabilities-log.html @@ -815,7 +815,7 @@ Has the program issue WDC get-dev-capabilities-log plugin command : diff --git a/Documentation/nvme-wdc-get-drive-status.1 b/Documentation/nvme-wdc-get-drive-status.1 index f9e44f3..32e82f5 100644 --- a/Documentation/nvme-wdc-get-drive-status.1 +++ b/Documentation/nvme-wdc-get-drive-status.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-get-drive-status .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-DRIV" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-DRIV" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-get-drive-status.html b/Documentation/nvme-wdc-get-drive-status.html index 47df6df..529a408 100644 --- a/Documentation/nvme-wdc-get-drive-status.html +++ b/Documentation/nvme-wdc-get-drive-status.html @@ -836,7 +836,7 @@ Has the program issue WDC get-drive-status command : diff --git a/Documentation/nvme-wdc-get-error-recovery-log.1 b/Documentation/nvme-wdc-get-error-recovery-log.1 index 8b0cc43..6cd0acb 100644 --- a/Documentation/nvme-wdc-get-error-recovery-log.1 +++ b/Documentation/nvme-wdc-get-error-recovery-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-get-error-recovery-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-ERRO" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-ERRO" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-get-error-recovery-log.html b/Documentation/nvme-wdc-get-error-recovery-log.html index 342bfb9..719bbee 100644 --- a/Documentation/nvme-wdc-get-error-recovery-log.html +++ b/Documentation/nvme-wdc-get-error-recovery-log.html @@ -816,7 +816,7 @@ Has the program issue WDC get-error-recovery-log plugin command : diff --git a/Documentation/nvme-wdc-get-latency-monitor-log.1 b/Documentation/nvme-wdc-get-latency-monitor-log.1 index 437e9c6..c3c3014 100644 --- a/Documentation/nvme-wdc-get-latency-monitor-log.1 +++ b/Documentation/nvme-wdc-get-latency-monitor-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-get-latency-monitor-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-LATE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-LATE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-get-latency-monitor-log.html b/Documentation/nvme-wdc-get-latency-monitor-log.html index 092f346..e0f6101 100644 --- a/Documentation/nvme-wdc-get-latency-monitor-log.html +++ b/Documentation/nvme-wdc-get-latency-monitor-log.html @@ -810,7 +810,7 @@ Displays the get latency monitor log for the device: diff --git a/Documentation/nvme-wdc-get-pfail-dump.1 b/Documentation/nvme-wdc-get-pfail-dump.1 index 37ba4a1..aaeb429 100644 --- a/Documentation/nvme-wdc-get-pfail-dump.1 +++ b/Documentation/nvme-wdc-get-pfail-dump.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-get-pfail-dump .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-PFAI" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-PFAI" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-get-pfail-dump.html b/Documentation/nvme-wdc-get-pfail-dump.html index 3fd5726..4b08016 100644 --- a/Documentation/nvme-wdc-get-pfail-dump.html +++ b/Documentation/nvme-wdc-get-pfail-dump.html @@ -832,7 +832,7 @@ Gets the pfail crash dump from the device and saves to defined file with pathnam diff --git a/Documentation/nvme-wdc-get-unsupported-reqs-log.1 b/Documentation/nvme-wdc-get-unsupported-reqs-log.1 index f458f33..462f025 100644 --- a/Documentation/nvme-wdc-get-unsupported-reqs-log.1 +++ b/Documentation/nvme-wdc-get-unsupported-reqs-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-get-unsupported-reqs-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-UNSU" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-UNSU" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-get-unsupported-reqs-log.html b/Documentation/nvme-wdc-get-unsupported-reqs-log.html index 57cd697..8aa5aab 100644 --- a/Documentation/nvme-wdc-get-unsupported-reqs-log.html +++ b/Documentation/nvme-wdc-get-unsupported-reqs-log.html @@ -816,7 +816,7 @@ Has the program issue WDC get-unsupported-reqs-log plugin command : diff --git a/Documentation/nvme-wdc-id-ctrl.1 b/Documentation/nvme-wdc-id-ctrl.1 index c3a31da..e7e7d42 100644 --- a/Documentation/nvme-wdc-id-ctrl.1 +++ b/Documentation/nvme-wdc-id-ctrl.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-id-ctrl .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-ID\-CTRL" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-ID\-CTRL" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-id-ctrl.html b/Documentation/nvme-wdc-id-ctrl.html index 36c535d..375e2c4 100644 --- a/Documentation/nvme-wdc-id-ctrl.html +++ b/Documentation/nvme-wdc-id-ctrl.html @@ -856,7 +856,7 @@ fields in a human readable format: diff --git a/Documentation/nvme-wdc-log-page-directory.1 b/Documentation/nvme-wdc-log-page-directory.1 index 5856e24..adf4078 100644 --- a/Documentation/nvme-wdc-log-page-directory.1 +++ b/Documentation/nvme-wdc-log-page-directory.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-log-page-directory .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-LOG\-PAGE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-LOG\-PAGE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-log-page-directory.html b/Documentation/nvme-wdc-log-page-directory.html index 2192754..96beb3d 100644 --- a/Documentation/nvme-wdc-log-page-directory.html +++ b/Documentation/nvme-wdc-log-page-directory.html @@ -812,7 +812,7 @@ WDC log-page-directory example command : diff --git a/Documentation/nvme-wdc-namespace-resize.1 b/Documentation/nvme-wdc-namespace-resize.1 index 88637d9..f78a96a 100644 --- a/Documentation/nvme-wdc-namespace-resize.1 +++ b/Documentation/nvme-wdc-namespace-resize.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-namespace-resize .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-NAMESPACE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-NAMESPACE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-namespace-resize.html b/Documentation/nvme-wdc-namespace-resize.html index d5fcc2b..cc38baa 100644 --- a/Documentation/nvme-wdc-namespace-resize.html +++ b/Documentation/nvme-wdc-namespace-resize.html @@ -836,7 +836,7 @@ Resizes namespace 2 to 7% of the original TNVMCAP reported value: diff --git a/Documentation/nvme-wdc-purge-monitor.1 b/Documentation/nvme-wdc-purge-monitor.1 index e01e1c1..253d3c9 100644 --- a/Documentation/nvme-wdc-purge-monitor.1 +++ b/Documentation/nvme-wdc-purge-monitor.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-purge-monitor .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-PURGE\-MO" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-PURGE\-MO" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-purge-monitor.html b/Documentation/nvme-wdc-purge-monitor.html index c25a28f..a64dc22 100644 --- a/Documentation/nvme-wdc-purge-monitor.html +++ b/Documentation/nvme-wdc-purge-monitor.html @@ -837,7 +837,7 @@ Has the program issue WDC Purge-Monitor Vendor Unique Command : diff --git a/Documentation/nvme-wdc-purge.1 b/Documentation/nvme-wdc-purge.1 index 89fb3b4..d007fa3 100644 --- a/Documentation/nvme-wdc-purge.1 +++ b/Documentation/nvme-wdc-purge.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-purge .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-PURGE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-PURGE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-purge.html b/Documentation/nvme-wdc-purge.html index 9afac8e..433fd3b 100644 --- a/Documentation/nvme-wdc-purge.html +++ b/Documentation/nvme-wdc-purge.html @@ -799,7 +799,7 @@ Has the program issue WDC Purge Vendor Unique Command : diff --git a/Documentation/nvme-wdc-vs-cloud-log.1 b/Documentation/nvme-wdc-vs-cloud-log.1 index 91f4c99..5cde88f 100644 --- a/Documentation/nvme-wdc-vs-cloud-log.1 +++ b/Documentation/nvme-wdc-vs-cloud-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-cloud-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-CLOUD" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-CLOUD" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-cloud-log.html b/Documentation/nvme-wdc-vs-cloud-log.html index f34317a..75aa3e3 100644 --- a/Documentation/nvme-wdc-vs-cloud-log.html +++ b/Documentation/nvme-wdc-vs-cloud-log.html @@ -828,7 +828,7 @@ Has the program issue WDC vs-cloud-log Vendor Unique Command : diff --git a/Documentation/nvme-wdc-vs-device-waf.1 b/Documentation/nvme-wdc-vs-device-waf.1 index d864c80..372d4d8 100644 --- a/Documentation/nvme-wdc-vs-device-waf.1 +++ b/Documentation/nvme-wdc-vs-device-waf.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-device-waf .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-DEVIC" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-DEVIC" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-device-waf.html b/Documentation/nvme-wdc-vs-device-waf.html index a4a90be..a882eaa 100644 --- a/Documentation/nvme-wdc-vs-device-waf.html +++ b/Documentation/nvme-wdc-vs-device-waf.html @@ -828,7 +828,7 @@ Has the program issue WDC vs-device-waf plugin Command : diff --git a/Documentation/nvme-wdc-vs-drive-info.1 b/Documentation/nvme-wdc-vs-drive-info.1 index 2816277..583ca23 100644 --- a/Documentation/nvme-wdc-vs-drive-info.1 +++ b/Documentation/nvme-wdc-vs-drive-info.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-drive-info .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-DRIVE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-DRIVE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-drive-info.html b/Documentation/nvme-wdc-vs-drive-info.html index ede45c7..08f1918 100644 --- a/Documentation/nvme-wdc-vs-drive-info.html +++ b/Documentation/nvme-wdc-vs-drive-info.html @@ -795,7 +795,7 @@ on the drive:

diff --git a/Documentation/nvme-wdc-vs-error-reason-identifier.1 b/Documentation/nvme-wdc-vs-error-reason-identifier.1 index 05e12fb..ba6fe3b 100644 --- a/Documentation/nvme-wdc-vs-error-reason-identifier.1 +++ b/Documentation/nvme-wdc-vs-error-reason-identifier.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-error-reason-identifier .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-ERROR" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-ERROR" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-error-reason-identifier.html b/Documentation/nvme-wdc-vs-error-reason-identifier.html index 4c96ee8..606ab4e 100644 --- a/Documentation/nvme-wdc-vs-error-reason-identifier.html +++ b/Documentation/nvme-wdc-vs-error-reason-identifier.html @@ -836,7 +836,7 @@ Retrieves the controller initiated error reason identifier field and save it in diff --git a/Documentation/nvme-wdc-vs-fw-activate-history.1 b/Documentation/nvme-wdc-vs-fw-activate-history.1 index 9fab5ae..d904117 100644 --- a/Documentation/nvme-wdc-vs-fw-activate-history.1 +++ b/Documentation/nvme-wdc-vs-fw-activate-history.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-fw-activate-history .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-FW\-A" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-FW\-A" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-fw-activate-history.html b/Documentation/nvme-wdc-vs-fw-activate-history.html index cdae180..4b133ce 100644 --- a/Documentation/nvme-wdc-vs-fw-activate-history.html +++ b/Documentation/nvme-wdc-vs-fw-activate-history.html @@ -868,7 +868,7 @@ Has the program issue WDC vs-fw-activate-history Vendor Unique Command : diff --git a/Documentation/nvme-wdc-vs-hw-rev-log.1 b/Documentation/nvme-wdc-vs-hw-rev-log.1 index abe700f..dd7cdf5 100644 --- a/Documentation/nvme-wdc-vs-hw-rev-log.1 +++ b/Documentation/nvme-wdc-vs-hw-rev-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-hw-rev-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-HW\-R" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-HW\-R" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-hw-rev-log.html b/Documentation/nvme-wdc-vs-hw-rev-log.html index 5225883..f46d71f 100644 --- a/Documentation/nvme-wdc-vs-hw-rev-log.html +++ b/Documentation/nvme-wdc-vs-hw-rev-log.html @@ -827,7 +827,7 @@ Has the program issue WDC vs-hw-rev-log plugin Command : diff --git a/Documentation/nvme-wdc-vs-internal-log.1 b/Documentation/nvme-wdc-vs-internal-log.1 index 0f94172..feb2748 100644 --- a/Documentation/nvme-wdc-vs-internal-log.1 +++ b/Documentation/nvme-wdc-vs-internal-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-internal-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-INTER" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-INTER" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-internal-log.html b/Documentation/nvme-wdc-vs-internal-log.html index e07879b..12c387e 100644 --- a/Documentation/nvme-wdc-vs-internal-log.html +++ b/Documentation/nvme-wdc-vs-internal-log.html @@ -958,7 +958,7 @@ Gets the controller telemetry log page to data area 3 from the device and stores diff --git a/Documentation/nvme-wdc-vs-nand-stats.1 b/Documentation/nvme-wdc-vs-nand-stats.1 index 7723faf..6c6a17b 100644 --- a/Documentation/nvme-wdc-vs-nand-stats.1 +++ b/Documentation/nvme-wdc-vs-nand-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-nand-stats .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-NAND\" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-NAND\" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-nand-stats.html b/Documentation/nvme-wdc-vs-nand-stats.html index 073efb0..498bf22 100644 --- a/Documentation/nvme-wdc-vs-nand-stats.html +++ b/Documentation/nvme-wdc-vs-nand-stats.html @@ -814,7 +814,7 @@ Has the program issue WDC vs-nand-stats Vendor Unique Command : diff --git a/Documentation/nvme-wdc-vs-smart-add-log.1 b/Documentation/nvme-wdc-vs-smart-add-log.1 index 269000a..57d15b9 100644 --- a/Documentation/nvme-wdc-vs-smart-add-log.1 +++ b/Documentation/nvme-wdc-vs-smart-add-log.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-smart-add-log .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-SMART" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-SMART" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-smart-add-log.html b/Documentation/nvme-wdc-vs-smart-add-log.html index 34291ef..1d720af 100644 --- a/Documentation/nvme-wdc-vs-smart-add-log.html +++ b/Documentation/nvme-wdc-vs-smart-add-log.html @@ -928,7 +928,7 @@ Has the program issue WDC vs-smart-add-log Vendor Unique Command for 0xC0 and 0x diff --git a/Documentation/nvme-wdc-vs-telemetry-controller-option.1 b/Documentation/nvme-wdc-vs-telemetry-controller-option.1 index 713642e..6aad2f9 100644 --- a/Documentation/nvme-wdc-vs-telemetry-controller-option.1 +++ b/Documentation/nvme-wdc-vs-telemetry-controller-option.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-telemetry-controller-option .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-TELEM" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-TELEM" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-telemetry-controller-option.html b/Documentation/nvme-wdc-vs-telemetry-controller-option.html index 0a0cbf8..e9ddca1 100644 --- a/Documentation/nvme-wdc-vs-telemetry-controller-option.html +++ b/Documentation/nvme-wdc-vs-telemetry-controller-option.html @@ -855,7 +855,7 @@ Gets the current status (enabled or disabled) of the controller initiated option diff --git a/Documentation/nvme-wdc-vs-temperature-stats.1 b/Documentation/nvme-wdc-vs-temperature-stats.1 index 4206337..b7131d9 100644 --- a/Documentation/nvme-wdc-vs-temperature-stats.1 +++ b/Documentation/nvme-wdc-vs-temperature-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-temperature-stats .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-TEMPE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-TEMPE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-vs-temperature-stats.html b/Documentation/nvme-wdc-vs-temperature-stats.html index cf2fa1d..b075ca0 100644 --- a/Documentation/nvme-wdc-vs-temperature-stats.html +++ b/Documentation/nvme-wdc-vs-temperature-stats.html @@ -857,7 +857,7 @@ Displays the temperature stats for the device: diff --git a/Documentation/nvme-write-uncor.1 b/Documentation/nvme-write-uncor.1 index 1523285..3475367 100644 --- a/Documentation/nvme-write-uncor.1 +++ b/Documentation/nvme-write-uncor.1 @@ -2,12 +2,12 @@ .\" Title: nvme-uncor .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-UNCOR" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-UNCOR" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-write-uncor.html b/Documentation/nvme-write-uncor.html index f4e58a9..96cb97a 100644 --- a/Documentation/nvme-write-uncor.html +++ b/Documentation/nvme-write-uncor.html @@ -868,7 +868,7 @@ blocks.

diff --git a/Documentation/nvme-write-zeroes.1 b/Documentation/nvme-write-zeroes.1 index c21c691..b210cae 100644 --- a/Documentation/nvme-write-zeroes.1 +++ b/Documentation/nvme-write-zeroes.1 @@ -2,12 +2,12 @@ .\" Title: nvme-write-zeroes .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WRITE\-ZEROES" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WRITE\-ZEROES" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-write-zeroes.html b/Documentation/nvme-write-zeroes.html index d5820b3..f8d2159 100644 --- a/Documentation/nvme-write-zeroes.html +++ b/Documentation/nvme-write-zeroes.html @@ -1011,7 +1011,7 @@ metadata is passes.

diff --git a/Documentation/nvme-write.1 b/Documentation/nvme-write.1 index 64757b4..88824a3 100644 --- a/Documentation/nvme-write.1 +++ b/Documentation/nvme-write.1 @@ -2,12 +2,12 @@ .\" Title: nvme-write .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WRITE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-WRITE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-write.html b/Documentation/nvme-write.html index 4471071..a148b82 100644 --- a/Documentation/nvme-write.html +++ b/Documentation/nvme-write.html @@ -1109,7 +1109,7 @@ metadata is passes.

diff --git a/Documentation/nvme-zns-changed-zone-list.1 b/Documentation/nvme-zns-changed-zone-list.1 index 2617f59..12cb781 100644 --- a/Documentation/nvme-zns-changed-zone-list.1 +++ b/Documentation/nvme-zns-changed-zone-list.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-changed-zone-list .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-CHANGED\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-CHANGED\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-changed-zone-list.html b/Documentation/nvme-zns-changed-zone-list.html index a52942e..0f9b2b0 100644 --- a/Documentation/nvme-zns-changed-zone-list.html +++ b/Documentation/nvme-zns-changed-zone-list.html @@ -832,7 +832,7 @@ Show the output in json format diff --git a/Documentation/nvme-zns-close-zone.1 b/Documentation/nvme-zns-close-zone.1 index 6443d0b..304b43e 100644 --- a/Documentation/nvme-zns-close-zone.1 +++ b/Documentation/nvme-zns-close-zone.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-close-zone .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-CLOSE\-ZO" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-CLOSE\-ZO" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-close-zone.html b/Documentation/nvme-zns-close-zone.html index 55e4312..6c31f89 100644 --- a/Documentation/nvme-zns-close-zone.html +++ b/Documentation/nvme-zns-close-zone.html @@ -846,7 +846,7 @@ Close all zones on namespace 1: diff --git a/Documentation/nvme-zns-finish-zone.1 b/Documentation/nvme-zns-finish-zone.1 index de7f76a..a75a64d 100644 --- a/Documentation/nvme-zns-finish-zone.1 +++ b/Documentation/nvme-zns-finish-zone.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-finish-zone .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-FINISH\-Z" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-FINISH\-Z" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-finish-zone.html b/Documentation/nvme-zns-finish-zone.html index ef7bcb8..4b45450 100644 --- a/Documentation/nvme-zns-finish-zone.html +++ b/Documentation/nvme-zns-finish-zone.html @@ -847,7 +847,7 @@ Finish all zones on namespace 1: diff --git a/Documentation/nvme-zns-id-ctrl.1 b/Documentation/nvme-zns-id-ctrl.1 index 4a95484..2930fff 100644 --- a/Documentation/nvme-zns-id-ctrl.1 +++ b/Documentation/nvme-zns-id-ctrl.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-id-ctrl .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-ID\-CTRL" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-ID\-CTRL" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-id-ctrl.html b/Documentation/nvme-zns-id-ctrl.html index 16b8914..62de674 100644 --- a/Documentation/nvme-zns-id-ctrl.html +++ b/Documentation/nvme-zns-id-ctrl.html @@ -821,7 +821,7 @@ Show the output in json format diff --git a/Documentation/nvme-zns-id-ns.1 b/Documentation/nvme-zns-id-ns.1 index 61d57b8..778ddcb 100644 --- a/Documentation/nvme-zns-id-ns.1 +++ b/Documentation/nvme-zns-id-ns.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-id-ns .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-ID\-NS" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-ID\-NS" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-id-ns.html b/Documentation/nvme-zns-id-ns.html index f099014..2ed1566 100644 --- a/Documentation/nvme-zns-id-ns.html +++ b/Documentation/nvme-zns-id-ns.html @@ -846,7 +846,7 @@ Show the output in json format with extra details diff --git a/Documentation/nvme-zns-offline-zone.1 b/Documentation/nvme-zns-offline-zone.1 index 974a77b..b994985 100644 --- a/Documentation/nvme-zns-offline-zone.1 +++ b/Documentation/nvme-zns-offline-zone.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-offline-zone .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-OFFLINE\-" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-OFFLINE\-" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-offline-zone.html b/Documentation/nvme-zns-offline-zone.html index cb4bd39..ffdd91f 100644 --- a/Documentation/nvme-zns-offline-zone.html +++ b/Documentation/nvme-zns-offline-zone.html @@ -846,7 +846,7 @@ Offline all zones on namespace 1: diff --git a/Documentation/nvme-zns-open-zone.1 b/Documentation/nvme-zns-open-zone.1 index 6831611..3aa47a0 100644 --- a/Documentation/nvme-zns-open-zone.1 +++ b/Documentation/nvme-zns-open-zone.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-open-zone .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-OPEN\-ZON" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-OPEN\-ZON" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-open-zone.html b/Documentation/nvme-zns-open-zone.html index 3db2fcc..79937f0 100644 --- a/Documentation/nvme-zns-open-zone.html +++ b/Documentation/nvme-zns-open-zone.html @@ -856,7 +856,7 @@ Open the first zone on namespace 1: diff --git a/Documentation/nvme-zns-report-zones.1 b/Documentation/nvme-zns-report-zones.1 index 37b60a6..3567b09 100644 --- a/Documentation/nvme-zns-report-zones.1 +++ b/Documentation/nvme-zns-report-zones.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-report-zones .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-REPORT\-Z" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-REPORT\-Z" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-report-zones.html b/Documentation/nvme-zns-report-zones.html index 2b12d87..539635c 100644 --- a/Documentation/nvme-zns-report-zones.html +++ b/Documentation/nvme-zns-report-zones.html @@ -957,7 +957,7 @@ Show the output in json format with extra details diff --git a/Documentation/nvme-zns-reset-zone.1 b/Documentation/nvme-zns-reset-zone.1 index 51cb758..c62ba0e 100644 --- a/Documentation/nvme-zns-reset-zone.1 +++ b/Documentation/nvme-zns-reset-zone.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-reset-zone .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-RESET\-ZO" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-RESET\-ZO" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-reset-zone.html b/Documentation/nvme-zns-reset-zone.html index 695b06c..d67563f 100644 --- a/Documentation/nvme-zns-reset-zone.html +++ b/Documentation/nvme-zns-reset-zone.html @@ -847,7 +847,7 @@ Reset the first zone on namespace 1: diff --git a/Documentation/nvme-zns-set-zone-desc.1 b/Documentation/nvme-zns-set-zone-desc.1 index 36de5fb..101d20f 100644 --- a/Documentation/nvme-zns-set-zone-desc.1 +++ b/Documentation/nvme-zns-set-zone-desc.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-set-zone-desc .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-SET\-ZONE" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-SET\-ZONE" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-set-zone-desc.html b/Documentation/nvme-zns-set-zone-desc.html index 53e41d6..d79d1f2 100644 --- a/Documentation/nvme-zns-set-zone-desc.html +++ b/Documentation/nvme-zns-set-zone-desc.html @@ -859,7 +859,7 @@ Write "hello world" into the zone descriptor for namespace 1’s first zone diff --git a/Documentation/nvme-zns-zone-append.1 b/Documentation/nvme-zns-zone-append.1 index fc226b7..affdcca 100644 --- a/Documentation/nvme-zns-zone-append.1 +++ b/Documentation/nvme-zns-zone-append.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-zone-append .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-ZONE\-APP" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-ZONE\-APP" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-zone-append.html b/Documentation/nvme-zns-zone-append.html index ff514b9..2584091 100644 --- a/Documentation/nvme-zns-zone-append.html +++ b/Documentation/nvme-zns-zone-append.html @@ -940,7 +940,7 @@ Append the data "hello world" into 4k worth of blocks into the zone starting diff --git a/Documentation/nvme-zns-zone-mgmt-recv.1 b/Documentation/nvme-zns-zone-mgmt-recv.1 index 4fa0f98..5e01783 100644 --- a/Documentation/nvme-zns-zone-mgmt-recv.1 +++ b/Documentation/nvme-zns-zone-mgmt-recv.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-zone-mgmt-recv .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-ZONE\-MGM" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-ZONE\-MGM" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-zone-mgmt-recv.html b/Documentation/nvme-zns-zone-mgmt-recv.html index 0cc2274..a998b16 100644 --- a/Documentation/nvme-zns-zone-mgmt-recv.html +++ b/Documentation/nvme-zns-zone-mgmt-recv.html @@ -880,7 +880,7 @@ Binary dump of a report all zones diff --git a/Documentation/nvme-zns-zone-mgmt-send.1 b/Documentation/nvme-zns-zone-mgmt-send.1 index 9de56a2..d8d819e 100644 --- a/Documentation/nvme-zns-zone-mgmt-send.1 +++ b/Documentation/nvme-zns-zone-mgmt-send.1 @@ -2,12 +2,12 @@ .\" Title: nvme-zns-zone-mgmt-send .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-ZONE\-MGM" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-ZONE\-MGM" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-zone-mgmt-send.html b/Documentation/nvme-zns-zone-mgmt-send.html index 1300db2..c679fdb 100644 --- a/Documentation/nvme-zns-zone-mgmt-send.html +++ b/Documentation/nvme-zns-zone-mgmt-send.html @@ -914,7 +914,7 @@ Write "hello world" into the zone descriptor for namespace 1’s first zone diff --git a/Documentation/nvme.1 b/Documentation/nvme.1 index ba7ef23..9430ca2 100644 --- a/Documentation/nvme.1 +++ b/Documentation/nvme.1 @@ -2,12 +2,12 @@ .\" Title: nvme .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/14/2024 +.\" Date: 05/03/2024 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME" "1" "02/14/2024" "NVMe" "NVMe Manual" +.TH "NVME" "1" "05/03/2024" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme.html b/Documentation/nvme.html index b92d95a..1adcce5 100644 --- a/Documentation/nvme.html +++ b/Documentation/nvme.html @@ -2114,7 +2114,7 @@ NVM-Express Site.

diff --git a/common.h b/common.h index b5594e9..a4f4f99 100644 --- a/common.h +++ b/common.h @@ -3,6 +3,7 @@ #define _COMMON_H #include +#include #include "ccan/endian/endian.h" @@ -32,7 +33,27 @@ static inline uint64_t mmio_read64(void *addr) low = le32_to_cpu(*p); high = le32_to_cpu(*(p + 1)); - return ((uint64_t) high << 32) | low; + return ((uint64_t)high << 32) | low; } +static inline void mmio_write32(void *addr, uint32_t value) +{ + leint32_t *p = addr; + + *p = cpu_to_le32(value); +} + +/* Access 64-bit registers as 2 32-bit if write32 flag set; Some devices fail 64-bit MMIO. */ +static inline void mmio_write64(void *addr, uint64_t value, bool write32) +{ + uint64_t *p = addr; + + if (write32) { + mmio_write32(addr, value); + mmio_write32((uint32_t *)addr + 1, value >> 32); + return; + } + + *p = cpu_to_le64(value); +} #endif diff --git a/completions/_nvme b/completions/_nvme index e90fc42..159a4ab 100644 --- a/completions/_nvme +++ b/completions/_nvme @@ -104,6 +104,8 @@ _nvme () { 'show-topology:show subsystem topology' 'nvme-mi-recv:send a NVMe-MI receive command' 'nvme-mi-send:send a NVMe-MI send command' + 'get-reg:read and show the defined NVMe controller register' + 'set-seg:write and show the defined NVMe controller register' 'version:show the program version' 'ocp:OCP cloud SSD extensions' 'solidigm:Solidigm plug-in extensions' @@ -264,6 +266,29 @@ _nvme () { _arguments '*:: :->subcmds' _describe -t commands "nvme ocp telemetry-string-log options" _telemetry_string_log ;; + (set-dssd-async-event-config) + local _set_dssd_async_event_config + _set_dssd_async_event_config=( + /dev/nvme':supply a device to use (required)' + --enable-panic-notices':Specifies whether an asynchronous event notification + is sent to the host for a panic event' + -e':alias for --enable-panic-notices' + --save':Specifies that the controller shall save the attribute' + -s':alias for --save' + ) + _arguments '*:: :->subcmds' + _describe -t commands "nvme ocp set-dssd-async-event-config options" _set_dssd_async_event_config + ;; + (get-dssd-async-event-config) + local _get_dssd_async_event_config + _get_dssd_async_event_config=( + /dev/nvme':supply a device to use (required)' + --sel=':select from 0 - current, 1 - default, 2 - saved, 3 - supported' + -S':alias to --sel' + ) + _arguments '*:: :->subcmds' + _describe -t commands "nvme ocp get-dssd-async-event-config options" _get_dssd_async_event_config + ;; (*) _files ;; @@ -445,6 +470,16 @@ _nvme () { _arguments '*:: :->subcmds' _describe -t commands "nvme solidigm vs-drive-info" _vs_drive_info ;; + (set-telemetry-profile) + local _ocp_set_telemetry_profile_feature + _ocp_set_telemetry_profile_feature=( + /dev/nvme':supply a device to use (required)' + --telemetry-profile-select=':Telemetry Profile Select' + -t':alias for --telemetry-profile-select' + ) + _arguments '*:: :->subcmds' + _describe -t commands "nvme ocp set-telemetry-profile options" _ocp_set_telemetry_profile_feature + ;; (*) _files ;; @@ -2234,6 +2269,81 @@ _nvme () { _arguments '*:: :->subcmds' _describe -t commands "nvme nvme-mi-send options" _nvme_mi_send ;; + (get-reg) + local _get_reg + _get_reg=( + --offset=':offset of the requested register' + -O':alias for --offset' + --human-readable':show register in readable format' + -H':alias for --human-readable' + --cap':CAP=0x0 register offset' + --vs':VS=0x8 register offset' + --cmbloc':CMBLOC=0x38 register offset' + --cmbsz':CMBSZ=0x3c register offset' + --bpinfo':BPINFO=0x40 register offset' + --cmbsts':CMBSTS=0x58 register offset' + --cmbebs':CMBEBS=0x5c register offset' + --cmbswtp':CMBSWTP=0x60 register offset' + --crto':CRTO=0x68 register offset' + --pmrcap':PMRCAP=0xe00 register offset' + --pmrsts':PMRSTS=0xe08 register offset' + --pmrebs':PMREBS=0xe0c register offset' + --pmrswtp':PMRSWTP=0xe10 register offset' + --intms':INTMS=0xc register offset' + --intmc':INTMC=0x10 register offset' + --cc':CC=0x14 register offset' + --csts':CSTS=0x1c register offset' + --nssr':NSSR=0x20 register offset' + --aqa':AQA=0x24 register offset' + --asq':ASQ=0x28 register offset' + --acq':ACQ=0x30 register offset' + --bprsel':BPRSEL=0x44 register offset' + --bpmbl':BPMBL=0x48 register offset' + --cmbmsc':CMBMSC=0x50 register offset' + --nssd':NSSD=0x64 register offset' + --pmrctl':PMRCTL=0xe04 register offset' + --pmrmscl':PMRMSCL=0xe14 register offset' + --pmrmscu':PMRMSCU=0xe18 register offset' + --output-format=':Output format: normal|json|binary' + -o ':alias for --output-format' + --verbose':Increase the information detail in the output.' + -v':alias for --verbose' + ) + _arguments '*:: :->subcmds' + _describe -t commands "nvme get-reg options" _get_reg + ;; + (set-reg) + local _set_reg + _set_reg=( + --offset=':offset of the requested register' + -O':alias for --offset' + --value=':the value of the register to be set' + -V':alias for --value' + --mmio32':Access 64-bit registers as 2 32-bit' + -m':alias for --mmio32' + --intms=':INTMS=0xc register offset' + --intmc=':INTMC=0x10 register offset' + --cc=':CC=0x14 register offset' + --csts=':CSTS=0x1c register offset' + --nssr=':NSSR=0x20 register offset' + --aqa=':AQA=0x24 register offset' + --asq=':ASQ=0x28 register offset' + --acq=':ACQ=0x30 register offset' + --bprsel=':BPRSEL=0x44 register offset' + --bpmbl=':BPMBL=0x48 register offset' + --cmbmsc=':CMBMSC=0x50 register offset' + --nssd=':NSSD=0x64 register offset' + --pmrctl=':PMRCTL=0xe04 register offset' + --pmrmscl=':PMRMSCL=0xe14 register offset' + --pmrmscu=':PMRMSCU=0xe18 register offset' + --output-format=':Output format: normal|json|binary' + -o ':alias for --output-format' + --verbose':Increase the information detail in the output.' + -v':alias for --verbose' + ) + _arguments '*:: :->subcmds' + _describe -t commands "nvme set-reg options" _set_reg + ;; (version) local _version _version=( @@ -2255,6 +2365,7 @@ _nvme () { device-capability-log':Get Device capability log' set-dssd-power-state-feature':Set DSSD Power State' telemetry-string-log':Retrieve Telemetry string Log Page' + set-telemetry-profile':Set Telemetry Profile' ) _arguments '*:: :->subcmds' _describe -t commands "nvme ocp options" _ocp diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh index d862aab..f5cdb43 100644 --- a/completions/bash-nvme-completion.sh +++ b/completions/bash-nvme-completion.sh @@ -453,6 +453,20 @@ nvme_list_opts () { opts+=" --opcode= -O --namespace-id= -n --data-len= -l \ --nmimt= -m --nmd0= -0 --nmd1= -1 --input-file= -i" ;; + "get-reg") + opts+=" --offset, -O --human-readable -H --cap --vs --cmbloc \ + --cmbsz --bpinfo --cmbsts --cmbebs --cmbswtp --crto \ + --pmrcap --pmrsts --pmrebs --pmrswtp --intms --intmc \ + --cc --csts --nssr --aqa --asq --acq --bprsel --bpmbl \ + --cmbmsc --nssd --pmrctl --pmrmscl --pmrmscu \ + --output-format -o --verbose -v" + ;; + "set-reg") + opts+=" --offset, -O --value= -V --mmio32 -m --intms= --intmc= \ + --cc= --csts= --nssr= --aqa= --asq= --acq= --bprsel= \ + --bpmbl= --cmbmsc= --nssd= --pmrctl= --pmrmscl= \ + --pmrmscu= --output-format= -o --verbose= -v" + ;; "version") opts+=$NO_OPTS ;; @@ -1444,6 +1458,15 @@ plugin_ocp_opts () { "telemetry-string-log") opts+=" --output-file= -o" ;; + "set-telemetry-profile") + opts+=" --telemetry-profile-select= -t" + ;; + "set-dssd-async-event-config") + opts+=" --enable-panic-notices -e --save -s" + ;; + "get-dssd-power-state-feature") + opts+=" --sel= -S" + ;; "help") opts+=$NO_OPTS ;; @@ -1519,7 +1542,9 @@ _nvme_subcmds () { clear-fw-activate-history eol-plp-failure-mode \ clear-pcie-correctable-error-counters \ vs-fw-activate-history device-capability-log \ - set-dssd-power-state-feature telemetry-string-log" + set-dssd-power-state-feature telemetry-string-log \ + set-telemetry-profile set-dssd-async-event-config \ + get-dssd-async-event-config" ) # Associative array mapping plugins to corresponding option completions @@ -1571,7 +1596,7 @@ _nvme_subcmds () { rpmb boot-part-log fid-support-effects-log \ supported-log-pages lockdown media-unit-stat-log \ supported-cap-config-log dim show-topology list-endgrp \ - nvme-mi-recv nvme-mi-send" + nvme-mi-recv nvme-mi-send get-reg set-reg" # Add plugins: for plugin in "${!_plugin_subcmds[@]}"; do diff --git a/fabrics.c b/fabrics.c index 1a53b23..871c20e 100644 --- a/fabrics.c +++ b/fabrics.c @@ -38,12 +38,14 @@ #include #include +#include + #include "common.h" #include "nvme.h" #include "nbft.h" -#include "libnvme.h" #include "nvme-print.h" #include "fabrics.h" +#include "util/logging.h" #define PATH_NVMF_DISC SYSCONFDIR "/nvme/discovery.conf" #define PATH_NVMF_CONFIG SYSCONFDIR "/nvme/config.json" @@ -76,6 +78,7 @@ static const char *nvmf_queue_size = "number of io queue elements to use (defaul static const char *nvmf_keep_alive_tmo = "keep alive timeout period in seconds"; static const char *nvmf_reconnect_delay = "reconnect timeout period in seconds"; static const char *nvmf_ctrl_loss_tmo = "controller loss timeout period in seconds"; +static const char *nvmf_fast_io_fail_tmo = "fast I/O fail timeout (default off)"; static const char *nvmf_tos = "type of service"; static const char *nvmf_keyring = "Keyring for TLS key lookup"; static const char *nvmf_tls_key = "TLS key to use"; @@ -106,6 +109,7 @@ static const char *nvmf_context = "execution context identification string"; OPT_INT("keep-alive-tmo", 'k', &c.keep_alive_tmo, nvmf_keep_alive_tmo), \ OPT_INT("reconnect-delay", 'c', &c.reconnect_delay, nvmf_reconnect_delay), \ OPT_INT("ctrl-loss-tmo", 'l', &c.ctrl_loss_tmo, nvmf_ctrl_loss_tmo), \ + OPT_INT("fast_io_fail_tmo", 'F', &c.fast_io_fail_tmo, nvmf_fast_io_fail_tmo),\ OPT_INT("tos", 'T', &c.tos, nvmf_tos), \ OPT_INT("keyring", 0, &c.keyring, nvmf_keyring), \ OPT_INT("tls_key", 0, &c.tls_key, nvmf_tls_key), \ @@ -195,6 +199,7 @@ static nvme_ctrl_t create_discover_ctrl(nvme_root_t r, nvme_host_t h, struct nvme_fabrics_config *cfg, struct tr_config *trcfg) { + _cleanup_free_ struct nvme_id_ctrl *id = NULL; nvme_ctrl_t c; c = __create_discover_ctrl(r, h, cfg, trcfg); @@ -204,10 +209,12 @@ static nvme_ctrl_t create_discover_ctrl(nvme_root_t r, nvme_host_t h, if (nvme_ctrl_is_unique_discovery_ctrl(c)) return c; - /* Find out the name of discovery controller */ - struct nvme_id_ctrl id = { 0 }; + id = nvme_alloc(sizeof(*id)); + if (!id) + return NULL; - if (nvme_ctrl_identify(c, &id)) { + /* Find out the name of discovery controller */ + if (nvme_ctrl_identify(c, id)) { fprintf(stderr, "failed to identify controller, error %s\n", nvme_strerror(errno)); nvme_disconnect_ctrl(c); @@ -215,7 +222,7 @@ static nvme_ctrl_t create_discover_ctrl(nvme_root_t r, nvme_host_t h, return NULL; } - if (!strcmp(id.subnqn, NVME_DISC_SUBSYS_NAME)) + if (!strcmp(id->subnqn, NVME_DISC_SUBSYS_NAME)) return c; /* @@ -225,7 +232,7 @@ static nvme_ctrl_t create_discover_ctrl(nvme_root_t r, nvme_host_t h, nvme_disconnect_ctrl(c); nvme_free_ctrl(c); - trcfg->subsysnqn = id.subnqn; + trcfg->subsysnqn = id->subnqn; return __create_discover_ctrl(r, h, cfg, trcfg); } @@ -636,7 +643,8 @@ char *nvmf_hostid_from_hostnqn(const char *hostnqn) void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn, unsigned int verbose) { - char *hostid_from_file, *hostid_from_hostnqn; + _cleanup_free_ char *hostid_from_file = NULL; + _cleanup_free_ char *hostid_from_hostnqn = NULL; if (!hostid) return; @@ -646,7 +654,6 @@ void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn, unsi if (verbose) fprintf(stderr, "warning: use generated hostid instead of hostid file\n"); - free(hostid_from_file); } if (!hostnqn) @@ -657,7 +664,6 @@ void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn, unsi if (verbose) fprintf(stderr, "warning: use hostid which does not match uuid in hostnqn\n"); - free(hostid_from_hostnqn); } } @@ -714,7 +720,9 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) if (!strcmp(config_file, "none")) config_file = NULL; - r = nvme_create_root(stderr, map_log_level(verbose, quiet)); + log_level = map_log_level(verbose, quiet); + + r = nvme_create_root(stderr, log_level); if (!r) { fprintf(stderr, "Failed to create topology root: %s\n", nvme_strerror(errno)); @@ -724,8 +732,9 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) nvme_root_set_application(r, context); ret = nvme_scan_topology(r, NULL, NULL); if (ret < 0) { - fprintf(stderr, "Failed to scan topology: %s\n", - nvme_strerror(errno)); + if (errno != ENOENT) + fprintf(stderr, "Failed to scan topology: %s\n", + nvme_strerror(errno)); nvme_free_tree(r); return ret; } @@ -942,7 +951,9 @@ int nvmf_connect(const char *desc, int argc, char **argv) if (!strcmp(config_file, "none")) config_file = NULL; - r = nvme_create_root(stderr, map_log_level(verbose, quiet)); + log_level = map_log_level(verbose, quiet); + + r = nvme_create_root(stderr, log_level); if (!r) { fprintf(stderr, "Failed to create topology root: %s\n", nvme_strerror(errno)); @@ -952,8 +963,9 @@ int nvmf_connect(const char *desc, int argc, char **argv) nvme_root_set_application(r, context); ret = nvme_scan_topology(r, NULL, NULL); if (ret < 0) { - fprintf(stderr, "Failed to scan topology: %s\n", - nvme_strerror(errno)); + if (errno != ENOENT) + fprintf(stderr, "Failed to scan topology: %s\n", + nvme_strerror(errno)); nvme_free_tree(r); return ret; } @@ -991,7 +1003,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) }; c = lookup_ctrl(h, &trcfg); - if (c && nvme_ctrl_get_name(c)) { + if (c && nvme_ctrl_get_name(c) && !cfg.duplicate_connect) { fprintf(stderr, "already connected\n"); errno = EALREADY; goto out_free; @@ -1102,7 +1114,9 @@ int nvmf_disconnect(const char *desc, int argc, char **argv) return -EINVAL; } - r = nvme_create_root(stderr, map_log_level(cfg.verbose, false)); + log_level = map_log_level(cfg.verbose, false); + + r = nvme_create_root(stderr, log_level); if (!r) { fprintf(stderr, "Failed to create topology root: %s\n", nvme_strerror(errno)); @@ -1110,8 +1124,9 @@ int nvmf_disconnect(const char *desc, int argc, char **argv) } ret = nvme_scan_topology(r, NULL, NULL); if (ret < 0) { - fprintf(stderr, "Failed to scan topology: %s\n", - nvme_strerror(errno)); + if (errno != ENOENT) + fprintf(stderr, "Failed to scan topology: %s\n", + nvme_strerror(errno)); nvme_free_tree(r); return ret; } @@ -1170,7 +1185,9 @@ int nvmf_disconnect_all(const char *desc, int argc, char **argv) if (ret) return ret; - r = nvme_create_root(stderr, map_log_level(cfg.verbose, false)); + log_level = map_log_level(cfg.verbose, false); + + r = nvme_create_root(stderr, log_level); if (!r) { fprintf(stderr, "Failed to create topology root: %s\n", nvme_strerror(errno)); @@ -1178,8 +1195,9 @@ int nvmf_disconnect_all(const char *desc, int argc, char **argv) } ret = nvme_scan_topology(r, NULL, NULL); if (ret < 0) { - fprintf(stderr, "Failed to scan topology: %s\n", - nvme_strerror(errno)); + if (errno != ENOENT) + fprintf(stderr, "Failed to scan topology: %s\n", + nvme_strerror(errno)); nvme_free_tree(r); return ret; } @@ -1238,7 +1256,9 @@ int nvmf_config(const char *desc, int argc, char **argv) if (!strcmp(config_file, "none")) config_file = NULL; - r = nvme_create_root(stderr, map_log_level(verbose, quiet)); + log_level = map_log_level(verbose, quiet); + + r = nvme_create_root(stderr, log_level); if (!r) { fprintf(stderr, "Failed to create topology root: %s\n", nvme_strerror(errno)); @@ -1247,8 +1267,9 @@ int nvmf_config(const char *desc, int argc, char **argv) if (scan_tree) { ret = nvme_scan_topology(r, NULL, NULL); if (ret < 0) { - fprintf(stderr, "Failed to scan topology: %s\n", - nvme_strerror(errno)); + if (errno != ENOENT) + fprintf(stderr, "Failed to scan topology: %s\n", + nvme_strerror(errno)); nvme_free_tree(r); return ret; } @@ -1390,7 +1411,9 @@ int nvmf_dim(const char *desc, int argc, char **argv) return -EINVAL; } - r = nvme_create_root(stderr, map_log_level(cfg.verbose, false)); + log_level = map_log_level(cfg.verbose, false); + + r = nvme_create_root(stderr, log_level); if (!r) { fprintf(stderr, "Failed to create topology root: %s\n", nvme_strerror(errno)); @@ -1398,8 +1421,9 @@ int nvmf_dim(const char *desc, int argc, char **argv) } ret = nvme_scan_topology(r, NULL, NULL); if (ret < 0) { - fprintf(stderr, "Failed to scan topology: %s\n", - nvme_strerror(errno)); + if (errno != ENOENT) + fprintf(stderr, "Failed to scan topology: %s\n", + nvme_strerror(errno)); nvme_free_tree(r); return ret; } diff --git a/meson.build b/meson.build index 1b31603..11f7cc5 100644 --- a/meson.build +++ b/meson.build @@ -4,10 +4,10 @@ project( 'nvme-cli', ['c'], meson_version: '>= 0.50.0', license: 'GPL-2.0-only', - version: '2.8', + version: '2.9.1', default_options: [ 'c_std=gnu99', - 'buildtype=debug', + 'buildtype=debugoptimized', 'prefix=/usr/local', 'warning_level=1', 'sysconfdir=etc', @@ -48,7 +48,7 @@ conf.set('SYSCONFDIR', '"@0@"'.format(sysconfdir)) conf.set('RUNDIR', '"@0@"'.format(rundir)) # Check for libnvme availability -libnvme_dep = dependency('libnvme', version: '>=1.8', required: true, +libnvme_dep = dependency('libnvme', version: '>=1.9', required: true, fallback : ['libnvme', 'libnvme_dep']) libnvme_mi_dep = dependency('libnvme-mi', required: true, fallback : ['libnvme', 'libnvme_mi_dep']) @@ -160,7 +160,7 @@ conf.set10( name: 'linux/sed-opal.h' ), - description: 'Is linux/sed-opa.h include-able?' + description: 'Is linux/sed-opal.h include-able?' ) conf.set10( 'HAVE_KEY_TYPE', diff --git a/nbft.c b/nbft.c index ff36119..7ff8765 100644 --- a/nbft.c +++ b/nbft.c @@ -13,6 +13,7 @@ #include "nvme-print.h" #include "util/types.h" +#include "util/logging.h" #define NBFT_SYSFS_FILENAME "NBFT*" @@ -76,18 +77,85 @@ void free_nbfts(struct list_head *nbft_list) } } +/* returns 0 for success or negative errno otherwise */ +static int do_connect(nvme_root_t r, + nvme_host_t h, + struct nbft_info_subsystem_ns *ss, + struct tr_config *trcfg, + const struct nvme_fabrics_config *cfg, + enum nvme_print_flags flags, + unsigned int verbose) +{ + nvme_ctrl_t c; + int saved_log_level = log_level; + bool saved_log_pid = false; + bool saved_log_tstamp = false; + int ret; + + /* Already connected ? */ + c = lookup_ctrl(h, trcfg); + if (c && nvme_ctrl_get_name(c)) + return 0; + + c = nvme_create_ctrl(r, trcfg->subsysnqn, trcfg->transport, + trcfg->traddr, trcfg->host_traddr, + trcfg->host_iface, trcfg->trsvcid); + if (!c) + return -ENOMEM; + + /* Pause logging for unavailable SSNSs */ + if (ss && ss->unavailable && verbose < 1) { + saved_log_level = nvme_get_logging_level(r, + &saved_log_pid, + &saved_log_tstamp); + nvme_init_logging(r, -1, false, false); + } + + errno = 0; + ret = nvmf_add_ctrl(h, c, cfg); + + /* Resume logging */ + if (ss && ss->unavailable && verbose < 1) + nvme_init_logging(r, + saved_log_level, + saved_log_pid, + saved_log_tstamp); + + if (ret == -1) { + nvme_free_ctrl(c); + /* + * In case this SSNS was marked as 'unavailable' and + * our connection attempt has failed, ignore it. + */ + if (ss && ss->unavailable) { + if (verbose >= 1) + fprintf(stderr, + "SSNS %d reported as unavailable, skipping\n", + ss->index); + return 0; + } + return -errno; + } + + if (flags == NORMAL) + print_connect_msg(c); + else if (flags == JSON) + json_connect_msg(c); + + return 0; +} + int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg, char *hostnqn_sys, char *hostid_sys, const char *desc, bool connect, const struct nvme_fabrics_config *cfg, char *nbft_path, - enum nvme_print_flags flags, bool verbose) + enum nvme_print_flags flags, unsigned int verbose) { char *hostnqn = NULL, *hostid = NULL, *host_traddr = NULL; nvme_host_t h; - nvme_ctrl_t c; int ret, i; struct list_head nbft_list; - struct nbft_file_entry *entry; + struct nbft_file_entry *entry = NULL; struct nbft_info_subsystem_ns **ss; struct nbft_info_hfi *hfi; @@ -98,38 +166,35 @@ int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg, list_head_init(&nbft_list); ret = read_nbft_files(&nbft_list, nbft_path); if (ret) { - if (ret != ENOENT) + if (ret != -ENOENT) nvme_show_perror("Failed to access ACPI tables directory"); - goto out_free_2; + goto out_free; } - list_for_each(&nbft_list, entry, node) - for (ss = entry->nbft->subsystem_ns_list; ss && *ss; ss++) - for (i = 0; i < (*ss)->num_hfis; i++) { - nvme_ctrl_t cl; + list_for_each(&nbft_list, entry, node) { + if (hostnqn_arg) + hostnqn = hostnqn_arg; + else { + hostnqn = entry->nbft->host.nqn; + if (!hostnqn) + hostnqn = hostnqn_sys; + } - hfi = (*ss)->hfis[i]; - if (hostnqn_arg) - hostnqn = hostnqn_arg; - else { - hostnqn = entry->nbft->host.nqn; - if (!hostnqn) - hostnqn = hostnqn_sys; - } + if (hostid_arg) + hostid = hostid_arg; + else if (*entry->nbft->host.id) { + hostid = (char *)util_uuid_to_string(entry->nbft->host.id); + if (!hostid) + hostid = hostid_sys; + } - if (hostid_arg) - hostid = hostid_arg; - else if (*entry->nbft->host.id) { - hostid = (char *)util_uuid_to_string(entry->nbft->host.id); - if (!hostid) - hostid = hostid_sys; - } + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) + goto out_free; - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - errno = ENOMEM; - goto out_free; - } + for (ss = entry->nbft->subsystem_ns_list; ss && *ss; ss++) + for (i = 0; i < (*ss)->num_hfis; i++) { + hfi = (*ss)->hfis[i]; if (!cfg->host_traddr) { host_traddr = NULL; @@ -146,65 +211,38 @@ int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg, .trsvcid = (*ss)->trsvcid, }; - /* Already connected ? */ - cl = lookup_ctrl(h, &trcfg); - if (cl && nvme_ctrl_get_name(cl)) - continue; - - c = nvme_create_ctrl(r, (*ss)->subsys_nqn, (*ss)->transport, - (*ss)->traddr, host_traddr, NULL, - (*ss)->trsvcid); - if (!c) { - errno = ENOMEM; - goto out_free; - } - - errno = 0; - ret = nvmf_add_ctrl(h, c, cfg); + ret = do_connect(r, h, *ss, &trcfg, + cfg, flags, verbose); /* * With TCP/DHCP, it can happen that the OS * obtains a different local IP address than the * firmware had. Retry without host_traddr. */ - if (ret == -1 && errno == ENVME_CONNECT_ADDRNOTAVAIL && + if (ret == -ENVME_CONNECT_ADDRNOTAVAIL && !strcmp((*ss)->transport, "tcp") && strlen(hfi->tcp_info.dhcp_server_ipaddr) > 0) { - nvme_free_ctrl(c); - trcfg.host_traddr = NULL; - cl = lookup_ctrl(h, &trcfg); - if (cl && nvme_ctrl_get_name(cl)) - continue; - - c = nvme_create_ctrl(r, (*ss)->subsys_nqn, (*ss)->transport, - (*ss)->traddr, - NULL, NULL, (*ss)->trsvcid); - if (!c) { - errno = ENOMEM; - goto out_free; - } - errno = 0; - ret = nvmf_add_ctrl(h, c, cfg); + + ret = do_connect(r, h, *ss, &trcfg, + cfg, flags, verbose); + if (ret == 0 && verbose >= 1) fprintf(stderr, - "connect with host_traddr=\"%s\" failed, success after omitting host_traddr\n", + "SSNS %d: connect with host_traddr=\"%s\" failed, success after omitting host_traddr\n", + (*ss)->index, host_traddr); } if (ret) - fprintf(stderr, "no controller found\n"); - else { - if (flags == NORMAL) - print_connect_msg(c); - else if (flags == JSON) - json_connect_msg(c); - } -out_free: - if (errno == ENOMEM) - goto out_free_2; + fprintf(stderr, "SSNS %d: no controller found\n", + (*ss)->index); + + if (ret == -ENOMEM) + goto out_free; } -out_free_2: + } +out_free: free_nbfts(&nbft_list); return errno; } diff --git a/nbft.h b/nbft.h index 0e09733..0f7e33c 100644 --- a/nbft.h +++ b/nbft.h @@ -16,4 +16,4 @@ extern int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg char *hostnqn_sys, char *hostid_sys, const char *desc, bool connect, const struct nvme_fabrics_config *cfg, char *nbft_path, - enum nvme_print_flags flags, bool verbose); + enum nvme_print_flags flags, unsigned int verbose); diff --git a/nvme-builtin.h b/nvme-builtin.h index 2d2bead..00e361c 100644 --- a/nvme-builtin.h +++ b/nvme-builtin.h @@ -89,6 +89,8 @@ COMMAND_LIST( ENTRY("subsystem-reset", "Resets the subsystem", subsystem_reset) ENTRY("ns-rescan", "Rescans the NVME namespaces", ns_rescan) ENTRY("show-regs", "Shows the controller registers or properties. Requires character device", show_registers) + ENTRY("set-reg", "Set a register and show the resulting value", set_register) + ENTRY("get-reg", "Get a register and show the resulting value", get_register) ENTRY("discover", "Discover NVMeoF subsystems", discover_cmd) ENTRY("connect-all", "Discover and Connect to NVMeoF subsystems", connect_all_cmd) ENTRY("connect", "Connect to NVMeoF subsystem", connect_cmd) @@ -101,6 +103,7 @@ COMMAND_LIST( ENTRY("check-dhchap-key", "Validate NVMeoF DH-HMAC-CHAP host key", check_dhchap_key) ENTRY("gen-tls-key", "Generate NVMeoF TLS PSK", gen_tls_key) ENTRY("check-tls-key", "Validate NVMeoF TLS PSK", check_tls_key) + ENTRY("tls-key", "Manipulate NVMeoF TLS PSK", tls_key) ENTRY("dir-receive", "Submit a Directive Receive command, return results", dir_receive) ENTRY("dir-send", "Submit a Directive Send command, return results", dir_send) ENTRY("virt-mgmt", "Manage Flexible Resources between Primary and Secondary Controller", virtual_mgmt) diff --git a/nvme-print-json.c b/nvme-print-json.c index 27f5c7c..fc3ba77 100644 --- a/nvme-print-json.c +++ b/nvme-print-json.c @@ -16,7 +16,6 @@ #define BUF_LEN 320 #define VAL_LEN 4096 #define BYTE_TO_BIT(byte) ((byte) * 8) -#define POWER_OF_TWO(exponent) (1 << (exponent)) #define MS_TO_SEC(time) ((time) / 1000) #define MS500_TO_MS(time) ((time) * 500) #define MS500_TO_SEC(time) (MS_TO_SEC(MS500_TO_MS(time))) @@ -36,6 +35,9 @@ static const uint8_t zero_uuid[16] = { 0 }; static struct print_ops json_print_ops; static struct json_object *json_r = NULL; +static void json_feature_show_fields(enum nvme_features_id fid, unsigned int result, + unsigned char *buf); + static void d_json(unsigned char *buf, int len, int width, int group, struct json_object *array) { int i; @@ -57,6 +59,15 @@ static void d_json(unsigned char *buf, int len, int width, int group, struct jso } } +static void obj_d(struct json_object *o, const char *k, unsigned char *buf, int len, int width, + int group) +{ + struct json_object *data = json_create_array(); + + d_json(buf, len, width, group, data); + obj_add_array(o, k, data); +} + static void obj_add_uint_x(struct json_object *o, const char *k, __u32 v) { char str[STR_LEN]; @@ -73,7 +84,7 @@ static void obj_add_uint_0x(struct json_object *o, const char *k, __u32 v) obj_add_str(o, k, str); } -static void obj_add_uint_02x(struct json_object *o, const char *k, __u32 v) +static void obj_add_uint_0nx(struct json_object *o, const char *k, __u32 v, int width) { char str[STR_LEN]; @@ -81,6 +92,11 @@ static void obj_add_uint_02x(struct json_object *o, const char *k, __u32 v) obj_add_str(o, k, str); } +static void obj_add_uint_02x(struct json_object *o, const char *k, __u32 v) +{ + obj_add_uint_0nx(o, k, v, 2); +} + static void obj_add_uint_nx(struct json_object *o, const char *k, __u32 v) { char str[STR_LEN]; @@ -179,6 +195,12 @@ static void json_print(struct json_object *r) json_free_object(r); } +static void obj_print(struct json_object *o) +{ + if (!json_r) + json_print(o); +} + static bool human(void) { return json_print_ops.flags & VERBOSE; @@ -759,7 +781,7 @@ static void json_select_result(enum nvme_features_id fid, __u32 result) sprintf(json_str, "Feature: %#0*x: select", fid ? 4 : 2, fid); obj_add_array(r, json_str, feature); - json_print(r); + obj_print(r); } static void json_self_test_log(struct nvme_self_test_log *self_test, __u8 dst_entries, @@ -880,7 +902,7 @@ static void json_registers_version(__u32 vs, struct json_object *r) sprintf(json_str, "%x", vs); obj_add_str(r, "Version", json_str); - sprintf(json_str, "%d.%d", (vs & 0xffff0000) >> 16, (vs & 0x0000ff00) >> 8); + sprintf(json_str, "%d.%d.%d", NVME_MAJOR(vs), NVME_MINOR(vs), NVME_TERTIARY(vs)); obj_add_str(r, "NVMe specification", json_str); } @@ -903,13 +925,13 @@ static void json_registers_cc_ams(__u8 ams, struct json_object *r) char json_str[STR_LEN]; switch (ams) { - case 0: + case NVME_CC_AMS_RR: sprintf(json_str, "Round Robin"); break; - case 1: + case NVME_CC_AMS_WRRU: sprintf(json_str, "Weighted Round Robin with Urgent Priority Class"); break; - case 7: + case NVME_CC_AMS_VS: sprintf(json_str, "Vendor Specific"); break; default: @@ -925,13 +947,13 @@ static void json_registers_cc_shn(__u8 shn, struct json_object *r) char json_str[STR_LEN]; switch (shn) { - case 0: + case NVME_CC_SHN_NONE: sprintf(json_str, "No notification; no effect"); break; - case 1: + case NVME_CC_SHN_NORMAL: sprintf(json_str, "Normal shutdown notification"); break; - case 2: + case NVME_CC_SHN_ABRUPT: sprintf(json_str, "Abrupt shutdown notification"); break; default: @@ -952,22 +974,23 @@ static void json_registers_cc(__u32 cc, struct json_object *r) obj_add_str(r, "Controller Ready Independent of Media Enable (CRIME)", NVME_CC_CRIME(cc) ? "Enabled" : "Disabled"); - sprintf(json_str, "%u bytes", POWER_OF_TWO(NVME_GET(cc, CC_IOCQES))); + sprintf(json_str, "%u bytes", POWER_OF_TWO(NVME_CC_IOCQES(cc))); obj_add_str(r, "I/O Completion Queue Entry Size (IOCQES): ", json_str); - sprintf(json_str, "%u bytes", POWER_OF_TWO(NVME_GET(cc, CC_IOSQES))); + sprintf(json_str, "%u bytes", POWER_OF_TWO(NVME_CC_IOSQES(cc))); obj_add_str(r, "I/O Submission Queue Entry Size (IOSQES)", json_str); - json_registers_cc_shn((cc & 0xc000) >> NVME_CC_SHN_SHIFT, r); - json_registers_cc_ams((cc & 0x3800) >> NVME_CC_AMS_SHIFT, r); + json_registers_cc_shn(NVME_CC_SHN(cc), r); + json_registers_cc_ams(NVME_CC_AMS(cc), r); - sprintf(json_str, "%u bytes", POWER_OF_TWO(12 + NVME_GET(cc, CC_MPS))); + sprintf(json_str, "%u bytes", POWER_OF_TWO(12 + NVME_CC_MPS(cc))); obj_add_str(r, "Memory Page Size (MPS)", json_str); - obj_add_str(r, "I/O Command Set Selected (CSS)", (cc & 0x70) == 0x00 ? "NVM Command Set" : - (cc & 0x70) == 0x60 ? "All supported I/O Command Sets" : - (cc & 0x70) == 0x70 ? "Admin Command Set only" : "Reserved"); - obj_add_str(r, "Enable (EN)", cc & 1 ? "Yes" : "No"); + obj_add_str(r, "I/O Command Set Selected (CSS)", + NVME_CC_CSS(cc) == NVME_CC_CSS_NVM ? "NVM Command Set" : + NVME_CC_CSS(cc) == NVME_CC_CSS_CSI ? "All supported I/O Command Sets" : + NVME_CC_CSS(cc) == NVME_CC_CSS_ADMIN ? "Admin Command Set only" : "Reserved"); + obj_add_str(r, "Enable (EN)", NVME_CC_EN(cc) ? "Yes" : "No"); } static void json_registers_csts_shst(__u8 shst, struct json_object *r) @@ -975,13 +998,13 @@ static void json_registers_csts_shst(__u8 shst, struct json_object *r) char json_str[STR_LEN]; switch (shst) { - case 0: + case NVME_CSTS_SHST_NORMAL: sprintf(json_str, "Normal operation (no shutdown has been requested)"); break; - case 1: + case NVME_CSTS_SHST_OCCUR: sprintf(json_str, "Shutdown processing occurring"); break; - case 2: + case NVME_CSTS_SHST_CMPLT: sprintf(json_str, "Shutdown processing complete"); break; default: @@ -996,13 +1019,15 @@ static void json_registers_csts(__u32 csts, struct json_object *r) { obj_add_uint_x(r, "csts", csts); - obj_add_str(r, "Processing Paused (PP)", csts & 0x20 ? "Yes" : "No"); - obj_add_str(r, "NVM Subsystem Reset Occurred (NSSRO)", csts & 0x10 ? "Yes" : "No"); + obj_add_str(r, "Shutdown Type (ST)", NVME_CSTS_ST(csts) ? "Subsystem" : "Controller"); + obj_add_str(r, "Processing Paused (PP)", NVME_CSTS_PP(csts) ? "Yes" : "No"); + obj_add_str(r, "NVM Subsystem Reset Occurred (NSSRO)", + NVME_CSTS_NSSRO(csts) ? "Yes" : "No"); - json_registers_csts_shst((csts & 0xc) >> 2, r); + json_registers_csts_shst(NVME_CSTS_SHST(csts), r); - obj_add_str(r, "Controller Fatal Status (CFS)", csts & 2 ? "True" : "False"); - obj_add_str(r, "Ready (RDY)", csts & 1 ? "Yes" : "No"); + obj_add_str(r, "Controller Fatal Status (CFS)", NVME_CSTS_CFS(csts) ? "True" : "False"); + obj_add_str(r, "Ready (RDY)", NVME_CSTS_RDY(csts) ? "Yes" : "No"); } static void json_registers_nssr(__u32 nssr, struct json_object *r) @@ -1011,6 +1036,11 @@ static void json_registers_nssr(__u32 nssr, struct json_object *r) obj_add_uint(r, "NVM Subsystem Reset Control (NSSRC)", nssr); } +static void json_registers_nssd(__u32 nssd, struct json_object *r) +{ + obj_add_uint_nx(r, "NVM Subsystem Shutdown Control (NSSC)", nssd); +} + static void json_registers_crto(__u32 crto, struct json_object *r) { obj_add_uint_x(r, "crto", crto); @@ -1022,8 +1052,8 @@ static void json_registers_crto(__u32 crto, struct json_object *r) static void json_registers_aqa(uint32_t aqa, struct json_object *r) { obj_add_uint_x(r, "aqa", aqa); - obj_add_uint(r, "Admin Completion Queue Size (ACQS)", ((aqa & 0xfff0000) >> 16) + 1); - obj_add_uint(r, "Admin Submission Queue Size (ASQS)", (aqa & 0xfff) + 1); + obj_add_uint(r, "Admin Completion Queue Size (ACQS)", NVME_AQA_ACQS(aqa) + 1); + obj_add_uint(r, "Admin Submission Queue Size (ASQS)", NVME_AQA_ASQS(aqa) + 1); } static void json_registers_asq(uint64_t asq, struct json_object *r) @@ -1038,13 +1068,11 @@ static void json_registers_acq(uint64_t acq, struct json_object *r) obj_add_prix64(r, "Admin Completion Queue Base (ACQB)", acq); } -static void json_registers_cmbloc(uint32_t cmbloc, void *bar, struct json_object *r) +static void json_registers_cmbloc(uint32_t cmbloc, bool support, struct json_object *r) { - uint32_t cmbsz = mmio_read32(bar + NVME_REG_CMBSZ); - obj_add_uint_x(r, "cmbloc", cmbloc); - if (!cmbsz) { + if (!support) { obj_add_result(r, "Controller Memory Buffer feature is not supported"); return; } @@ -1173,17 +1201,15 @@ static void json_registers_pmrctl(uint32_t pmrctl, struct json_object *r) obj_add_str(r, "Enable (EN)", pmrctl & 1 ? "Ready" : "Disabled"); } -static void json_registers_pmrsts(uint32_t pmrsts, void *bar, struct json_object *r) +static void json_registers_pmrsts(uint32_t pmrsts, bool ready, struct json_object *r) { - uint32_t pmrctl = mmio_read32(bar + NVME_REG_PMRCTL); - obj_add_uint_x(r, "pmrsts", pmrsts); obj_add_uint_x(r, "Controller Base Address Invalid (CBAI)", (pmrsts & 0x1000) >> 12); obj_add_str(r, "Health Status (HSTS)", - nvme_register_pmr_hsts_to_string((pmrsts & 0xe00) >> 9)); + nvme_register_pmr_hsts_to_string((pmrsts & 0xe00) >> 9)); obj_add_str(r, "Not Ready (NRDY)", - !(pmrsts & 0x100) && (pmrctl & 1) ? "Ready" : "Not ready"); + !(pmrsts & 0x100) && ready ? "Ready" : "Not ready"); obj_add_uint_x(r, "Error (ERR)", pmrsts & 0xff); } @@ -1194,7 +1220,7 @@ static void json_registers_pmrebs(uint32_t pmrebs, struct json_object *r) obj_add_uint_x(r, "PMR Elasticity Buffer Size Base (PMRWBZ)", (pmrebs & 0xffffff00) >> 8); obj_add_str(r, "Read Bypass Behavior", pmrebs & 0x10 ? "Shall" : "May"); obj_add_str(r, "PMR Elasticity Buffer Size Units (PMRSZU)", - nvme_register_pmr_pmrszu_to_string(pmrebs & 0xf)); + nvme_register_unit_to_string(pmrebs & 0xf)); } static void json_registers_pmrswtp(uint32_t pmrswtp, struct json_object *r) @@ -1203,7 +1229,7 @@ static void json_registers_pmrswtp(uint32_t pmrswtp, struct json_object *r) obj_add_uint_x(r, "PMR Sustained Write Throughput (PMRSWTV)", (pmrswtp & 0xffffff00) >> 8); obj_add_key(r, "PMR Sustained Write Throughput Units (PMRSWTU)", "%s/second", - nvme_register_pmr_pmrszu_to_string(pmrswtp & 0xf)); + nvme_register_unit_to_string(pmrswtp & 0xf)); } static void json_registers_pmrmscl(uint32_t pmrmscl, struct json_object *r) @@ -1248,6 +1274,9 @@ static void json_single_property_human(int offset, uint64_t value64, struct json case NVME_REG_NSSR: json_registers_nssr(value32, r); break; + case NVME_REG_NSSD: + json_registers_nssd(value32, r); + break; case NVME_REG_CRTO: json_registers_crto(value32, r); break; @@ -1321,7 +1350,7 @@ struct json_object* json_effects_log(enum nvme_csi csi, static void json_effects_log_list(struct list_head *list) { struct json_object *r = json_create_array(); - nvme_effects_log_node_t *node; + nvme_effects_log_node_t *node = NULL; list_for_each(list, node, node) { struct json_object *json_page = @@ -1351,7 +1380,7 @@ static void json_sanitize_log(struct nvme_sanitize_log_page *sanitize_log, status_str = nvme_sstat_status_to_string(status); sprintf(str, "(%d) %s", status & NVME_SANITIZE_SSTAT_STATUS_MASK, status_str); - obj_add_str(sstat, status_str, str); + obj_add_str(sstat, "status", str); obj_add_obj(dev, "sstat", sstat); obj_add_uint(dev, "cdw10_info", le32_to_cpu(sanitize_log->scdw10)); @@ -1416,12 +1445,12 @@ static void json_add_bitmap(int i, __u8 seb, struct json_object *r) char evt_str[50]; char key[128]; - for (int bit = 0; bit < 8; bit++) { - if (nvme_pel_event_to_string(bit + i * 8)) { - sprintf(key, "bitmap_%x", (bit + i * 8)); + for (int bit = 0; bit < CHAR_BIT; bit++) { + if (nvme_pel_event_to_string(bit + i * CHAR_BIT)) { + sprintf(key, "bitmap_%x", (bit + i * CHAR_BIT)); if ((seb >> bit) & 0x1) snprintf(evt_str, sizeof(evt_str), "Support %s", - nvme_pel_event_to_string(bit + i * 8)); + nvme_pel_event_to_string(bit + i * CHAR_BIT)); obj_add_str(r, key, evt_str); } } @@ -1644,6 +1673,31 @@ static void json_pel_sanitize_completion(void *pevent_log_info, __u32 offset, obj_add_uint(valid_attrs, "cmpln_info", le16_to_cpu(sanitize_cmpln_event->cmpln_info)); } +static void json_pel_set_feature(void *pevent_log_info, __u32 offset, + struct json_object *valid_attrs) +{ + struct nvme_set_feature_event *set_feat_event = pevent_log_info + offset; + int fid = NVME_GET(le32_to_cpu(set_feat_event->cdw_mem[0]), FEATURES_CDW10_FID); + int cdw11 = le32_to_cpu(set_feat_event->cdw_mem[1]); + int dword_cnt = NVME_SET_FEAT_EVENT_DW_COUNT(set_feat_event->layout); + unsigned char *mem_buf; + + obj_add_uint_02x(valid_attrs, "feature", fid); + obj_add_str(valid_attrs, "name", nvme_feature_to_string(fid)); + obj_add_uint_0nx(valid_attrs, "value", cdw11, 8); + + if (NVME_SET_FEAT_EVENT_MB_COUNT(set_feat_event->layout)) { + mem_buf = (unsigned char *)(set_feat_event + 4 + dword_cnt * 4); + json_feature_show_fields(fid, cdw11, mem_buf); + } +} + +static void json_pel_telemetry_crt(void *pevent_log_info, __u32 offset, + struct json_object *valid_attrs) +{ + obj_d(valid_attrs, "create", pevent_log_info + offset, 512, 16, 1); +} + static void json_pel_thermal_excursion(void *pevent_log_info, __u32 offset, struct json_object *valid_attrs) { @@ -1720,6 +1774,12 @@ static void json_pevent_entry(void *pevent_log_info, __u8 action, __u32 size, co case NVME_PEL_SANITIZE_COMPLETION_EVENT: json_pel_sanitize_completion(pevent_log_info, offset, valid_attrs); break; + case NVME_PEL_SET_FEATURE_EVENT: + json_pel_set_feature(pevent_log_info, offset, valid_attrs); + break; + case NVME_PEL_TELEMETRY_CRT: + json_pel_telemetry_crt(pevent_log_info, offset, valid_attrs); + break; case NVME_PEL_THERMAL_EXCURSION_EVENT: json_pel_thermal_excursion(pevent_log_info, offset, valid_attrs); break; @@ -1942,8 +2002,8 @@ static void json_boot_part_log(void *bp_log, const char *devname, struct json_object *r = json_create_object(); obj_add_uint(r, "count", hdr->lid); - obj_add_uint(r, "abpid", (le32_to_cpu(hdr->bpinfo) >> 31) & 0x1); - obj_add_uint(r, "bpsz", le32_to_cpu(hdr->bpinfo) & 0x7fff); + obj_add_uint(r, "abpid", NVME_BOOT_PARTITION_INFO_ABPID(le32_to_cpu(hdr->bpinfo))); + obj_add_uint(r, "bpsz", NVME_BOOT_PARTITION_INFO_BPSZ(le32_to_cpu(hdr->bpinfo))); json_print(r); } @@ -1997,7 +2057,7 @@ static void json_phy_rx_eom_descs(struct nvme_phy_rx_eom_log *log, obj_add_uint(jdesc, "ncols", le16_to_cpu(desc->ncols)); obj_add_uint(jdesc, "edlen", le16_to_cpu(desc->edlen)); - if (log->odp & NVME_EOM_PRINTABLE_EYE_PRESENT) + if (NVME_EOM_ODP_PEFP(log->odp)) allocated_eyes[i] = json_eom_printable_eye(desc, r); /* Eye Data field is vendor specific, doesn't map to JSON */ @@ -2476,6 +2536,16 @@ static void json_ctrl_registers_nssr(void *bar, struct json_object *r) obj_add_int(r, "nssr", nssr); } +static void json_ctrl_registers_nssd(void *bar, struct json_object *r) +{ + uint32_t nssd = mmio_read32(bar + NVME_REG_NSSD); + + if (human()) + json_registers_nssd(nssd, obj_create_array_obj(r, "nssd")); + else + obj_add_int(r, "nssd", nssd); +} + static void json_ctrl_registers_crto(void *bar, struct json_object *r) { uint32_t crto = mmio_read32(bar + NVME_REG_CRTO); @@ -2519,11 +2589,16 @@ static void json_ctrl_registers_acq(void *bar, struct json_object *r) static void json_ctrl_registers_cmbloc(void *bar, struct json_object *r) { uint32_t cmbloc = mmio_read32(bar + NVME_REG_CMBLOC); + uint32_t cmbsz; + bool support; - if (human()) - json_registers_cmbloc(cmbloc, bar, obj_create_array_obj(r, "cmbloc")); - else + if (human()) { + cmbsz = mmio_read32(bar + NVME_REG_CMBSZ); + support = nvme_registers_cmbloc_support(cmbsz); + json_registers_cmbloc(cmbloc, support, obj_create_array_obj(r, "cmbloc")); + } else { obj_add_int(r, "cmbloc", cmbloc); + } } static void json_ctrl_registers_cmbsz(void *bar, struct json_object *r) @@ -2609,11 +2684,16 @@ static void json_ctrl_registers_pmrctl(void *bar, struct json_object *r) static void json_ctrl_registers_pmrsts(void *bar, struct json_object *r) { uint32_t pmrsts = mmio_read32(bar + NVME_REG_PMRSTS); + uint32_t pmrctl; + bool ready; - if (human()) - json_registers_pmrsts(pmrsts, bar, obj_create_array_obj(r, "pmrsts")); - else + if (human()) { + pmrctl = mmio_read32(bar + NVME_REG_PMRCTL); + ready = nvme_registers_pmrctl_ready(pmrctl); + json_registers_pmrsts(pmrsts, ready, obj_create_array_obj(r, "pmrsts")); + } else { obj_add_int(r, "pmrsts", pmrsts); + } } static void json_ctrl_registers_pmrebs(void *bar, struct json_object *r) @@ -2667,6 +2747,7 @@ static void json_ctrl_registers(void *bar, bool fabrics) json_ctrl_registers_cc(bar, r); json_ctrl_registers_csts(bar, r); json_ctrl_registers_nssr(bar, r); + json_ctrl_registers_nssd(bar, r); json_ctrl_registers_crto(bar, r); json_ctrl_registers_aqa(bar, r); json_ctrl_registers_asq(bar, r); @@ -2689,6 +2770,149 @@ static void json_ctrl_registers(void *bar, bool fabrics) json_print(r); } +static void json_registers_cmbebs(__u32 cmbebs, struct json_object *r) +{ + char buffer[BUF_LEN]; + + obj_add_uint_nx(r, "cmbebs", cmbebs); + + obj_add_uint_nx(r, "CMB Elasticity Buffer Size Base (CMBWBZ)", cmbebs >> 8); + sprintf(buffer, "%s", cmbebs & 0x10 ? "shall" : "may"); + obj_add_str(r, "Read Bypass Behavior", buffer); + obj_add_str(r, "CMB Elasticity Buffer Size Units (CMBSZU)", + nvme_register_unit_to_string(cmbebs & 0xf)); +} + +static void json_registers_cmbswtp(__u32 cmbswtp, struct json_object *r) +{ + char str[STR_LEN]; + + obj_add_uint_nx(r, "cmbswtp", cmbswtp); + + obj_add_uint_nx(r, "CMB Sustained Write Throughput (CMBSWTV)", cmbswtp >> 8); + sprintf(str, "%s", nvme_register_unit_to_string(cmbswtp & 0xf)); + obj_add_str(r, "CMB Sustained Write Throughput Units (CMBSWTU)", str); +} + +static void json_ctrl_register_human(int offset, uint64_t value, struct json_object *r) +{ + char buffer[BUF_LEN]; + struct json_object *array_obj = NULL; + + switch (offset) { + case NVME_REG_CAP: + array_obj = obj_create_array_obj(r, "cap"); + break; + case NVME_REG_VS: + array_obj = obj_create_array_obj(r, "vs"); + break; + case NVME_REG_INTMS: + obj_add_nprix64(r, "Interrupt Vector Mask Set (IVMS)", value); + break; + case NVME_REG_INTMC: + obj_add_nprix64(r, "Interrupt Vector Mask Clear (IVMC)", value); + break; + case NVME_REG_CC: + array_obj = obj_create_array_obj(r, "cc"); + break; + case NVME_REG_CSTS: + array_obj = obj_create_array_obj(r, "csts"); + break; + case NVME_REG_NSSR: + obj_add_uint64(r, "NVM Subsystem Reset Control (NSSRC)", value); + break; + case NVME_REG_AQA: + json_registers_aqa(value, obj_create_array_obj(r, "aqa")); + break; + case NVME_REG_ASQ: + obj_add_nprix64(r, "Admin Submission Queue Base (ASQB)", value); + break; + case NVME_REG_ACQ: + obj_add_nprix64(r, "Admin Completion Queue Base (ACQB)", value); + break; + case NVME_REG_CMBLOC: + json_registers_cmbloc(value, true, obj_create_array_obj(r, "cmbloc")); + break; + case NVME_REG_CMBSZ: + json_registers_cmbsz(value, obj_create_array_obj(r, "cmbsz")); + break; + case NVME_REG_BPINFO: + json_registers_bpinfo(value, obj_create_array_obj(r, "bpinfo")); + break; + case NVME_REG_BPRSEL: + json_registers_bprsel(value, obj_create_array_obj(r, "bprsel")); + break; + case NVME_REG_BPMBL: + json_registers_bpmbl(value, obj_create_array_obj(r, "bpmbl")); + break; + case NVME_REG_CMBMSC: + json_registers_cmbmsc(value, obj_create_array_obj(r, "cmbmsc")); + break; + case NVME_REG_CMBSTS: + json_registers_cmbsts(value, obj_create_array_obj(r, "cmbsts")); + break; + case NVME_REG_CMBEBS: + json_registers_cmbebs(value, obj_create_array_obj(r, "cmbebs")); + break; + case NVME_REG_CMBSWTP: + json_registers_cmbswtp(value, obj_create_array_obj(r, "cmbswtp")); + break; + case NVME_REG_NSSD: + json_registers_nssd(value, obj_create_array_obj(r, "nssd")); + break; + case NVME_REG_CRTO: + array_obj = obj_create_array_obj(r, "crto"); + break; + case NVME_REG_PMRCAP: + json_registers_pmrcap(value, obj_create_array_obj(r, "pmrcap")); + break; + case NVME_REG_PMRCTL: + json_registers_pmrctl(value, obj_create_array_obj(r, "pmrctl")); + break; + case NVME_REG_PMRSTS: + json_registers_pmrsts(value, true, obj_create_array_obj(r, "pmrsts")); + break; + case NVME_REG_PMREBS: + json_registers_pmrebs(value, obj_create_array_obj(r, "pmrebs")); + break; + case NVME_REG_PMRSWTP: + json_registers_pmrswtp(value, obj_create_array_obj(r, "pmrswtp")); + break; + case NVME_REG_PMRMSCL: + json_registers_pmrmscl(value, obj_create_array_obj(r, "pmrmscl")); + break; + case NVME_REG_PMRMSCU: + json_registers_pmrmscu(value, obj_create_array_obj(r, "pmrmscu")); + break; + default: + sprintf(buffer, "%#04x (%s)", offset, nvme_register_to_string(offset)); + obj_add_str(r, "register", buffer); + obj_add_nprix64(r, "value", value); + break; + } + + if (array_obj) + json_single_property_human(offset, value, array_obj); +} + +static void json_ctrl_register(int offset, uint64_t value) +{ + bool human = json_print_ops.flags & VERBOSE; + struct json_object *r; + char json_str[STR_LEN]; + + sprintf(json_str, "register: %#04x", offset); + r = obj_create(json_str); + + if (human) { + obj_add_uint64(r, nvme_register_to_string(offset), value); + json_ctrl_register_human(offset, value, r); + } else { + obj_add_str(r, "name", nvme_register_symbol_to_string(offset)); + obj_add_uint64(r, "value", value); + } +} + static void json_nvme_cmd_set_independent_id_ns(struct nvme_id_independent_id_ns *ns, unsigned int nsid) { @@ -3433,7 +3657,7 @@ static void json_feature_show(enum nvme_features_id fid, int sel, unsigned int r sprintf(json_str, "%#0*x", result ? 10 : 8, result); obj_add_str(r, nvme_select_to_string(sel), json_str); - json_print(r); + obj_print(r); } static void json_feature_show_fields(enum nvme_features_id fid, unsigned int result, @@ -3525,9 +3749,7 @@ static void json_feature_show_fields(enum nvme_features_id fid, unsigned int res json_feature_show_fields_spinup_control(r, result); break; case NVME_FEAT_FID_ENH_CTRL_METADATA: - fallthrough; case NVME_FEAT_FID_CTRL_METADATA: - fallthrough; case NVME_FEAT_FID_NS_METADATA: json_feature_show_fields_ns_metadata(r, fid, buf); break; @@ -3556,7 +3778,7 @@ static void json_feature_show_fields(enum nvme_features_id fid, unsigned int res break; } - json_print(r); + obj_print(r); } void json_id_ctrl_rpmbs(__le32 ctrl_rpmbs) @@ -3604,13 +3826,11 @@ void json_d(unsigned char *buf, int len, int width, int group) { struct json_object *r = json_r ? json_r : json_create_object(); char json_str[STR_LEN]; - struct json_object *data = json_create_array(); sprintf(json_str, "data: buf=%p len=%d width=%d group=%d", buf, len, width, group); - d_json(buf, len, width, group, data); - obj_add_array(r, json_str, data); + obj_d(r, json_str, buf, len, width, group); - json_print(r); + obj_print(r); } static void json_nvme_list_ctrl(struct nvme_ctrl_list *ctrl_list) @@ -3876,6 +4096,7 @@ static void json_detail_list(nvme_root_t t) struct json_object *jpaths = json_create_array(); obj_add_str(jctrl, "Controller", nvme_ctrl_get_name(c)); + obj_add_str(jctrl, "Cntlid", nvme_ctrl_get_cntlid(c)); obj_add_str(jctrl, "SerialNumber", nvme_ctrl_get_serial(c)); obj_add_str(jctrl, "ModelNumber", nvme_ctrl_get_model(c)); obj_add_str(jctrl, "Firmware", nvme_ctrl_get_firmware(c)); @@ -4311,7 +4532,7 @@ static void json_output_status(int status) if (status < 0) { obj_add_str(r, "error", nvme_strerror(errno)); - json_print(r); + obj_print(r); return; } @@ -4332,7 +4553,7 @@ static void json_output_status(int status) break; } - json_print(r); + obj_print(r); } static void json_output_error_status(int status, const char *msg, va_list ap) @@ -4353,7 +4574,7 @@ static void json_output_error_status(int status, const char *msg, va_list ap) if (status < 0) { obj_add_str(r, "error", nvme_strerror(errno)); - json_print(r); + obj_print(r); return; } @@ -4376,7 +4597,7 @@ static void json_output_error_status(int status, const char *msg, va_list ap) obj_add_int(r, "value", val); - json_print(r); + obj_print(r); } static void json_output_message(bool error, const char *msg, va_list ap) @@ -4391,7 +4612,7 @@ static void json_output_message(bool error, const char *msg, va_list ap) free(value); - json_print(r); + obj_print(r); } static void json_output_perror(const char *msg) @@ -4432,6 +4653,7 @@ static struct print_ops json_print_ops = { .phy_rx_eom_log = json_phy_rx_eom_log, .ctrl_list = json_nvme_list_ctrl, .ctrl_registers = json_ctrl_registers, + .ctrl_register = json_ctrl_register, .directive = json_directive_show, .discovery_log = json_discovery_log, .effects_log_list = json_effects_log_list, diff --git a/nvme-print-stdout.c b/nvme-print-stdout.c index 63462ea..bd0d888 100644 --- a/nvme-print-stdout.c +++ b/nvme-print-stdout.c @@ -183,7 +183,7 @@ static void stdout_predictable_latency_per_nvmset( le64_to_cpu(plpns_log->dtwin_wt)); printf("DTWIN Time Maximum: %"PRIu64"\n", le64_to_cpu(plpns_log->dtwin_tmax)); - printf("NDWIN Time Minimum High: %"PRIu64" \n", + printf("NDWIN Time Minimum High: %"PRIu64"\n", le64_to_cpu(plpns_log->ndwin_tmin_hi)); printf("NDWIN Time Minimum Low: %"PRIu64"\n", le64_to_cpu(plpns_log->ndwin_tmin_lo)); @@ -203,59 +203,47 @@ static void stdout_predictable_latency_event_agg_log( __u64 num_entries; num_entries = le64_to_cpu(pea_log->num_entries); - printf("Predictable Latency Event Aggregate Log for"\ - " device: %s\n", devname); + printf("Predictable Latency Event Aggregate Log for device: %s\n", devname); - printf("Number of Entries Available: %"PRIu64"\n", - (uint64_t)num_entries); + printf("Number of Entries Available: %"PRIu64"\n", (uint64_t)num_entries); num_iter = min(num_entries, log_entries); - for (int i = 0; i < num_iter; i++) { - printf("Entry[%d]: %u\n", i + 1, - le16_to_cpu(pea_log->entries[i])); - } + for (int i = 0; i < num_iter; i++) + printf("Entry[%d]: %u\n", i + 1, le16_to_cpu(pea_log->entries[i])); } static void stdout_persistent_event_log_rci(__le32 pel_header_rci) { __u32 rci = le32_to_cpu(pel_header_rci); - __u32 rsvd19 = (rci & 0xfff80000) >> 19; - __u8 rce = (rci & 0x40000) >> 18; - __u8 rcpit = (rci & 0x30000) >> 16; - __u16 rcpid = rci & 0xffff; + __u32 rsvd19 = NVME_PEL_RCI_RSVD(rci); + __u8 rce = NVME_PEL_RCI_RCE(rci); + __u8 rcpit = NVME_PEL_RCI_RCPIT(rci); + __u16 rcpid = NVME_PEL_RCI_RCPID(rci); - if(rsvd19) + if (rsvd19) printf(" [31:19] : %#x\tReserved\n", rsvd19); - printf("\tReporting Context Exists (RCE): %s(%u)\n", - rce ? "true" : "false", rce); + printf("\tReporting Context Exists (RCE): %s(%u)\n", rce ? "true" : "false", rce); printf("\tReporting Context Port Identifier Type (RCPIT): %u(%s)\n", rcpit, - (rcpit == 0x00) ? "Does not already exist" : - (rcpit == 0x01) ? "NVM subsystem port" : - (rcpit == 0x02) ? "NVMe-MI port" : "Reserved"); + nvme_pel_rci_rcpit_to_string(rcpit)); printf("\tReporting Context Port Identifier (RCPID): %#x\n\n", rcpid); } static void stdout_persistent_event_entry_ehai(__u8 ehai) { - __u8 rsvd1 = (ehai & 0xfc) >> 2; - __u8 pit = ehai & 0x03; + __u8 rsvd1 = NVME_PEL_EHAI_RSVD(ehai); + __u8 pit = NVME_PEL_EHAI_PIT(ehai); printf(" [7:2] : %#x\tReserved\n", rsvd1); - printf("\tPort Identifier Type (PIT): %u(%s)\n", pit, - (pit == 0x00) ? "PIT not reported and PELPID does not apply" : - (pit == 0x01) ? "NVM subsystem port" : - (pit == 0x02) ? "NVMe-MI port" : - "Event not associated with any port and PELPID does not apply"); + printf("\tPort Identifier Type (PIT): %u(%s)\n", pit, nvme_pel_ehai_pit_to_string(pit)); } static void stdout_add_bitmap(int i, __u8 seb) { - for (int bit = 0; bit < 8; bit++) { - if (nvme_pel_event_to_string(bit + i * 8)) { - if (nvme_pel_event_to_string(bit + i * 8)) - if ((seb >> bit) & 0x1) - printf(" Support %s\n", - nvme_pel_event_to_string(bit + i * 8)); + for (int bit = 0; bit < CHAR_BIT; bit++) { + if (nvme_pel_event_to_string(bit + i * CHAR_BIT)) { + if ((seb >> bit) & 0x1) + printf(" Support %s\n", + nvme_pel_event_to_string(bit + i * CHAR_BIT)); } } } @@ -321,7 +309,7 @@ static void stdout_persistent_event_log(void *pevent_log_info, le32_to_cpu(pevent_log_head->rci)); if (human) stdout_persistent_event_log_rci(pevent_log_head->rci); - printf("Supported Events Bitmap: \n"); + printf("Supported Events Bitmap:\n"); for (int i = 0; i < 32; i++) { if (pevent_log_head->seb[i] == 0) continue; @@ -366,12 +354,12 @@ static void stdout_persistent_event_log(void *pevent_log_info, switch (pevent_entry_head->etype) { case NVME_PEL_SMART_HEALTH_EVENT: smart_event = pevent_log_info + offset; - printf("Smart Health Event Entry: \n"); + printf("Smart Health Event Entry:\n"); stdout_smart_log(smart_event, NVME_NSID_ALL, devname); break; case NVME_PEL_FW_COMMIT_EVENT: fw_commit_event = pevent_log_info + offset; - printf("FW Commit Event Entry: \n"); + printf("FW Commit Event Entry:\n"); printf("Old Firmware Revision: %"PRIu64" (%s)\n", le64_to_cpu(fw_commit_event->old_fw_rev), util_fw_to_string((char *)&fw_commit_event->old_fw_rev)); @@ -390,7 +378,7 @@ static void stdout_persistent_event_log(void *pevent_log_info, break; case NVME_PEL_TIMESTAMP_EVENT: ts_change_event = pevent_log_info + offset; - printf("Time Stamp Change Event Entry: \n"); + printf("Time Stamp Change Event Entry:\n"); printf("Previous Timestamp: %"PRIu64"\n", le64_to_cpu(ts_change_event->previous_timestamp)); printf("Milliseconds Since Reset: %"PRIu64"\n", @@ -402,11 +390,11 @@ static void stdout_persistent_event_log(void *pevent_log_info, por_info_list = por_info_len / sizeof(*por_event); - printf("Power On Reset Event Entry: \n"); + printf("Power On Reset Event Entry:\n"); fw_rev = pevent_log_info + offset; printf("Firmware Revision: %"PRIu64" (%s)\n", le64_to_cpu(*fw_rev), util_fw_to_string((char *)fw_rev)); - printf("Reset Information List: \n"); + printf("Reset Information List:\n"); for (int i = 0; i < por_info_list; i++) { por_event = pevent_log_info + offset + @@ -432,7 +420,7 @@ static void stdout_persistent_event_log(void *pevent_log_info, break; case NVME_PEL_CHANGE_NS_EVENT: ns_event = pevent_log_info + offset; - printf("Change Namespace Event Entry: \n"); + printf("Change Namespace Event Entry:\n"); printf("Namespace Management CDW10: %u\n", le32_to_cpu(ns_event->nsmgt_cdw10)); printf("Namespace Size: %"PRIu64"\n", @@ -451,7 +439,7 @@ static void stdout_persistent_event_log(void *pevent_log_info, break; case NVME_PEL_FORMAT_START_EVENT: format_start_event = pevent_log_info + offset; - printf("Format NVM Start Event Entry: \n"); + printf("Format NVM Start Event Entry:\n"); printf("Namespace Identifier: %u\n", le32_to_cpu(format_start_event->nsid)); printf("Format NVM Attributes: %u\n", @@ -461,7 +449,7 @@ static void stdout_persistent_event_log(void *pevent_log_info, break; case NVME_PEL_FORMAT_COMPLETION_EVENT: format_cmpln_event = pevent_log_info + offset; - printf("Format NVM Completion Event Entry: \n"); + printf("Format NVM Completion Event Entry:\n"); printf("Namespace Identifier: %u\n", le32_to_cpu(format_cmpln_event->nsid)); printf("Smallest Format Progress Indicator: %u\n", @@ -475,7 +463,7 @@ static void stdout_persistent_event_log(void *pevent_log_info, break; case NVME_PEL_SANITIZE_START_EVENT: sanitize_start_event = pevent_log_info + offset; - printf("Sanitize Start Event Entry: \n"); + printf("Sanitize Start Event Entry:\n"); printf("SANICAP: %u\n", sanitize_start_event->sani_cap); printf("Sanitize CDW10: %u\n", le32_to_cpu(sanitize_start_event->sani_cdw10)); @@ -484,7 +472,7 @@ static void stdout_persistent_event_log(void *pevent_log_info, break; case NVME_PEL_SANITIZE_COMPLETION_EVENT: sanitize_cmpln_event = pevent_log_info + offset; - printf("Sanitize Completion Event Entry: \n"); + printf("Sanitize Completion Event Entry:\n"); printf("Sanitize Progress: %u\n", le16_to_cpu(sanitize_cmpln_event->sani_prog)); printf("Sanitize Status: %u\n", @@ -494,14 +482,14 @@ static void stdout_persistent_event_log(void *pevent_log_info, break; case NVME_PEL_SET_FEATURE_EVENT: set_feat_event = pevent_log_info + offset; - printf("Set Feature Event Entry: \n"); - dword_cnt = set_feat_event->layout & 0x03; - fid = le32_to_cpu(set_feat_event->cdw_mem[0]) & 0x000f; + printf("Set Feature Event Entry:\n"); + dword_cnt = NVME_SET_FEAT_EVENT_DW_COUNT(set_feat_event->layout); + fid = NVME_GET(le32_to_cpu(set_feat_event->cdw_mem[0]), FEATURES_CDW10_FID); cdw11 = le32_to_cpu(set_feat_event->cdw_mem[1]); printf("Set Feature ID :%#02x (%s), value:%#08x\n", fid, nvme_feature_to_string(fid), cdw11); - if (((set_feat_event->layout & 0xff) >> 2) != 0) { + if (NVME_SET_FEAT_EVENT_MB_COUNT(set_feat_event->layout)) { mem_buf = (unsigned char *)(set_feat_event + 4 + dword_cnt * 4); stdout_feature_show_fields(fid, cdw11, mem_buf); } @@ -511,7 +499,7 @@ static void stdout_persistent_event_log(void *pevent_log_info, break; case NVME_PEL_THERMAL_EXCURSION_EVENT: thermal_exc_event = pevent_log_info + offset; - printf("Thermal Excursion Event Entry: \n"); + printf("Thermal Excursion Event Entry:\n"); printf("Over Temperature: %u\n", thermal_exc_event->over_temp); printf("Threshold: %u\n", thermal_exc_event->threshold); break; @@ -528,8 +516,7 @@ static void stdout_endurance_group_event_agg_log( struct nvme_aggregate_predictable_lat_event *endurance_log, __u64 log_entries, __u32 size, const char *devname) { - printf("Endurance Group Event Aggregate Log for"\ - " device: %s\n", devname); + printf("Endurance Group Event Aggregate Log for device: %s\n", devname); printf("Number of Entries Available: %"PRIu64"\n", le64_to_cpu(endurance_log->num_entries)); @@ -611,7 +598,7 @@ static void stdout_fid_support_effects_log_human(__u32 fid_support) printf(" CCC%s", (fid_support & NVME_FID_SUPPORTED_EFFECTS_CCC) ? set : clr); printf(" USS%s", (fid_support & NVME_FID_SUPPORTED_EFFECTS_UUID_SEL) ? set : clr); - fsp = (fid_support >> NVME_FID_SUPPORTED_EFFECTS_SCOPE_SHIFT) & NVME_FID_SUPPORTED_EFFECTS_SCOPE_MASK; + fsp = NVME_GET(fid_support, FID_SUPPORTED_EFFECTS_SCOPE); printf(" NAMESPACE SCOPE%s", (fsp & NVME_FID_SUPPORTED_EFFECTS_SCOPE_NS) ? set : clr); printf(" CONTROLLER SCOPE%s", (fsp & NVME_FID_SUPPORTED_EFFECTS_SCOPE_CTRL) ? set : clr); @@ -654,7 +641,7 @@ static void stdout_mi_cmd_support_effects_log_human(__u32 mi_cmd_support) printf(" NIC%s", (mi_cmd_support & NVME_MI_CMD_SUPPORTED_EFFECTS_NIC) ? set : clr); printf(" CCC%s", (mi_cmd_support & NVME_MI_CMD_SUPPORTED_EFFECTS_CCC) ? set : clr); - csp = (mi_cmd_support >> NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_SHIFT) & NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_MASK; + csp = NVME_GET(mi_cmd_support, MI_CMD_SUPPORTED_EFFECTS_SCOPE); printf(" NAMESPACE SCOPE%s", (csp & NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_NS) ? set : clr); printf(" CONTROLLER SCOPE%s", (csp & NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_CTRL) ? set : clr); @@ -688,18 +675,19 @@ static void stdout_mi_cmd_support_effects_log(struct nvme_mi_cmd_supported_effec static void stdout_boot_part_log(void *bp_log, const char *devname, __u32 size) { - struct nvme_boot_partition *hdr; + struct nvme_boot_partition *hdr = bp_log; - hdr = bp_log; printf("Boot Partition Log for device: %s\n", devname); printf("Log ID: %u\n", hdr->lid); - printf("Boot Partition Size: %u KiB\n", le32_to_cpu(hdr->bpinfo) & 0x7fff); - printf("Active BPID: %u\n", (le32_to_cpu(hdr->bpinfo) >> 31) & 0x1); + printf("Boot Partition Size: %u KiB\n", + NVME_BOOT_PARTITION_INFO_BPSZ(le32_to_cpu(hdr->bpinfo))); + printf("Active BPID: %u\n", NVME_BOOT_PARTITION_INFO_ABPID(le32_to_cpu(hdr->bpinfo))); } static const char *eomip_to_string(__u8 eomip) { const char *string; + switch (eomip) { case NVME_PHY_RX_EOM_NOT_STARTED: string = "Not Started"; @@ -719,9 +707,9 @@ static const char *eomip_to_string(__u8 eomip) static void stdout_phy_rx_eom_odp(uint8_t odp) { - __u8 rsvd = (odp >> 2) & 0x3F; - __u8 edfp = (odp >> 1) & 0x1; - __u8 pefp = odp & 0x1; + __u8 rsvd = NVME_EOM_ODP_RSVD(odp); + __u8 edfp = NVME_EOM_ODP_EDFP(odp); + __u8 pefp = NVME_EOM_ODP_PEFP(odp); if (rsvd) printf(" [7:2] : %#x\tReserved\n", rsvd); @@ -735,6 +723,7 @@ static void stdout_eom_printable_eye(struct nvme_eom_lane_desc *lane) { char *eye = (char *)lane->eye_desc; int i, j; + for (i = 0; i < lane->nrows; i++) { for (j = 0; j < lane->ncols; j++) printf("%c", eye[i * lane->ncols + j]); @@ -762,7 +751,7 @@ static void stdout_phy_rx_eom_descs(struct nvme_phy_rx_eom_log *log) printf("Number of Columns: %u\n", le16_to_cpu(desc->ncols)); printf("Eye Data Length: %u\n", le16_to_cpu(desc->edlen)); - if (log->odp & NVME_EOM_PRINTABLE_EYE_PRESENT) + if (NVME_EOM_ODP_PEFP(log->odp)) stdout_eom_printable_eye(desc); /* Eye Data field is vendor specific */ @@ -798,9 +787,8 @@ static void stdout_phy_rx_eom_log(struct nvme_phy_rx_eom_log *log, __u16 control printf("Estimated Time for Better Quality: %u\n", le16_to_cpu(log->etbetter)); printf("Estimated Time for Best Quality: %u\n", le16_to_cpu(log->etbest)); - if (log->eomip == NVME_PHY_RX_EOM_COMPLETED) { + if (log->eomip == NVME_PHY_RX_EOM_COMPLETED) stdout_phy_rx_eom_descs(log); - } } static void stdout_media_unit_stat_log(struct nvme_media_unit_stat_log *mus_log) @@ -832,10 +820,10 @@ static void stdout_media_unit_stat_log(struct nvme_media_unit_stat_log *mus_log) static void stdout_fdp_config_fdpa(uint8_t fdpa) { - __u8 valid = (fdpa >> 7) & 0x1; + __u8 valid = NVME_GET(fdpa, FDP_CONFIG_FDPA_VALID); __u8 rsvd = (fdpa >> 5) & 0x3; - __u8 fdpvwc = (fdpa >> 4) & 0x1; - __u8 rgif = fdpa & 0xf; + __u8 fdpvwc = NVME_GET(fdpa, FDP_CONFIG_FDPA_FDPVWC); + __u8 rgif = NVME_GET(fdpa, FDP_CONFIG_FDPA_RGIF); printf(" [7:7] : %#x\tFDP Configuration %sValid\n", valid, valid ? "" : "Not "); @@ -886,7 +874,7 @@ static void stdout_fdp_usage(struct nvme_fdp_ruhu_log *log, size_t len) for (int i = 0; i < nruh; i++) { struct nvme_fdp_ruhu_desc *ruhu = &log->ruhus[i]; - printf("Reclaim Unit Handle %d Attributes: 0x%"PRIx8" (%s)\n", i, ruhu->ruha, + printf("Reclaim Unit Handle %d Attributes: %#"PRIx8" (%s)\n", i, ruhu->ruha, ruhu->ruha == 0x0 ? "Unused" : ( ruhu->ruha == 0x1 ? "Host Specified" : ( ruhu->ruha == 0x2 ? "Controller Specified" : "Unknown"))); @@ -917,25 +905,28 @@ static void stdout_fdp_events(struct nvme_fdp_events_log *log) tm = localtime(&ts); printf("Event[%u]\n", i); - printf(" Event Type: 0x%"PRIx8" (%s)\n", event->type, nvme_fdp_event_to_string(event->type)); + printf(" Event Type: %#"PRIx8" (%s)\n", event->type, + nvme_fdp_event_to_string(event->type)); printf(" Event Timestamp: %"PRIu64" (%s)\n", int48_to_long(event->ts.timestamp), strftime(buffer, sizeof(buffer), "%c %Z", tm) ? buffer : "-"); if (event->flags & NVME_FDP_EVENT_F_PIV) - printf(" Placement Identifier (PID): 0x%"PRIx16"\n", le16_to_cpu(event->pid)); + printf(" Placement Identifier (PID): %#"PRIx16"\n", + le16_to_cpu(event->pid)); if (event->flags & NVME_FDP_EVENT_F_NSIDV) printf(" Namespace Identifier (NSID): %"PRIu32"\n", le32_to_cpu(event->nsid)); if (event->type == NVME_FDP_EVENT_REALLOC) { struct nvme_fdp_event_realloc *mr; + mr = (struct nvme_fdp_event_realloc *)&event->type_specific; printf(" Number of LBAs Moved (NLBAM): %"PRIu16"\n", le16_to_cpu(mr->nlbam)); - if (mr->flags & NVME_FDP_EVENT_REALLOC_F_LBAV) { - printf(" Logical Block Address (LBA): 0x%"PRIx64"\n", le64_to_cpu(mr->lba)); - } + if (mr->flags & NVME_FDP_EVENT_REALLOC_F_LBAV) + printf(" Logical Block Address (LBA): %#"PRIx64"\n", + le64_to_cpu(mr->lba)); } if (event->flags & NVME_FDP_EVENT_F_LV) { @@ -980,7 +971,7 @@ static void stdout_supported_cap_config_log(struct nvme_supported_cap_config_lis le16_to_cpu(cap->cap_config_desc[i].domainid)); egcn = le16_to_cpu(cap->cap_config_desc[i].egcn); printf("Number of Endurance Group Configuration Descriptors: %u\n", egcn); - for(j = 0; j < egcn; j++) { + for (j = 0; j < egcn; j++) { printf("Endurance Group Identifier: %u\n", le16_to_cpu(cap->cap_config_desc[i].egcd[j].endgid)); printf("Capacity Adjustment Factor: %u\n", @@ -996,20 +987,20 @@ static void stdout_supported_cap_config_log(struct nvme_supported_cap_config_lis cap->cap_config_desc[i].egcd[j].end_est))); egsets = le16_to_cpu(cap->cap_config_desc[i].egcd[j].egsets); printf("Number of NVM Sets: %u\n", egsets); - for(k = 0; k < egsets; k++) { + for (k = 0; k < egsets; k++) printf("NVM Set %d Identifier: %u\n", i, - le16_to_cpu(cap->cap_config_desc[i].egcd[j].nvmsetid[k])); - } - chan_desc = (struct nvme_end_grp_chan_desc *) \ - ((cap->cap_config_desc[i].egcd[j].nvmsetid[0]) * (sizeof(__u16)*egsets)); + le16_to_cpu(cap->cap_config_desc[i].egcd[j].nvmsetid[k])); + + chan_desc = (struct nvme_end_grp_chan_desc *) + &cap->cap_config_desc[i].egcd[j].nvmsetid[egsets]; egchans = le16_to_cpu(chan_desc->egchans); printf("Number of Channels: %u\n", egchans); - for(l = 0; l < egchans; l++) { + for (l = 0; l < egchans; l++) { printf("Channel Identifier: %u\n", le16_to_cpu(chan_desc->chan_config_desc[l].chanid)); chmus = le16_to_cpu(chan_desc->chan_config_desc[l].chmus); printf("Number of Channel Media Units: %u\n", chmus); - for(m = 0; m < chmus; m++) { + for (m = 0; m < chmus; m++) { printf("Media Unit Identifier: %u\n", le16_to_cpu(chan_desc->chan_config_desc[l].mu_config_desc[m].muid)); printf("Media Unit Descriptor Length: %u\n", @@ -1127,21 +1118,21 @@ static void stdout_registers_cap(struct nvme_bar_cap *cap) static void stdout_registers_version(__u32 vs) { - printf("\tNVMe specification %d.%d\n\n", (vs & 0xffff0000) >> 16, - (vs & 0x0000ff00) >> 8); + printf("\tNVMe specification %d.%d.%d\n\n", NVME_MAJOR(vs), NVME_MINOR(vs), + NVME_TERTIARY(vs)); } -static void stdout_registers_cc_ams (__u8 ams) +static void stdout_registers_cc_ams(__u8 ams) { printf("\tArbitration Mechanism Selected (AMS): "); switch (ams) { - case 0: + case NVME_CC_AMS_RR: printf("Round Robin\n"); break; - case 1: + case NVME_CC_AMS_WRRU: printf("Weighted Round Robin with Urgent Priority Class\n"); break; - case 7: + case NVME_CC_AMS_VS: printf("Vendor Specific\n"); break; default: @@ -1150,17 +1141,17 @@ static void stdout_registers_cc_ams (__u8 ams) } } -static void stdout_registers_cc_shn (__u8 shn) +static void stdout_registers_cc_shn(__u8 shn) { printf("\tShutdown Notification (SHN): "); switch (shn) { - case 0: + case NVME_CC_SHN_NONE: printf("No notification; no effect\n"); break; - case 1: + case NVME_CC_SHN_NORMAL: printf("Normal shutdown notification\n"); break; - case 2: + case NVME_CC_SHN_ABRUPT: printf("Abrupt shutdown notification\n"); break; default: @@ -1175,32 +1166,31 @@ static void stdout_registers_cc(__u32 cc) NVME_CC_CRIME(cc) ? "Enabled" : "Disabled"); printf("\tI/O Completion Queue Entry Size (IOCQES): %u bytes\n", - 1 << ((cc & 0x00f00000) >> NVME_CC_IOCQES_SHIFT)); + POWER_OF_TWO(NVME_CC_IOCQES(cc))); printf("\tI/O Submission Queue Entry Size (IOSQES): %u bytes\n", - 1 << ((cc & 0x000f0000) >> NVME_CC_IOSQES_SHIFT)); - stdout_registers_cc_shn((cc & 0x0000c000) >> NVME_CC_SHN_SHIFT); - stdout_registers_cc_ams((cc & 0x00003800) >> NVME_CC_AMS_SHIFT); + POWER_OF_TWO(NVME_CC_IOSQES(cc))); + stdout_registers_cc_shn(NVME_CC_SHN(cc)); + stdout_registers_cc_ams(NVME_CC_AMS(cc)); printf("\tMemory Page Size (MPS): %u bytes\n", - 1 << (12 + ((cc & 0x00000780) >> NVME_CC_MPS_SHIFT))); + POWER_OF_TWO(12 + NVME_CC_MPS(cc))); printf("\tI/O Command Set Selected (CSS): %s\n", - (cc & 0x00000070) == 0x00 ? "NVM Command Set" : - (cc & 0x00000070) == 0x60 ? "All supported I/O Command Sets" : - (cc & 0x00000070) == 0x70 ? "Admin Command Set only" : "Reserved"); - printf("\tEnable (EN): %s\n\n", - (cc & 0x00000001) ? "Yes" : "No"); + NVME_CC_CSS(cc) == NVME_CC_CSS_NVM ? "NVM Command Set" : + NVME_CC_CSS(cc) == NVME_CC_CSS_CSI ? "All supported I/O Command Sets" : + NVME_CC_CSS(cc) == NVME_CC_CSS_ADMIN ? "Admin Command Set only" : "Reserved"); + printf("\tEnable (EN): %s\n\n", NVME_CC_EN(cc) ? "Yes" : "No"); } static void stdout_registers_csts_shst(__u8 shst) { printf("\tShutdown Status (SHST): "); switch (shst) { - case 0: + case NVME_CSTS_SHST_NORMAL: printf("Normal operation (no shutdown has been requested)\n"); break; - case 1: + case NVME_CSTS_SHST_OCCUR: printf("Shutdown processing occurring\n"); break; - case 2: + case NVME_CSTS_SHST_CMPLT: printf("Shutdown processing complete\n"); break; default: @@ -1211,16 +1201,21 @@ static void stdout_registers_csts_shst(__u8 shst) static void stdout_registers_csts(__u32 csts) { - printf("\tProcessing Paused (PP): %s\n", - (csts & 0x00000020) ? "Yes" : "No"); + printf("\tShutdown Type (ST): %s\n", + NVME_CSTS_ST(csts) ? "Subsystem" : "Controller"); + printf("\tProcessing Paused (PP): %s\n", NVME_CSTS_PP(csts) ? "Yes" : "No"); printf("\tNVM Subsystem Reset Occurred (NSSRO): %s\n", - (csts & 0x00000010) ? "Yes" : "No"); - stdout_registers_csts_shst((csts & 0x0000000c) >> 2); + NVME_CSTS_NSSRO(csts) ? "Yes" : "No"); + stdout_registers_csts_shst(NVME_CSTS_SHST(csts)); printf("\tController Fatal Status (CFS): %s\n", - (csts & 0x00000002) ? "True" : "False"); + NVME_CSTS_CFS(csts) ? "True" : "False"); printf("\tReady (RDY): %s\n\n", - (csts & 0x00000001) ? "Yes" : "No"); + NVME_CSTS_RDY(csts) ? "Yes" : "No"); +} +static void stdout_registers_nssd(__u32 nssd) +{ + printf("\tNVM Subsystem Shutdown Control (NSSC): %#x\n\n", nssd); } static void stdout_registers_crto(__u32 crto) @@ -1231,65 +1226,74 @@ static void stdout_registers_crto(__u32 crto) static void stdout_registers_aqa(__u32 aqa) { - printf("\tAdmin Completion Queue Size (ACQS): %u\n", - ((aqa & 0x0fff0000) >> 16) + 1); - printf("\tAdmin Submission Queue Size (ASQS): %u\n\n", - (aqa & 0x00000fff) + 1); + printf("\tAdmin Completion Queue Size (ACQS): %u\n", NVME_AQA_ACQS(aqa) + 1); + printf("\tAdmin Submission Queue Size (ASQS): %u\n\n", NVME_AQA_ASQS(aqa) + 1); +} +static void stdout_registers_asq(uint64_t asq) +{ + printf("\tAdmin Submission Queue Base (ASQB): %"PRIx64"\n", (uint64_t)NVME_ASQ_ASQB(asq)); } -static void stdout_registers_cmbloc(__u32 cmbloc, __u32 cmbsz) +static void stdout_registers_acq(uint64_t acq) { - static const char *enforced[] = { "Enforced", "Not Enforced" }; + printf("\tAdmin Completion Queue Base (ACQB): %"PRIx64"\n", (uint64_t)NVME_ACQ_ACQB(acq)); +} - if (cmbsz == 0) { +static void stdout_registers_cmbloc(__u32 cmbloc, bool support) +{ + static const char * const enforced[] = { "Enforced", "Not Enforced" }; + + if (!support) { printf("\tController Memory Buffer feature is not supported\n\n"); return; } - printf("\tOffset (OFST): 0x%x (See cmbsz.szu for granularity)\n", - (cmbloc & 0xfffff000) >> 12); + + printf("\tOffset (OFST): "); + printf("%#x (See cmbsz.szu for granularity)\n", NVME_CMBLOC_OFST(cmbloc)); printf("\tCMB Queue Dword Alignment (CQDA): %d\n", - (cmbloc & 0x00000100) >> 8); + NVME_CMBLOC_CQDA(cmbloc)); printf("\tCMB Data Metadata Mixed Memory Support (CDMMMS): %s\n", - enforced[(cmbloc & 0x00000080) >> 7]); + enforced[NVME_CMBLOC_CDMMMS(cmbloc)]); printf("\tCMB Data Pointer and Command Independent Locations Support (CDPCILS): %s\n", - enforced[(cmbloc & 0x00000040) >> 6]); + enforced[NVME_CMBLOC_CDPCILS(cmbloc)]); printf("\tCMB Data Pointer Mixed Locations Support (CDPMLS): %s\n", - enforced[(cmbloc & 0x00000020) >> 5]); + enforced[NVME_CMBLOC_CDPLMS(cmbloc)]); printf("\tCMB Queue Physically Discontiguous Support (CQPDS): %s\n", - enforced[(cmbloc & 0x00000010) >> 4]); + enforced[NVME_CMBLOC_CQPDS(cmbloc)]); printf("\tCMB Queue Mixed Memory Support (CQMMS): %s\n", - enforced[(cmbloc & 0x00000008) >> 3]); + enforced[NVME_CMBLOC_CQMMS(cmbloc)]); - printf("\tBase Indicator Register (BIR): 0x%x\n\n", - (cmbloc & 0x00000007)); + printf("\tBase Indicator Register (BIR): %#x\n\n", + NVME_CMBLOC_BIR(cmbloc)); } static void stdout_registers_cmbsz(__u32 cmbsz) { - if (cmbsz == 0) { + if (!cmbsz) { printf("\tController Memory Buffer feature is not supported\n\n"); return; } - printf("\tSize (SZ): %u\n", (cmbsz & 0xfffff000) >> 12); + + printf("\tSize (SZ): %u\n", NVME_CMBSZ_SZ(cmbsz)); printf("\tSize Units (SZU): %s\n", - nvme_register_szu_to_string((cmbsz & 0x00000f00) >> 8)); + nvme_register_szu_to_string(NVME_CMBSZ_SZU(cmbsz))); printf("\tWrite Data Support (WDS): Write Data and metadata transfer in Controller Memory Buffer is %s\n", - (cmbsz & 0x00000010) ? "Supported" : "Not supported"); + NVME_CMBSZ_WDS(cmbsz) ? "Supported" : "Not supported"); printf("\tRead Data Support (RDS): Read Data and metadata transfer in Controller Memory Buffer is %s\n", - (cmbsz & 0x00000008) ? "Supported" : "Not supported"); + NVME_CMBSZ_RDS(cmbsz) ? "Supported" : "Not supported"); printf("\tPRP SGL List Support (LISTS): PRP/SG Lists in Controller Memory Buffer is %s\n", - (cmbsz & 0x00000004) ? "Supported" : "Not supported"); + NVME_CMBSZ_LISTS(cmbsz) ? "Supported" : "Not supported"); printf("\tCompletion Queue Support (CQS): Admin and I/O Completion Queues in Controller Memory Buffer is %s\n", - (cmbsz & 0x00000002) ? "Supported" : "Not supported"); + NVME_CMBSZ_CQS(cmbsz) ? "Supported" : "Not supported"); printf("\tSubmission Queue Support (SQS): Admin and I/O Submission Queues in Controller Memory Buffer is %s\n\n", - (cmbsz & 0x00000001) ? "Supported" : "Not supported"); + NVME_CMBSZ_SQS(cmbsz) ? "Supported" : "Not supported"); } static void stdout_registers_bpinfo_brs(__u8 brs) @@ -1316,109 +1320,117 @@ static void stdout_registers_bpinfo_brs(__u8 brs) static void stdout_registers_bpinfo(__u32 bpinfo) { - printf("\tActive Boot Partition ID (ABPID): %u\n", - (bpinfo & 0x80000000) >> 31); - stdout_registers_bpinfo_brs((bpinfo & 0x03000000) >> 24); - printf("\tBoot Partition Size (BPSZ): %u\n", - bpinfo & 0x00007fff); + printf("\tActive Boot Partition ID (ABPID): %u\n", NVME_BPINFO_ABPID(bpinfo)); + stdout_registers_bpinfo_brs(NVME_BPINFO_BRS(bpinfo)); + printf("\tBoot Partition Size (BPSZ): %u\n", NVME_BPINFO_BPSZ(bpinfo)); } static void stdout_registers_bprsel(__u32 bprsel) { - printf("\tBoot Partition Identifier (BPID): %u\n", - (bprsel & 0x80000000) >> 31); - printf("\tBoot Partition Read Offset (BPROF): %x\n", - (bprsel & 0x3ffffc00) >> 10); - printf("\tBoot Partition Read Size (BPRSZ): %x\n", - bprsel & 0x000003ff); + printf("\tBoot Partition Identifier (BPID): %u\n", NVME_BPRSEL_BPID(bprsel)); + printf("\tBoot Partition Read Offset (BPROF): %x\n", NVME_BPRSEL_BPROF(bprsel)); + printf("\tBoot Partition Read Size (BPRSZ): %x\n", NVME_BPRSEL_BPRSZ(bprsel)); } static void stdout_registers_bpmbl(uint64_t bpmbl) { printf("\tBoot Partition Memory Buffer Base Address (BMBBA): %"PRIx64"\n", - bpmbl); + (uint64_t)NVME_BPMBL_BMBBA(bpmbl)); } static void stdout_registers_cmbmsc(uint64_t cmbmsc) { printf("\tController Base Address (CBA): %" PRIx64 "\n", - (cmbmsc & 0xfffffffffffff000) >> 12); - printf("\tController Memory Space Enable (CMSE): %" PRIx64 "\n", - (cmbmsc & 0x0000000000000002) >> 1); - printf("\tCapabilities Registers Enabled (CRE): CMBLOC and "\ - "CMBSZ registers are%senabled\n\n", - (cmbmsc & 0x0000000000000001) ? " " : " NOT "); + (uint64_t)NVME_CMBMSC_CBA(cmbmsc)); + printf("\tController Memory Space Enable (CMSE): %" PRIx64 "\n", NVME_CMBMSC_CMSE(cmbmsc)); + printf("\tCapabilities Registers Enabled (CRE): "); + printf("CMBLOC and CMBSZ registers are %senabled\n\n", + NVME_CMBMSC_CRE(cmbmsc) ? "" : "NOT "); } static void stdout_registers_cmbsts(__u32 cmbsts) { - printf("\tController Base Address Invalid (CBAI): %x\n\n", - (cmbsts & 0x00000001)); + printf("\tController Base Address Invalid (CBAI): %x\n\n", NVME_CMBSTS_CBAI(cmbsts)); +} + +static void stdout_registers_cmbebs(__u32 cmbebs) +{ + printf("\tCMB Elasticity Buffer Size Base (CMBWBZ): %#x\n", NVME_CMBEBS_CMBWBZ(cmbebs)); + printf("\tRead Bypass Behavior : "); + printf("memory reads not conflicting with memory writes in the CMB Elasticity Buffer "); + printf("%s bypass those memory writes\n", NVME_CMBEBS_RBB(cmbebs) ? "SHALL" : "MAY"); + printf("\tCMB Elasticity Buffer Size Units (CMBSZU): %s\n\n", + nvme_register_unit_to_string(NVME_CMBEBS_CMBSZU(cmbebs))); +} + +static void stdout_registers_cmbswtp(__u32 cmbswtp) +{ + printf("\tCMB Sustained Write Throughput (CMBSWTV): %#x\n", + NVME_CMBSWTP_CMBSWTV(cmbswtp)); + printf("\tCMB Sustained Write Throughput Units (CMBSWTU): %s/second\n\n", + nvme_register_unit_to_string(NVME_CMBSWTP_CMBSWTU(cmbswtp))); } static void stdout_registers_pmrcap(__u32 pmrcap) { - printf("\tController Memory Space Supported (CMSS): "\ - "Referencing PMR with host supplied addresses is %s\n", - ((pmrcap & 0x01000000) >> 24) ? "Supported" : "Not Supported"); + printf("\tController Memory Space Supported (CMSS): "); + printf("Referencing PMR with host supplied addresses is %sSupported\n", + NVME_PMRCAP_CMSS(pmrcap) ? "" : "Not "); printf("\tPersistent Memory Region Timeout (PMRTO): %x\n", - (pmrcap & 0x00ff0000) >> 16); + NVME_PMRCAP_PMRTO(pmrcap)); printf("\tPersistent Memory Region Write Barrier Mechanisms (PMRWBM): %x\n", - (pmrcap & 0x00003c00) >> 10); - printf("\tPersistent Memory Region Time Units (PMRTU): PMR time unit is %s\n", - (pmrcap & 0x00000300) >> 8 ? "minutes" : "500 milliseconds"); + NVME_PMRCAP_PMRWMB(pmrcap)); + printf("\tPersistent Memory Region Time Units (PMRTU): "); + printf("PMR time unit is %s\n", NVME_PMRCAP_PMRTU(pmrcap) ? "minutes" : "500 milliseconds"); printf("\tBase Indicator Register (BIR): %x\n", - (pmrcap & 0x000000e0) >> 5); - printf("\tWrite Data Support (WDS): Write data to the PMR is %s\n", - (pmrcap & 0x00000010) ? "supported" : "not supported"); - printf("\tRead Data Support (RDS): Read data from the PMR is %s\n", - (pmrcap & 0x00000008) ? "supported" : "not supported"); + NVME_PMRCAP_BIR(pmrcap)); + printf("\tWrite Data Support (WDS): "); + printf("Write data to the PMR is %ssupported\n", NVME_PMRCAP_WDS(pmrcap) ? "" : "not "); + printf("\tRead Data Support (RDS): "); + printf("Read data from the PMR is %ssupported\n", NVME_PMRCAP_RDS(pmrcap) ? "" : "not "); } static void stdout_registers_pmrctl(__u32 pmrctl) { - printf("\tEnable (EN): PMR is %s\n", (pmrctl & 0x00000001) ? - "READY" : "Disabled"); + printf("\tEnable (EN): PMR is %s\n", NVME_PMRCTL_EN(pmrctl) ? "READY" : "Disabled"); } -static void stdout_registers_pmrsts(__u32 pmrsts, __u32 pmrctl) +static void stdout_registers_pmrsts(__u32 pmrsts, bool ready) { - printf("\tController Base Address Invalid (CBAI): %x\n", - (pmrsts & 0x00001000) >> 12); + printf("\tController Base Address Invalid (CBAI): %x\n", NVME_PMRSTS_CBAI(pmrsts)); printf("\tHealth Status (HSTS): %s\n", - nvme_register_pmr_hsts_to_string((pmrsts & 0x00000e00) >> 9)); - printf("\tNot Ready (NRDY): "\ - "The Persistent Memory Region is %s to process "\ - "PCI Express memory read and write requests\n", - (pmrsts & 0x00000100) == 0 && (pmrctl & 0x00000001) ? - "READY" : "Not Ready"); - printf("\tError (ERR): %x\n", (pmrsts & 0x000000ff)); + nvme_register_pmr_hsts_to_string(NVME_PMRSTS_HSTS(pmrsts))); + printf("\tNot Ready (NRDY): "); + printf("The Persistent Memory Region is %s to process ", + !NVME_PMRSTS_NRDY(pmrsts) && ready ? "READY" : "Not Ready"); + printf("PCI Express memory read and write requests\n"); + printf("\tError (ERR): %x\n", NVME_PMRSTS_ERR(pmrsts)); } static void stdout_registers_pmrebs(__u32 pmrebs) { - printf("\tPMR Elasticity Buffer Size Base (PMRWBZ): %x\n", (pmrebs & 0xffffff00) >> 8); - printf("\tRead Bypass Behavior : memory reads not conflicting with memory writes "\ - "in the PMR Elasticity Buffer %s bypass those memory writes\n", - (pmrebs & 0x00000010) ? "SHALL" : "MAY"); + printf("\tPMR Elasticity Buffer Size Base (PMRWBZ): %x\n", NVME_PMREBS_PMRWBZ(pmrebs)); + printf("\tRead Bypass Behavior : "); + printf("memory reads not conflicting with memory writes "); + printf("in the PMR Elasticity Buffer %s bypass those memory writes\n", + NVME_PMREBS_RBB(pmrebs) ? "SHALL" : "MAY"); printf("\tPMR Elasticity Buffer Size Units (PMRSZU): %s\n", - nvme_register_pmr_pmrszu_to_string(pmrebs & 0x0000000f)); + nvme_register_unit_to_string(NVME_PMREBS_PMRSZU(pmrebs))); } static void stdout_registers_pmrswtp(__u32 pmrswtp) { printf("\tPMR Sustained Write Throughput (PMRSWTV): %x\n", - (pmrswtp & 0xffffff00) >> 8); + NVME_PMRSWTP_PMRSWTV(pmrswtp)); printf("\tPMR Sustained Write Throughput Units (PMRSWTU): %s/second\n", - nvme_register_pmr_pmrszu_to_string(pmrswtp & 0x0000000f)); + nvme_register_unit_to_string(NVME_PMRSWTP_PMRSWTU(pmrswtp))); } static void stdout_registers_pmrmscl(uint32_t pmrmscl) { printf("\tController Base Address (CBA): %#x\n", - (pmrmscl & 0xfffff000) >> 12); - printf("\tController Memory Space Enable (CMSE): %#x\n\n", - (pmrmscl & 0x00000002) >> 1); + (uint32_t)NVME_PMRMSC_CBA(pmrmscl)); + printf("\tController Memory Space Enable (CMSE): %#x\n\n", NVME_PMRMSC_CMSE(pmrmscl)); } static void stdout_registers_pmrmscu(uint32_t pmrmscu) @@ -1427,209 +1439,168 @@ static void stdout_registers_pmrmscu(uint32_t pmrmscu) pmrmscu); } -void stdout_ctrl_registers(void *bar, bool fabrics) +static void stdout_ctrl_register_human(int offset, uint64_t value, bool support) { - uint64_t cap, asq, acq, bpmbl, cmbmsc; - uint32_t vs, intms, intmc, cc, csts, nssr, crto, aqa, cmbsz, cmbloc, bpinfo, - bprsel, cmbsts, pmrcap, pmrctl, pmrsts, pmrebs, pmrswtp, - pmrmscl, pmrmscu; - int human = stdout_print_ops.flags & VERBOSE; + switch (offset) { + case NVME_REG_CAP: + stdout_registers_cap((struct nvme_bar_cap *)&value); + break; + case NVME_REG_VS: + stdout_registers_version(value); + break; + case NVME_REG_INTMS: + printf("\tInterrupt Vector Mask Set (IVMS): %#"PRIx64"\n\n", value); + break; + case NVME_REG_INTMC: + printf("\tInterrupt Vector Mask Clear (IVMC): %#"PRIx64"\n\n", value); + break; + case NVME_REG_CC: + stdout_registers_cc(value); + break; + case NVME_REG_CSTS: + stdout_registers_csts(value); + break; + case NVME_REG_NSSR: + printf("\tNVM Subsystem Reset Control (NSSRC): %"PRIu64"\n\n", value); + break; + case NVME_REG_AQA: + stdout_registers_aqa(value); + break; + case NVME_REG_ASQ: + stdout_registers_asq(value); + break; + case NVME_REG_ACQ: + stdout_registers_acq(value); + break; + case NVME_REG_CMBLOC: + stdout_registers_cmbloc(value, support); + break; + case NVME_REG_CMBSZ: + stdout_registers_cmbsz(value); + break; + case NVME_REG_BPINFO: + stdout_registers_bpinfo(value); + break; + case NVME_REG_BPRSEL: + stdout_registers_bprsel(value); + break; + case NVME_REG_BPMBL: + stdout_registers_bpmbl(value); + break; + case NVME_REG_CMBMSC: + stdout_registers_cmbmsc(value); + break; + case NVME_REG_CMBSTS: + stdout_registers_cmbsts(value); + break; + case NVME_REG_CMBEBS: + stdout_registers_cmbebs(value); + break; + case NVME_REG_CMBSWTP: + stdout_registers_cmbswtp(value); + break; + case NVME_REG_NSSD: + stdout_registers_nssd(value); + break; + case NVME_REG_CRTO: + stdout_registers_crto(value); + break; + case NVME_REG_PMRCAP: + stdout_registers_pmrcap(value); + break; + case NVME_REG_PMRCTL: + stdout_registers_pmrctl(value); + break; + case NVME_REG_PMRSTS: + stdout_registers_pmrsts(value, support); + break; + case NVME_REG_PMREBS: + stdout_registers_pmrebs(value); + break; + case NVME_REG_PMRSWTP: + stdout_registers_pmrswtp(value); + break; + case NVME_REG_PMRMSCL: + stdout_registers_pmrmscl(value); + break; + case NVME_REG_PMRMSCU: + stdout_registers_pmrmscu(value); + break; + default: + printf("unknown register: %#04x (%s), value: %#"PRIx64"\n", + offset, nvme_register_to_string(offset), value); + break; + } +} - cap = mmio_read64(bar + NVME_REG_CAP); - vs = mmio_read32(bar + NVME_REG_VS); - intms = mmio_read32(bar + NVME_REG_INTMS); - intmc = mmio_read32(bar + NVME_REG_INTMC); - cc = mmio_read32(bar + NVME_REG_CC); - csts = mmio_read32(bar + NVME_REG_CSTS); - nssr = mmio_read32(bar + NVME_REG_NSSR); - crto = mmio_read32(bar + NVME_REG_CRTO); - aqa = mmio_read32(bar + NVME_REG_AQA); - asq = mmio_read64(bar + NVME_REG_ASQ); - acq = mmio_read64(bar + NVME_REG_ACQ); - cmbloc = mmio_read32(bar + NVME_REG_CMBLOC); - cmbsz = mmio_read32(bar + NVME_REG_CMBSZ); - bpinfo = mmio_read32(bar + NVME_REG_BPINFO); - bprsel = mmio_read32(bar + NVME_REG_BPRSEL); - bpmbl = mmio_read64(bar + NVME_REG_BPMBL); - cmbmsc = mmio_read64(bar + NVME_REG_CMBMSC); - cmbsts = mmio_read32(bar + NVME_REG_CMBSTS); - pmrcap = mmio_read32(bar + NVME_REG_PMRCAP); - pmrctl = mmio_read32(bar + NVME_REG_PMRCTL); - pmrsts = mmio_read32(bar + NVME_REG_PMRSTS); - pmrebs = mmio_read32(bar + NVME_REG_PMREBS); - pmrswtp = mmio_read32(bar + NVME_REG_PMRSWTP); - pmrmscl = mmio_read32(bar + NVME_REG_PMRMSCL); - pmrmscu = mmio_read32(bar + NVME_REG_PMRMSCU); +static void stdout_ctrl_register_common(int offset, uint64_t value, bool fabrics) +{ + bool human = !!(stdout_print_ops.flags & VERBOSE); + const char *name = nvme_register_to_string(offset); + const char *type = fabrics ? "property" : "register"; if (human) { - if (cap != 0xffffffff) { - printf("cap : %"PRIx64"\n", cap); - stdout_registers_cap((struct nvme_bar_cap *)&cap); - } - if (vs != 0xffffffff) { - printf("version : %x\n", vs); - stdout_registers_version(vs); - } - if (cc != 0xffffffff) { - printf("cc : %x\n", cc); - stdout_registers_cc(cc); - } - if (csts != 0xffffffff) { - printf("csts : %x\n", csts); - stdout_registers_csts(csts); - } - if (nssr != 0xffffffff) { - printf("nssr : %x\n", nssr); - printf("\tNVM Subsystem Reset Control (NSSRC): %u\n\n", - nssr); - } - if (crto != 0xffffffff) { - printf("crto : %x\n", crto); - stdout_registers_crto(crto); - } - if (!fabrics) { - printf("intms : %x\n", intms); - printf("\tInterrupt Vector Mask Set (IVMS): %x\n\n", - intms); - - printf("intmc : %x\n", intmc); - printf("\tInterrupt Vector Mask Clear (IVMC): %x\n\n", - intmc); - printf("aqa : %x\n", aqa); - stdout_registers_aqa(aqa); - - printf("asq : %"PRIx64"\n", asq); - printf("\tAdmin Submission Queue Base (ASQB): %"PRIx64"\n\n", - asq); - - printf("acq : %"PRIx64"\n", acq); - printf("\tAdmin Completion Queue Base (ACQB): %"PRIx64"\n\n", - acq); - - printf("cmbloc : %x\n", cmbloc); - stdout_registers_cmbloc(cmbloc, cmbsz); - - printf("cmbsz : %x\n", cmbsz); - stdout_registers_cmbsz(cmbsz); - - printf("bpinfo : %x\n", bpinfo); - stdout_registers_bpinfo(bpinfo); - - printf("bprsel : %x\n", bprsel); - stdout_registers_bprsel(bprsel); - - printf("bpmbl : %"PRIx64"\n", bpmbl); - stdout_registers_bpmbl(bpmbl); + printf("%s: %#"PRIx64"\n", name, value); + stdout_ctrl_register_human(offset, value, true); + return; + } - printf("cmbmsc : %"PRIx64"\n", cmbmsc); - stdout_registers_cmbmsc(cmbmsc); + printf("%s: %#04x (%s), value: %#"PRIx64"\n", type, offset, + name, value); +} - printf("cmbsts : %x\n", cmbsts); - stdout_registers_cmbsts(cmbsts); +static void stdout_ctrl_register(int offset, uint64_t value) +{ + stdout_ctrl_register_common(offset, value, false); +} - printf("pmrcap : %x\n", pmrcap); - stdout_registers_pmrcap(pmrcap); +static void stdout_ctrl_register_support(void *bar, bool fabrics, int offset, bool human, + bool support) +{ + uint64_t value = nvme_is_64bit_reg(offset) ? mmio_read64(bar + offset) : + mmio_read32(bar + offset); - printf("pmrctl : %x\n", pmrctl); - stdout_registers_pmrctl(pmrctl); + if (fabrics && value == -1) + return; - printf("pmrsts : %x\n", pmrsts); - stdout_registers_pmrsts(pmrsts, pmrctl); + printf("%-8s: ", nvme_register_symbol_to_string(offset)); - printf("pmrebs : %x\n", pmrebs); - stdout_registers_pmrebs(pmrebs); + printf("%#"PRIx64"\n", value); - printf("pmrswtp : %x\n", pmrswtp); - stdout_registers_pmrswtp(pmrswtp); + if (human) + stdout_ctrl_register_human(offset, value, support); +} - printf("pmrmscl : %#x\n", pmrmscl); - stdout_registers_pmrmscl(pmrmscl); +void stdout_ctrl_registers(void *bar, bool fabrics) +{ + uint32_t value; + bool human = !!(stdout_print_ops.flags & VERBOSE); + int offset; + bool support; - printf("pmrmscu : %#x\n", pmrmscu); - stdout_registers_pmrmscu(pmrmscu); - } - } else { - if (cap != 0xffffffff) - printf("cap : %"PRIx64"\n", cap); - if (vs != 0xffffffff) - printf("version : %x\n", vs); - if (cc != 0xffffffff) - printf("cc : %x\n", cc); - if (csts != 0xffffffff) - printf("csts : %x\n", csts); - if (nssr != 0xffffffff) - printf("nssr : %x\n", nssr); - if (crto != 0xffffffff) - printf("crto : %x\n", crto); - if (!fabrics) { - printf("intms : %x\n", intms); - printf("intmc : %x\n", intmc); - printf("aqa : %x\n", aqa); - printf("asq : %"PRIx64"\n", asq); - printf("acq : %"PRIx64"\n", acq); - printf("cmbloc : %x\n", cmbloc); - printf("cmbsz : %x\n", cmbsz); - printf("bpinfo : %x\n", bpinfo); - printf("bprsel : %x\n", bprsel); - printf("bpmbl : %"PRIx64"\n", bpmbl); - printf("cmbmsc : %"PRIx64"\n", cmbmsc); - printf("cmbsts : %x\n", cmbsts); - printf("pmrcap : %x\n", pmrcap); - printf("pmrctl : %x\n", pmrctl); - printf("pmrsts : %x\n", pmrsts); - printf("pmrebs : %x\n", pmrebs); - printf("pmrswtp : %x\n", pmrswtp); - printf("pmrmscl : %#x\n", pmrmscl); - printf("pmrmscu : %#x\n", pmrmscu); + for (offset = NVME_REG_CAP; offset <= NVME_REG_PMRMSCU; offset += get_reg_size(offset)) { + if (!nvme_is_ctrl_reg(offset) || (fabrics && !nvme_is_fabrics_reg(offset))) + continue; + switch (offset) { + case NVME_REG_CMBLOC: + value = mmio_read32(bar + NVME_REG_CMBSZ); + support = nvme_registers_cmbloc_support(value); + break; + case NVME_REG_PMRSTS: + value = mmio_read32(bar + NVME_REG_PMRCTL); + support = nvme_registers_pmrctl_ready(value); + break; + default: + support = true; + break; } + stdout_ctrl_register_support(bar, fabrics, offset, human, support); } } -static void stdout_single_property(int offset, uint64_t value64) +static void stdout_single_property(int offset, uint64_t value) { - int human = stdout_print_ops.flags & VERBOSE; - uint32_t value32 = (uint32_t)value64; - - if (!human) { - if (nvme_is_64bit_reg(offset)) - printf("property: 0x%02x (%s), value: %"PRIx64"\n", - offset, nvme_register_to_string(offset), value64); - else - printf("property: 0x%02x (%s), value: %x\n", offset, - nvme_register_to_string(offset), value32); - return; - } - - switch (offset) { - case NVME_REG_CAP: - printf("cap : %"PRIx64"\n", value64); - stdout_registers_cap((struct nvme_bar_cap *)&value64); - break; - case NVME_REG_VS: - printf("version : %x\n", value32); - stdout_registers_version(value32); - break; - case NVME_REG_CC: - printf("cc : %x\n", value32); - stdout_registers_cc(value32); - break; - case NVME_REG_CSTS: - printf("csts : %x\n", value32); - stdout_registers_csts(value32); - break; - case NVME_REG_NSSR: - printf("nssr : %x\n", value32); - printf("\tNVM Subsystem Reset Control (NSSRC): %u\n\n", value32); - break; - case NVME_REG_CRTO: - printf("crto : %x\n", value32); - stdout_registers_crto(value32); - break; - default: - printf("unknown property: 0x%02x (%s), value: %"PRIx64"\n", - offset, nvme_register_to_string(offset), value64); - break; - } + stdout_ctrl_register_common(offset, value, true); } static void stdout_status(int status) @@ -1674,18 +1645,17 @@ static void stdout_error_status(int status, const char *msg, va_list ap) static void stdout_id_ctrl_cmic(__u8 cmic) { - __u8 rsvd = (cmic & 0xF0) >> 4; - __u8 ana = (cmic & 0x8) >> 3; - __u8 sriov = (cmic & 0x4) >> 2; - __u8 mctl = (cmic & 0x2) >> 1; - __u8 mp = cmic & 0x1; + __u8 rsvd = NVME_CMIC_MULTI_RSVD(cmic); + __u8 ana = NVME_CMIC_MULTI_ANA(cmic); + __u8 sriov = NVME_CMIC_MULTI_SRIOV(cmic); + __u8 mctl = NVME_CMIC_MULTI_CTRL(cmic); + __u8 mp = NVME_CMIC_MULTI_PORT(cmic); if (rsvd) printf(" [7:4] : %#x\tReserved\n", rsvd); printf(" [3:3] : %#x\tANA %ssupported\n", ana, ana ? "" : "not "); printf(" [2:2] : %#x\t%s\n", sriov, sriov ? "SR-IOV" : "PCI"); - printf(" [1:1] : %#x\t%s Controller\n", - mctl, mctl ? "Multi" : "Single"); + printf(" [1:1] : %#x\t%s Controller\n", mctl, mctl ? "Multi" : "Single"); printf(" [0:0] : %#x\t%s Port\n", mp, mp ? "Multi" : "Single"); printf("\n"); } @@ -1807,7 +1777,7 @@ static void stdout_id_ctrl_cntrltype(__u8 cntrltype) __u8 rsvd = (cntrltype & 0xFC) >> 2; __u8 cntrl = cntrltype & 0x3; - static const char *type[] = { + static const char * const type[] = { "Controller type not reported", "I/O Controller", "Discovery Controller", @@ -1840,7 +1810,7 @@ static void stdout_id_ctrl_vwci(__u8 vwci) printf(" [7:7] : %#x\tVPD Write Cycles Remaining field is %svalid.\n", vwcrv, vwcrv ? "" : "Not "); - printf(" [6:0] : %#x\tVPD Write Cycles Remaining \n", vwcr); + printf(" [6:0] : %#x\tVPD Write Cycles Remaining\n", vwcr); printf("\n"); } @@ -1972,6 +1942,7 @@ static void stdout_id_ctrl_avscc(__u8 avscc) { __u8 rsvd = (avscc & 0xFE) >> 1; __u8 fmt = avscc & 0x1; + if (rsvd) printf(" [7:1] : %#x\tReserved\n", rsvd); printf(" [0:0] : %#x\tAdmin Vendor Specific Commands uses %s Format\n", @@ -1983,6 +1954,7 @@ static void stdout_id_ctrl_apsta(__u8 apsta) { __u8 rsvd = (apsta & 0xFE) >> 1; __u8 apst = apsta & 0x1; + if (rsvd) printf(" [7:1] : %#x\tReserved\n", rsvd); printf(" [0:0] : %#x\tAutonomous Power State Transitions %sSupported\n", @@ -2071,7 +2043,7 @@ static void stdout_id_ctrl_sanicap(__le32 ctrl_sanicap) __u32 ndi = (sanicap & 0x20000000) >> 29; __u32 nodmmas = (sanicap & 0xC0000000) >> 30; - static const char *modifies_media[] = { + static const char * const modifies_media[] = { "Additional media modification after sanitize operation completes successfully is not defined", "Media is not additionally modified after sanitize operation completes successfully", "Media is additionally modified after sanitize operation completes successfully", @@ -2126,6 +2098,7 @@ static void stdout_id_ctrl_sqes(__u8 sqes) { __u8 msqes = (sqes & 0xF0) >> 4; __u8 rsqes = sqes & 0xF; + printf(" [7:4] : %#x\tMax SQ Entry Size (%d)\n", msqes, 1 << msqes); printf(" [3:0] : %#x\tMin SQ Entry Size (%d)\n", rsqes, 1 << rsqes); printf("\n"); @@ -2135,6 +2108,7 @@ static void stdout_id_ctrl_cqes(__u8 cqes) { __u8 mcqes = (cqes & 0xF0) >> 4; __u8 rcqes = cqes & 0xF; + printf(" [7:4] : %#x\tMax CQ Entry Size (%d)\n", mcqes, 1 << mcqes); printf(" [3:0] : %#x\tMin CQ Entry Size (%d)\n", rcqes, 1 << rcqes); printf("\n"); @@ -2203,6 +2177,7 @@ static void stdout_id_ctrl_fna(__u8 fna) __u8 cese = (fna & 0x4) >> 2; __u8 cens = (fna & 0x2) >> 1; __u8 fmns = fna & 0x1; + if (rsvd) printf(" [7:4] : %#x\tReserved\n", rsvd); printf(" [3:3] : %#x\tFormat NVM Broadcast NSID (FFFFFFFFh) %sSupported\n", @@ -2222,7 +2197,7 @@ static void stdout_id_ctrl_vwc(__u8 vwc) __u8 flush = (vwc & 0x6) >> 1; __u8 vwcp = vwc & 0x1; - static const char *flush_behavior[] = { + static const char * const flush_behavior[] = { "Support for the NSID field set to FFFFFFFFh is not indicated", "Reserved", "The Flush command does not support NSID set to FFFFFFFFh", @@ -2232,8 +2207,7 @@ static void stdout_id_ctrl_vwc(__u8 vwc) if (rsvd) printf(" [7:3] : %#x\tReserved\n", rsvd); printf(" [2:1] : %#x\t%s\n", flush, flush_behavior[flush]); - printf(" [0:0] : %#x\tVolatile Write Cache %sPresent\n", - vwcp, vwcp ? "" : "Not "); + printf(" [0:0] : %#x\tVolatile Write Cache %sPresent\n", vwcp, vwcp ? "" : "Not "); printf("\n"); } @@ -2241,6 +2215,7 @@ static void stdout_id_ctrl_icsvscc(__u8 icsvscc) { __u8 rsvd = (icsvscc & 0xFE) >> 1; __u8 fmt = icsvscc & 0x1; + if (rsvd) printf(" [7:1] : %#x\tReserved\n", rsvd); printf(" [0:0] : %#x\tNVM Vendor Specific Commands uses %s Format\n", @@ -2273,12 +2248,13 @@ static void stdout_id_ctrl_ocfs(__le16 ctrl_ocfs) __u16 rsvd = ocfs >> 4; __u8 copy_fmt_supported; int copy_fmt; + if (rsvd) printf(" [15:4] : %#x\tReserved\n", rsvd); for (copy_fmt = 3; copy_fmt >= 0; copy_fmt--) { copy_fmt_supported = ocfs >> copy_fmt & 1; - printf(" [%d:%d] : %#x\tController Copy Format %xh %sSupported\n", copy_fmt, copy_fmt, - copy_fmt_supported, copy_fmt, copy_fmt_supported ? "" : "Not "); + printf(" [%d:%d] : %#x\tController Copy Format %xh %sSupported\n", copy_fmt, + copy_fmt, copy_fmt_supported, copy_fmt, copy_fmt_supported ? "" : "Not "); } printf("\n"); } @@ -2342,6 +2318,7 @@ static void stdout_id_ctrl_fcatt(__u8 fcatt) { __u8 rsvd = (fcatt & 0xFE) >> 1; __u8 scm = fcatt & 0x1; + if (rsvd) printf(" [7:1] : %#x\tReserved\n", rsvd); printf(" [0:0] : %#x\t%s Controller Model\n", @@ -2353,6 +2330,7 @@ static void stdout_id_ctrl_ofcs(__le16 ofcs) { __u16 rsvd = (ofcs & 0xfffe) >> 1; __u8 disconn = ofcs & 0x1; + if (rsvd) printf(" [15:1] : %#x\tReserved\n", rsvd); printf(" [0:0] : %#x\tDisconnect command %s Supported\n", @@ -2369,6 +2347,7 @@ static void stdout_id_ns_nsfeat(__u8 nsfeat) __u8 dulbe = (nsfeat & 0x4) >> 2; __u8 na = (nsfeat & 0x2) >> 1; __u8 thin = nsfeat & 0x1; + if (rsvd) printf(" [7:5] : %#x\tReserved\n", rsvd); printf(" [4:4] : %#x\tNPWG, NPWA, NPDG, NPDA, and NOWS are %sSupported\n", @@ -2407,6 +2386,7 @@ static void stdout_id_ns_mc(__u8 mc) __u8 rsvd = (mc & 0xFC) >> 2; __u8 mdp = (mc & 0x2) >> 1; __u8 extdlba = mc & 0x1; + if (rsvd) printf(" [7:2] : %#x\tReserved\n", rsvd); printf(" [1:1] : %#x\tMetadata Pointer %sSupported\n", @@ -2424,6 +2404,7 @@ static void stdout_id_ns_dpc(__u8 dpc) __u8 pit3 = (dpc & 0x4) >> 2; __u8 pit2 = (dpc & 0x2) >> 1; __u8 pit1 = dpc & 0x1; + if (rsvd) printf(" [7:5] : %#x\tReserved\n", rsvd); printf(" [4:4] : %#x\tProtection Information Transferred as Last Bytes of Metadata %sSupported\n", @@ -2444,6 +2425,7 @@ static void stdout_id_ns_dps(__u8 dps) __u8 rsvd = (dps & 0xF0) >> 4; __u8 pif8 = (dps & 0x8) >> 3; __u8 pit = dps & 0x7; + if (rsvd) printf(" [7:4] : %#x\tReserved\n", rsvd); printf(" [3:3] : %#x\tProtection Information is Transferred as %s Bytes of Metadata\n", @@ -2460,6 +2442,7 @@ static void stdout_id_ns_nmic(__u8 nmic) { __u8 rsvd = (nmic & 0xFE) >> 1; __u8 mp = nmic & 0x1; + if (rsvd) printf(" [7:1] : %#x\tReserved\n", rsvd); printf(" [0:0] : %#x\tNamespace Multipath %sCapable\n", @@ -2501,6 +2484,7 @@ static void stdout_id_ns_fpi(__u8 fpi) { __u8 fpis = (fpi & 0x80) >> 7; __u8 fpii = fpi & 0x7F; + printf(" [7:7] : %#x\tFormat Progress Indicator %sSupported\n", fpis, fpis ? "" : "Not "); if (fpis || (!fpis && fpii)) @@ -2513,6 +2497,7 @@ static void stdout_id_ns_nsattr(__u8 nsattr) { __u8 rsvd = (nsattr & 0xFE) >> 1; __u8 write_protected = nsattr & 0x1; + if (rsvd) printf(" [7:1] : %#x\tReserved\n", rsvd); printf(" [0:0] : %#x\tNamespace %sWrite Protected\n", @@ -2526,6 +2511,7 @@ static void stdout_id_ns_dlfeat(__u8 dlfeat) __u8 guard = (dlfeat & 0x10) >> 4; __u8 dwz = (dlfeat & 0x8) >> 3; __u8 val = dlfeat & 0x7; + if (rsvd) printf(" [7:5] : %#x\tReserved\n", rsvd); printf(" [4:4] : %#x\tGuard Field of Deallocated Logical Blocks is set to %s\n", @@ -2657,6 +2643,7 @@ static void stdout_cmd_set_independent_id_ns_nsfeat(__u8 nsfeat) __u8 rmedia = (nsfeat & 0x10) >> 4; __u8 uidreuse = (nsfeat & 0x8) >> 3; __u8 rsvd0 = (nsfeat & 0x7); + if (rsvd6) printf(" [7:6] : %#x\tReserved\n", rsvd6); printf(" [5:5] : %#x\tVolatile Write Cache is %sPresent\n", @@ -2674,6 +2661,7 @@ static void stdout_cmd_set_independent_id_ns_nstat(__u8 nstat) { __u8 rsvd1 = (nstat & 0xfe) >> 1; __u8 nrdy = nstat & 0x1; + if (rsvd1) printf(" [7:1] : %#x\tReserved\n", rsvd1); printf(" [0:0] : %#x\tName space is %sready\n", @@ -2714,7 +2702,7 @@ static void stdout_cmd_set_independent_id_ns(struct nvme_id_independent_id_ns *n static void stdout_id_ns_descs(void *data, unsigned int nsid) { int pos, len = 0; - int i; + int i, verbose = stdout_print_ops.flags & VERBOSE; __u8 uuid[NVME_UUID_LEN]; char uuid_str[NVME_UUID_LEN_STRING]; __u8 eui64[8]; @@ -2728,9 +2716,17 @@ static void stdout_id_ns_descs(void *data, unsigned int nsid) if (cur->nidl == 0) break; + if (verbose) { + printf("loc : %d\n", pos); + printf("nidt : %d\n", (int)cur->nidt); + printf("nidl : %d\n", (int)cur->nidl); + } + switch (cur->nidt) { case NVME_NIDT_EUI64: memcpy(eui64, data + pos + sizeof(*cur), sizeof(eui64)); + if (verbose) + printf("type : eui64\n"); printf("eui64 : "); for (i = 0; i < 8; i++) printf("%02x", eui64[i]); @@ -2739,6 +2735,8 @@ static void stdout_id_ns_descs(void *data, unsigned int nsid) break; case NVME_NIDT_NGUID: memcpy(nguid, data + pos + sizeof(*cur), sizeof(nguid)); + if (verbose) + printf("type : nguid\n"); printf("nguid : "); for (i = 0; i < 16; i++) printf("%02x", nguid[i]); @@ -2748,11 +2746,15 @@ static void stdout_id_ns_descs(void *data, unsigned int nsid) case NVME_NIDT_UUID: memcpy(uuid, data + pos + sizeof(*cur), 16); nvme_uuid_to_string(uuid, uuid_str); + if (verbose) + printf("type : uuid\n"); printf("uuid : %s\n", uuid_str); len = sizeof(uuid); break; case NVME_NIDT_CSI: memcpy(&csi, data + pos + sizeof(*cur), 1); + if (verbose) + printf("type : csi\n"); printf("csi : %#x\n", csi); len += sizeof(csi); break; @@ -3102,6 +3104,7 @@ static void show_nvme_id_ns_zoned_zoc(__le16 ns_zoc) __u8 rsvd = (zoc & 0xfffc) >> 2; __u8 ze = (zoc & 0x2) >> 1; __u8 vzc = zoc & 0x1; + if (rsvd) printf(" [15:2] : %#x\tReserved\n", rsvd); printf(" [1:1] : %#x\t Zone Active Excursions: %s\n", @@ -3130,6 +3133,7 @@ static void stdout_zns_id_ns_recommended_limit(__le32 ns_rl, int human, const char *target_limit) { unsigned int recommended_limit = le32_to_cpu(ns_rl); + if (!recommended_limit && human) printf("%s : Not Reported\n", target_limit); else @@ -3173,21 +3177,19 @@ static void stdout_zns_id_ns(struct nvme_zns_id_ns *ns, } if (human) { - if (ns->mar == 0xffffffff) { + if (ns->mar == 0xffffffff) printf("mar : No Active Resource Limit\n"); - } else { + else printf("mar : %u\tActive Resources\n", le32_to_cpu(ns->mar) + 1); - } } else { printf("mar : %#x\n", le32_to_cpu(ns->mar)); } if (human) { - if (ns->mor == 0xffffffff) { + if (ns->mor == 0xffffffff) printf("mor : No Open Resource Limit\n"); - } else { + else printf("mor : %u\tOpen Resources\n", le32_to_cpu(ns->mor) + 1); - } } else { printf("mor : %#x\n", le32_to_cpu(ns->mor)); } @@ -3211,14 +3213,14 @@ static void stdout_zns_id_ns(struct nvme_zns_id_ns *ns, printf("zrwacap : %u\n", ns->zrwacap); } - for (i = 0; i <= id_ns->nlbaf; i++){ + for (i = 0; i <= id_ns->nlbaf; i++) { if (human) - printf("LBA Format Extension %2d : Zone Size: 0x%"PRIx64" LBAs - " + printf("LBA Format Extension %2d : Zone Size: %#"PRIx64" LBAs - " "Zone Descriptor Extension Size: %-1d bytes%s\n", i, le64_to_cpu(ns->lbafe[i].zsze), ns->lbafe[i].zdes << 6, i == lbaf ? " (in use)" : ""); else - printf("lbafe %2d: zsze:0x%"PRIx64" zdes:%u%s\n", i, + printf("lbafe %2d: zsze:%#"PRIx64" zdes:%u%s\n", i, (uint64_t)le64_to_cpu(ns->lbafe[i].zsze), ns->lbafe[i].zdes, i == lbaf ? " (in use)" : ""); } @@ -3264,20 +3266,21 @@ static void stdout_zns_changed(struct nvme_zns_changed_zone_log *log) static void stdout_zns_report_zone_attributes(__u8 za, __u8 zai) { - const char *const recommended_limit[4] = {"","1","2","3"}; + const char * const recommended_limit[4] = {"", "1", "2", "3"}; + printf("Attrs: Zone Descriptor Extension is %sVaild\n", - (za & NVME_ZNS_ZA_ZDEV)? "" : "Not "); - if(za & NVME_ZNS_ZA_RZR) { + za & NVME_ZNS_ZA_ZDEV ? "" : "Not "); + + if (za & NVME_ZNS_ZA_RZR) printf(" Reset Zone Recommended with Reset Recommended Limit%s\n", - recommended_limit[(zai&0xd)>>2]); - } - if (za & NVME_ZNS_ZA_FZR) { + recommended_limit[(zai&0xd)>>2]); + + if (za & NVME_ZNS_ZA_FZR) printf(" Finish Zone Recommended with Finish Recommended Limit%s\n", - recommended_limit[zai&0x3]); - } - if (za & NVME_ZNS_ZA_ZFC) { + recommended_limit[zai&0x3]); + + if (za & NVME_ZNS_ZA_ZFC) printf(" Zone Finished by Controller\n"); - } } static void stdout_zns_report_zones(void *report, __u32 descs, @@ -3295,7 +3298,7 @@ static void stdout_zns_report_zones(void *report, __u32 descs, for (i = 0; i < descs; i++) { desc = (struct nvme_zns_desc *) (report + sizeof(*r) + i * (sizeof(*desc) + ext_size)); - if(verbose) { + if (verbose) { printf("SLBA: %#-10"PRIx64" WP: %#-10"PRIx64" Cap: %#-10"PRIx64" State: %-12s Type: %-14s\n", (uint64_t)le64_to_cpu(desc->zslba), (uint64_t)le64_to_cpu(desc->wp), (uint64_t)le64_to_cpu(desc->zcap), nvme_zone_state_to_string(desc->zs >> 4), @@ -3408,18 +3411,18 @@ static void stdout_list_secondary_ctrl(const struct nvme_secondary_ctrl_list *sc for (i = 0; i < entries; i++) { printf(" SCEntry[%-3d]:\n", i); printf("................\n"); - printf(" SCID : Secondary Controller Identifier : 0x%.04x\n", + printf(" SCID : Secondary Controller Identifier : %#.04x\n", le16_to_cpu(sc_entry[i].scid)); - printf(" PCID : Primary Controller Identifier : 0x%.04x\n", + printf(" PCID : Primary Controller Identifier : %#.04x\n", le16_to_cpu(sc_entry[i].pcid)); - printf(" SCS : Secondary Controller State : 0x%.04x (%s)\n", + printf(" SCS : Secondary Controller State : %#.04x (%s)\n", sc_entry[i].scs, state_desc[sc_entry[i].scs & 0x1]); - printf(" VFN : Virtual Function Number : 0x%.04x\n", + printf(" VFN : Virtual Function Number : %#.04x\n", le16_to_cpu(sc_entry[i].vfn)); - printf(" NVQ : Num VQ Flex Resources Assigned : 0x%.04x\n", + printf(" NVQ : Num VQ Flex Resources Assigned : %#.04x\n", le16_to_cpu(sc_entry[i].nvq)); - printf(" NVI : Num VI Flex Resources Assigned : 0x%.04x\n", + printf(" NVI : Num VI Flex Resources Assigned : %#.04x\n", le16_to_cpu(sc_entry[i].nvi)); } } @@ -3429,7 +3432,7 @@ static void stdout_id_ns_granularity_list(const struct nvme_id_ns_granularity_li int i; printf("Identify Namespace Granularity List:\n"); - printf(" ATTR : Namespace Granularity Attributes: 0x%x\n", + printf(" ATTR : Namespace Granularity Attributes: %#x\n", glist->attributes); printf(" NUMD : Number of Descriptors : %d\n", glist->num_descriptors); @@ -3438,9 +3441,9 @@ static void stdout_id_ns_granularity_list(const struct nvme_id_ns_granularity_li for (i = 0; i <= glist->num_descriptors; i++) { printf("\n Entry[%2d] :\n", i); printf("................\n"); - printf(" NSG : Namespace Size Granularity : 0x%"PRIx64"\n", + printf(" NSG : Namespace Size Granularity : %#"PRIx64"\n", le64_to_cpu(glist->entry[i].nszegran)); - printf(" NCG : Namespace Capacity Granularity : 0x%"PRIx64"\n", + printf(" NCG : Namespace Capacity Granularity : %#"PRIx64"\n", le64_to_cpu(glist->entry[i].ncapgran)); } } @@ -3477,7 +3480,7 @@ static void stdout_id_uuid_list(const struct nvme_id_uuid_list *uuid_list) } printf(" Entry[%3d]\n", i+1); printf(".................\n"); - printf("association : 0x%x %s\n", identifier_association, association); + printf("association : %#x %s\n", identifier_association, association); printf("UUID : %s", util_uuid_to_string(uuid)); if (memcmp(uuid_list->entry[i].uuid, invalid_uuid, sizeof(zero_uuid)) == 0) @@ -3512,9 +3515,8 @@ static void stdout_endurance_group_list(struct nvme_id_endurance_group_list *end __u16 num = le16_to_cpu(endgrp_list->num); printf("num of endurance group ids: %u\n", num); - for (i = 0; i < min(num, 2047); i++) { + for (i = 0; i < min(num, 2047); i++) printf("[%4u]:%#x\n", i, le16_to_cpu(endgrp_list->identifier[i])); - } } static void stdout_id_iocs(struct nvme_id_iocs *iocs) @@ -3538,7 +3540,7 @@ static void stdout_error_log(struct nvme_error_log_page *err_log, int entries, for (i = 0; i < entries; i++) { __u16 status = le16_to_cpu(err_log[i].status_field) >> 0x1; - printf(" Entry[%2d] \n", i); + printf(" Entry[%2d]\n", i); printf(".................\n"); printf("error_count : %"PRIu64"\n", le64_to_cpu(err_log[i].error_count)); @@ -3683,7 +3685,7 @@ static void stdout_effects_log_human(FILE *stream, __u32 effect) fprintf(stream, " Reserved CSE\n"); } -static void stdout_effects_entry(FILE* stream, int admin, int index, +static void stdout_effects_entry(FILE *stream, int admin, int index, __le32 entry, unsigned int human) { __u32 effect; @@ -3704,7 +3706,7 @@ static void stdout_effects_entry(FILE* stream, int admin, int index, static void stdout_effects_log_segment(int admin, int a, int b, struct nvme_cmd_effects_log *effects, - char* header, int human) + char *header, int human) { FILE *stream; char *stream_location; @@ -3717,13 +3719,10 @@ static void stdout_effects_log_segment(int admin, int a, int b, } for (int i = a; i < b; i++) { - if (admin) { + if (admin) stdout_effects_entry(stream, admin, i, effects->acs[i], human); - } - else { - stdout_effects_entry(stream, admin, i, - effects->iocs[i], human); - } + else + stdout_effects_entry(stream, admin, i, effects->iocs[i], human); } fclose(stream); @@ -3765,7 +3764,7 @@ static void stdout_effects_log_page(enum nvme_csi csi, static void stdout_effects_log_pages(struct list_head *list) { - nvme_effects_log_node_t *node; + nvme_effects_log_node_t *node = NULL; list_for_each(list, node, node) { stdout_effects_log_page(node->csi, &node->effects); @@ -3788,14 +3787,14 @@ static void stdout_support_log_human(__u32 support, __u8 lid) static void stdout_supported_log(struct nvme_supported_log_pages *support_log, const char *devname) { - int lid, human = stdout_print_ops.flags& VERBOSE; + int lid, human = stdout_print_ops.flags & VERBOSE; __u32 support = 0; printf("Support Log Pages Details for %s:\n", devname); for (lid = 0; lid < 256; lid++) { support = le32_to_cpu(support_log->lid_support[lid]); if (support & 0x1) { - printf("LID 0x%x - %s\n", lid, nvme_log_to_string(lid)); + printf("LID %#x - %s\n", lid, nvme_log_to_string(lid)); if (human) stdout_support_log_human(support, lid); } @@ -3951,7 +3950,7 @@ static void stdout_ana_log(struct nvme_ana_log *ana_log, const char *devname, static void stdout_self_test_result(struct nvme_st_result *res) { - static const char *const test_res[] = { + static const char * const test_res[] = { "Operation completed without error", "Operation was aborted by a Device Self-test command", "Operation was aborted by a Controller Level Reset", @@ -4151,12 +4150,12 @@ static void stdout_auto_pst(struct nvme_feat_auto_pst *apst) int i; __u64 value; - printf( "\tAuto PST Entries"); + printf("\tAuto PST Entries"); printf("\t.................\n"); for (i = 0; i < ARRAY_SIZE(apst->apst_entry); i++) { value = le64_to_cpu(apst->apst_entry[i]); - printf("\tEntry[%2d] \n", i); + printf("\tEntry[%2d]\n", i); printf("\t.................\n"); printf("\tIdle Time Prior to Transition (ITPT): %u ms\n", (__u32)NVME_GET(value, APST_ENTRY_ITPT)); @@ -4193,9 +4192,9 @@ static void stdout_host_mem_buffer(struct nvme_host_mem_buf_attrs *hmb) { printf("\tHost Memory Descriptor List Entry Count (HMDLEC): %u\n", le32_to_cpu(hmb->hmdlec)); - printf("\tHost Memory Descriptor List Address (HMDLAU): 0x%x\n", + printf("\tHost Memory Descriptor List Address (HMDLAU): %#x\n", le32_to_cpu(hmb->hmdlau)); - printf("\tHost Memory Descriptor List Address (HMDLAL): 0x%x\n", + printf("\tHost Memory Descriptor List Address (HMDLAL): %#x\n", le32_to_cpu(hmb->hmdlal)); printf("\tHost Memory Buffer Size (HSIZE): %u\n", le32_to_cpu(hmb->hsize)); @@ -4211,21 +4210,21 @@ static void stdout_directive_show_fields(__u8 dtype, __u8 doper, case NVME_DIRECTIVE_DTYPE_IDENTIFY: switch (doper) { case NVME_DIRECTIVE_RECEIVE_IDENTIFY_DOPER_PARAM: - printf("\tDirective support \n"); + printf("\tDirective support\n"); printf("\t\tIdentify Directive : %s\n", (*field & 0x1) ? "supported" : "not supported"); printf("\t\tStream Directive : %s\n", (*field & 0x2) ? "supported" : "not supported"); printf("\t\tData Placement Directive : %s\n", (*field & 0x4) ? "supported" : "not supported"); - printf("\tDirective enabled \n"); + printf("\tDirective enabled\n"); printf("\t\tIdentify Directive : %s\n", (*(field + 32) & 0x1) ? "enabled" : "disabled"); printf("\t\tStream Directive : %s\n", (*(field + 32) & 0x2) ? "enabled" : "disabled"); printf("\t\tData Placement Directive : %s\n", (*(field + 32) & 0x4) ? "enabled" : "disabled"); - printf("\tDirective Persistent Across Controller Level Resets \n"); + printf("\tDirective Persistent Across Controller Level Resets\n"); printf("\t\tIdentify Directive : %s\n", (*(field + 64) & 0x1) ? "enabled" : "disabled"); printf("\t\tStream Directive : %s\n", @@ -4313,25 +4312,26 @@ void stdout_d(unsigned char *buf, int len, int width, int group) for (i = 0; i < len; i++) { if (!(i % width)) - printf( "\n%04x:", offset); + printf("\n%04x:", offset); if (i % group) - printf( "%02x", buf[i]); + printf("%02x", buf[i]); else - printf( " %02x", buf[i]); + printf(" %02x", buf[i]); ascii[i % width] = (buf[i] >= '!' && buf[i] <= '~') ? buf[i] : '.'; if (!((i + 1) % width)) { - printf( " \"%.*s\"", width, ascii); + printf(" \"%.*s\"", width, ascii); offset += width; memset(ascii, 0, sizeof(ascii)); } } if (strlen(ascii)) { - unsigned b = width - (i % width); - printf( " %*s \"%.*s\"", 2 * b + b / group + (b % group ? 1 : 0), "", width, ascii); + unsigned int b = width - (i % width); + + printf(" %*s \"%.*s\"", 2 * b + b / group + (b % group ? 1 : 0), "", width, ascii); } - printf( "\n"); + printf("\n"); } static void stdout_plm_config(struct nvme_plm_config *plmcfg) @@ -4356,7 +4356,7 @@ static void stdout_host_metadata(enum nvme_features_id fid, strncpy(val, (char *)desc->val, min(sizeof(val) - 1, len)); printf("\tElement[%-3d]:\n", i); - printf("\t\tType : 0x%02x (%s)\n", desc->type, + printf("\t\tType : %#02x (%s)\n", desc->type, nvme_host_metadata_type_to_string(fid, desc->type)); printf("\t\tRevision : %d\n", desc->rev); printf("\t\tLength : %d\n", len); @@ -4527,9 +4527,7 @@ static void stdout_feature_show_fields(enum nvme_features_id fid, printf("\tSpinup control feature Enabled: %s\n", (result & 1) ? "True" : "False"); break; case NVME_FEAT_FID_ENH_CTRL_METADATA: - fallthrough; case NVME_FEAT_FID_CTRL_METADATA: - fallthrough; case NVME_FEAT_FID_NS_METADATA: if (buf) stdout_host_metadata(fid, (struct nvme_host_metadata *)buf); @@ -4606,7 +4604,8 @@ static void stdout_lba_status(struct nvme_lba_status *list, for (idx = 0; idx < list->nlsd; idx++) { struct nvme_lba_status_desc *e = &list->descs[idx]; - printf("{ DSLBA: 0x%016"PRIu64", NLB: 0x%08x, Status: 0x%02x }\n", + + printf("{ DSLBA: %#016"PRIx64", NLB: %#08x, Status: %#02x }\n", le64_to_cpu(e->dslba), le32_to_cpu(e->nlb), e->status); } @@ -4616,11 +4615,11 @@ static void stdout_dev_full_path(nvme_ns_t n, char *path, size_t len) { struct stat st; - snprintf(path, len, "/dev/%s", nvme_ns_get_name(n)); - if (stat(path, &st) == 0) + snprintf(path, len, "%s", nvme_ns_get_name(n)); + if (strncmp(path, "/dev/spdk/", 10) == 0 && stat(path, &st) == 0) return; - snprintf(path, len, "/dev/spdk/%s", nvme_ns_get_name(n)); + snprintf(path, len, "/dev/%s", nvme_ns_get_name(n)); if (stat(path, &st) == 0) return; @@ -4637,15 +4636,22 @@ static void stdout_generic_full_path(nvme_ns_t n, char *path, size_t len) int instance; struct stat st; - sscanf(nvme_ns_get_name(n), "nvme%dn%d", &instance, &head_instance); - snprintf(path, len, "/dev/ng%dn%d", instance, head_instance); + /* + * There is no block devices for SPDK, point generic path to existing + * chardevice. + */ + snprintf(path, len, "%s", nvme_ns_get_name(n)); + if (strncmp(path, "/dev/spdk/", 10) == 0 && stat(path, &st) == 0) + return; - if (stat(path, &st) == 0) + if (sscanf(nvme_ns_get_name(n), "nvme%dn%d", &instance, &head_instance) != 2) return; - snprintf(path, len, "/dev/spdk/ng%dn%d", instance, head_instance); + snprintf(path, len, "/dev/ng%dn%d", instance, head_instance); + if (stat(path, &st) == 0) return; + /* * We could start trying to search for it but let's make * it simple and just don't show the path at all. @@ -4719,8 +4725,8 @@ static void stdout_ns_details(nvme_ns_t n) const char *u_suffix = suffix_si_get(&nuse); const char *l_suffix = suffix_binary_get(&lba); - sprintf(usage,"%6.2f %2sB / %6.2f %2sB", nuse, u_suffix, nsze, s_suffix); - sprintf(format,"%3.0f %2sB + %2d B", (double)lba, l_suffix, + sprintf(usage, "%6.2f %2sB / %6.2f %2sB", nuse, u_suffix, nsze, s_suffix); + sprintf(format, "%3.0f %2sB + %2d B", (double)lba, l_suffix, nvme_ns_get_meta_size(n)); nvme_dev_full_path(n, devname, sizeof(devname)); @@ -4783,8 +4789,9 @@ static bool stdout_detailed_ctrl(const char *name, void *arg) c = htable_ctrl_get(&res->ht_c, name); assert(c); - printf("%-8s %-20s %-40s %-8s %-6s %-14s %-6s %-12s ", + printf("%-8s %-6s %-20s %-40s %-8s %-6s %-14s %-6s %-12s ", nvme_ctrl_get_name(c), + nvme_ctrl_get_cntlid(c), nvme_ctrl_get_serial(c), nvme_ctrl_get_model(c), nvme_ctrl_get_firmware(c), @@ -4863,16 +4870,17 @@ static void stdout_detailed_list(nvme_root_t r) strset_iterate(&res.subsystems, stdout_detailed_subsys, &res); printf("\n"); - printf("%-8s %-20s %-40s %-8s %-6s %-14s %-6s %-12s %-16s\n", "Device", - "SN", "MN", "FR", "TxPort", "Address", "Slot", "Subsystem", "Namespaces"); - printf("%-.8s %-.20s %-.40s %-.8s %-.6s %-.14s %-.6s %-.12s %-.16s\n", dash, - dash, dash, dash, dash, dash, dash, dash, dash); + printf("%-16s %-5s %-20s %-40s %-8s %-6s %-14s %-6s %-12s %-16s\n", "Device", + "Cntlid", "SN", "MN", "FR", "TxPort", "Address", "Slot", "Subsystem", + "Namespaces"); + printf("%-.16s %-.6s %-.20s %-.40s %-.8s %-.6s %-.14s %-.6s %-.12s %-.16s\n", + dash, dash, dash, dash, dash, dash, dash, dash, dash, dash); strset_iterate(&res.ctrls, stdout_detailed_ctrl, &res); printf("\n"); - printf("%-12s %-12s %-10s %-26s %-16s %-16s\n", "Device", "Generic", + printf("%-17s %-17s %-10s %-26s %-16s %-16s\n", "Device", "Generic", "NSID", "Usage", "Format", "Controllers"); - printf("%-.12s %-.12s %-.10s %-.26s %-.16s %-.16s\n", dash, dash, dash, + printf("%-.17s %-.17s %-.10s %-.26s %-.16s %-.16s\n", dash, dash, dash, dash, dash, dash); strset_iterate(&res.namespaces, stdout_detailed_ns, &res); @@ -5069,7 +5077,7 @@ static void stdout_discovery_log(struct nvmf_discovery_log *log, int numrec) nvmf_qptype_str(e->tsas.rdma.qptype)); printf("rdma_cms: %s\n", nvmf_cms_str(e->tsas.rdma.cms)); - printf("rdma_pkey: 0x%04x\n", + printf("rdma_pkey: %#04x\n", le16_to_cpu(e->tsas.rdma.pkey)); break; case NVMF_TRTYPE_TCP: @@ -5092,6 +5100,7 @@ static struct print_ops stdout_print_ops = { .phy_rx_eom_log = stdout_phy_rx_eom_log, .ctrl_list = stdout_list_ctrl, .ctrl_registers = stdout_ctrl_registers, + .ctrl_register = stdout_ctrl_register, .directive = stdout_directive_show, .discovery_log = stdout_discovery_log, .effects_log_list = stdout_effects_log_pages, @@ -5132,7 +5141,7 @@ static struct print_ops stdout_print_ops = { .sanitize_log_page = stdout_sanitize_log, .secondary_ctrl_list = stdout_list_secondary_ctrl, .select_result = stdout_select_result, - .self_test_log = stdout_self_test_log, + .self_test_log = stdout_self_test_log, .single_property = stdout_single_property, .smart_log = stdout_smart_log, .supported_cap_config_list_log = stdout_supported_cap_config_log, diff --git a/nvme-print.c b/nvme-print.c index 1086aad..c3993f1 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -351,15 +351,67 @@ const char *nvme_register_pmr_hsts_to_string(__u8 hsts) } } -const char *nvme_register_pmr_pmrszu_to_string(__u8 pmrszu) +const char *nvme_register_unit_to_string(__u8 unit) +{ + switch (unit) { + case NVME_UNIT_B: + return "Bytes"; + case NVME_UNIT_1K: + return "One KB"; + case NVME_UNIT_1M: + return "One MB"; + case NVME_UNIT_1G: + return "One GB"; + default: + break; + } + + return "Reserved"; +} + +bool nvme_is_fabrics_reg(int offset) { - switch (pmrszu) { - case 0: return "Bytes"; - case 1: return "One KB"; - case 2: return "One MB"; - case 3: return "One GB"; - default: return "Reserved"; + switch (offset) { + case NVME_REG_CAP: + case NVME_REG_VS: + case NVME_REG_CC: + case NVME_REG_CSTS: + case NVME_REG_NSSR: + case NVME_REG_CRTO: + return true; + default: + break; + } + + return false; +} + +bool nvme_registers_cmbloc_support(__u32 cmbsz) +{ + return !!cmbsz; +} + +bool nvme_registers_pmrctl_ready(__u32 pmrctl) +{ + return NVME_PMRCTL_EN(pmrctl); +} + +void nvme_show_ctrl_register(void *bar, bool fabrics, int offset, enum nvme_print_flags flags) +{ + uint64_t value; + + if (fabrics && !nvme_is_fabrics_reg(offset)) { + printf("register: %#04x (%s) not fabrics\n", offset, + nvme_register_to_string(offset)); + return; } + + if (nvme_is_64bit_reg(offset)) + value = mmio_read64(bar + offset); + else + value = mmio_read32(bar + offset); + + nvme_print(ctrl_register, flags, offset, value); } void nvme_show_ctrl_registers(void *bar, bool fabrics, enum nvme_print_flags flags) @@ -761,20 +813,67 @@ const char *nvme_feature_to_string(enum nvme_features_id feature) const char *nvme_register_to_string(int reg) { switch (reg) { - case NVME_REG_CAP: return "Controller Capabilities"; - case NVME_REG_VS: return "Version"; - case NVME_REG_INTMS: return "Interrupt Vector Mask Set"; - case NVME_REG_INTMC: return "Interrupt Vector Mask Clear"; - case NVME_REG_CC: return "Controller Configuration"; - case NVME_REG_CSTS: return "Controller Status"; - case NVME_REG_NSSR: return "NVM Subsystem Reset"; - case NVME_REG_AQA: return "Admin Queue Attributes"; - case NVME_REG_ASQ: return "Admin Submission Queue Base Address"; - case NVME_REG_ACQ: return "Admin Completion Queue Base Address"; - case NVME_REG_CMBLOC: return "Controller Memory Buffer Location"; - case NVME_REG_CMBSZ: return "Controller Memory Buffer Size"; - default: return "Unknown"; + case NVME_REG_CAP: + return "Controller Capabilities"; + case NVME_REG_VS: + return "Version"; + case NVME_REG_INTMS: + return "Interrupt Vector Mask Set"; + case NVME_REG_INTMC: + return "Interrupt Vector Mask Clear"; + case NVME_REG_CC: + return "Controller Configuration"; + case NVME_REG_CSTS: + return "Controller Status"; + case NVME_REG_NSSR: + return "NVM Subsystem Reset"; + case NVME_REG_AQA: + return "Admin Queue Attributes"; + case NVME_REG_ASQ: + return "Admin Submission Queue Base Address"; + case NVME_REG_ACQ: + return "Admin Completion Queue Base Address"; + case NVME_REG_CMBLOC: + return "Controller Memory Buffer Location"; + case NVME_REG_CMBSZ: + return "Controller Memory Buffer Size"; + case NVME_REG_BPINFO: + return "Boot Partition Information"; + case NVME_REG_BPRSEL: + return "Boot Partition Read Select"; + case NVME_REG_BPMBL: + return "Boot Partition Memory Buffer Location"; + case NVME_REG_CMBMSC: + return "Controller Memory Buffer Memory Space Control"; + case NVME_REG_CMBSTS: + return "Controller Memory Buffer Status"; + case NVME_REG_CMBEBS: + return "Controller Memory Buffer Elasticity Buffer Size"; + case NVME_REG_CMBSWTP: + return "Controller Memory Buffer Sustained Write Throughput"; + case NVME_REG_NSSD: + return "NVM Subsystem Shutdown"; + case NVME_REG_CRTO: + return "Controller Ready Timeouts"; + case NVME_REG_PMRCAP: + return "Persistent Memory Region Capabilities"; + case NVME_REG_PMRCTL: + return "Persistent Memory Region Control"; + case NVME_REG_PMRSTS: + return "Persistent Memory Region Status"; + case NVME_REG_PMREBS: + return "Persistent Memory Region Elasticity Buffer Size"; + case NVME_REG_PMRSWTP: + return "Persistent Memory Region Sustained Write Throughput"; + case NVME_REG_PMRMSCL: + return "Persistent Memory Region Memory Space Control Lower"; + case NVME_REG_PMRMSCU: + return "Persistent Memory Region Memory Space Control Upper"; + default: + break; } + + return "Unknown"; } const char *nvme_select_to_string(int sel) @@ -890,64 +989,161 @@ void nvme_show_lba_status_info(__u32 result) nvme_print(lba_status_info, NORMAL, result); } -const char *nvme_host_metadata_type_to_string(enum nvme_features_id fid, - __u8 type) -{ - switch (fid) { - case NVME_FEAT_FID_ENH_CTRL_METADATA: - case NVME_FEAT_FID_CTRL_METADATA: - switch (type) { - case NVME_CTRL_METADATA_OS_CTRL_NAME: - return "Operating System Controller Name"; - case NVME_CTRL_METADATA_OS_DRIVER_NAME: - return "Operating System Driver Name"; - case NVME_CTRL_METADATA_OS_DRIVER_VER: - return "Operating System Driver Version"; - case NVME_CTRL_METADATA_PRE_BOOT_CTRL_NAME: - return "Pre-boot Controller Name"; - case NVME_CTRL_METADATA_PRE_BOOT_DRIVER_NAME: - return "Pre-boot Driver Name"; - case NVME_CTRL_METADATA_PRE_BOOT_DRIVER_VER: - return "Pre-boot Driver Version"; - case NVME_CTRL_METADATA_SYS_PROC_MODEL: - return "System Processor Model"; - case NVME_CTRL_METADATA_CHIPSET_DRV_NAME: - return "Chipset Driver Name"; - case NVME_CTRL_METADATA_CHIPSET_DRV_VERSION: - return "Chipset Driver Version"; - case NVME_CTRL_METADATA_OS_NAME_AND_BUILD: - return "Operating System Name and Build"; - case NVME_CTRL_METADATA_SYS_PROD_NAME: - return "System Product Name"; - case NVME_CTRL_METADATA_FIRMWARE_VERSION: - return "Firmware Version"; - case NVME_CTRL_METADATA_OS_DRIVER_FILENAME: - return "Operating System Driver Filename"; - case NVME_CTRL_METADATA_DISPLAY_DRV_NAME: - return "Display Driver Name"; - case NVME_CTRL_METADATA_DISPLAY_DRV_VERSION: - return "Display Driver Version"; - case NVME_CTRL_METADATA_HOST_DET_FAIL_REC: - return "Host-Determined Failure Record"; - default: - return "Unknown Controller Type"; - } - case NVME_FEAT_FID_NS_METADATA: - switch (type) { - case NVME_NS_METADATA_OS_NS_NAME: - return "Operating System Namespace Name"; - case NVME_NS_METADATA_PRE_BOOT_NS_NAME: - return "Pre-boot Namespace Name"; - case NVME_NS_METADATA_OS_NS_QUAL_1: - return "Operating System Namespace Name Qualifier 1"; - case NVME_NS_METADATA_OS_NS_QUAL_2: - return "Operating System Namespace Name Qualifier 2"; - default: - return "Unknown Namespace Type"; - } - default: - return "Unknown Feature"; - } +const char *nvme_host_metadata_type_to_string(enum nvme_features_id fid, __u8 type) +{ + switch (fid) { + case NVME_FEAT_FID_ENH_CTRL_METADATA: + case NVME_FEAT_FID_CTRL_METADATA: + switch (type) { + case NVME_CTRL_METADATA_OS_CTRL_NAME: + return "Operating System Controller Name"; + case NVME_CTRL_METADATA_OS_DRIVER_NAME: + return "Operating System Driver Name"; + case NVME_CTRL_METADATA_OS_DRIVER_VER: + return "Operating System Driver Version"; + case NVME_CTRL_METADATA_PRE_BOOT_CTRL_NAME: + return "Pre-boot Controller Name"; + case NVME_CTRL_METADATA_PRE_BOOT_DRIVER_NAME: + return "Pre-boot Driver Name"; + case NVME_CTRL_METADATA_PRE_BOOT_DRIVER_VER: + return "Pre-boot Driver Version"; + case NVME_CTRL_METADATA_SYS_PROC_MODEL: + return "System Processor Model"; + case NVME_CTRL_METADATA_CHIPSET_DRV_NAME: + return "Chipset Driver Name"; + case NVME_CTRL_METADATA_CHIPSET_DRV_VERSION: + return "Chipset Driver Version"; + case NVME_CTRL_METADATA_OS_NAME_AND_BUILD: + return "Operating System Name and Build"; + case NVME_CTRL_METADATA_SYS_PROD_NAME: + return "System Product Name"; + case NVME_CTRL_METADATA_FIRMWARE_VERSION: + return "Firmware Version"; + case NVME_CTRL_METADATA_OS_DRIVER_FILENAME: + return "Operating System Driver Filename"; + case NVME_CTRL_METADATA_DISPLAY_DRV_NAME: + return "Display Driver Name"; + case NVME_CTRL_METADATA_DISPLAY_DRV_VERSION: + return "Display Driver Version"; + case NVME_CTRL_METADATA_HOST_DET_FAIL_REC: + return "Host-Determined Failure Record"; + default: + return "Unknown Controller Type"; + } + case NVME_FEAT_FID_NS_METADATA: + switch (type) { + case NVME_NS_METADATA_OS_NS_NAME: + return "Operating System Namespace Name"; + case NVME_NS_METADATA_PRE_BOOT_NS_NAME: + return "Pre-boot Namespace Name"; + case NVME_NS_METADATA_OS_NS_QUAL_1: + return "Operating System Namespace Name Qualifier 1"; + case NVME_NS_METADATA_OS_NS_QUAL_2: + return "Operating System Namespace Name Qualifier 2"; + default: + return "Unknown Namespace Type"; + } + default: + return "Unknown Feature"; + } +} + +const char *nvme_pel_rci_rcpit_to_string(enum nvme_pel_rci_rcpit rcpit) +{ + switch (rcpit) { + case NVME_PEL_RCI_RCPIT_NOT_EXIST: + return "Does not already exist"; + case NVME_PEL_RCI_RCPIT_EST_PORT: + return "NVM subsystem port"; + case NVME_PEL_RCI_RCPIT_EST_ME: + return "NVMe-MI port"; + default: + break; + } + return "Reserved"; +} + +const char *nvme_pel_ehai_pit_to_string(enum nvme_pel_ehai_pit pit) +{ + switch (pit) { + case NVME_PEL_EHAI_PIT_NOT_REPORTED: + return "PIT not reported and PELPID does not apply"; + case NVME_PEL_EHAI_PIT_NSS_PORT: + return "NVM subsystem port"; + case NVME_PEL_EHAI_PIT_NMI_PORT: + return "NVMe-MI port"; + case NVME_PEL_EHAI_PIT_NOT_ASSOCIATED: + return "Event not associated with any port and PELPID does not apply"; + default: + break; + } + return "Reserved"; +} + +const char *nvme_register_symbol_to_string(int offset) +{ + switch (offset) { + case NVME_REG_CAP: + return "cap"; + case NVME_REG_VS: + return "version"; + case NVME_REG_INTMS: + return "intms"; + case NVME_REG_INTMC: + return "intmc"; + case NVME_REG_CC: + return "cc"; + case NVME_REG_CSTS: + return "csts"; + case NVME_REG_NSSR: + return "nssr"; + case NVME_REG_AQA: + return "aqa"; + case NVME_REG_ASQ: + return "asq"; + case NVME_REG_ACQ: + return "acq"; + case NVME_REG_CMBLOC: + return "cmbloc"; + case NVME_REG_CMBSZ: + return "cmbsz"; + case NVME_REG_BPINFO: + return "bpinfo"; + case NVME_REG_BPRSEL: + return "bprsel"; + case NVME_REG_BPMBL: + return "bpmbl"; + case NVME_REG_CMBMSC: + return "cmbmsc"; + case NVME_REG_CMBSTS: + return "cmbsts"; + case NVME_REG_CMBEBS: + return "cmbebs"; + case NVME_REG_CMBSWTP: + return "cmbswtp"; + case NVME_REG_NSSD: + return "nssd"; + case NVME_REG_CRTO: + return "crto"; + case NVME_REG_PMRCAP: + return "pmrcap"; + case NVME_REG_PMRCTL: + return "pmrctl"; + case NVME_REG_PMRSTS: + return "pmrsts"; + case NVME_REG_PMREBS: + return "pmrebs"; + case NVME_REG_PMRSWTP: + return "pmrswtp"; + case NVME_REG_PMRMSCL: + return "pmrmscl"; + case NVME_REG_PMRMSCU: + return "pmrmscu"; + default: + break; + } + + return "unknown"; } void nvme_feature_show(enum nvme_features_id fid, int sel, unsigned int result) @@ -970,14 +1166,13 @@ void nvme_dev_full_path(nvme_ns_t n, char *path, size_t len) { struct stat st; - snprintf(path, len, "/dev/%s", nvme_ns_get_name(n)); - if (stat(path, &st) == 0) + snprintf(path, len, "%s", nvme_ns_get_name(n)); + if (strncmp(path, "/dev/spdk/", 10) == 0 && stat(path, &st) == 0) return; - snprintf(path, len, "/dev/spdk/%s", nvme_ns_get_name(n)); + snprintf(path, len, "/dev/%s", nvme_ns_get_name(n)); if (stat(path, &st) == 0) return; - /* * We could start trying to search for it but let's make * it simple and just don't show the path at all. @@ -991,13 +1186,17 @@ void nvme_generic_full_path(nvme_ns_t n, char *path, size_t len) int instance; struct stat st; + /* + * There is no block devices for SPDK, point generic path to existing + * chardevice. + */ + snprintf(path, len, "%s", nvme_ns_get_name(n)); + if (strncmp(path, "/dev/spdk/", 10) == 0 && stat(path, &st) == 0) + return; + sscanf(nvme_ns_get_name(n), "nvme%dn%d", &instance, &head_instance); snprintf(path, len, "/dev/ng%dn%d", instance, head_instance); - if (stat(path, &st) == 0) - return; - - snprintf(path, len, "/dev/spdk/ng%dn%d", instance, head_instance); if (stat(path, &st) == 0) return; /* diff --git a/nvme-print.h b/nvme-print.h index 4533474..b17172e 100644 --- a/nvme-print.h +++ b/nvme-print.h @@ -16,6 +16,8 @@ typedef struct nvme_effects_log_node { #define nvme_show_error(msg, ...) nvme_show_message(true, msg, ##__VA_ARGS__) #define nvme_show_result(msg, ...) nvme_show_message(false, msg, ##__VA_ARGS__) +#define POWER_OF_TWO(exponent) (1 << (exponent)) + void d(unsigned char *buf, int len, int width, int group); void d_raw(unsigned char *buf, unsigned len); @@ -26,6 +28,7 @@ struct print_ops { void (*phy_rx_eom_log)(struct nvme_phy_rx_eom_log *log, __u16 controller); void (*ctrl_list)(struct nvme_ctrl_list *ctrl_list); void (*ctrl_registers)(void *bar, bool fabrics); + void (*ctrl_register)(int offset, uint64_t value); void (*directive)(__u8 type, __u8 oper, __u16 spec, __u32 nsid, __u32 result, void *buf, __u32 len); void (*discovery_log)(struct nvmf_discovery_log *log, int numrec); void (*effects_log_list)(struct list_head *list); @@ -205,6 +208,7 @@ void nvme_show_media_unit_stat_log(struct nvme_media_unit_stat_log *mus, void nvme_show_supported_cap_config_log(struct nvme_supported_cap_config_list_log *caplog, enum nvme_print_flags flags); void nvme_show_ctrl_registers(void *bar, bool fabrics, enum nvme_print_flags flags); +void nvme_show_ctrl_register(void *bar, bool fabrics, int offset, enum nvme_print_flags flags); void nvme_show_single_property(int offset, uint64_t prop, enum nvme_print_flags flags); void nvme_show_id_ns_descs(void *data, unsigned nsid, enum nvme_print_flags flags); void nvme_show_lba_status(struct nvme_lba_status *list, unsigned long len, @@ -291,9 +295,10 @@ const char *nvme_log_to_string(__u8 lid); const char *nvme_nss_hw_error_to_string(__u16 error_code); const char *nvme_pel_event_to_string(int type); const char *nvme_register_pmr_hsts_to_string(__u8 hsts); -const char *nvme_register_pmr_pmrszu_to_string(__u8 pmrszu); +const char *nvme_register_unit_to_string(__u8 unit); const char *nvme_register_szu_to_string(__u8 szu); const char *nvme_register_to_string(int reg); +const char *nvme_register_symbol_to_string(int offset); const char *nvme_resv_notif_to_string(__u8 type); const char *nvme_select_to_string(int sel); const char *nvme_sstat_status_to_string(__u16 status); @@ -302,6 +307,8 @@ const char *nvme_zone_state_to_string(__u8 state); const char *nvme_zone_type_to_string(__u8 cond); const char *nvme_plm_window_to_string(__u32 plm); const char *nvme_ns_wp_cfg_to_string(enum nvme_ns_write_protect_cfg state); +const char *nvme_pel_rci_rcpit_to_string(enum nvme_pel_rci_rcpit rcpit); +const char *nvme_pel_ehai_pit_to_string(enum nvme_pel_ehai_pit pit); void nvme_dev_full_path(nvme_ns_t n, char *path, size_t len); void nvme_generic_full_path(nvme_ns_t n, char *path, size_t len); @@ -310,4 +317,7 @@ void nvme_show_perror(const char *msg); void nvme_show_error_status(int status, const char *msg, ...); void nvme_show_init(void); void nvme_show_finish(void); +bool nvme_is_fabrics_reg(int offset); +bool nvme_registers_cmbloc_support(__u32 cmbsz); +bool nvme_registers_pmrctl_ready(__u32 pmrctl); #endif /* NVME_PRINT_H */ diff --git a/nvme-wrap.c b/nvme-wrap.c index a61b489..1327c86 100644 --- a/nvme-wrap.c +++ b/nvme-wrap.c @@ -100,17 +100,16 @@ int nvme_cli_identify_allocated_ns_list(struct nvme_dev *dev, __u32 nsid, return do_admin_op(identify_allocated_ns_list, dev, nsid, list); } -int nvme_cli_identify_primary_ctrl(struct nvme_dev *dev, __u32 nsid, +int nvme_cli_identify_primary_ctrl(struct nvme_dev *dev, __u16 cntid, struct nvme_primary_ctrl_cap *cap) { - return do_admin_op(identify_primary_ctrl, dev, nsid, cap); + return do_admin_op(identify_primary_ctrl, dev, cntid, cap); } -int nvme_cli_identify_secondary_ctrl_list(struct nvme_dev *dev, - __u16 ctrl_id, +int nvme_cli_identify_secondary_ctrl_list(struct nvme_dev *dev, __u16 cntid, struct nvme_secondary_ctrl_list *sc_list) { - return do_admin_op(identify_secondary_ctrl_list, dev, ctrl_id, + return do_admin_op(identify_secondary_ctrl_list, dev, cntid, sc_list); } @@ -264,12 +263,6 @@ int nvme_cli_get_log_ana(struct nvme_dev *dev, return do_admin_op(get_log_ana, dev, lsp, rae, offset, len, log); } -int nvme_cli_get_log_ana_groups(struct nvme_dev *dev, bool rae, __u32 len, - struct nvme_ana_group_desc *log) -{ - return do_admin_op(get_log_ana_groups, dev, rae, len, log); -} - int nvme_cli_get_log_lba_status(struct nvme_dev *dev, bool rae, __u64 offset, __u32 len, void *log) { @@ -428,9 +421,3 @@ int nvme_cli_security_receive(struct nvme_dev *dev, return -ENODEV; } - -void nvme_cli_set_debug(struct nvme_dev *dev, bool set) -{ - if (dev->type == NVME_DEV_DIRECT) - nvme_set_debug(set); -} diff --git a/nvme-wrap.h b/nvme-wrap.h index c50df14..c3bb09a 100644 --- a/nvme-wrap.h +++ b/nvme-wrap.h @@ -26,10 +26,9 @@ int nvme_cli_identify_active_ns_list(struct nvme_dev *dev, __u32 nsid, struct nvme_ns_list *list); int nvme_cli_identify_allocated_ns_list(struct nvme_dev *dev, __u32 nsid, struct nvme_ns_list *list); -int nvme_cli_identify_primary_ctrl(struct nvme_dev *dev, __u32 nsid, +int nvme_cli_identify_primary_ctrl(struct nvme_dev *dev, __u16 cntid, struct nvme_primary_ctrl_cap *cap); -int nvme_cli_identify_secondary_ctrl_list(struct nvme_dev *dev, - __u16 ctrl_id, +int nvme_cli_identify_secondary_ctrl_list(struct nvme_dev *dev, __u16 cntid, struct nvme_secondary_ctrl_list *sc_list); int nvme_cli_ns_mgmt_delete(struct nvme_dev *dev, __u32 nsid); int nvme_cli_ns_mgmt_create(struct nvme_dev *dev, @@ -92,8 +91,6 @@ int nvme_cli_get_log_predictable_lat_event(struct nvme_dev *dev, bool rae, int nvme_cli_get_log_ana(struct nvme_dev *dev, enum nvme_log_ana_lsp lsp, bool rae, __u64 offset, __u32 len, void *log); -int nvme_cli_get_log_ana_groups(struct nvme_dev *dev, bool rae, __u32 len, - struct nvme_ana_group_desc *log); int nvme_cli_get_log_lba_status(struct nvme_dev *dev, bool rae, __u64 offset, __u32 len, void *log); int nvme_cli_get_log_endurance_grp_evt(struct nvme_dev *dev, bool rae, @@ -147,5 +144,4 @@ int nvme_cli_security_send(struct nvme_dev *dev, int nvme_cli_security_receive(struct nvme_dev *dev, struct nvme_security_receive_args* args); -void nvme_cli_set_debug(struct nvme_dev *dev, bool set); #endif /* _NVME_WRAP_H */ diff --git a/nvme.c b/nvme.c index e9aac8f..4a65c4b 100644 --- a/nvme.c +++ b/nvme.c @@ -52,9 +52,10 @@ #include #endif +#include + #include "common.h" #include "nvme.h" -#include "libnvme.h" #include "nvme-print.h" #include "plugin.h" #include "util/base64.h" @@ -62,6 +63,7 @@ #include "nvme-wrap.h" #include "util/argconfig.h" #include "util/suffix.h" +#include "util/logging.h" #include "fabrics.h" #define CREATE_CMD #include "nvme-builtin.h" @@ -106,9 +108,64 @@ struct passthru_config { bool latency; }; +struct get_reg_config { + int offset; + bool human_readable; + bool cap; + bool vs; + bool intms; + bool intmc; + bool cc; + bool csts; + bool nssr; + bool aqa; + bool asq; + bool acq; + bool cmbloc; + bool cmbsz; + bool bpinfo; + bool bprsel; + bool bpmbl; + bool cmbmsc; + bool cmbsts; + bool cmbebs; + bool cmbswtp; + bool nssd; + bool crto; + bool pmrcap; + bool pmrctl; + bool pmrsts; + bool pmrebs; + bool pmrswtp; + bool pmrmscl; + bool pmrmscu; + bool fabrics; +}; + +struct set_reg_config { + int offset; + bool mmio32; + __u64 value; + __u32 intms; + __u32 intmc; + __u32 cc; + __u32 csts; + __u32 nssr; + __u32 aqa; + __u64 asq; + __u64 acq; + __u32 bprsel; + __u64 bpmbl; + __u64 cmbmsc; + __u32 nssd; + __u32 pmrctl; + __u32 pmrmscl; + __u32 pmrmscu; +}; + #define NVME_ARGS(n, ...) \ struct argconfig_commandline_options n[] = { \ - OPT_FLAG("verbose", 'v', NULL, verbose), \ + OPT_INCR("verbose", 'v', &verbose_level, verbose), \ OPT_FMT("output-format", 'o', &output_format_val, output_format), \ ##__VA_ARGS__, \ OPT_END() \ @@ -184,10 +241,27 @@ static const char *uuid_index_specify = "specify uuid index"; static const char *verbose = "Increase output verbosity"; static const char dash[51] = {[0 ... 49] = '=', '\0'}; static const char space[51] = {[0 ... 49] = ' ', '\0'}; +static const char *offset = "offset of the requested register"; +static const char *intms = "INTMS=0xc register offset"; +static const char *intmc = "INTMC=0x10 register offset"; +static const char *cc = "CC=0x14 register offset"; +static const char *csts = "CSTS=0x1c register offset"; +static const char *nssr = "NSSR=0x20 register offset"; +static const char *aqa = "AQA=0x24 register offset"; +static const char *asq = "ASQ=0x28 register offset"; +static const char *acq = "ACQ=0x30 register offset"; +static const char *bprsel = "BPRSEL=0x44 register offset"; +static const char *bpmbl = "BPMBL=0x48 register offset"; +static const char *cmbmsc = "CMBMSC=0x50 register offset"; +static const char *nssd = "NSSD=0x64 register offset"; +static const char *pmrctl = "PMRCTL=0xe04 register offset"; +static const char *pmrmscl = "PMRMSCL=0xe14 register offset"; +static const char *pmrmscu = "PMRMSCU=0xe18 register offset"; static char *output_format_val = "normal"; +int verbose_level; -static void *mmap_registers(nvme_root_t r, struct nvme_dev *dev); +static void *mmap_registers(struct nvme_dev *dev, bool writable); const char *nvme_strerror(int errnum) { @@ -196,36 +270,6 @@ const char *nvme_strerror(int errnum) return strerror(errnum); } -int map_log_level(int verbose, bool quiet) -{ - int log_level; - - /* - * LOG_NOTICE is unused thus the user has to provide two 'v' for getting - * any feedback at all. Thus skip this level - */ - verbose++; - - switch (verbose) { - case 0: - log_level = LOG_WARNING; - break; - case 1: - log_level = LOG_NOTICE; - break; - case 2: - log_level = LOG_INFO; - break; - default: - log_level = LOG_DEBUG; - break; - } - if (quiet) - log_level = LOG_ERR; - - return log_level; -} - static ssize_t getrandom_bytes(void *buf, size_t buflen) { #if HAVE_SYS_RANDOM @@ -281,7 +325,8 @@ static int open_dev_direct(struct nvme_dev **devp, char *devstr, int flags) } if (!is_chardev(dev) && !is_blkdev(dev)) { nvme_show_error("%s is not a block or character device", devstr); - err = -ENODEV; + errno = ENODEV; + err = -1; goto err_close; } *devp = dev; @@ -400,8 +445,8 @@ int parse_and_open(struct nvme_dev **dev, int argc, char **argv, ret = get_dev(dev, argc, argv, O_RDONLY); if (ret < 0) argconfig_print_help(desc, opts); - else if (argconfig_parse_seen(opts, "verbose")) - nvme_cli_set_debug(*dev, true); + else + log_level = map_log_level(verbose_level, false); return ret; } @@ -531,7 +576,7 @@ static int get_ana_log(int argc, char **argv, struct command *cmd, "decoded format (default), json or binary."; const char *groups = "Return ANA groups only."; - _cleanup_nvme_dev_ struct nvme_dev *dev= NULL; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; _cleanup_free_ struct nvme_id_ctrl *ctrl = NULL; _cleanup_free_ void *ana_log = NULL; size_t ana_log_len; @@ -868,7 +913,9 @@ static int get_telemetry_log(int argc, char **argv, struct command *cmd, while (data_remaining) { data_written = write(output, data_ptr, data_remaining); if (data_written < 0) { - data_remaining = data_written; + err = -errno; + nvme_show_error("ERROR: %s: : write failed with error : %s", + __func__, strerror(errno)); break; } else if (data_written <= data_remaining) { data_remaining -= data_written; @@ -877,6 +924,7 @@ static int get_telemetry_log(int argc, char **argv, struct command *cmd, /* Unexpected overwrite */ fprintf(stderr, "Failure: Unexpected telemetry log overwrite - data_remaining = 0x%x, data_written = 0x%x\n", data_remaining, data_written); + err = -1; break; } } @@ -1007,12 +1055,9 @@ static int get_effects_log(int argc, char **argv, struct command *cmd, struct pl list_head_init(&log_pages); if (cfg.csi < 0) { - nvme_root_t r; __u64 cap; - r = nvme_scan(NULL); - bar = mmap_registers(r, dev); - nvme_free_tree(r); + bar = mmap_registers(dev, false); if (bar) { cap = mmio_read64(bar + NVME_REG_CAP); @@ -1172,7 +1217,7 @@ static int get_fw_log(int argc, char **argv, struct command *cmd, struct plugin const char *desc = "Retrieve the firmware log for the " "specified device in either decoded format (default) or binary."; - _cleanup_free_ struct nvme_firmware_slot *fw_log = NULL;; + _cleanup_free_ struct nvme_firmware_slot *fw_log = NULL; _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; enum nvme_print_flags flags; int err; @@ -3251,7 +3296,8 @@ static int list_subsys(int argc, char **argv, struct command *cmd, if (argconfig_parse_seen(opts, "verbose")) flags |= VERBOSE; - r = nvme_create_root(stderr, map_log_level(!!(flags & VERBOSE), false)); + + r = nvme_create_root(stderr, log_level); if (!r) { if (devname) nvme_show_error("Failed to scan nvme subsystem for %s", devname); @@ -3274,7 +3320,8 @@ static int list_subsys(int argc, char **argv, struct command *cmd, err = nvme_scan_topology(r, filter, (void *)devname); if (err) { - nvme_show_error("Failed to scan topology: %s", nvme_strerror(errno)); + if (errno != ENOENT) + nvme_show_error("Failed to scan topology: %s", nvme_strerror(errno)); goto ret; } @@ -3308,14 +3355,15 @@ static int list(int argc, char **argv, struct command *cmd, struct plugin *plugi if (argconfig_parse_seen(opts, "verbose")) flags |= VERBOSE; - r = nvme_create_root(stderr, map_log_level(!!(flags & VERBOSE), false)); + r = nvme_create_root(stderr, log_level); if (!r) { nvme_show_error("Failed to create topology root: %s", nvme_strerror(errno)); return -errno; } err = nvme_scan_topology(r, NULL, NULL); if (err < 0) { - nvme_show_error("Failed to scan topology: %s", nvme_strerror(errno)); + if (errno != ENOENT) + nvme_show_error("Failed to scan topology: %s", nvme_strerror(errno)); nvme_free_tree(r); return err; } @@ -3584,7 +3632,7 @@ static int ns_descs(int argc, char **argv, struct command *cmd, struct plugin *p const char *raw = "show descriptors in binary format"; _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; - _cleanup_free_ void *nsdescs = NULL;; + _cleanup_free_ void *nsdescs = NULL; enum nvme_print_flags flags; int err; @@ -3615,6 +3663,9 @@ static int ns_descs(int argc, char **argv, struct command *cmd, struct plugin *p if (cfg.raw_binary) flags = BINARY; + if (argconfig_parse_seen(opts, "verbose")) + flags |= VERBOSE; + if (!cfg.namespace_id) { err = nvme_get_nsid(dev_fd(dev), &cfg.namespace_id); if (err < 0) { @@ -4824,7 +4875,7 @@ static int fw_download(int argc, char **argv, struct command *cmd, struct plugin int err; struct stat sb; void *fw_buf; - struct nvme_id_ctrl ctrl; + struct nvme_id_ctrl ctrl = { 0 }; struct config { char *fw; @@ -4836,7 +4887,7 @@ static int fw_download(int argc, char **argv, struct command *cmd, struct plugin struct config cfg = { .fw = "", - .xfer = 4096, + .xfer = 0, .offset = 0, .progress = false, .ignore_ovr = false, @@ -4885,6 +4936,10 @@ static int fw_download(int argc, char **argv, struct command *cmd, struct plugin } else if (cfg.xfer % 4096) cfg.xfer = 4096; + if (ctrl.fwug && ctrl.fwug != 0xff && fw_size % cfg.xfer) + nvme_show_error("WARNING: firmware file size %u not conform to FWUG alignment %lu", + fw_size, cfg.xfer); + fw_buf = nvme_alloc_huge(fw_size, &mh); if (!fw_buf) return -ENOMEM; @@ -5119,7 +5174,7 @@ static int ns_rescan(int argc, char **argv, struct command *cmd, struct plugin * err = nvme_ns_rescan(dev_fd(dev)); if (err < 0) - nvme_show_error("Namespace Rescan"); + nvme_show_error("Namespace Rescan: %s\n", nvme_strerror(errno)); return err; } @@ -5224,42 +5279,62 @@ static int sanitize_cmd(int argc, char **argv, struct command *cmd, struct plugi return err; } -static int nvme_get_properties(int fd, void **pbar) +static int nvme_get_single_property(int fd, struct get_reg_config *cfg, __u64 *value) +{ + int err; + struct nvme_get_property_args args = { + .args_size = sizeof(args), + .fd = fd, + .offset = cfg->offset, + .value = value, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + }; + + err = nvme_get_property(&args); + if (!err) + return 0; + + if (!cfg->fabrics && + nvme_status_equals(err, NVME_STATUS_TYPE_NVME, NVME_SC_INVALID_FIELD)) { + *value = -1; + return 0; + } + + if (cfg->fabrics && err > 0) + nvme_show_status(err); + else + nvme_show_error("get-property: %s", nvme_strerror(errno)); + + return err; +} + +static int nvme_get_properties(int fd, void **pbar, struct get_reg_config *cfg) { - int offset, err, size = getpagesize(); + int err, size = getpagesize(); + bool is_64bit = false; __u64 value; - void *bar = malloc(size); + void *bar; + int offset; + bar = malloc(size); if (!bar) { nvme_show_error("malloc: %s", strerror(errno)); - return -1; + return -errno; } memset(bar, 0xff, size); - for (offset = NVME_REG_CAP; offset <= NVME_REG_CMBSZ;) { - struct nvme_get_property_args args = { - .args_size = sizeof(args), - .fd = fd, - .offset = offset, - .value = &value, - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - }; - - err = nvme_get_property(&args); - if (nvme_status_equals(err, NVME_STATUS_TYPE_NVME, NVME_SC_INVALID_FIELD)) { - err = 0; - value = -1; - } else if (err) { - nvme_show_error("get-property: %s", nvme_strerror(errno)); + for (offset = NVME_REG_CAP; offset <= NVME_REG_CMBSZ; + offset += is_64bit ? sizeof(uint64_t) : sizeof(uint32_t)) { + cfg->offset = offset; + err = nvme_get_single_property(fd, cfg, &value); + if (err) break; - } - if (nvme_is_64bit_reg(offset)) { - *(uint64_t *)(bar + offset) = value; - offset += 8; - } else { - *(uint32_t *)(bar + offset) = value; - offset += 4; - } + + is_64bit = nvme_is_64bit_reg(cfg->offset); + if (is_64bit) + *(uint64_t *)(bar + cfg->offset) = value; + else + *(uint32_t *)(bar + cfg->offset) = value; } if (err) @@ -5270,42 +5345,28 @@ static int nvme_get_properties(int fd, void **pbar) return err; } -static void *mmap_registers(nvme_root_t r, struct nvme_dev *dev) +static void *mmap_registers(struct nvme_dev *dev, bool writable) { - nvme_ctrl_t c = NULL; - nvme_ns_t n = NULL; - char path[512]; void *membase; int fd; + int prot = PROT_READ; - c = nvme_scan_ctrl(r, dev->name); - if (c) { - snprintf(path, sizeof(path), "%s/device/resource0", - nvme_ctrl_get_sysfs_dir(c)); - nvme_free_ctrl(c); - } else { - n = nvme_scan_namespace(dev->name); - if (!n) { - nvme_show_error("Unable to find %s", dev->name); - return NULL; - } - snprintf(path, sizeof(path), "%s/device/device/resource0", - nvme_ns_get_sysfs_dir(n)); - nvme_free_ns(n); - } + if (writable) + prot |= PROT_WRITE; - fd = open(path, O_RDONLY); + sprintf(path, "/sys/class/nvme/%s/device/resource0", dev->name); + fd = open(path, writable ? O_RDWR : O_RDONLY); if (fd < 0) { - if (map_log_level(0, false) >= LOG_DEBUG) + if (log_level >= LOG_DEBUG) nvme_show_error("%s did not find a pci resource, open failed %s", dev->name, strerror(errno)); return NULL; } - membase = mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED, fd, 0); + membase = mmap(NULL, getpagesize(), prot, MAP_SHARED, fd, 0); if (membase == MAP_FAILED) { - if (map_log_level(0, false) >= LOG_DEBUG) { + if (log_level >= LOG_DEBUG) { fprintf(stderr, "%s failed to map. ", dev->name); fprintf(stderr, "Did your kernel enable CONFIG_IO_STRICT_DEVMEM?\n"); } @@ -5326,15 +5387,10 @@ static int show_registers(int argc, char **argv, struct command *cmd, struct plu _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; enum nvme_print_flags flags; bool fabrics = false; - nvme_root_t r; void *bar; int err; - struct config { - bool human_readable; - }; - - struct config cfg = { + struct get_reg_config cfg = { .human_readable = false, }; @@ -5345,21 +5401,20 @@ static int show_registers(int argc, char **argv, struct command *cmd, struct plu if (err) return err; - r = nvme_scan(NULL); err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); - goto free_tree; + return err; } if (cfg.human_readable) flags |= VERBOSE; - bar = mmap_registers(r, dev); + bar = mmap_registers(dev, false); if (!bar) { - err = nvme_get_properties(dev_fd(dev), &bar); + err = nvme_get_properties(dev_fd(dev), &bar, &cfg); if (err) - goto free_tree; + return err; fabrics = true; } @@ -5368,8 +5423,575 @@ static int show_registers(int argc, char **argv, struct command *cmd, struct plu free(bar); else munmap(bar, getpagesize()); -free_tree: - nvme_free_tree(r); + + return 0; +} + +int get_reg_size(int offset) +{ + return nvme_is_64bit_reg(offset) ? sizeof(uint64_t) : sizeof(uint32_t); +} + +static bool is_reg_selected(struct get_reg_config *cfg, int offset) +{ + switch (offset) { + case NVME_REG_CAP: + return cfg->cap; + case NVME_REG_VS: + return cfg->vs; + case NVME_REG_INTMS: + return cfg->intms; + case NVME_REG_INTMC: + return cfg->intmc; + case NVME_REG_CC: + return cfg->cc; + case NVME_REG_CSTS: + return cfg->csts; + case NVME_REG_NSSR: + return cfg->nssr; + case NVME_REG_AQA: + return cfg->aqa; + case NVME_REG_ASQ: + return cfg->asq; + case NVME_REG_ACQ: + return cfg->acq; + case NVME_REG_CMBLOC: + return cfg->cmbloc; + case NVME_REG_CMBSZ: + return cfg->cmbsz; + case NVME_REG_BPINFO: + return cfg->bpinfo; + case NVME_REG_BPRSEL: + return cfg->bprsel; + case NVME_REG_BPMBL: + return cfg->bpmbl; + case NVME_REG_CMBMSC: + return cfg->cmbmsc; + case NVME_REG_CMBSTS: + return cfg->cmbsts; + case NVME_REG_CMBEBS: + return cfg->cmbebs; + case NVME_REG_CMBSWTP: + return cfg->cmbswtp; + case NVME_REG_NSSD: + return cfg->nssd; + case NVME_REG_CRTO: + return cfg->crto; + case NVME_REG_PMRCAP: + return cfg->pmrcap; + case NVME_REG_PMRCTL: + return cfg->pmrctl; + case NVME_REG_PMRSTS: + return cfg->pmrsts; + case NVME_REG_PMREBS: + return cfg->pmrebs; + case NVME_REG_PMRSWTP: + return cfg->pmrswtp; + case NVME_REG_PMRMSCL: + return cfg->pmrmscl; + case NVME_REG_PMRMSCU: + return cfg->pmrmscu; + default: + break; + } + + return false; +} + +static int get_register_properties(int fd, void **pbar, struct get_reg_config *cfg) +{ + int offset = NVME_REG_CRTO; + __u64 value; + int size; + int err; + void *bar; + struct nvme_get_property_args args = { + .args_size = sizeof(args), + .fd = fd, + .value = &value, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + }; + + size = offset + get_reg_size(offset); + bar = malloc(size); + if (!bar) { + nvme_show_error("malloc: %s", strerror(errno)); + return -1; + } + + for (offset = NVME_REG_CAP; offset <= NVME_REG_CRTO; offset += get_reg_size(offset)) { + if ((cfg->offset != offset && !is_reg_selected(cfg, offset)) || + !nvme_is_fabrics_reg(offset)) + continue; + + args.offset = offset; + err = nvme_get_property(&args); + if (nvme_status_equals(err, NVME_STATUS_TYPE_NVME, NVME_SC_INVALID_FIELD)) { + value = -1; + } else if (err) { + nvme_show_error("get-property: %s", nvme_strerror(errno)); + free(bar); + return err; + } + + if (nvme_is_64bit_reg(offset)) + *(uint64_t *)(bar + offset) = value; + else + *(uint32_t *)(bar + offset) = value; + } + + *pbar = bar; + + return 0; +} + +bool nvme_is_ctrl_reg(int offset) +{ + switch (offset) { + case NVME_REG_CAP: + case NVME_REG_VS: + case NVME_REG_INTMS: + case NVME_REG_INTMC: + case NVME_REG_CC: + case NVME_REG_CSTS: + case NVME_REG_NSSR: + case NVME_REG_AQA: + case NVME_REG_ASQ: + case NVME_REG_ACQ: + case NVME_REG_CMBLOC: + case NVME_REG_CMBSZ: + case NVME_REG_BPINFO: + case NVME_REG_BPRSEL: + case NVME_REG_BPMBL: + case NVME_REG_CMBMSC: + case NVME_REG_CMBSTS: + case NVME_REG_CMBEBS: + case NVME_REG_CMBSWTP: + case NVME_REG_NSSD: + case NVME_REG_CRTO: + case NVME_REG_PMRCAP: + case NVME_REG_PMRCTL: + case NVME_REG_PMRSTS: + case NVME_REG_PMREBS: + case NVME_REG_PMRSWTP: + case NVME_REG_PMRMSCL: + case NVME_REG_PMRMSCU: + return true; + default: + break; + } + + return false; +} + +static bool get_register_offset(void *bar, bool fabrics, struct get_reg_config *cfg, + enum nvme_print_flags flags) +{ + bool offset_matched = cfg->offset >= 0; + int offset; + + if (offset_matched) + nvme_show_ctrl_register(bar, fabrics, cfg->offset, flags); + + for (offset = NVME_REG_CAP; offset <= NVME_REG_PMRMSCU; offset += get_reg_size(offset)) { + if (!nvme_is_ctrl_reg(offset) || offset == cfg->offset || !is_reg_selected(cfg, offset)) + continue; + nvme_show_ctrl_register(bar, fabrics, offset, flags); + if (!offset_matched) + offset_matched = true; + } + + return offset_matched; +} + +static int get_register(int argc, char **argv, struct command *cmd, struct plugin *plugin) +{ + const char *desc = "Reads and shows the defined NVMe controller register.\n" + "Register offset must be one of:\n" + "CAP=0x0, VS=0x8, INTMS=0xc, INTMC=0x10, CC=0x14, CSTS=0x1c,\n" + "NSSR=0x20, AQA=0x24, ASQ=0x28, ACQ=0x30, CMBLOC=0x38,\n" + "CMBSZ=0x3c, BPINFO=0x40, BPRSEL=0x44, BPMBL=0x48, CMBMSC=0x50,\n" + "CMBSTS=0x58, CRTO=0x68, PMRCAP=0xe00, PMRCTL=0xe04,\n" + "PMRSTS=0xe08, PMREBS=0xe0c, PMRSWTP=0xe10, PMRMSCL=0xe14, PMRMSCU=0xe18"; + const char *human_readable = "show register in readable format"; + const char *cap = "CAP=0x0 register offset"; + const char *vs = "VS=0x8 register offset"; + const char *cmbloc = "CMBLOC=0x38 register offset"; + const char *cmbsz = "CMBSZ=0x3c register offset"; + const char *bpinfo = "BPINFO=0x40 register offset"; + const char *cmbsts = "CMBSTS=0x58 register offset"; + const char *cmbebs = "CMBEBS=0x5c register offset"; + const char *cmbswtp = "CMBSWTP=0x60 register offset"; + const char *crto = "CRTO=0x68 register offset"; + const char *pmrcap = "PMRCAP=0xe00 register offset"; + const char *pmrsts = "PMRSTS=0xe08 register offset"; + const char *pmrebs = "PMREBS=0xe0c register offset"; + const char *pmrswtp = "PMRSWTP=0xe10 register offset"; + const char *pmrmscl = "PMRMSCL=0xe14 register offset"; + const char *pmrmscu = "PMRMSCU=0xe18 register offset"; + + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; + int err; + enum nvme_print_flags flags; + bool fabrics = false; + + void *bar; + + struct get_reg_config cfg = { + .offset = -1, + }; + + NVME_ARGS(opts, + OPT_UINT("offset", 'O', &cfg.offset, offset), + OPT_FLAG("human-readable", 'H', &cfg.human_readable, human_readable), + OPT_FLAG("cap", 0, &cfg.cap, cap), + OPT_FLAG("vs", 0, &cfg.vs, vs), + OPT_FLAG("cmbloc", 0, &cfg.cmbloc, cmbloc), + OPT_FLAG("cmbsz", 0, &cfg.cmbsz, cmbsz), + OPT_FLAG("bpinfo", 0, &cfg.bpinfo, bpinfo), + OPT_FLAG("cmbsts", 0, &cfg.cmbsts, cmbsts), + OPT_FLAG("cmbebs", 0, &cfg.cmbebs, cmbebs), + OPT_FLAG("cmbswtp", 0, &cfg.cmbswtp, cmbswtp), + OPT_FLAG("crto", 0, &cfg.crto, crto), + OPT_FLAG("pmrcap", 0, &cfg.pmrcap, pmrcap), + OPT_FLAG("pmrsts", 0, &cfg.pmrsts, pmrsts), + OPT_FLAG("pmrebs", 0, &cfg.pmrebs, pmrebs), + OPT_FLAG("pmrswtp", 0, &cfg.pmrswtp, pmrswtp), + OPT_FLAG("intms", 0, &cfg.intms, intms), + OPT_FLAG("intmc", 0, &cfg.intmc, intmc), + OPT_FLAG("cc", 0, &cfg.cc, cc), + OPT_FLAG("csts", 0, &cfg.csts, csts), + OPT_FLAG("nssr", 0, &cfg.nssr, nssr), + OPT_FLAG("aqa", 0, &cfg.aqa, aqa), + OPT_FLAG("asq", 0, &cfg.asq, asq), + OPT_FLAG("acq", 0, &cfg.acq, acq), + OPT_FLAG("bprsel", 0, &cfg.bprsel, bprsel), + OPT_FLAG("bpmbl", 0, &cfg.bpmbl, bpmbl), + OPT_FLAG("cmbmsc", 0, &cfg.cmbmsc, cmbmsc), + OPT_FLAG("nssd", 0, &cfg.nssd, nssd), + OPT_FLAG("pmrctl", 0, &cfg.pmrctl, pmrctl), + OPT_FLAG("pmrmscl", 0, &cfg.pmrmscl, pmrmscl), + OPT_FLAG("pmrmscu", 0, &cfg.pmrmscu, pmrmscu)); + + err = parse_and_open(&dev, argc, argv, desc, opts); + if (err) + return err; + + err = validate_output_format(output_format_val, &flags); + if (err < 0) { + nvme_show_error("Invalid output format"); + return err; + } + + if (cfg.human_readable) + flags |= VERBOSE; + + bar = mmap_registers(dev, false); + if (!bar) { + err = get_register_properties(dev_fd(dev), &bar, &cfg); + if (err) + return err; + fabrics = true; + } + + nvme_show_init(); + + if (!get_register_offset(bar, fabrics, &cfg, flags)) { + nvme_show_error("offset required param"); + err = -EINVAL; + } + + nvme_show_finish(); + + if (fabrics) + free(bar); + else + munmap(bar, getpagesize()); + + return err; +} + +static int nvme_set_single_property(int fd, int offset, uint64_t value) +{ + struct nvme_set_property_args args = { + .args_size = sizeof(args), + .fd = fd, + .offset = offset, + .value = value, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .result = NULL, + }; + int err = nvme_set_property(&args); + + if (err < 0) + nvme_show_error("set-property: %s", nvme_strerror(errno)); + else if (!err) + printf("set-property: %#02x (%s), value: %#"PRIx64"\n", offset, + nvme_register_to_string(offset), value); + else if (err > 0) + nvme_show_status(err); + + return err; +} + +static int set_register_property(int fd, int offset, uint64_t value) +{ + if (!nvme_is_fabrics_reg(offset)) { + printf("register: %#04x (%s) not fabrics\n", offset, + nvme_register_to_string(offset)); + return -EINVAL; + } + + return nvme_set_single_property(fd, offset, value); +} + +static int nvme_set_register(int fd, void *bar, int offset, uint64_t value, bool mmio32) +{ + if (!bar) + return set_register_property(fd, offset, value); + + if (nvme_is_64bit_reg(offset)) + mmio_write64(bar + offset, value, mmio32); + else + mmio_write32(bar + offset, value); + + printf("set-register: %#02x (%s), value: %#"PRIx64"\n", offset, + nvme_register_to_string(offset), value); + + return 0; +} + +static inline int set_register_names_check(struct argconfig_commandline_options *opts, int offset) +{ + switch (offset) { + case NVME_REG_INTMS: + if (argconfig_parse_seen(opts, "intms")) + return -EINVAL; + break; + case NVME_REG_INTMC: + if (argconfig_parse_seen(opts, "intmc")) + return -EINVAL; + break; + case NVME_REG_CC: + if (argconfig_parse_seen(opts, "cc")) + return -EINVAL; + break; + case NVME_REG_CSTS: + if (argconfig_parse_seen(opts, "csts")) + return -EINVAL; + break; + case NVME_REG_NSSR: + if (argconfig_parse_seen(opts, "nssr")) + return -EINVAL; + break; + case NVME_REG_AQA: + if (argconfig_parse_seen(opts, "aqa")) + return -EINVAL; + break; + case NVME_REG_ASQ: + if (argconfig_parse_seen(opts, "asq")) + return -EINVAL; + break; + case NVME_REG_ACQ: + if (argconfig_parse_seen(opts, "acq")) + return -EINVAL; + break; + case NVME_REG_BPRSEL: + if (argconfig_parse_seen(opts, "bprsel")) + return -EINVAL; + break; + case NVME_REG_CMBMSC: + if (argconfig_parse_seen(opts, "cmbmsc")) + return -EINVAL; + break; + case NVME_REG_NSSD: + if (argconfig_parse_seen(opts, "nssd")) + return -EINVAL; + break; + case NVME_REG_PMRCTL: + if (argconfig_parse_seen(opts, "pmrctl")) + return -EINVAL; + break; + case NVME_REG_PMRMSCL: + if (argconfig_parse_seen(opts, "pmrmscl")) + return -EINVAL; + break; + case NVME_REG_PMRMSCU: + if (argconfig_parse_seen(opts, "pmrmscu")) + return -EINVAL; + break; + default: + break; + } + + return 0; +} + +static int set_register_offset(int fd, void *bar, struct argconfig_commandline_options *opts, + struct set_reg_config *cfg) +{ + int err; + + if (!argconfig_parse_seen(opts, "value")) { + nvme_show_error("value required param"); + return -EINVAL; + } + + err = set_register_names_check(opts, cfg->offset); + if (err) { + nvme_show_error("offset duplicated param"); + return err; + } + + err = nvme_set_register(fd, bar, cfg->offset, cfg->value, cfg->mmio32); + if (err) + return err; + + return 0; +} + +static int set_register_names(int fd, void *bar, struct argconfig_commandline_options *opts, + struct set_reg_config *cfg) +{ + int err; + + if (argconfig_parse_seen(opts, "intms")) { + err = nvme_set_register(fd, bar, NVME_REG_INTMS, cfg->intms, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "intmc")) { + err = nvme_set_register(fd, bar, NVME_REG_INTMC, cfg->intmc, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "cc")) { + err = nvme_set_register(fd, bar, NVME_REG_CC, cfg->cc, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "csts")) { + err = nvme_set_register(fd, bar, NVME_REG_CSTS, cfg->csts, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "nssr")) { + err = nvme_set_register(fd, bar, NVME_REG_NSSR, cfg->nssr, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "aqa")) { + err = nvme_set_register(fd, bar, NVME_REG_AQA, cfg->aqa, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "asq")) { + err = nvme_set_register(fd, bar, NVME_REG_ASQ, cfg->asq, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "acq")) { + err = nvme_set_register(fd, bar, NVME_REG_ACQ, cfg->acq, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "bprsel")) { + err = nvme_set_register(fd, bar, NVME_REG_BPRSEL, cfg->bprsel, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "cmbmsc")) { + err = nvme_set_register(fd, bar, NVME_REG_CMBMSC, cfg->cmbmsc, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "nssd")) { + err = nvme_set_register(fd, bar, NVME_REG_NSSD, cfg->nssd, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "pmrctl")) { + err = nvme_set_register(fd, bar, NVME_REG_PMRCTL, cfg->pmrctl, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "pmrmscl")) { + err = nvme_set_register(fd, bar, NVME_REG_PMRMSCL, cfg->pmrmscl, cfg->mmio32); + if (err) + return err; + } + + if (argconfig_parse_seen(opts, "pmrmscu")) { + err = nvme_set_register(fd, bar, NVME_REG_PMRMSCU, cfg->pmrmscu, cfg->mmio32); + if (err) + return err; + } + + return 0; +} + +static int set_register(int argc, char **argv, struct command *cmd, struct plugin *plugin) +{ + const char *desc = "Writes and shows the defined NVMe controller register"; + const char *value = "the value of the register to be set"; + const char *mmio32 = "Access 64-bit registers as 2 32-bit"; + + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; + int err; + + void *bar; + + struct set_reg_config cfg = { + .offset = -1, + }; + + NVME_ARGS(opts, + OPT_UINT("offset", 'O', &cfg.offset, offset), + OPT_SUFFIX("value", 'V', &cfg.value, value), + OPT_FLAG("mmio32", 'm', &cfg.mmio32, mmio32), + OPT_UINT("intms", 0, &cfg.intms, intms), + OPT_UINT("intmc", 0, &cfg.intmc, intmc), + OPT_UINT("cc", 0, &cfg.cc, cc), + OPT_UINT("csts", 0, &cfg.csts, csts), + OPT_UINT("nssr", 0, &cfg.nssr, nssr), + OPT_UINT("aqa", 0, &cfg.aqa, aqa), + OPT_SUFFIX("asq", 0, &cfg.asq, asq), + OPT_SUFFIX("acq", 0, &cfg.acq, acq), + OPT_UINT("bprsel", 0, &cfg.bprsel, bprsel), + OPT_SUFFIX("bpmbl", 0, &cfg.bpmbl, bpmbl), + OPT_SUFFIX("cmbmsc", 0, &cfg.cmbmsc, cmbmsc), + OPT_UINT("nssd", 0, &cfg.nssd, nssd), + OPT_UINT("pmrctl", 0, &cfg.pmrctl, pmrctl), + OPT_UINT("pmrmscl", 0, &cfg.pmrmscl, pmrmscl), + OPT_UINT("pmrmscu", 0, &cfg.pmrmscu, pmrmscu)); + + err = parse_and_open(&dev, argc, argv, desc, opts); + if (err) + return err; + + bar = mmap_registers(dev, true); + + if (argconfig_parse_seen(opts, "offset")) + err = set_register_offset(dev_fd(dev), bar, opts, &cfg); + + if (!err) + err = set_register_names(dev_fd(dev), bar, opts, &cfg); + + if (bar) + munmap(bar, getpagesize()); + return err; } @@ -5377,7 +5999,7 @@ static int get_property(int argc, char **argv, struct command *cmd, struct plugi { const char *desc = "Reads and shows the defined NVMe controller property\n" "for NVMe over Fabric. Property offset must be one of:\n" - "CAP=0x0, VS=0x8, CC=0x14, CSTS=0x1c, NSSR=0x20"; + "CAP=0x0, VS=0x8, CC=0x14, CSTS=0x1c, NSSR=0x20, NSSD=0x64, CRTO=0x68"; const char *offset = "offset of the requested property"; const char *human_readable = "show property in readable format"; @@ -5385,14 +6007,10 @@ static int get_property(int argc, char **argv, struct command *cmd, struct plugi __u64 value; int err; - struct config { - int offset; - bool human_readable; - }; - - struct config cfg = { + struct get_reg_config cfg = { .offset = -1, .human_readable = false, + .fabrics = true, }; NVME_ARGS(opts, @@ -5408,20 +6026,9 @@ static int get_property(int argc, char **argv, struct command *cmd, struct plugi return -EINVAL; } - struct nvme_get_property_args args = { - .args_size = sizeof(args), - .fd = dev_fd(dev), - .offset = cfg.offset, - .value = &value, - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - }; - err = nvme_get_property(&args); - if (err < 0) - nvme_show_error("get-property: %s", nvme_strerror(errno)); - else if (!err) + err = nvme_get_single_property(dev_fd(dev), &cfg, &value); + if (!err) nvme_show_single_property(cfg.offset, value, cfg.human_readable); - else if (err > 0) - nvme_show_status(err); return err; } @@ -5436,12 +6043,7 @@ static int set_property(int argc, char **argv, struct command *cmd, struct plugi _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; int err; - struct config { - int offset; - int value; - }; - - struct config cfg = { + struct set_reg_config cfg = { .offset = -1, .value = -1, }; @@ -5463,24 +6065,7 @@ static int set_property(int argc, char **argv, struct command *cmd, struct plugi return -EINVAL; } - struct nvme_set_property_args args = { - .args_size = sizeof(args), - .fd = dev_fd(dev), - .offset = cfg.offset, - .value = cfg.value, - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .result = NULL, - }; - err = nvme_set_property(&args); - if (err < 0) - nvme_show_error("set-property: %s", nvme_strerror(errno)); - else if (!err) - printf("set-property: %02x (%s), value: %#08x\n", cfg.offset, - nvme_register_to_string(cfg.offset), cfg.value); - else if (err > 0) - nvme_show_status(err); - - return err; + return nvme_set_single_property(dev_fd(dev), cfg.offset, cfg.value); } static int format_cmd(int argc, char **argv, struct command *cmd, struct plugin *plugin) @@ -7644,7 +8229,7 @@ static int sec_recv(int argc, char **argv, struct command *cmd, struct plugin *p return err; if (cfg.size) { - sec_buf = nvme_alloc(sizeof(*sec_buf)); + sec_buf = nvme_alloc(cfg.size); if (!sec_buf) return -ENOMEM; } @@ -8363,7 +8948,8 @@ static int gen_dhchap_key(int argc, char **argv, struct command *command, struct "HMAC function to use for key transformation (0 = none, 1 = SHA-256, 2 = SHA-384, 3 = SHA-512)."; const char *nqn = "Host NQN to use for key transformation."; - unsigned char *raw_secret; + _cleanup_free_ unsigned char *raw_secret = NULL; + _cleanup_free_ char *hnqn = NULL; unsigned char key[68]; char encoded_key[128]; unsigned long crc = crc32(0L, NULL, 0); @@ -8458,7 +9044,7 @@ static int gen_dhchap_key(int argc, char **argv, struct command *command, struct } if (!cfg.nqn) { - cfg.nqn = nvmf_hostnqn_from_file(); + cfg.nqn = hnqn = nvmf_hostnqn_from_file(); if (!cfg.nqn) { nvme_show_error("Could not read host NQN"); return -ENOENT; @@ -8581,12 +9167,12 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl const char *subsysnqn = "Subsystem NQN for the retained key."; const char *keyring = "Keyring for the retained key."; const char *keytype = "Key type of the retained key."; - const char *insert = "Insert only, do not print the retained key."; + const char *insert = "Insert retained key into the keyring."; - unsigned char *raw_secret; - char encoded_key[128]; + _cleanup_free_ unsigned char *raw_secret = NULL; + _cleanup_free_ char *encoded_key = NULL; + _cleanup_free_ char *hnqn = NULL; int key_len = 32; - unsigned long crc = crc32(0L, NULL, 0); int err; long tls_key; @@ -8640,7 +9226,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl return -EINVAL; } if (!cfg.hostnqn) { - cfg.hostnqn = nvmf_hostnqn_from_file(); + cfg.hostnqn = hnqn = nvmf_hostnqn_from_file(); if (!cfg.hostnqn) { nvme_show_error("Failed to read host NQN"); return -EINVAL; @@ -8677,6 +9263,9 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl } } + encoded_key = nvme_export_tls_key(raw_secret, key_len); + printf("%s\n", encoded_key); + if (cfg.insert) { tls_key = nvme_insert_tls_key_versioned(cfg.keyring, cfg.keytype, cfg.hostnqn, @@ -8688,18 +9277,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl } printf("Inserted TLS key %08x\n", (unsigned int)tls_key); - return 0; } - crc = crc32(crc, raw_secret, key_len); - raw_secret[key_len++] = crc & 0xff; - raw_secret[key_len++] = (crc >> 8) & 0xff; - raw_secret[key_len++] = (crc >> 16) & 0xff; - raw_secret[key_len++] = (crc >> 24) & 0xff; - - memset(encoded_key, 0, sizeof(encoded_key)); - base64_encode(raw_secret, key_len, encoded_key); - - printf("NVMeTLSkey-1:%02x:%s:\n", cfg.hmac, encoded_key); return 0; } @@ -8714,11 +9292,10 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct const char *keytype = "Key type of the retained key."; const char *insert = "Insert retained key into the keyring."; - unsigned char decoded_key[128]; - unsigned int decoded_len; - u_int32_t crc = crc32(0L, NULL, 0); - u_int32_t key_crc; - int err = 0, hmac; + _cleanup_free_ unsigned char *decoded_key = NULL; + _cleanup_free_ char *hnqn = NULL; + int decoded_len, err = 0; + unsigned int hmac; long tls_key; struct config { char *keyring; @@ -8763,60 +9340,25 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct return -EINVAL; } - if (sscanf(cfg.keydata, "NVMeTLSkey-1:%02x:*s", &hmac) != 1) { - nvme_show_error("Invalid key '%s'", cfg.keydata); - return -EINVAL; - } - switch (hmac) { - case 1: - if (strlen(cfg.keydata) != 65) { - nvme_show_error("Invalid key length %zu for SHA(256)", strlen(cfg.keydata)); - return -EINVAL; - } - break; - case 2: - if (strlen(cfg.keydata) != 89) { - nvme_show_error("Invalid key length %zu for SHA(384)", strlen(cfg.keydata)); - return -EINVAL; - } - break; - default: - nvme_show_error("Invalid HMAC identifier %d", hmac); - return -EINVAL; + decoded_key = nvme_import_tls_key(cfg.keydata, &decoded_len, &hmac); + if (!decoded_key) { + nvme_show_error("Key decoding failed, error %d\n", errno); + return -errno; } if (cfg.subsysnqn) { - if (cfg.insert && !cfg.hostnqn) { - cfg.hostnqn = nvmf_hostnqn_from_file(); + if (!cfg.hostnqn) { + cfg.hostnqn = hnqn = nvmf_hostnqn_from_file(); if (!cfg.hostnqn) { nvme_show_error("Failed to read host NQN"); return -EINVAL; } } - } else if (cfg.insert || cfg.identity == 1) { + } else { nvme_show_error("Need to specify a subsystem NQN"); return -EINVAL; } - err = base64_decode(cfg.keydata + 16, strlen(cfg.keydata) - 17, decoded_key); - if (err < 0) { - nvme_show_error("Base64 decoding failed (%s, error %d)", cfg.keydata + 16, err); - return err; - } - decoded_len = err; - decoded_len -= 4; - if (decoded_len != 32 && decoded_len != 48) { - nvme_show_error("Invalid key length %d", decoded_len); - return -EINVAL; - } - crc = crc32(crc, decoded_key, decoded_len); - key_crc = ((u_int32_t)decoded_key[decoded_len]) | - ((u_int32_t)decoded_key[decoded_len + 1] << 8) | - ((u_int32_t)decoded_key[decoded_len + 2] << 16) | - ((u_int32_t)decoded_key[decoded_len + 3] << 24); - if (key_crc != crc) { - nvme_show_error("CRC mismatch (key %08x, crc %08x)", key_crc, crc); - return -EINVAL; - } + if (cfg.insert) { tls_key = nvme_insert_tls_key_versioned(cfg.keyring, cfg.keytype, cfg.hostnqn, @@ -8828,7 +9370,7 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct } printf("Inserted TLS key %08x\n", (unsigned int)tls_key); } else { - char *tls_id; + _cleanup_free_ char *tls_id = NULL; tls_id = nvme_generate_tls_key_identity(cfg.hostnqn, cfg.subsysnqn, cfg.identity, @@ -8839,11 +9381,128 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct return -errno; } printf("%s\n", tls_id); - free(tls_id); } return 0; } +static void __scan_tls_key(long keyring_id, long key_id, + char *desc, int desc_len, void *data) +{ + FILE *fd = data; + _cleanup_free_ const unsigned char *key_data = NULL; + _cleanup_free_ char *encoded_key = NULL; + int key_len; + + key_data = nvme_read_key(keyring_id, key_id, &key_len); + if (!key_data) + return; + encoded_key = nvme_export_tls_key(key_data, key_len); + if (!encoded_key) + return; + fprintf(fd, "%s %s\n", desc, encoded_key); +} + +static int tls_key(int argc, char **argv, struct command *command, struct plugin *plugin) +{ + const char *desc = "Manipulation of TLS keys.\n"; + const char *keyring = "Keyring for the retained key."; + const char *keytype = "Key type of the retained key."; + const char *keyfile = "File for list of keys."; + const char *import = "Import all keys into the keyring."; + const char *export = "Export all keys from the keyring."; + + FILE *fd; + int err = 0; + + struct config { + char *keyring; + char *keytype; + char *keyfile; + bool import; + bool export; + }; + + struct config cfg = { + .keyring = ".nvme", + .keytype = "psk", + .keyfile = NULL, + .import = false, + .export = false, + }; + + NVME_ARGS(opts, + OPT_STR("keyring", 'k', &cfg.keyring, keyring), + OPT_STR("keytype", 't', &cfg.keytype, keytype), + OPT_STR("keyfile", 'f', &cfg.keyfile, keyfile), + OPT_FLAG("import", 'i', &cfg.import, import), + OPT_FLAG("export", 'e', &cfg.export, export)); + + err = argconfig_parse(argc, argv, desc, opts); + if (err) + return err; + + if (cfg.keyfile) { + fd = fopen(cfg.keyfile, "r"); + if (!fd) { + nvme_show_error("Cannot open keyfile %s, error %d\n", + cfg.keyfile, errno); + return -errno; + } + } else + fd = stdin; + + if (cfg.export && cfg.import) { + nvme_show_error("Cannot specify both --import and --export"); + err = -EINVAL; + } else if (cfg.export) { + nvme_scan_tls_keys(cfg.keyring, __scan_tls_key, fd); + } else if (cfg.import) { + long keyring_id; + char tls_str[512]; + char *tls_key; + unsigned char *psk; + unsigned int hmac; + int linenum = -1, key_len; + + keyring_id = nvme_lookup_keyring(cfg.keyring); + if (!keyring_id) { + nvme_show_error("Invalid keyring '%s'", cfg.keyring); + err = -ENOKEY; + goto out; + } + + while (fgets(tls_str, 512, fd)) { + linenum++; + tls_key = strrchr(tls_str, ' '); + if (!tls_key) { + nvme_show_error("Parse error in line %d", + linenum); + continue; + } + *tls_key = '\0'; + tls_key++; + psk = nvme_import_tls_key(tls_key, &key_len, &hmac); + if (!psk) { + nvme_show_error("Failed to import key in line %d", + linenum); + continue; + } + nvme_update_key(keyring_id, "psk", tls_str, + psk, key_len); + free(psk); + } + } else { + nvme_show_error("Must specify either --import or --export"); + err = -EINVAL; + } + +out: + if (cfg.keyfile) + fclose(fd); + + return err; +} + static int show_topology_cmd(int argc, char **argv, struct command *command, struct plugin *plugin) { const char *desc = "Show the topology\n"; @@ -8886,7 +9545,7 @@ static int show_topology_cmd(int argc, char **argv, struct command *command, str return -EINVAL; } - r = nvme_create_root(stderr, map_log_level(!!(flags & VERBOSE), false)); + r = nvme_create_root(stderr, log_level); if (!r) { nvme_show_error("Failed to create topology root: %s", nvme_strerror(errno)); return -errno; @@ -8894,7 +9553,8 @@ static int show_topology_cmd(int argc, char **argv, struct command *command, str err = nvme_scan_topology(r, NULL, NULL); if (err < 0) { - nvme_show_error("Failed to scan topology: %s", nvme_strerror(errno)); + if (errno != ENOENT) + nvme_show_error("Failed to scan topology: %s", nvme_strerror(errno)); nvme_free_tree(r); return err; } diff --git a/nvme.h b/nvme.h index 3915698..7e86afc 100644 --- a/nvme.h +++ b/nvme.h @@ -113,8 +113,6 @@ bool nvme_is_output_format_json(void); int __id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *plugin, void (*vs)(uint8_t *vs, struct json_object *root)); -extern int current_index; - const char *nvme_strerror(int errnum); unsigned long long elapsed_utime(struct timeval start_time, @@ -127,5 +125,6 @@ void d(unsigned char *buf, int len, int width, int group); void d_raw(unsigned char *buf, unsigned len); uint64_t int48_to_long(uint8_t *data); -int map_log_level(int verbose, bool quiet); +int get_reg_size(int offset); +bool nvme_is_ctrl_reg(int offset); #endif /* _NVME_H */ diff --git a/nvme.spec.in b/nvme.spec.in index 3eab9ff..43fc930 100644 --- a/nvme.spec.in +++ b/nvme.spec.in @@ -30,11 +30,13 @@ touch %{buildroot}@SYSCONFDIR@/nvme/hostid @SYSCONFDIR@/nvme/hostid @SYSCONFDIR@/nvme/discovery.conf %ghost @SYSCONFDIR@/nvme/config.json +@UDEVRULESDIR@/65-persistent-net-nbft.rules @UDEVRULESDIR@/70-nvmf-autoconnect.rules @UDEVRULESDIR@/71-nvmf-netapp.rules @DRACUTRILESDIR@/70-nvmf-autoconnect.conf @SYSTEMDDIR@/nvmf-connect@.service @SYSTEMDDIR@/nvmefc-boot-connections.service +@SYSTEMDDIR@/nvmf-connect-nbft.service @SYSTEMDDIR@/nvmf-connect.target @SYSTEMDDIR@/nvmf-autoconnect.service diff --git a/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in b/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in index 7036625..783feb0 100644 --- a/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in +++ b/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in @@ -6,6 +6,18 @@ After=systemd-udevd.service Before=local-fs-pre.target [Service] +ProtectSystem=full +ProtectHome=true +ProtectHostname=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectControlGroups=true +ProtectProc=invisible +RestrictRealtime=true +LockPersonality=yes +MemoryDenyWriteExecute=yes +RemoveIPC=yes +RestrictAddressFamilies=none Type=oneshot ExecStart=/bin/sh -c "echo add > /sys/class/fc/fc_udev_device/nvme_discovery" diff --git a/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in b/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in index 92960cd..1ac1588 100644 --- a/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in +++ b/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in @@ -8,6 +8,18 @@ After=network-online.target Before=remote-fs-pre.target [Service] +ProtectSystem=full +ProtectHome=true +ProtectHostname=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectControlGroups=true +ProtectProc=invisible +RestrictRealtime=true +LockPersonality=yes +MemoryDenyWriteExecute=yes +RemoveIPC=yes +RestrictAddressFamilies=AF_INET AF_INET6 Type=oneshot ExecStart=@SBINDIR@/nvme connect-all --context=autoconnect diff --git a/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in b/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in index 820e6ce..e3934fe 100644 --- a/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in +++ b/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in @@ -10,5 +10,17 @@ After=network-online.target Before=remote-fs-pre.target [Service] +ProtectSystem=full +ProtectHome=true +ProtectHostname=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectControlGroups=true +ProtectProc=invisible +RestrictRealtime=true +LockPersonality=yes +MemoryDenyWriteExecute=yes +RemoveIPC=yes +RestrictAddressFamilies=AF_INET AF_INET6 Type=oneshot ExecStart=@SBINDIR@/nvme connect-all --nbft diff --git a/nvmf-autoconnect/systemd/nvmf-connect@.service.in b/nvmf-autoconnect/systemd/nvmf-connect@.service.in index 5ba7086..3cec347 100644 --- a/nvmf-autoconnect/systemd/nvmf-connect@.service.in +++ b/nvmf-autoconnect/systemd/nvmf-connect@.service.in @@ -11,6 +11,18 @@ PartOf=nvmf-connect.target Requires=nvmf-connect.target [Service] +ProtectSystem=full +ProtectHome=true +ProtectHostname=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectControlGroups=true +ProtectProc=invisible +RestrictRealtime=true +LockPersonality=yes +MemoryDenyWriteExecute=yes +RemoveIPC=yes +RestrictAddressFamilies=AF_INET AF_INET6 Type=simple Environment="CONNECT_ARGS=%i" ExecStart=/bin/sh -c "@SBINDIR@/nvme connect-all --context=autoconnect --quiet `/bin/echo -e '${CONNECT_ARGS}'`" diff --git a/nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules.in b/nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules.in index 9235a5c..d353dc8 100644 --- a/nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules.in +++ b/nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules.in @@ -15,18 +15,18 @@ ENV{NVME_HOST_IFACE}=="", ENV{NVME_HOST_IFACE}="none" ACTION=="change", SUBSYSTEM=="nvme", ENV{NVME_AEN}=="0x70f002", \ ENV{NVME_TRTYPE}=="*", ENV{NVME_TRADDR}=="*", \ ENV{NVME_TRSVCID}=="*", ENV{NVME_HOST_TRADDR}=="*", ENV{NVME_HOST_IFACE}=="*", \ - RUN+="@SYSTEMCTL@ --no-block restart nvmf-connect@--device=$kernel\t--transport=$env{NVME_TRTYPE}\t--traddr=$env{NVME_TRADDR}\t--trsvcid=$env{NVME_TRSVCID}\t--host-traddr=$env{NVME_HOST_TRADDR}\t--host-iface=$env{NVME_HOST_IFACE}.service" + RUN+="@SYSTEMCTL@ --no-block restart nvmf-connect@--device\x3d$kernel\t--transport\x3d$env{NVME_TRTYPE}\t--traddr\x3d$env{NVME_TRADDR}\t--trsvcid\x3d$env{NVME_TRSVCID}\t--host-traddr\x3d$env{NVME_HOST_TRADDR}\t--host-iface\x3d$env{NVME_HOST_IFACE}.service" # nvme-fc transport generated events (old-style for compatibility) ACTION=="change", SUBSYSTEM=="fc", ENV{FC_EVENT}=="nvmediscovery", \ ENV{NVMEFC_HOST_TRADDR}=="*", ENV{NVMEFC_TRADDR}=="*", \ - RUN+="@SYSTEMCTL@ --no-block restart nvmf-connect@--device=none\t--transport=fc\t--traddr=$env{NVMEFC_TRADDR}\t--trsvcid=none\t--host-traddr=$env{NVMEFC_HOST_TRADDR}.service" + RUN+="@SYSTEMCTL@ --no-block restart nvmf-connect@--device\x3dnone\t--transport\x3dfc\t--traddr\x3d$env{NVMEFC_TRADDR}\t--trsvcid\x3dnone\t--host-traddr\x3d$env{NVMEFC_HOST_TRADDR}.service" # A discovery controller just (re)connected, re-read the discovery log change to # check if there were any changes since it was last connected. ACTION=="change", SUBSYSTEM=="nvme", ENV{NVME_EVENT}=="rediscover", ATTR{cntrltype}=="discovery", \ ENV{NVME_TRTYPE}=="*", ENV{NVME_TRADDR}=="*", \ ENV{NVME_TRSVCID}=="*", ENV{NVME_HOST_TRADDR}=="*", ENV{NVME_HOST_IFACE}=="*", \ - RUN+="@SYSTEMCTL@ --no-block restart nvmf-connect@--device=$kernel\t--transport=$env{NVME_TRTYPE}\t--traddr=$env{NVME_TRADDR}\t--trsvcid=$env{NVME_TRSVCID}\t--host-traddr=$env{NVME_HOST_TRADDR}\t--host-iface=$env{NVME_HOST_IFACE}.service" + RUN+="@SYSTEMCTL@ --no-block restart nvmf-connect@--device\x3d$kernel\t--transport\x3d$env{NVME_TRTYPE}\t--traddr\x3d$env{NVME_TRADDR}\t--trsvcid\x3d$env{NVME_TRSVCID}\t--host-traddr\x3d$env{NVME_HOST_TRADDR}\t--host-iface\x3d$env{NVME_HOST_IFACE}.service" LABEL="autoconnect_end" diff --git a/plugins/memblaze/memblaze-nvme.c b/plugins/memblaze/memblaze-nvme.c index b215125..c189f1b 100644 --- a/plugins/memblaze/memblaze-nvme.c +++ b/plugins/memblaze/memblaze-nvme.c @@ -65,7 +65,7 @@ static int compare_fw_version(const char *fw1, const char *fw2) * 0: old memblaze format * *******************************************************/ #define MEMBLAZE_FORMAT (0) -#define INTEL_FORMAT (1) +#define INTEL_FORMAT (1) /* 2.13 = papaya */ #define IS_PAPAYA(str) (!strcmp(str, "2.13")) @@ -107,14 +107,15 @@ static __u64 raw_2_u64(const __u8 *buf, size_t len) return le64_to_cpu(val); } -static void get_memblaze_new_smart_info(struct nvme_p4_smart_log *smart, int index, __u8 *nm_val, __u8 *raw_val) +static void get_memblaze_new_smart_info(struct nvme_p4_smart_log *smart, int index, __u8 *nm_val, + __u8 *raw_val) { memcpy(nm_val, smart->itemArr[index].nmVal, NM_SIZE); memcpy(raw_val, smart->itemArr[index].rawVal, RAW_SIZE); } -static void show_memblaze_smart_log_new(struct nvme_memblaze_smart_log *s, - unsigned int nsid, const char *devname) +static void show_memblaze_smart_log_new(struct nvme_memblaze_smart_log *s, unsigned int nsid, + const char *devname) { struct nvme_p4_smart_log *smart = (struct nvme_p4_smart_log *)s; __u8 *nm = malloc(NM_SIZE * sizeof(__u8)); @@ -130,7 +131,8 @@ static void show_memblaze_smart_log_new(struct nvme_memblaze_smart_log *s, return; } - printf("%s:%s %s:%x\n", "Additional Smart Log for NVME device", devname, "namespace-id", nsid); + printf("%s:%s %s:%x\n", "Additional Smart Log for NVME device", devname, "namespace-id", + nsid); printf("%-34s%-11s%s\n", "key", "normalized", "raw"); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_PROGRAM_FAIL, nm, raw); @@ -140,42 +142,51 @@ static void show_memblaze_smart_log_new(struct nvme_memblaze_smart_log *s, printf("%-32s: %3d%% %"PRIu64"\n", "erase_fail_count", *nm, int48_to_long(raw)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_WEARLEVELING_COUNT, nm, raw); - printf("%-31s : %3d%% %s%u%s%u%s%u\n", "wear_leveling", *nm, - "min: ", *(__u16 *)raw, ", max: ", *(__u16 *)(raw+2), ", avg: ", *(__u16 *)(raw+4)); + printf("%-31s : %3d%% %s%u%s%u%s%u\n", "wear_leveling", *nm, "min: ", *(__u16 *)raw, + ", max: ", *(__u16 *)(raw+2), ", avg: ", *(__u16 *)(raw+4)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_E2E_DECTECTION_COUNT, nm, raw); - printf("%-31s: %3d%% %"PRIu64"\n", "end_to_end_error_detection_count", *nm, int48_to_long(raw)); + printf("%-31s: %3d%% %"PRIu64"\n", "end_to_end_error_detection_count", *nm, + int48_to_long(raw)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_PCIE_CRC_ERR_COUNT, nm, raw); printf("%-32s: %3d%% %"PRIu64"\n", "crc_error_count", *nm, int48_to_long(raw)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TIMED_WORKLOAD_MEDIA_WEAR, nm, raw); - printf("%-32s: %3d%% %.3f%%\n", "timed_workload_media_wear", *nm, ((float)int48_to_long(raw))/1000); + printf("%-32s: %3d%% %.3f%%\n", "timed_workload_media_wear", *nm, + ((float)int48_to_long(raw))/1000); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TIMED_WORKLOAD_HOST_READ, nm, raw); - printf("%-32s: %3d%% %"PRIu64"%%\n", "timed_workload_host_reads", *nm, int48_to_long(raw)); + printf("%-32s: %3d%% %"PRIu64"%%\n", "timed_workload_host_reads", *nm, + int48_to_long(raw)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TIMED_WORKLOAD_TIMER, nm, raw); - printf("%-32s: %3d%% %"PRIu64"%s\n", "timed_workload_timer", *nm, int48_to_long(raw), " min"); + printf("%-32s: %3d%% %"PRIu64"%s\n", "timed_workload_timer", *nm, + int48_to_long(raw), " min"); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_THERMAL_THROTTLE_STATUS, nm, raw); - printf("%-32s: %3d%% %u%%%s%"PRIu64"\n", "thermal_throttle_status", *nm, - *raw, ", cnt: ", int48_to_long(raw+1)); + printf("%-32s: %3d%% %u%%%s%"PRIu64"\n", "thermal_throttle_status", *nm, *raw, + ", cnt: ", int48_to_long(raw+1)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_RETRY_BUFF_OVERFLOW_COUNT, nm, raw); - printf("%-32s: %3d%% %"PRIu64"\n", "retry_buffer_overflow_count", *nm, int48_to_long(raw)); + printf("%-32s: %3d%% %"PRIu64"\n", "retry_buffer_overflow_count", *nm, + int48_to_long(raw)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_PLL_LOCK_LOSS_COUNT, nm, raw); - printf("%-32s: %3d%% %"PRIu64"\n", "pll_lock_loss_count", *nm, int48_to_long(raw)); + printf("%-32s: %3d%% %"PRIu64"\n", "pll_lock_loss_count", *nm, + int48_to_long(raw)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TOTAL_WRITE, nm, raw); - printf("%-32s: %3d%% %s%"PRIu64"\n", "nand_bytes_written", *nm, "sectors: ", int48_to_long(raw)); + printf("%-32s: %3d%% %s%"PRIu64"\n", "nand_bytes_written", *nm, "sectors: ", + int48_to_long(raw)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_HOST_WRITE, nm, raw); - printf("%-32s: %3d%% %s%"PRIu64"\n", "host_bytes_written", *nm, "sectors: ", int48_to_long(raw)); + printf("%-32s: %3d%% %s%"PRIu64"\n", "host_bytes_written", *nm, "sectors: ", + int48_to_long(raw)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_SYSTEM_AREA_LIFE_LEFT, nm, raw); - printf("%-32s: %3d%% %"PRIu64"\n", "system_area_life_left", *nm, int48_to_long(raw)); + printf("%-32s: %3d%% %"PRIu64"\n", "system_area_life_left", *nm, + int48_to_long(raw)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TOTAL_READ, nm, raw); printf("%-32s: %3d%% %"PRIu64"\n", "total_read", *nm, int48_to_long(raw)); @@ -189,8 +200,8 @@ static void show_memblaze_smart_log_new(struct nvme_memblaze_smart_log *s, "max: ", *(__u16 *)raw, ", min: ", *(__u16 *)(raw+2), ", curr: ", *(__u16 *)(raw+4)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TEMPT_SINCE_BOOTUP, nm, raw); - printf("%-32s: %3d%% %s%u%s%u%s%u\n", "tempt_since_bootup", *nm, "max: ", *(__u16 *)raw, - ", min: ", *(__u16 *)(raw+2), ", curr: ", *(__u16 *)(raw+4)); + printf("%-32s: %3d%% %s%u%s%u%s%u\n", "tempt_since_bootup", *nm, "max: ", + *(__u16 *)raw, ", min: ", *(__u16 *)(raw+2), ", curr: ", *(__u16 *)(raw+4)); get_memblaze_new_smart_info(smart, RAISIN_SI_VD_READ_FAIL, nm, raw); printf("%-32s: %3d%% %"PRIu64"\n", "read_fail_count", *nm, int48_to_long(raw)); @@ -319,23 +330,24 @@ static void show_memblaze_smart_log_old(struct nvme_memblaze_smart_log *smart, } get_memblaze_new_smart_info(s, PROGRAM_FAIL, nm, raw); printf("%-32s : %3d%% %"PRIu64"\n", - "program_fail_count", *nm, int48_to_long(raw)); + "program_fail_count", *nm, int48_to_long(raw)); get_memblaze_new_smart_info(s, ERASE_FAIL, nm, raw); printf("%-32s : %3d%% %"PRIu64"\n", - "erase_fail_count", *nm, int48_to_long(raw)); + "erase_fail_count", *nm, int48_to_long(raw)); get_memblaze_new_smart_info(s, WEARLEVELING_COUNT, nm, raw); printf("%-31s : %3d%% %s%u%s%u%s%u\n", - "wear_leveling", *nm, "min: ", *(__u16 *)raw, ", max: ", *(__u16 *)(raw+2), ", avg: ", *(__u16 *)(raw+4)); + "wear_leveling", *nm, "min: ", *(__u16 *)raw, ", max: ", *(__u16 *)(raw+2), + ", avg: ", *(__u16 *)(raw+4)); get_memblaze_new_smart_info(s, TOTAL_WRITE, nm, raw); printf("%-32s : %3d%% %"PRIu64"\n", - "nand_bytes_written", *nm, 32*int48_to_long(raw)); + "nand_bytes_written", *nm, 32*int48_to_long(raw)); get_memblaze_new_smart_info(s, HOST_WRITE, nm, raw); printf("%-32s : %3d%% %"PRIu64"\n", - "host_bytes_written", *nm, 32*int48_to_long(raw)); + "host_bytes_written", *nm, 32*int48_to_long(raw)); free(nm); free(raw); @@ -402,14 +414,15 @@ int parse_params(char *str, int number, ...) return 0; } -static int mb_get_additional_smart_log(int argc, char **argv, struct command *cmd, struct plugin *plugin) +static int mb_get_additional_smart_log(int argc, char **argv, struct command *cmd, + struct plugin *plugin) { struct nvme_memblaze_smart_log smart_log; char *desc = - "Get Memblaze vendor specific additional smart log (optionally, for the specified namespace), and show it."; + "Get Memblaze vendor specific additional smart log, and show it."; const char *namespace = "(optional) desired namespace"; const char *raw = "dump output in binary format"; - struct nvme_dev *dev; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; struct config { __u32 namespace_id; bool raw_binary; @@ -442,7 +455,6 @@ static int mb_get_additional_smart_log(int argc, char **argv, struct command *cm if (err > 0) nvme_show_status(err); - dev_close(dev); return err; } @@ -460,12 +472,13 @@ static char *mb_feature_to_string(int feature) } } -static int mb_get_powermanager_status(int argc, char **argv, struct command *cmd, struct plugin *plugin) +static int mb_get_powermanager_status(int argc, char **argv, struct command *cmd, + struct plugin *plugin) { const char *desc = "Get Memblaze power management ststus\n (value 0 - 25w, 1 - 20w, 2 - 15w)"; __u32 result; __u32 feature_id = MB_FEAT_POWER_MGMT; - struct nvme_dev *dev; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; int err; OPT_ARGS(opts) = { @@ -477,16 +490,16 @@ static int mb_get_powermanager_status(int argc, char **argv, struct command *cmd return err; struct nvme_get_features_args args = { - .args_size = sizeof(args), - .fd = dev_fd(dev), + .args_size = sizeof(args), + .fd = dev_fd(dev), .fid = feature_id, .nsid = 0, .sel = 0, .cdw11 = 0, .uuidx = 0, - .data_len = 0, + .data_len = 0, .data = NULL, - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, .result = &result, }; err = nvme_get_features(&args); @@ -497,16 +510,16 @@ static int mb_get_powermanager_status(int argc, char **argv, struct command *cmd mb_feature_to_string(feature_id), nvme_select_to_string(0), result); else if (err > 0) nvme_show_status(err); - dev_close(dev); return err; } -static int mb_set_powermanager_status(int argc, char **argv, struct command *cmd, struct plugin *plugin) +static int mb_set_powermanager_status(int argc, char **argv, struct command *cmd, + struct plugin *plugin) { const char *desc = "Set Memblaze power management status\n (value 0 - 25w, 1 - 20w, 2 - 15w)"; const char *value = "new value of feature (required)"; const char *save = "specifies that the controller shall save the attribute"; - struct nvme_dev *dev; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; __u32 result; int err; @@ -533,8 +546,8 @@ static int mb_set_powermanager_status(int argc, char **argv, struct command *cmd return err; struct nvme_set_features_args args = { - .args_size = sizeof(args), - .fd = dev_fd(dev), + .args_size = sizeof(args), + .fd = dev_fd(dev), .fid = cfg.feature_id, .nsid = 0, .cdw11 = cfg.value, @@ -542,9 +555,9 @@ static int mb_set_powermanager_status(int argc, char **argv, struct command *cmd .save = cfg.save, .uuidx = 0, .cdw15 = 0, - .data_len = 0, + .data_len = 0, .data = NULL, - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, .result = &result, }; err = nvme_set_features(&args); @@ -556,14 +569,14 @@ static int mb_set_powermanager_status(int argc, char **argv, struct command *cmd else if (err > 0) nvme_show_status(err); - dev_close(dev); return err; } -#define P2MIN (1) -#define P2MAX (5000) -#define MB_FEAT_HIGH_LATENCY_VALUE_SHIFT (15) -static int mb_set_high_latency_log(int argc, char **argv, struct command *cmd, struct plugin *plugin) +#define P2MIN (1) +#define P2MAX (5000) +#define MB_FEAT_HIGH_LATENCY_VALUE_SHIFT (15) +static int mb_set_high_latency_log(int argc, char **argv, struct command *cmd, + struct plugin *plugin) { const char *desc = "Set Memblaze high latency log\n" " input parameter p1,p2\n" @@ -571,7 +584,7 @@ static int mb_set_high_latency_log(int argc, char **argv, struct command *cmd, s " p2 value: 1 .. 5000 ms"; const char *param = "input parameters"; int param1 = 0, param2 = 0; - struct nvme_dev *dev; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; __u32 result; int err; @@ -598,12 +611,10 @@ static int mb_set_high_latency_log(int argc, char **argv, struct command *cmd, s if (parse_params(cfg.param, 2, ¶m1, ¶m2)) { printf("setfeature: invalid formats %s\n", cfg.param); - dev_close(dev); return -EINVAL; } if ((param1 == 1) && (param2 < P2MIN || param2 > P2MAX)) { printf("setfeature: invalid high io latency threshold %d\n", param2); - dev_close(dev); return -EINVAL; } cfg.value = (param1 << MB_FEAT_HIGH_LATENCY_VALUE_SHIFT) | param2; @@ -632,7 +643,6 @@ static int mb_set_high_latency_log(int argc, char **argv, struct command *cmd, s else if (err > 0) nvme_show_status(err); - dev_close(dev); return err; } @@ -672,7 +682,7 @@ static int find_deadbeef(char *buf) return 0; } -#define TIME_STR_SIZE (44) +#define TIME_STR_SIZE (44) static int glp_high_latency(FILE *fdi, char *buf, int buflen, int print) { struct log_page_high_latency *logEntry; @@ -723,11 +733,12 @@ static int glp_high_latency(FILE *fdi, char *buf, int buflen, int print) return 1; } -static int mb_high_latency_log_print(int argc, char **argv, struct command *cmd, struct plugin *plugin) +static int mb_high_latency_log_print(int argc, char **argv, struct command *cmd, + struct plugin *plugin) { const char *desc = "Get Memblaze high latency log"; char buf[LOG_PAGE_SIZE]; - struct nvme_dev *dev; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; FILE *fdi = NULL; int err; @@ -742,14 +753,13 @@ static int mb_high_latency_log_print(int argc, char **argv, struct command *cmd, fdi = fopen(FID_C3_LOG_FILENAME, "w+"); glp_high_latency_show_bar(fdi, DO_PRINT_FLAG); - err = nvme_get_log_simple(dev_fd(dev), GLP_ID_VU_GET_HIGH_LATENCY_LOG, - sizeof(buf), &buf); + err = nvme_get_log_simple(dev_fd(dev), GLP_ID_VU_GET_HIGH_LATENCY_LOG, sizeof(buf), &buf); while (1) { if (!glp_high_latency(fdi, buf, LOG_PAGE_SIZE, DO_PRINT_FLAG)) break; - err = nvme_get_log_simple(dev_fd(dev), GLP_ID_VU_GET_HIGH_LATENCY_LOG, - sizeof(buf), &buf); + err = nvme_get_log_simple(dev_fd(dev), GLP_ID_VU_GET_HIGH_LATENCY_LOG, sizeof(buf), + &buf); if (err) { nvme_show_status(err); break; @@ -758,7 +768,6 @@ static int mb_high_latency_log_print(int argc, char **argv, struct command *cmd, if (fdi) fclose(fdi); - dev_close(dev); return err; } @@ -787,7 +796,7 @@ static int mb_selective_download(int argc, char **argv, struct command *cmd, str int xfer = 4096; void *fw_buf; int selectNo, fw_fd, fw_size, err, offset = 0; - struct nvme_dev *dev; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; struct stat sb; int i; @@ -901,12 +910,11 @@ out_free: out_close: close(fw_fd); out: - dev_close(dev); return err; } static void ioLatencyHistogramOutput(FILE *fd, int index, int start, int end, char *unit0, - char *unit1, unsigned int *pHistogram, int print) + char *unit1, unsigned int *pHistogram, int print) { int len; char string[64], subString0[12], subString1[12]; @@ -917,8 +925,7 @@ static void ioLatencyHistogramOutput(FILE *fd, int index, int start, int end, ch else snprintf(subString1, sizeof(subString1), "%s", "+INF"); len = snprintf(string, sizeof(string), "%-11d %-11s %-11s %-11u\n", - index, subString0, subString1, - pHistogram[index]); + index, subString0, subString1, pHistogram[index]); fwrite(string, 1, len, fd); if (print) printf("%s", string); @@ -960,7 +967,8 @@ int io_latency_histogram(char *file, char *buf, int print, int logid) strcpy(unit[0], "ms"); strcpy(unit[1], "ms"); for (i = 1; i < 32; i++, index++) - ioLatencyHistogramOutput(fdi, index, i, i + 1, unit[0], unit[1], (unsigned int *)buf, print); + ioLatencyHistogramOutput(fdi, index, i, i + 1, unit[0], unit[1], + (unsigned int *)buf, print); for (i = 1; i < 32; i++, index++) { if (i == 31) { @@ -976,9 +984,11 @@ int io_latency_histogram(char *file, char *buf, int print, int logid) strcpy(unit[0], "s"); strcpy(unit[1], "s"); for (i = 1; i < 4; i++, index++) - ioLatencyHistogramOutput(fdi, index, i, i + 1, unit[0], unit[1], (unsigned int *)buf, print); + ioLatencyHistogramOutput(fdi, index, i, i + 1, unit[0], unit[1], + (unsigned int *)buf, print); - ioLatencyHistogramOutput(fdi, index, i, 0x7FFFFFFF, unit[0], unit[1], (unsigned int *)buf, print); + ioLatencyHistogramOutput(fdi, index, i, 0x7FFFFFFF, unit[0], unit[1], + (unsigned int *)buf, print); } else { fPRINT_PARAM1("Unsupported io latency histogram revision\n"); } @@ -993,7 +1003,7 @@ static int mb_lat_stats_log_print(int argc, char **argv, struct command *cmd, st char stats[LOG_PAGE_SIZE]; char f1[] = FID_C1_LOG_FILENAME; char f2[] = FID_C2_LOG_FILENAME; - struct nvme_dev *dev; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; int err; const char *desc = "Get Latency Statistics log and show it."; @@ -1015,8 +1025,7 @@ static int mb_lat_stats_log_print(int argc, char **argv, struct command *cmd, st if (err) return err; - err = nvme_get_log_simple(dev_fd(dev), cfg.write ? 0xc2 : 0xc1, - sizeof(stats), &stats); + err = nvme_get_log_simple(dev_fd(dev), cfg.write ? 0xc2 : 0xc1, sizeof(stats), &stats); if (!err) io_latency_histogram(cfg.write ? f2 : f1, stats, DO_PRINT_FLAG, cfg.write ? GLP_ID_VU_GET_WRITE_LATENCY_HISTOGRAM : @@ -1024,14 +1033,14 @@ static int mb_lat_stats_log_print(int argc, char **argv, struct command *cmd, st else nvme_show_status(err); - dev_close(dev); return err; } -static int memblaze_clear_error_log(int argc, char **argv, struct command *cmd, struct plugin *plugin) +static int memblaze_clear_error_log(int argc, char **argv, struct command *cmd, + struct plugin *plugin) { char *desc = "Clear Memblaze devices error log."; - struct nvme_dev *dev; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; int err; __u32 result; @@ -1043,9 +1052,9 @@ static int memblaze_clear_error_log(int argc, char **argv, struct command *cmd, }; struct config cfg = { - .feature_id = 0xf7, - .value = 0x534d0001, - .save = 0, + .feature_id = 0xf7, + .value = 0x534d0001, + .save = 0, }; OPT_ARGS(opts) = { @@ -1075,16 +1084,15 @@ static int memblaze_clear_error_log(int argc, char **argv, struct command *cmd, if (err < 0) perror("set-feature"); if (!err) - printf("set-feature:%02x (%s), value:%#08x\n", cfg.feature_id, mb_feature_to_string(cfg.feature_id), cfg.value); + printf("set-feature:%02x (%s), value:%#08x\n", cfg.feature_id, + mb_feature_to_string(cfg.feature_id), cfg.value); else if (err > 0) nvme_show_status(err); - dev_close(dev); return err; } -static int mb_set_lat_stats(int argc, char **argv, - struct command *command, struct plugin *plugin) +static int mb_set_lat_stats(int argc, char **argv, struct command *command, struct plugin *plugin) { const char *desc = ( "Enable/Disable Latency Statistics Tracking.\n" @@ -1098,7 +1106,7 @@ static int mb_set_lat_stats(int argc, char **argv, const __u32 cdw12 = 0x0; const __u32 data_len = 32; const __u32 save = 0; - struct nvme_dev *dev; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; void *buf = NULL; __u32 result; int err; @@ -1168,12 +1176,10 @@ static int mb_set_lat_stats(int argc, char **argv, case None: err = nvme_get_features(&args_get); if (!err) { - printf( - "Latency Statistics Tracking (FID 0x%X) is currently (%i).\n", - fid, result); + printf("Latency Statistics Tracking (FID 0x%X) is currently (%i).\n", fid, + result); } else { printf("Could not read feature id 0xE2.\n"); - dev_close(dev); return err; } break; @@ -1186,15 +1192,13 @@ static int mb_set_lat_stats(int argc, char **argv, perror("Enable latency tracking"); fprintf(stderr, "Command failed while parsing.\n"); } else { - printf("Successfully set enable bit for FID (0x%X) to %i.\n", - 0xe2, option); + printf("Successfully set enable bit for FID (0x%X) to %i.\n", 0xe2, option); } break; default: printf("%d not supported.\n", option); err = EINVAL; } - dev_close(dev); return err; } @@ -1238,17 +1242,17 @@ struct __packed smart_log_add_item_12 { uint8_t rsvd1; union { struct wear_level wear_level; // 0xad - struct temp_since_born { // 0xe7 + struct __packed temp_since_born { // 0xe7 __le16 max; __le16 min; __le16 curr; } temp_since_born; - struct power_consumption { // 0xe8 + struct __packed power_consumption { // 0xe8 __le16 max; __le16 min; __le16 curr; } power_consumption; - struct temp_since_power_on { // 0xaf + struct __packed temp_since_power_on { // 0xaf __le16 max; __le16 min; __le16 curr; @@ -1268,10 +1272,10 @@ struct __packed smart_log_add_item_10 { uint8_t rsvd[2]; }; -struct smart_log_add { +struct __packed smart_log_add { union { union { - struct smart_log_add_v0 { + struct __packed smart_log_add_v0 { struct smart_log_add_item_12 program_fail_count; struct smart_log_add_item_12 erase_fail_count; struct smart_log_add_item_12 wear_leveling_count; @@ -1300,7 +1304,7 @@ struct smart_log_add { }; union { - struct smart_log_add_v2 { + struct __packed smart_log_add_v2 { struct smart_log_add_item_12 program_fail_count; struct smart_log_add_item_12 erase_fail_count; struct smart_log_add_item_12 wear_leveling_count; @@ -1322,7 +1326,7 @@ struct smart_log_add { struct smart_log_add_item_12 xor_fail_count; struct smart_log_add_item_12 xor_invoked_count; struct smart_log_add_item_12 inflight_read_io_cmd; - struct smart_log_add_item_12 flash_error_media_count; + struct smart_log_add_item_12 inflight_write_io_cmd; struct smart_log_add_item_12 nand_bytes_read; struct smart_log_add_item_12 temp_since_born; struct smart_log_add_item_12 power_consumption; @@ -1334,7 +1338,7 @@ struct smart_log_add { }; union { - struct smart_log_add_v3 { + struct __packed smart_log_add_v3 { struct smart_log_add_item_10 program_fail_count; struct smart_log_add_item_10 erase_fail_count; struct smart_log_add_item_10 wear_leveling_count; @@ -1401,33 +1405,33 @@ static void smart_log_add_v0_print(struct smart_log_add_item_12 *item, int item_ switch (item->id) { case 0xad: printf("min: %d, max: %d, avg: %d\n", - le16_to_cpu(item->wear_level.min), - le16_to_cpu(item->wear_level.max), - le16_to_cpu(item->wear_level.avg)); + le16_to_cpu(item->wear_level.min), + le16_to_cpu(item->wear_level.max), + le16_to_cpu(item->wear_level.avg)); break; case 0xe7: printf("max: %d °C (%d K), min: %d °C (%d K), curr: %d °C (%d K)\n", - K2C(le16_to_cpu(item->temp_since_born.max)), - le16_to_cpu(item->temp_since_born.max), - K2C(le16_to_cpu(item->temp_since_born.min)), - le16_to_cpu(item->temp_since_born.min), - K2C(le16_to_cpu(item->temp_since_born.curr)), - le16_to_cpu(item->temp_since_born.curr)); + K2C(le16_to_cpu(item->temp_since_born.max)), + le16_to_cpu(item->temp_since_born.max), + K2C(le16_to_cpu(item->temp_since_born.min)), + le16_to_cpu(item->temp_since_born.min), + K2C(le16_to_cpu(item->temp_since_born.curr)), + le16_to_cpu(item->temp_since_born.curr)); break; case 0xe8: printf("max: %d, min: %d, curr: %d\n", - le16_to_cpu(item->power_consumption.max), - le16_to_cpu(item->power_consumption.min), - le16_to_cpu(item->power_consumption.curr)); + le16_to_cpu(item->power_consumption.max), + le16_to_cpu(item->power_consumption.min), + le16_to_cpu(item->power_consumption.curr)); break; case 0xaf: printf("max: %d °C (%d K), min: %d °C (%d K), curr: %d °C (%d K)\n", - K2C(le16_to_cpu(item->temp_since_power_on.max)), - le16_to_cpu(item->temp_since_power_on.max), - K2C(le16_to_cpu(item->temp_since_power_on.min)), - le16_to_cpu(item->temp_since_power_on.min), - K2C(le16_to_cpu(item->temp_since_power_on.curr)), - le16_to_cpu(item->temp_since_power_on.curr)); + K2C(le16_to_cpu(item->temp_since_power_on.max)), + le16_to_cpu(item->temp_since_power_on.max), + K2C(le16_to_cpu(item->temp_since_power_on.min)), + le16_to_cpu(item->temp_since_power_on.min), + K2C(le16_to_cpu(item->temp_since_power_on.curr)), + le16_to_cpu(item->temp_since_power_on.curr)); break; default: printf("%" PRIu64 "\n", int48_to_long(item->raw)); @@ -1460,7 +1464,7 @@ static void smart_log_add_v2_print(struct smart_log_add_item_12 *item, int item_ [0xfd] = {18, "xor_fail_count" }, [0xfe] = {19, "xor_invoked_count" }, [0xe5] = {20, "inflight_read_io_cmd" }, - [0xe6] = {21, "flash_error_media_count" }, + [0xe6] = {21, "inflight_write_io_cmd" }, [0xf8] = {22, "nand_bytes_read" }, [0xe7] = {23, "temp_since_born" }, [0xe8] = {24, "power_consumption" }, @@ -1476,33 +1480,33 @@ static void smart_log_add_v2_print(struct smart_log_add_item_12 *item, int item_ switch (item->id) { case 0xad: printf("min: %d, max: %d, avg: %d\n", - le16_to_cpu(item->wear_level.min), - le16_to_cpu(item->wear_level.max), - le16_to_cpu(item->wear_level.avg)); + le16_to_cpu(item->wear_level.min), + le16_to_cpu(item->wear_level.max), + le16_to_cpu(item->wear_level.avg)); break; case 0xe7: printf("max: %d °C (%d K), min: %d °C (%d K), curr: %d °C (%d K)\n", - K2C(le16_to_cpu(item->temp_since_born.max)), - le16_to_cpu(item->temp_since_born.max), - K2C(le16_to_cpu(item->temp_since_born.min)), - le16_to_cpu(item->temp_since_born.min), - K2C(le16_to_cpu(item->temp_since_born.curr)), - le16_to_cpu(item->temp_since_born.curr)); + K2C(le16_to_cpu(item->temp_since_born.max)), + le16_to_cpu(item->temp_since_born.max), + K2C(le16_to_cpu(item->temp_since_born.min)), + le16_to_cpu(item->temp_since_born.min), + K2C(le16_to_cpu(item->temp_since_born.curr)), + le16_to_cpu(item->temp_since_born.curr)); break; case 0xe8: printf("max: %d, min: %d, curr: %d\n", - le16_to_cpu(item->power_consumption.max), - le16_to_cpu(item->power_consumption.min), - le16_to_cpu(item->power_consumption.curr)); + le16_to_cpu(item->power_consumption.max), + le16_to_cpu(item->power_consumption.min), + le16_to_cpu(item->power_consumption.curr)); break; case 0xaf: printf("max: %d °C (%d K), min: %d °C (%d K), curr: %d °C (%d K)\n", - K2C(le16_to_cpu(item->temp_since_power_on.max)), - le16_to_cpu(item->temp_since_power_on.max), - K2C(le16_to_cpu(item->temp_since_power_on.min)), - le16_to_cpu(item->temp_since_power_on.min), - K2C(le16_to_cpu(item->temp_since_power_on.curr)), - le16_to_cpu(item->temp_since_power_on.curr)); + K2C(le16_to_cpu(item->temp_since_power_on.max)), + le16_to_cpu(item->temp_since_power_on.max), + K2C(le16_to_cpu(item->temp_since_power_on.min)), + le16_to_cpu(item->temp_since_power_on.min), + K2C(le16_to_cpu(item->temp_since_power_on.curr)), + le16_to_cpu(item->temp_since_power_on.curr)); break; default: printf("%" PRIu64 "\n", int48_to_long(item->raw)); @@ -1546,9 +1550,9 @@ static void smart_log_add_v3_print(struct smart_log_add_item_10 *item, int item_ switch (item->id) { case 0xad: printf("min: %d, max: %d, avg: %d\n", - le16_to_cpu(item->wear_level.min), - le16_to_cpu(item->wear_level.max), - le16_to_cpu(item->wear_level.avg)); + le16_to_cpu(item->wear_level.min), + le16_to_cpu(item->wear_level.max), + le16_to_cpu(item->wear_level.avg)); break; default: printf("%" PRIu64 "\n", int48_to_long(item->raw)); @@ -1571,13 +1575,13 @@ static void smart_log_add_print(struct smart_log_add *log, const char *devname) switch (version) { case 0: return smart_log_add_v0_print(&log->v0_raw[0], - sizeof(struct smart_log_add_v0) / sizeof(struct smart_log_add_item_12)); + sizeof(struct smart_log_add_v0) / sizeof(struct smart_log_add_item_12)); case 2: return smart_log_add_v2_print(&log->v2_raw[0], - sizeof(struct smart_log_add_v2) / sizeof(struct smart_log_add_item_12)); + sizeof(struct smart_log_add_v2) / sizeof(struct smart_log_add_item_12)); case 3: return smart_log_add_v3_print(&log->v3_raw[0], - sizeof(struct smart_log_add_v3) / sizeof(struct smart_log_add_item_10)); + sizeof(struct smart_log_add_v3) / sizeof(struct smart_log_add_item_10)); case 1: fprintf(stderr, "Version %d: N/A\n", version); @@ -1604,9 +1608,7 @@ static int mb_get_smart_log_add(int argc, char **argv, struct command *cmd, stru OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, "dump the whole log buffer in binary format"), OPT_END()}; - // Open device - - struct nvme_dev *dev = NULL; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; err = parse_and_open(&dev, argc, argv, cmd->help, opts); if (err) @@ -1616,7 +1618,8 @@ static int mb_get_smart_log_add(int argc, char **argv, struct command *cmd, stru struct smart_log_add log = {0}; - err = nvme_get_log_simple(dev_fd(dev), LID_SMART_LOG_ADD, sizeof(struct smart_log_add), &log); + err = nvme_get_log_simple(dev_fd(dev), LID_SMART_LOG_ADD, sizeof(struct smart_log_add), + &log); if (!err) { if (!cfg.raw_binary) smart_log_add_print(&log, dev->name); @@ -1628,9 +1631,6 @@ static int mb_get_smart_log_add(int argc, char **argv, struct command *cmd, stru nvme_show_error("%s: %s", cmd->name, nvme_strerror(errno)); } - // Close device - - dev_close(dev); return err; } @@ -1643,7 +1643,7 @@ struct latency_stats_bucket { struct __packed latency_stats { union { - struct latency_stats_v2_0 { + struct __packed latency_stats_v2_0 { uint32_t minor_version; uint32_t major_version; uint32_t bucket_read_data[32]; @@ -1660,9 +1660,9 @@ struct __packed latency_stats { struct __packed high_latency_log { union { - struct high_latency_log_v1 { + struct __packed high_latency_log_v1 { uint32_t version; - struct high_latency_log_entry { + struct __packed high_latency_log_entry { uint64_t timestamp; // ms uint32_t latency; uint32_t qid; @@ -1688,12 +1688,12 @@ struct __packed high_latency_log { struct __packed performance_stats { union { - struct performance_stats_v1 { + struct __packed performance_stats_v1 { uint8_t version; uint8_t rsvd[3]; - struct performance_stats_timestamp { + struct __packed performance_stats_timestamp { uint8_t timestamp[6]; - struct performance_stats_entry { + struct __packed performance_stats_entry { uint16_t read_iops; // K IOPS uint16_t read_bandwidth; // MiB uint32_t read_latency; // us @@ -1705,12 +1705,36 @@ struct __packed performance_stats { } entries[3600]; } timestamps[24]; } v1; + struct __packed performance_stats_v2 { + uint8_t version; + uint8_t rsvd[3]; + struct __packed performance_stats_timestamp_v2 { + uint8_t timestamp[6]; + struct __packed performance_stats_entry_v2 { + uint16_t read_iops; + uint16_t read_bandwidth; + uint16_t read_latency_avg; + uint16_t read_latency_max; + uint8_t scale_of_read_iops; + uint8_t scale_of_read_bandwidth; + uint8_t scale_of_read_latency_avg; + uint8_t scale_of_read_latency_max; + uint16_t write_iops; + uint16_t write_bandwidth; + uint16_t write_latency_avg; + uint16_t write_latency_max; + uint8_t scale_of_write_iops; + uint8_t scale_of_write_bandwidth; + uint8_t scale_of_write_latency_avg; + uint8_t scale_of_write_latency_max; + } entries[3600]; + } timestamps[24]; + } v2; uint8_t raw[4 + 24 * (6 + 3600 * 24)]; }; }; -static int mb_set_latency_feature(int argc, char **argv, struct command *cmd, - struct plugin *plugin) +static int mb_set_latency_feature(int argc, char **argv, struct command *cmd, struct plugin *plugin) { int err = 0; @@ -1728,26 +1752,24 @@ static int mb_set_latency_feature(int argc, char **argv, struct command *cmd, OPT_ARGS(opts) = { OPT_UINT("sel-perf-log", 's', &cfg.perf_monitor, - "Select features to turn on, default: Disable\n" - " bit 0: latency statistics\n" - " bit 1: high latency log\n" - " bit 2: Performance stat"), + "Select features to turn on, default: Disable\n" + " bit 0: latency statistics\n" + " bit 1: high latency log\n" + " bit 2: Performance stat"), OPT_UINT("set-commands-mask", 'm', &cfg.cmd_mask, - "Set Enable, default: Disable\n" - " bit 0: Read commands\n" - " bit 1: high Write commands\n" - " bit 2: De-allocate/TRIM (this bit is not worked for Performance stat.)"), + "Set Enable, default: Disable\n" + " bit 0: Read commands\n" + " bit 1: high Write commands\n" + " bit 2: De-allocate/TRIM (this bit is not worked for Performance stat.)"), OPT_UINT("set-read-threshold", 'r', &cfg.read_threshold, - "set read high latency log threshold, it's a 0-based value and unit is 10ms"), + "set read high latency log threshold, it's a 0-based value and unit is 10ms"), OPT_UINT("set-write-threshold", 'w', &cfg.write_threshold, - "set write high latency log threshold, it's a 0-based value and unit is 10ms"), + "set write high latency log threshold, it's a 0-based value and unit is 10ms"), OPT_UINT("set-trim-threshold", 't', &cfg.de_allocate_trim_threshold, - "set trim high latency log threshold, it's a 0-based value and unit is 10ms"), + "set trim high latency log threshold, it's a 0-based value and unit is 10ms"), OPT_END()}; - // Open device - - struct nvme_dev *dev = NULL; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; err = parse_and_open(&dev, argc, argv, cmd->help, opts); if (err) @@ -1766,9 +1788,9 @@ static int mb_set_latency_feature(int argc, char **argv, struct command *cmd, .cdw11 = 0 | cfg.perf_monitor, .cdw12 = 0 | cfg.cmd_mask, .cdw13 = 0 | - (cfg.read_threshold & 0xff) | - ((cfg.write_threshold & 0xff) << 8) | - ((cfg.de_allocate_trim_threshold & 0xff) << 16), + (cfg.read_threshold & 0xff) | + ((cfg.write_threshold & 0xff) << 8) | + ((cfg.de_allocate_trim_threshold & 0xff) << 16), .cdw15 = 0, .save = 0, .uuidx = 0, @@ -1786,14 +1808,10 @@ static int mb_set_latency_feature(int argc, char **argv, struct command *cmd, else nvme_show_error("%s: %s", cmd->name, nvme_strerror(errno)); - // Close device - - dev_close(dev); return err; } -static int mb_get_latency_feature(int argc, char **argv, struct command *cmd, - struct plugin *plugin) +static int mb_get_latency_feature(int argc, char **argv, struct command *cmd, struct plugin *plugin) { int err = 0; @@ -1802,9 +1820,7 @@ static int mb_get_latency_feature(int argc, char **argv, struct command *cmd, OPT_ARGS(opts) = { OPT_END()}; - // Open device - - struct nvme_dev *dev = NULL; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; err = parse_and_open(&dev, argc, argv, cmd->help, opts); if (err) @@ -1835,8 +1851,512 @@ static int mb_get_latency_feature(int argc, char **argv, struct command *cmd, nvme_show_error("%s: %s", cmd->name, nvme_strerror(errno)); } - // Close device + return err; +} + +static void latency_stats_v2_0_print(struct latency_stats *log, int size) +{ + static const struct latency_stats_bucket buckets[0xff] = { + [1] = {"0us", "50us" }, + [2] = {"50us", "100us"}, + [3] = {"100us", "150us"}, + [4] = {"150us", "200us"}, + [5] = {"200us", "300us"}, + [6] = {"300us", "400us"}, + [7] = {"400us", "500us"}, + [8] = {"500us", "600us"}, + [9] = {"600us", "700us"}, + [10] = {"700us", "800us"}, + [11] = {"800us", "900us"}, + [12] = {"900us", "1ms" }, + [13] = {"1ms", "5ms" }, + [14] = {"5ms", "10ms" }, + [15] = {"10ms", "20ms" }, + [16] = {"20ms", "50ms" }, + [17] = {"50ms", "100ms"}, + [18] = {"100ms", "200ms"}, + [19] = {"200ms", "300ms"}, + [20] = {"300ms", "400ms"}, + [21] = {"400ms", "500ms"}, + [22] = {"500ms", "600ms"}, + [23] = {"600ms", "700ms"}, + [24] = {"700ms", "800ms"}, + [25] = {"800ms", "900ms"}, + [26] = {"900ms", "1s" }, + [27] = {"1s", "2s" }, + [28] = {"2s", "3s" }, + [29] = {"3s", "4s" }, + [30] = {"4s", "5s" }, + [31] = {"5s", "8s" }, + [32] = {"8s", "INF" }, + }; + + printf("Bucket 1-32 IO Read Command Data\n"); + printf("-------------------------------------------\n"); + printf("%-12s%-12s%-12s%-12s\n", "Bucket", "Start(>=)", "End(<)", "Value"); + int bucket_count = sizeof(log->v2_0.bucket_read_data) / sizeof(uint32_t); + + for (int i = 0; i < bucket_count; i++) { + printf("%-12u%-12s%-12s%-12u\n", i + 1, buckets[i + 1].start_threshold, + buckets[i + 1].end_threshold, log->v2_0.bucket_read_data[i]); + } + printf("\n"); + + printf("Bucket 1-32 IO Write Command Data\n"); + printf("-------------------------------------------\n"); + printf("%-12s%-12s%-12s%-12s\n", "Bucket", "Start(>=)", "End(<)", "Value"); + bucket_count = sizeof(log->v2_0.bucket_write_data) / sizeof(uint32_t); + + for (int i = 0; i < bucket_count; i++) { + printf("%-12u%-12s%-12s%-12u\n", i + 1, buckets[i + 1].start_threshold, + buckets[i + 1].end_threshold, log->v2_0.bucket_write_data[i]); + } + printf("\n"); + + printf("Bucket 1-32 IO Trim Command Data\n"); + printf("-------------------------------------------\n"); + printf("%-12s%-12s%-12s%-12s\n", "Bucket", "Start(>=)", "End(<)", "Value"); + bucket_count = sizeof(log->v2_0.bucket_trim_data) / sizeof(uint32_t); + + for (int i = 0; i < bucket_count; i++) { + printf("%-12u%-12s%-12s%-12u\n", i + 1, buckets[i + 1].start_threshold, + buckets[i + 1].end_threshold, log->v2_0.bucket_trim_data[i]); + } + printf("\n"); +} + +static void latency_stats_print(struct latency_stats *log, const char *devname) +{ + uint32_t minor_version = *(uint32_t *)&log->raw[0]; + uint32_t major_version = *(uint32_t *)&log->raw[4]; + + printf("Major Version: %u, Minor Version: %u\n", major_version, minor_version); + printf("\n"); + printf("Latency Statistics Log for NVMe device: %s\n", devname); + printf("\n"); + + switch (major_version) { + case 2: + switch (minor_version) { + case 0: + latency_stats_v2_0_print(log, sizeof(struct latency_stats)); + break; + default: + fprintf(stderr, "Major Version %u, Minor Version %u: Not supported yet\n", + major_version, minor_version); + break; + } + break; + + default: + fprintf(stderr, "Major Version %u: Not supported yet\n", major_version); + break; + } +} + +static int mb_get_latency_stats(int argc, char **argv, struct command *cmd, struct plugin *plugin) +{ + // Get the configuration + + struct config { + bool raw_binary; + }; + + struct config cfg = {0}; + + OPT_ARGS(opts) = { + OPT_FLAG("raw-binary", + 'b', + &cfg.raw_binary, + "dump the whole log buffer in binary format"), + OPT_END()}; + + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; + + int err = parse_and_open(&dev, argc, argv, cmd->help, opts); + + if (err) + return err; + + // Get log + + struct latency_stats log = {0}; + + err = nvme_get_log_simple(dev_fd(dev), LID_LATENCY_STATISTICS, sizeof(struct latency_stats), + &log); + if (!err) { + if (!cfg.raw_binary) + latency_stats_print(&log, dev->name); + else + d_raw((unsigned char *)&log, sizeof(struct latency_stats)); + } else if (err > 0) { + nvme_show_status(err); + } else { + nvme_show_error("%s: %s", cmd->name, nvme_strerror(errno)); + } + + return err; +} + +static void high_latency_log_v1_print(struct high_latency_log *log, int size) +{ + printf("%-24s%-12s%-12s%-6s%-6s%-6s%-6s%-12s%-24s%-6s%-6s%-6s%-6s%-6s\n", + "Timestamp", "Latency(us)", "QID", "OpC", "Fuse", "PSDT", "CID", "NSID", "SLBA", + "NLB", "DType", "PInfo", "FUA", "LR"); + + for (int i = 0; i < 1024; i++) { + if (log->v1.entries[i].timestamp == 0) + break; + + // Get the timestamp + + time_t timestamp_ms = log->v1.entries[i].timestamp; + time_t timestamp_s = timestamp_ms / 1000; + int time_ms = timestamp_ms % 1000; + char str_time_s[20] = {0}; + char str_time_ms[32] = {0}; + + strftime(str_time_s, sizeof(str_time_s), "%Y-%m-%d %H:%M:%S", + localtime(×tamp_s)); + snprintf(str_time_ms, sizeof(str_time_ms), "%s.%03d", str_time_s, time_ms); + printf("%-24s", str_time_ms); + + // + printf("%-12" PRIu32, log->v1.entries[i].latency); + printf("%-12" PRIu32, log->v1.entries[i].qid); + printf("%#-6" PRIx32, log->v1.entries[i].opcode); + printf("%-6" PRIu32, log->v1.entries[i].fuse); + printf("%-6" PRIu32, log->v1.entries[i].psdt); + printf("%-6" PRIu32, log->v1.entries[i].cid); + printf("%-12" PRIu32, log->v1.entries[i].nsid); + printf("%-24" PRIu64, log->v1.entries[i].slba); + printf("%-6" PRIu32, log->v1.entries[i].nlb); + printf("%-6" PRIu32, log->v1.entries[i].dtype); + printf("%-6" PRIu32, log->v1.entries[i].pinfo); + printf("%-6" PRIu32, log->v1.entries[i].fua); + printf("%-6" PRIu32, log->v1.entries[i].lr); + printf("\n"); + } +} + +static void high_latency_log_print(struct high_latency_log *log, const char *devname) +{ + uint32_t version = *(uint32_t *)&log->raw[0]; + + printf("Version: %u\n", version); + printf("\n"); + printf("High Latency Log for NVMe device: %s\n", devname); + printf("\n"); + + switch (version) { + case 1: + high_latency_log_v1_print(log, sizeof(struct high_latency_log)); + break; + + default: + fprintf(stderr, "Version %u: Not supported yet\n", version); + break; + } +} + +static int mb_get_high_latency_log(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + // Get the configuration + + struct config { + bool raw_binary; + }; + + struct config cfg = {0}; + + OPT_ARGS(opts) = { + OPT_FLAG("raw-binary", + 'b', + &cfg.raw_binary, + "dump the whole log buffer in binary format"), + OPT_END()}; + + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; + + int err = parse_and_open(&dev, argc, argv, cmd->help, opts); + + if (err) + return err; + + // Get log + + struct high_latency_log log = {0}; + + err = nvme_get_log_simple(dev_fd(dev), LID_HIGH_LATENCY_LOG, + sizeof(struct high_latency_log), &log); + if (!err) { + if (!cfg.raw_binary) + high_latency_log_print(&log, dev->name); + else + d_raw((unsigned char *)&log, sizeof(struct high_latency_log)); + } else if (err > 0) { + nvme_show_status(err); + } else { + nvme_show_error("%s: %s", cmd->name, nvme_strerror(errno)); + } + + return err; +} + +static void performance_stats_v1_print(struct performance_stats *log, int duration) +{ + for (int i = 0; i < duration; i++) { + // Print timestamp + + time_t timestamp_ms = int48_to_long(log->v1.timestamps[i].timestamp); + time_t timestamp_s = timestamp_ms / 1000; + int time_ms = timestamp_ms % 1000; + char time_s[32] = {0}; + + strftime(time_s, sizeof(time_s), "%Y-%m-%d %H:%M:%S", localtime(×tamp_s)); + printf("Timestamp %2d: %s.%03d\n", i + 1, time_s, time_ms); + + // Print entry title + + printf("%-8s%-14s%-21s%-22s%-22s%-15s%-22s%-23s%-23s\n", "Entry", "Read-IOs(K)", + "Read-Bandwidth(MiB)", "Avg-Read-Latency(us)", "Max-Read-Latency(us)", + "Write-IOs(K)", "Write-Bandwidth(MiB)", "Avg-Write-Latency(us)", + "Max-Write-Latency(us)"); + + // Print all entries content + + struct performance_stats_entry entry = {0}; + + for (int j = 0; j < 3600; j++) { + entry.read_iops = + log->v1.timestamps[i].entries[j].read_iops; + entry.read_bandwidth = + log->v1.timestamps[i].entries[j].read_bandwidth; + entry.read_latency = + log->v1.timestamps[i].entries[j].read_latency; + entry.read_latency_max = + log->v1.timestamps[i].entries[j].read_latency_max; + entry.write_iops = + log->v1.timestamps[i].entries[j].write_iops; + entry.write_bandwidth = + log->v1.timestamps[i].entries[j].write_bandwidth; + entry.write_latency = + log->v1.timestamps[i].entries[j].write_latency; + entry.write_latency_max = + log->v1.timestamps[i].entries[j].write_latency_max; + + if (entry.read_iops == 0 && entry.write_iops == 0) + continue; + + printf("%-8u%-14u%-21u%-22u%-22u%-15u%-22u%-23u%-23u\n", + j + 1, + entry.read_iops, + entry.read_bandwidth, + entry.read_iops == 0 ? + 0 : entry.read_latency / (1000 * entry.read_iops), + entry.read_latency_max, + entry.write_iops, + entry.write_bandwidth, + entry.write_iops == 0 ? + 0 : entry.write_latency / (1000 * entry.write_iops), + entry.write_latency_max); + usleep(100); + } + printf("\n"); + } +} + +static void performance_stats_v2_print(struct performance_stats *log, int duration) +{ + for (int i = 0; i < duration; i++) { + // Print timestamp + + time_t timestamp_ms = int48_to_long(log->v2.timestamps[i].timestamp); + time_t timestamp_s = timestamp_ms / 1000; + int time_ms = timestamp_ms % 1000; + char time_s[32] = {0}; + + strftime(time_s, sizeof(time_s), "%Y-%m-%d %H:%M:%S", localtime(×tamp_s)); + printf("Timestamp %2d: %s.%03d\n", i + 1, time_s, time_ms); + + // Print entry title + + printf("%-8s%-23s%-23s%-23s%-23s%-23s%-23s%-23s%-23s\n", + "Entry", + "Read-IOs(IOPS)", "Read-Bandwidth(KiB)", + "Avg-Read-Latency(us)", "Max-Read-Latency(us)", + "Write-IOs(IOPS)", "Write-Bandwidth(KiB)", + "Avg-Write-Latency(us)", "Max-Write-Latency(us)"); + + // Print all entries content + for (int j = 0; j < 3600; j++) { + uint32_t read_iops = + log->v2.timestamps[i].entries[j].read_iops; + uint32_t read_bandwidth = + log->v2.timestamps[i].entries[j].read_bandwidth; + uint32_t read_latency_avg = + log->v2.timestamps[i].entries[j].read_latency_avg; + uint32_t read_latency_max = + log->v2.timestamps[i].entries[j].read_latency_max; + uint32_t scale_of_read_iops = + log->v2.timestamps[i].entries[j].scale_of_read_iops; + uint32_t scale_of_read_bandwidth = + log->v2.timestamps[i].entries[j].scale_of_read_bandwidth; + uint32_t scale_of_read_latency_avg = + log->v2.timestamps[i].entries[j].scale_of_read_latency_avg; + uint32_t scale_of_read_latency_max = + log->v2.timestamps[i].entries[j].scale_of_read_latency_max; + + uint32_t write_iops = + log->v2.timestamps[i].entries[j].write_iops; + uint32_t write_bandwidth = + log->v2.timestamps[i].entries[j].write_bandwidth; + uint32_t write_latency_avg = + log->v2.timestamps[i].entries[j].write_latency_avg; + uint32_t write_latency_max = + log->v2.timestamps[i].entries[j].write_latency_max; + uint32_t scale_of_write_iops = + log->v2.timestamps[i].entries[j].scale_of_write_iops; + uint32_t scale_of_write_bandwidth = + log->v2.timestamps[i].entries[j].scale_of_write_bandwidth; + uint32_t scale_of_write_latency_avg = + log->v2.timestamps[i].entries[j].scale_of_write_latency_avg; + uint32_t scale_of_write_latency_max = + log->v2.timestamps[i].entries[j].scale_of_write_latency_max; + + if (read_iops == 0 && write_iops == 0) + continue; + + while (scale_of_read_iops < 4 && scale_of_read_iops) { + read_iops *= 10; + scale_of_read_iops--; + } + while (scale_of_read_bandwidth < 3 && scale_of_read_bandwidth) { + read_bandwidth *= 1024; + scale_of_read_bandwidth--; + } + while (scale_of_read_latency_avg < 3 && scale_of_read_latency_avg) { + read_latency_avg *= 1000; + scale_of_read_latency_avg--; + } + while (scale_of_read_latency_max < 3 && scale_of_read_latency_max) { + read_latency_max *= 1000; + scale_of_read_latency_max--; + } + + while (scale_of_write_iops < 4 && scale_of_write_iops) { + write_iops *= 10; + scale_of_write_iops--; + } + while (scale_of_write_bandwidth < 3 && scale_of_write_bandwidth) { + write_bandwidth *= 1024; + scale_of_write_bandwidth--; + } + while (scale_of_write_latency_avg < 3 && scale_of_write_latency_avg) { + write_latency_avg *= 1000; + scale_of_write_latency_avg--; + } + while (scale_of_write_latency_max < 3 && scale_of_write_latency_max) { + write_latency_max *= 1000; + scale_of_write_latency_max--; + } + + printf("%-8u%-23u%-23u%-23u%-23u%-23u%-23u%-23u%-23u\n", + j + 1, + read_iops, + read_bandwidth, + read_latency_avg, + read_latency_max, + write_iops, + write_bandwidth, + write_latency_avg, + write_latency_max); + usleep(100); + } + printf("\n"); + } +} + +static void performance_stats_print(struct performance_stats *log, const char *devname, + int duration) +{ + uint8_t version = *(uint8_t *)&log->raw[0]; + + printf("Version: %u\n", version); + printf("\n"); + printf("Performance Stat log for NVMe device: %s\n", devname); + printf("\n"); + + switch (version) { + case 1: + performance_stats_v1_print(log, duration); + break; + case 2: + performance_stats_v2_print(log, duration); + break; + default: + fprintf(stderr, "Version %u: Not supported yet\n", version); + break; + } +} + +static int mb_get_performance_stats(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + // Get the configuration + + struct config { + int duration; + bool raw_binary; + }; + + struct config cfg = {.duration = 1, .raw_binary = false}; + + OPT_ARGS(opts) = { + OPT_UINT("duration", + 'd', + &cfg.duration, + "[1-24] hours: duration of the log to be printed, default is 1 hour"), + OPT_FLAG("raw-binary", + 'b', + &cfg.raw_binary, + "dump the whole log buffer in binary format"), + OPT_END()}; + + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; + + int err = parse_and_open(&dev, argc, argv, cmd->help, opts); + + if (err) + return err; + + // Check parameters + if (cfg.duration < 1 || cfg.duration > 24) { + fprintf(stderr, "duration must be between 1 and 24.\n"); + exit(1); + } + + // Get log + + struct performance_stats log = {0}; + + int log_size = 4 + cfg.duration * sizeof(struct performance_stats_timestamp); + // Get one more timestamp if duration is odd number to avoid non-dw alignment issues + int xfer_size = (cfg.duration % 2) > 0 ? + (4 + (cfg.duration + 1) * sizeof(struct performance_stats_timestamp)) : log_size; + + err = nvme_get_log_simple(dev_fd(dev), LID_PERFORMANCE_STATISTICS, xfer_size, &log); + if (!err) { + if (!cfg.raw_binary) + performance_stats_print(&log, dev->name, cfg.duration); + else + d_raw((unsigned char *)&log, log_size); + } else if (err > 0) { + nvme_show_status(err); + } else { + nvme_show_error("%s: %s", cmd->name, nvme_strerror(errno)); + } - dev_close(dev); return err; } diff --git a/plugins/memblaze/memblaze-nvme.h b/plugins/memblaze/memblaze-nvme.h index e25267b..6c7462f 100644 --- a/plugins/memblaze/memblaze-nvme.h +++ b/plugins/memblaze/memblaze-nvme.h @@ -9,18 +9,36 @@ PLUGIN(NAME("memblaze", "Memblaze vendor specific extensions", NVME_VERSION), COMMAND_LIST( - ENTRY("smart-log-add", "Retrieve Memblaze SMART Log, show it", mb_get_additional_smart_log) - ENTRY("get-pm-status", "Get Memblaze Power Manager Status", mb_get_powermanager_status) - ENTRY("set-pm-status", "Set Memblaze Power Manager Status", mb_set_powermanager_status) - ENTRY("select-download", "Selective Firmware Download", mb_selective_download) - ENTRY("lat-stats", "Enable and disable Latency Statistics logging", mb_set_lat_stats) - ENTRY("lat-stats-print", "Retrieve IO Latency Statistics log, show it", mb_lat_stats_log_print) - ENTRY("lat-log", "Set Memblaze High Latency Log", mb_set_high_latency_log) - ENTRY("lat-log-print", "Output Memblaze High Latency Log", mb_high_latency_log_print) - ENTRY("clear-error-log", "Clear error log", memblaze_clear_error_log) - ENTRY("smart-log-add-x", "Retrieve Memblaze SMART Log, show it", mb_get_smart_log_add) - ENTRY("lat-set-feature-x", "Set Enable/Disable for Latency Monitor feature", mb_set_latency_feature) - ENTRY("lat-get-feature-x", "Get Enabled/Disabled of Latency Monitor feature", mb_get_latency_feature) + ENTRY("smart-log-add", "Retrieve Memblaze SMART Log, show it", + mb_get_additional_smart_log) + ENTRY("get-pm-status", "Get Memblaze Power Manager Status", + mb_get_powermanager_status) + ENTRY("set-pm-status", "Set Memblaze Power Manager Status", + mb_set_powermanager_status) + ENTRY("select-download", "Selective Firmware Download", + mb_selective_download) + ENTRY("lat-stats", "Enable and disable Latency Statistics logging", + mb_set_lat_stats) + ENTRY("lat-stats-print", "Retrieve IO Latency Statistics log, show it", + mb_lat_stats_log_print) + ENTRY("lat-log", "Set Memblaze High Latency Log", + mb_set_high_latency_log) + ENTRY("lat-log-print", "Output Memblaze High Latency Log", + mb_high_latency_log_print) + ENTRY("clear-error-log", "Clear error log", + memblaze_clear_error_log) + ENTRY("smart-log-add-x", "Retrieve Memblaze SMART Log, show it", + mb_get_smart_log_add) + ENTRY("lat-set-feature-x", "Set Enable/Disable for Latency Monitor feature", + mb_set_latency_feature) + ENTRY("lat-get-feature-x", "Get Enabled/Disabled of Latency Monitor feature", + mb_get_latency_feature) + ENTRY("lat-stats-print-x", "Get Latency Statistics log and show it.", + mb_get_latency_stats) + ENTRY("lat-log-print-x", "Get High Latency log and show it.", + mb_get_high_latency_log) + ENTRY("perf-stats-print-x", "Get Performance Stat log and show it.", + mb_get_performance_stats) ) ); diff --git a/plugins/meson.build b/plugins/meson.build index bb4c9ad..146fa2a 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -26,10 +26,11 @@ if json_c_dep.found() 'plugins/wdc/wdc-utils.c', 'plugins/ymtc/ymtc-nvme.c', 'plugins/zns/zns.c', + 'plugins/ssstc/ssstc-nvme.c', ] subdir('solidigm') subdir('ocp') - if conf.has('HAVE_SED_OPAL') + if conf.get('HAVE_SED_OPAL') != 0 subdir('sed') endif endif diff --git a/plugins/micron/micron-nvme.c b/plugins/micron/micron-nvme.c index 63a7a79..ddecc97 100644 --- a/plugins/micron/micron-nvme.c +++ b/plugins/micron/micron-nvme.c @@ -132,34 +132,24 @@ static enum eDriveModel GetDriveModel(int idx) if (vendor_id == MICRON_VENDOR_ID) { switch (device_id) { case 0x5196: - fallthrough; case 0x51A0: - fallthrough; case 0x51A1: - fallthrough; case 0x51A2: eModel = M51AX; break; case 0x51B0: - fallthrough; case 0x51B1: - fallthrough; case 0x51B2: eModel = M51BX; break; case 0x51C0: - fallthrough; case 0x51C1: - fallthrough; case 0x51C2: - fallthrough; case 0x51C3: eModel = M51CX; break; case 0x5405: - fallthrough; case 0x5406: - fallthrough; case 0x5407: eModel = M5407; break; @@ -226,7 +216,6 @@ static int SetupDebugDataDirectories(char *strSN, char *strFilePath, int length = 0; int nIndex = 0; char *strTemp = NULL; - struct stat dirStat; int j; int k = 0; int i = 0; @@ -304,18 +293,17 @@ static int SetupDebugDataDirectories(char *strSN, char *strFilePath, strMainDirName[nIndex] = '\0'; j = 1; - while (!stat(strMainDirName, &dirStat)) { + while (mkdir(strMainDirName, 0777) < 0) { + if (errno != EEXIST) { + err = -1; + goto exit_status; + } strMainDirName[nIndex] = '\0'; sprintf(strAppend, "-%d", j); strcat(strMainDirName, strAppend); j++; } - if (mkdir(strMainDirName, 0777) < 0) { - err = -1; - goto exit_status; - } - if (strOSDirName) { sprintf(strOSDirName, "%s/%s", strMainDirName, "OS"); if (mkdir(strOSDirName, 0777) < 0) { @@ -331,7 +319,7 @@ static int SetupDebugDataDirectories(char *strSN, char *strFilePath, rmdir(strOSDirName); rmdir(strMainDirName); err = -1; - } + } } exit_status: @@ -3217,28 +3205,20 @@ static int micron_internal_logs(int argc, char **argv, struct command *cmd, err = -1; switch (aVendorLogs[i].ucLogPage) { case 0xE1: - fallthrough; case 0xE5: - fallthrough; case 0xE9: err = 1; break; case 0xE2: - fallthrough; case 0xE3: - fallthrough; case 0xE4: - fallthrough; case 0xE8: - fallthrough; case 0xEA: err = get_common_log(dev_fd(dev), aVendorLogs[i].ucLogPage, &dataBuffer, &bSize); break; case 0xC1: - fallthrough; case 0xC2: - fallthrough; case 0xC4: err = GetLogPageSize(dev_fd(dev), aVendorLogs[i].ucLogPage, &bSize); @@ -3247,7 +3227,6 @@ static int micron_internal_logs(int argc, char **argv, struct command *cmd, &dataBuffer, bSize); break; case 0xE6: - fallthrough; case 0xE7: puiIDDBuf = (unsigned int *)&ctrl; uiMask = puiIDDBuf[1015]; @@ -3273,11 +3252,8 @@ static int micron_internal_logs(int argc, char **argv, struct command *cmd, } break; case 0xF7: - fallthrough; case 0xF9: - fallthrough; case 0xFC: - fallthrough; case 0xFD: if (eModel == M51BX) (void)NVMEResetLog(dev_fd(dev), aVendorLogs[i].ucLogPage, diff --git a/plugins/nbft/nbft-plugin.c b/plugins/nbft/nbft-plugin.c index 2193ffb..1bb60be 100644 --- a/plugins/nbft/nbft-plugin.c +++ b/plugins/nbft/nbft-plugin.c @@ -4,11 +4,12 @@ #include #include +#include #include "nvme-print.h" #include "nvme.h" #include "nbft.h" -#include "libnvme.h" #include "fabrics.h" +#include "util/logging.h" #define CREATE_CMD #include "nbft-plugin.h" @@ -168,7 +169,11 @@ static json_object *ssns_to_json(struct nbft_info_subsystem_ns *ss) || json_object_add_value_int(ss_json, "pdu_header_digest_required", ss->pdu_header_digest_required) || json_object_add_value_int(ss_json, "data_digest_required", - ss->data_digest_required)) + ss->data_digest_required) + || json_object_add_value_int(ss_json, "discovered", + ss->discovered) + || json_object_add_value_int(ss_json, "unavailable", + ss->unavailable)) goto fail; return ss_json; @@ -319,7 +324,7 @@ static int json_show_nbfts(struct list_head *nbft_list, bool show_subsys, bool show_hfi, bool show_discovery) { struct json_object *nbft_json_array, *nbft_json; - struct nbft_file_entry *entry; + struct nbft_file_entry *entry = NULL; nbft_json_array = json_create_array(); if (!nbft_json_array) @@ -510,7 +515,7 @@ static void normal_show_nbfts(struct list_head *nbft_list, bool show_subsys, bool show_hfi, bool show_discovery) { bool not_first = false; - struct nbft_file_entry *entry; + struct nbft_file_entry *entry = NULL; list_for_each(nbft_list, entry, node) { if (not_first) @@ -529,6 +534,8 @@ int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin) enum nvme_print_flags flags; int ret; bool show_subsys = false, show_hfi = false, show_discovery = false; + unsigned int verbose = 0; + nvme_root_t r; OPT_ARGS(opts) = { OPT_FMT("output-format", 'o', &format, "Output format: normal|json"), @@ -536,6 +543,7 @@ int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin) OPT_FLAG("hfi", 'H', &show_hfi, "show NBFT HFIs"), OPT_FLAG("discovery", 'd', &show_discovery, "show NBFT discovery controllers"), OPT_STRING("nbft-path", 0, "STR", &nbft_path, "user-defined path for NBFT tables"), + OPT_INCR("verbose", 'v', &verbose, "Increase logging verbosity"), OPT_END() }; @@ -543,10 +551,15 @@ int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin) if (ret) return ret; + log_level = map_log_level(verbose, false /* quiet */); + ret = validate_output_format(format, &flags); if (ret < 0) return ret; + /* initialize libnvme logging */ + r = nvme_create_root(stderr, log_level); + if (!(show_subsys || show_hfi || show_discovery)) show_subsys = show_hfi = show_discovery = true; @@ -559,5 +572,6 @@ int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin) ret = json_show_nbfts(&nbft_list, show_subsys, show_hfi, show_discovery); free_nbfts(&nbft_list); } + nvme_free_tree(r); return ret; } diff --git a/plugins/netapp/netapp-nvme.c b/plugins/netapp/netapp-nvme.c index 2ecdcc5..99f0a20 100644 --- a/plugins/netapp/netapp-nvme.c +++ b/plugins/netapp/netapp-nvme.c @@ -46,12 +46,14 @@ enum { enum { ONTAP_C2_LOG_SUPPORTED_LSP = 0x0, ONTAP_C2_LOG_NSINFO_LSP = 0x1, + ONTAP_C2_LOG_PLATFORM_LSP = 0x2, }; enum { - ONTAP_VSERVER_TLV = 0x11, - ONTAP_VOLUME_TLV = 0x12, - ONTAP_NS_TLV = 0x13, + ONTAP_VSERVER_NAME_TLV = 0x11, + ONTAP_VOLUME_NAME_TLV = 0x12, + ONTAP_NS_NAME_TLV = 0x13, + ONTAP_NS_PATH_TLV = 0x14, }; static const char *dev_path = "/dev/"; @@ -134,8 +136,10 @@ static void netapp_get_ontap_labels(char *vsname, char *nspath, unsigned char *log_data) { int lsp, tlv, label_len; - char *vserver_name, *volume_name, *namespace_name; + char *vserver_name, *volume_name, *namespace_name, *namespace_path; char vol_name[ONTAP_LABEL_LEN], ns_name[ONTAP_LABEL_LEN]; + char ns_path[ONTAP_LABEL_LEN]; + bool nspath_tlv_available = false; const char *ontap_vol = "/vol/"; int i, j; @@ -145,9 +149,9 @@ static void netapp_get_ontap_labels(char *vsname, char *nspath, /* lsp not related to nsinfo */ return; - /* get the vserver tlv and name */ + /* get the vserver name tlv */ tlv = *(__u8 *)&log_data[32]; - if (tlv == ONTAP_VSERVER_TLV) { + if (tlv == ONTAP_VSERVER_NAME_TLV) { label_len = (*(__u16 *)&log_data[34]) * 4; vserver_name = (char *)&log_data[36]; ontap_labels_to_str(vsname, vserver_name, label_len); @@ -159,9 +163,9 @@ static void netapp_get_ontap_labels(char *vsname, char *nspath, i = 36 + label_len; j = i + 2; - /* get the volume tlv and name */ + /* get the volume name tlv */ tlv = *(__u8 *)&log_data[i]; - if (tlv == ONTAP_VOLUME_TLV) { + if (tlv == ONTAP_VOLUME_NAME_TLV) { label_len = (*(__u16 *)&log_data[j]) * 4; volume_name = (char *)&log_data[j + 2]; ontap_labels_to_str(vol_name, volume_name, label_len); @@ -173,9 +177,9 @@ static void netapp_get_ontap_labels(char *vsname, char *nspath, i += 4 + label_len; j += 4 + label_len; - /* get the namespace tlv and name */ + /* get the namespace name tlv */ tlv = *(__u8 *)&log_data[i]; - if (tlv == ONTAP_NS_TLV) { + if (tlv == ONTAP_NS_NAME_TLV) { label_len = (*(__u16 *)&log_data[j]) * 4; namespace_name = (char *)&log_data[j + 2]; ontap_labels_to_str(ns_name, namespace_name, label_len); @@ -185,8 +189,25 @@ static void netapp_get_ontap_labels(char *vsname, char *nspath, return; } - snprintf(nspath, ONTAP_NS_PATHLEN, "%s%s%s%s", ontap_vol, + i += 4 + label_len; + j += 4 + label_len; + /* get the namespace path tlv if available */ + tlv = *(__u8 *)&log_data[i]; + if (tlv == ONTAP_NS_PATH_TLV) { + nspath_tlv_available = true; + label_len = (*(__u16 *)&log_data[j]) * 4; + namespace_path = (char *)&log_data[j + 2]; + ontap_labels_to_str(ns_path, namespace_path, label_len); + } + + if (nspath_tlv_available) { + /* set nspath from the corresponding ns_path string */ + snprintf(nspath, ONTAP_NS_PATHLEN, "%s", ns_path); + } else { + /* set nspath by concatenating ontap_vol with ns_name */ + snprintf(nspath, ONTAP_NS_PATHLEN, "%s%s%s%s", ontap_vol, vol_name, "/", ns_name); + } } static void netapp_smdevice_json(struct json_object *devices, char *devname, diff --git a/plugins/ocp/ocp-clear-features.c b/plugins/ocp/ocp-clear-features.c index 0f49584..731dfea 100644 --- a/plugins/ocp/ocp-clear-features.c +++ b/plugins/ocp/ocp-clear-features.c @@ -18,7 +18,7 @@ static int ocp_clear_feature(int argc, char **argv, const char *desc, const __u8 __u32 result = 0; __u32 clear = 1 << 31; struct nvme_dev *dev; - int uuid_index = 0; + __u8 uuid_index = 0; bool uuid = true; int err; diff --git a/plugins/ocp/ocp-fw-activation-history.c b/plugins/ocp/ocp-fw-activation-history.c index ad96c6b..16598a0 100644 --- a/plugins/ocp/ocp-fw-activation-history.c +++ b/plugins/ocp/ocp-fw-activation-history.c @@ -66,7 +66,7 @@ static void ocp_fw_activation_history_normal(const struct fw_activation_history printf(" %-22s%d\n", "activation count:", le16_to_cpu(entry->activation_count)); printf(" %-22s%"PRIu64"\n", "timestamp:", - le64_to_cpu(entry->timestamp)); + (0x0000FFFFFFFFFFFF & le64_to_cpu(entry->timestamp))); printf(" %-22s%"PRIu64"\n", "power cycle count:", le64_to_cpu(entry->power_cycle_count)); printf(" %-22s%.*s\n", "previous firmware:", (int)sizeof(entry->previous_fw), @@ -106,7 +106,7 @@ static void ocp_fw_activation_history_json(const struct fw_activation_history *f json_object_add_value_uint(entry_obj, "activation count", le16_to_cpu(entry->activation_count)); json_object_add_value_uint64(entry_obj, "timestamp", - le64_to_cpu(entry->timestamp)); + (0x0000FFFFFFFFFFFF & le64_to_cpu(entry->timestamp))); json_object_add_value_uint(entry_obj, "power cycle count", le64_to_cpu(entry->power_cycle_count)); @@ -162,7 +162,7 @@ int ocp_fw_activation_history_log(int argc, char **argv, struct command *cmd, if (err) return err; - int uuid_index = 0; + __u8 uuid_index = 0; /* * Best effort attempt at uuid. Otherwise, assume no index (i.e. 0) diff --git a/plugins/ocp/ocp-nvme.c b/plugins/ocp/ocp-nvme.c index 53ae0f4..6eaa773 100644 --- a/plugins/ocp/ocp-nvme.c +++ b/plugins/ocp/ocp-nvme.c @@ -705,7 +705,7 @@ static int eol_plp_failure_mode_set(struct nvme_dev *dev, const __u32 nsid, { __u32 result; int err; - int uuid_index = 0; + __u8 uuid_index = 0; if (uuid) { /* OCP 2.0 requires UUID index support */ @@ -2056,6 +2056,90 @@ static int ocp_device_capabilities_log(int argc, char **argv, struct command *cm return ret; } +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/// Set Telemetry Profile (Feature Identifier C8h) Set Feature + +static int ocp_set_telemetry_profile(struct nvme_dev *dev, __u8 tps) +{ + __u32 result; + int err; + __u8 uuid_index = 0; + + /* OCP 2.0 requires UUID index support */ + err = ocp_get_uuid_index(dev, &uuid_index); + if (err || !uuid_index) { + nvme_show_error("ERROR: No OCP UUID index found"); + return err; + } + + struct nvme_set_features_args args = { + .args_size = sizeof(args), + .fd = dev_fd(dev), + .fid = 0xC8, + .nsid = 0xFFFFFFFF, + .cdw11 = tps, + .cdw12 = 0, + .save = true, + .uuidx = uuid_index, + .cdw15 = 0, + .data_len = 0, + .data = NULL, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .result = &result, + }; + + err = nvme_set_features(&args); + if (err > 0) { + nvme_show_status(err); + } else if (err < 0) { + nvme_show_perror("Set Telemetry Profile"); + fprintf(stderr, "Command failed while parsing.\n"); + } else { + printf("Successfully Set Telemetry Profile (feature: 0xC8) to below values\n"); + printf("Telemetry Profile Select: 0x%x\n", tps); + } + + return err; +} + +static int ocp_set_telemetry_profile_feature(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + const char *desc = "Set Telemetry Profile (Feature Identifier C8h) Set Feature."; + const char *tps = "Telemetry Profile Select for device debug data collection"; + struct nvme_dev *dev; + int err; + + struct config { + __u8 tps; + }; + + struct config cfg = { + .tps = 0, + }; + + OPT_ARGS(opts) = { + OPT_BYTE("telemetry-profile-select", 't', &cfg.tps, tps), + OPT_END() + }; + + err = parse_and_open(&dev, argc, argv, desc, opts); + if (err) + return err; + + if (argconfig_parse_seen(opts, "telemetry-profile-select")) + err = ocp_set_telemetry_profile(dev, cfg.tps); + else + nvme_show_error("Telemetry Profile Select is a required argument"); + + dev_close(dev); + + return err; +} + /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @@ -2068,7 +2152,7 @@ static int set_dssd_power_state(struct nvme_dev *dev, const __u32 nsid, { __u32 result; int err; - int uuid_index = 0; + __u8 uuid_index = 0; if (uuid) { /* OCP 2.0 requires UUID index support */ @@ -2143,7 +2227,7 @@ static int set_dssd_power_state_feature(int argc, char **argv, struct command *c if (err) return err; - if (argconfig_parse_seen(opts, "power state")) + if (argconfig_parse_seen(opts, "power-state")) err = set_dssd_power_state(dev, nsid, fid, cfg.power_state, cfg.save, !argconfig_parse_seen(opts, "no-uuid")); @@ -2160,137 +2244,271 @@ static int set_dssd_power_state_feature(int argc, char **argv, struct command *c /// plp_health_check_interval static int set_plp_health_check_interval(int argc, char **argv, struct command *cmd, - struct plugin *plugin) + struct plugin *plugin) { - const char *desc = "Define Issue Set Feature command (FID : 0xC6) PLP Health Check Interval"; - const char *plp_health_interval = "[31:16]:PLP Health Check Interval"; - const char *save = "Specifies that the controller shall save the attribute"; - const __u32 nsid = 0; - const __u8 fid = 0xc6; - struct nvme_dev *dev; - int err; - __u32 result; - int uuid_index = 0; - - struct config { - __le16 plp_health_interval; - bool save; - }; - - struct config cfg = { - .plp_health_interval = 0, - .save = false, - }; - - OPT_ARGS(opts) = { - OPT_BYTE("plp_health_interval", 'p', &cfg.plp_health_interval, plp_health_interval), - OPT_FLAG("save", 's', &cfg.save, save), - OPT_FLAG("no-uuid", 'n', NULL, - "Skip UUID index search (UUID index not required for OCP 1.0)"), - OPT_END() - }; - - err = parse_and_open(&dev, argc, argv, desc, opts); - if (err) - return err; - - - if (!argconfig_parse_seen(opts, "no-uuid")) { - /* OCP 2.0 requires UUID index support */ - err = ocp_get_uuid_index(dev, &uuid_index); - if (err || !uuid_index) { - printf("ERROR: No OCP UUID index found"); - return err; - } - } - - - struct nvme_set_features_args args = { - .args_size = sizeof(args), - .fd = dev_fd(dev), - .fid = fid, - .nsid = nsid, - .cdw11 = cfg.plp_health_interval << 16, - .cdw12 = 0, - .save = cfg.save, - .uuidx = uuid_index, - .cdw15 = 0, - .data_len = 0, - .data = NULL, - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .result = &result, - }; - - err = nvme_set_features(&args); - if (err > 0) { - nvme_show_status(err); - } else if (err < 0) { - nvme_show_perror("Define PLP Health Check Interval"); - fprintf(stderr, "Command failed while parsing.\n"); - } else { - printf("Successfully set the PLP Health Check Interval"); - printf("PLP Health Check Interval: 0x%x\n", cfg.plp_health_interval); - printf("Save bit Value: 0x%x\n", cfg.save); - } - return err; + const char *desc = "Define Issue Set Feature command (FID : 0xC6) PLP Health Check Interval"; + const char *plp_health_interval = "[31:16]:PLP Health Check Interval"; + const char *save = "Specifies that the controller shall save the attribute"; + const __u32 nsid = 0; + const __u8 fid = 0xc6; + struct nvme_dev *dev; + int err; + __u32 result; + __u8 uuid_index = 0; + + struct config { + __le16 plp_health_interval; + bool save; + }; + + struct config cfg = { + .plp_health_interval = 0, + .save = false, + }; + + OPT_ARGS(opts) = { + OPT_BYTE("plp_health_interval", 'p', &cfg.plp_health_interval, plp_health_interval), + OPT_FLAG("save", 's', &cfg.save, save), + OPT_FLAG("no-uuid", 'n', NULL, + "Skip UUID index search (UUID index not required for OCP 1.0)"), + OPT_END() + }; + + err = parse_and_open(&dev, argc, argv, desc, opts); + if (err) + return err; + + + if (!argconfig_parse_seen(opts, "no-uuid")) { + /* OCP 2.0 requires UUID index support */ + err = ocp_get_uuid_index(dev, &uuid_index); + if (err || !uuid_index) { + printf("ERROR: No OCP UUID index found"); + return err; + } + } + + + struct nvme_set_features_args args = { + .args_size = sizeof(args), + .fd = dev_fd(dev), + .fid = fid, + .nsid = nsid, + .cdw11 = cfg.plp_health_interval << 16, + .cdw12 = 0, + .save = cfg.save, + .uuidx = uuid_index, + .cdw15 = 0, + .data_len = 0, + .data = NULL, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .result = &result, + }; + + err = nvme_set_features(&args); + if (err > 0) { + nvme_show_status(err); + } else if (err < 0) { + nvme_show_perror("Define PLP Health Check Interval"); + fprintf(stderr, "Command failed while parsing.\n"); + } else { + printf("Successfully set the PLP Health Check Interval"); + printf("PLP Health Check Interval: 0x%x\n", cfg.plp_health_interval); + printf("Save bit Value: 0x%x\n", cfg.save); + } + return err; } static int get_plp_health_check_interval(int argc, char **argv, struct command *cmd, - struct plugin *plugin) + struct plugin *plugin) { - const char *desc = "Define Issue Get Feature command (FID : 0xC6) PLP Health Check Interval"; - const char *sel = "[0-3,8]: current/default/saved/supported/changed"; - const __u32 nsid = 0; - const __u8 fid = 0xc6; - struct nvme_dev *dev; - __u32 result; - int err; - - struct config { - __u8 sel; - }; - - struct config cfg = { - .sel = 0, - }; - - OPT_ARGS(opts) = { - OPT_BYTE("sel", 'S', &cfg.sel, sel), - OPT_END() - }; - - err = parse_and_open(&dev, argc, argv, desc, opts); - if (err) - return err; - - - struct nvme_get_features_args args = { - .args_size = sizeof(args), - .fd = dev_fd(dev), - .fid = fid, - .nsid = nsid, - .sel = cfg.sel, - .cdw11 = 0, - .uuidx = 0, - .data_len = 0, - .data = NULL, - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .result = &result, - }; - - err = nvme_get_features(&args); - if (!err) { - printf("get-feature:0xC6 %s value: %#08x\n", nvme_select_to_string(cfg.sel), result); - - if (cfg.sel == NVME_GET_FEATURES_SEL_SUPPORTED) - nvme_show_select_result(fid, result); - } else { - nvme_show_error("Could not get feature: 0xC6"); - } - - return err; + const char *desc = "Define Issue Get Feature command (FID : 0xC6) PLP Health Check Interval"; + const char *sel = "[0-3,8]: current/default/saved/supported/changed"; + const __u32 nsid = 0; + const __u8 fid = 0xc6; + struct nvme_dev *dev; + __u32 result; + int err; + + struct config { + __u8 sel; + }; + + struct config cfg = { + .sel = 0, + }; + + OPT_ARGS(opts) = { + OPT_BYTE("sel", 'S', &cfg.sel, sel), + OPT_END() + }; + + err = parse_and_open(&dev, argc, argv, desc, opts); + if (err) + return err; + + + struct nvme_get_features_args args = { + .args_size = sizeof(args), + .fd = dev_fd(dev), + .fid = fid, + .nsid = nsid, + .sel = cfg.sel, + .cdw11 = 0, + .uuidx = 0, + .data_len = 0, + .data = NULL, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .result = &result, + }; + + err = nvme_get_features(&args); + if (!err) { + printf("get-feature:0xC6 %s value: %#08x\n", nvme_select_to_string(cfg.sel), result); + + if (cfg.sel == NVME_GET_FEATURES_SEL_SUPPORTED) + nvme_show_select_result(fid, result); + } else { + nvme_show_error("Could not get feature: 0xC6"); + } + + return err; +} + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/// dssd_async_event_config + +static int set_dssd_async_event_config(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + + const char *desc = "Issue Set Feature command (FID : 0xC9) DSSD Async Event Config"; + const char *epn = "[0]:Enable Panic Notices"; + const char *save = "Specifies that the controller shall save the attribute"; + const __u32 nsid = 0; + const __u8 fid = 0xc9; + struct nvme_dev *dev; + int err; + __u32 result; + __u8 uuid_index = 0; + + struct config { + bool epn; + bool save; + }; + + struct config cfg = { + .epn = false, + .save = false, + }; + + OPT_ARGS(opts) = { + OPT_FLAG("enable-panic-notices", 'e', &cfg.epn, epn), + OPT_FLAG("save", 's', &cfg.save, save), + OPT_END() + }; + + err = parse_and_open(&dev, argc, argv, desc, opts); + if (err) + return err; + + /* OCP 2.0 requires UUID index support */ + err = ocp_get_uuid_index(dev, &uuid_index); + if (err || !uuid_index) { + printf("ERROR: No OCP UUID index found\n"); + return err; + } + + struct nvme_set_features_args args = { + .args_size = sizeof(args), + .fd = dev_fd(dev), + .fid = fid, + .nsid = nsid, + .cdw11 = cfg.epn ? 1 : 0, + .cdw12 = 0, + .save = cfg.save, + .uuidx = uuid_index, + .cdw15 = 0, + .data_len = 0, + .data = NULL, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .result = &result, + }; + + err = nvme_set_features(&args); + if (err > 0) { + nvme_show_status(err); + } else if (err < 0) { + nvme_show_perror("Set DSSD Asynchronous Event Configuration\n"); + fprintf(stderr, "Command failed while parsing.\n"); + } else { + printf("Successfully set the DSSD Asynchronous Event Configuration\n"); + printf("Enable Panic Notices bit Value: 0x%x\n", cfg.epn); + printf("Save bit Value: 0x%x\n", cfg.save); + } + return err; +} + +static int get_dssd_async_event_config(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + + const char *desc = "Issue Get Feature command (FID : 0xC9) DSSD Async Event Config"; + const char *sel = "[0-3]: current/default/saved/supported"; + const __u32 nsid = 0; + const __u8 fid = 0xc9; + struct nvme_dev *dev; + __u32 result; + int err; + + struct config { + __u8 sel; + }; + + struct config cfg = { + .sel = 0, + }; + + OPT_ARGS(opts) = { + OPT_BYTE("sel", 'S', &cfg.sel, sel), + OPT_END() + }; + + err = parse_and_open(&dev, argc, argv, desc, opts); + if (err) + return err; + + + struct nvme_get_features_args args = { + .args_size = sizeof(args), + .fd = dev_fd(dev), + .fid = fid, + .nsid = nsid, + .sel = cfg.sel, + .cdw11 = 0, + .uuidx = 0, + .data_len = 0, + .data = NULL, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .result = &result, + }; + + err = nvme_get_features(&args); + if (!err) { + printf("get-feature:0xC9 %s value: %#08x\n", nvme_select_to_string(cfg.sel), result); + + if (cfg.sel == NVME_GET_FEATURES_SEL_SUPPORTED) + nvme_show_select_result(fid, result); + } else { + nvme_show_error("Could not get feature: 0xC9\n"); + } + + return err; } /////////////////////////////////////////////////////////////////////////////// @@ -2342,36 +2560,36 @@ static int get_plp_health_check_interval(int argc, char **argv, struct command * * @reserved3: reserved */ struct __attribute__((__packed__)) telemetry_str_log_format { - __u8 log_page_version; - __u8 reserved1[15]; - __u8 log_page_guid[C9_GUID_LENGTH]; - __le64 sls; - __u8 reserved2[24]; - __le64 sits; - __le64 sitsz; - __le64 ests; - __le64 estsz; - __le64 vu_eve_sts; - __le64 vu_eve_st_sz; - __le64 ascts; - __le64 asctsz; - __u8 fifo1[16]; - __u8 fifo2[16]; - __u8 fifo3[16]; - __u8 fifo4[16]; - __u8 fifo5[16]; - __u8 fifo6[16]; - __u8 fifo7[16]; - __u8 fifo8[16]; - __u8 fifo9[16]; - __u8 fifo10[16]; - __u8 fifo11[16]; - __u8 fifo12[16]; - __u8 fifo13[16]; - __u8 fifo14[16]; - __u8 fifo15[16]; - __u8 fifo16[16]; - __u8 reserved3[48]; + __u8 log_page_version; + __u8 reserved1[15]; + __u8 log_page_guid[C9_GUID_LENGTH]; + __le64 sls; + __u8 reserved2[24]; + __le64 sits; + __le64 sitsz; + __le64 ests; + __le64 estsz; + __le64 vu_eve_sts; + __le64 vu_eve_st_sz; + __le64 ascts; + __le64 asctsz; + __u8 fifo1[16]; + __u8 fifo2[16]; + __u8 fifo3[16]; + __u8 fifo4[16]; + __u8 fifo5[16]; + __u8 fifo6[16]; + __u8 fifo7[16]; + __u8 fifo8[16]; + __u8 fifo9[16]; + __u8 fifo10[16]; + __u8 fifo11[16]; + __u8 fifo12[16]; + __u8 fifo13[16]; + __u8 fifo14[16]; + __u8 fifo15[16]; + __u8 fifo16[16]; + __u8 reserved3[48]; }; /* @@ -2385,11 +2603,11 @@ struct __attribute__((__packed__)) telemetry_str_log_format { * @reserved2 reserved */ struct __attribute__((__packed__)) statistics_id_str_table_entry { - __le16 vs_si; - __u8 reserved1; - __u8 ascii_id_len; - __le64 ascii_id_ofst; - __le32 reserved2; + __le16 vs_si; + __u8 reserved1; + __u8 ascii_id_len; + __le64 ascii_id_ofst; + __le32 reserved2; }; /* @@ -2402,11 +2620,11 @@ struct __attribute__((__packed__)) statistics_id_str_table_entry { * @reserved2 reserved */ struct __attribute__((__packed__)) event_id_str_table_entry { - __u8 deb_eve_class; - __le16 ei; - __u8 ascii_id_len; - __le64 ascii_id_ofst; - __le32 reserved2; + __u8 deb_eve_class; + __le16 ei; + __u8 ascii_id_len; + __le64 ascii_id_ofst; + __le32 reserved2; }; /* @@ -2419,525 +2637,525 @@ struct __attribute__((__packed__)) event_id_str_table_entry { * @reserved reserved */ struct __attribute__((__packed__)) vu_event_id_str_table_entry { - __u8 deb_eve_class; - __le16 vu_ei; - __u8 ascii_id_len; - __le64 ascii_id_ofst; - __le32 reserved; + __u8 deb_eve_class; + __le16 vu_ei; + __u8 ascii_id_len; + __le64 ascii_id_ofst; + __le32 reserved; }; /* Function declaration for Telemetry String Log Format (LID:C9h) */ static int ocp_telemetry_str_log_format(int argc, char **argv, struct command *cmd, - struct plugin *plugin); + struct plugin *plugin); static int ocp_print_C9_log_normal(struct telemetry_str_log_format *log_data,__u8 *log_data_buf) { - //calculating the index value for array - __le64 stat_id_index = (log_data->sitsz * 4) / 16; - __le64 eve_id_index = (log_data->estsz * 4) / 16; - __le64 vu_eve_index = (log_data->vu_eve_st_sz * 4) / 16; - __le64 ascii_table_index = (log_data->asctsz * 4); - //Calculating the offset for dynamic fields. - __le64 stat_id_str_table_ofst = C9_TELEMETRY_STR_LOG_SIST_OFST + (log_data->sitsz * 4); - __le64 event_str_table_ofst = stat_id_str_table_ofst + (log_data->estsz * 4); - __le64 vu_event_str_table_ofst = event_str_table_ofst + (log_data->vu_eve_st_sz * 4); - __le64 ascii_table_ofst = vu_event_str_table_ofst + (log_data->asctsz * 4); - struct statistics_id_str_table_entry stat_id_str_table_arr[stat_id_index]; - struct event_id_str_table_entry event_id_str_table_arr[eve_id_index]; - struct vu_event_id_str_table_entry vu_event_id_str_table_arr[vu_eve_index]; - __u8 ascii_table_info_arr[ascii_table_index]; - int j; - - printf(" Log Page Version : 0x%x\n", log_data->log_page_version); - - printf(" Reserved : "); - for (j = 0; j < 15; j++) - printf("%d", log_data->reserved1[j]); - printf("\n"); - - printf(" Log page GUID : 0x"); - for (j = C9_GUID_LENGTH - 1; j >= 0; j--) - printf("%x", log_data->log_page_guid[j]); - printf("\n"); - - printf(" Telemetry String Log Size : 0x%lx\n", le64_to_cpu(log_data->sls)); - - printf(" Reserved : "); - for (j = 0; j < 24; j++) - printf("%d", log_data->reserved2[j]); - printf("\n"); - - printf(" Statistics Identifier String Table Start : 0x%lx\n", le64_to_cpu(log_data->sits)); - printf(" Statistics Identifier String Table Size : 0x%lx\n", le64_to_cpu(log_data->sitsz)); - printf(" Event String Table Start : 0x%lx\n", le64_to_cpu(log_data->ests)); - printf(" Event String Table Size : 0x%lx\n", le64_to_cpu(log_data->estsz)); - printf(" VU Event String Table Start : 0x%lx\n", le64_to_cpu(log_data->vu_eve_sts)); - printf(" VU Event String Table Size : 0x%lx\n", le64_to_cpu(log_data->vu_eve_st_sz)); - printf(" ASCII Table Start : 0x%lx\n", le64_to_cpu(log_data->ascts)); - printf(" ASCII Table Size : 0x%lx\n", le64_to_cpu(log_data->asctsz)); - - printf(" FIFO 1 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo1[j], log_data->fifo1[j]); - } - - printf(" FIFO 2 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo2[j], log_data->fifo2[j]); - } - - printf(" FIFO 3 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo3[j], log_data->fifo3[j]); - } - - printf(" FIFO 4 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - - printf(" %d %d %c \n", j, log_data->fifo4[j], log_data->fifo4[j]); - } - - printf(" FIFO 5 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo5[j], log_data->fifo5[j]); - } - - printf(" FIFO 6 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo6[j], log_data->fifo6[j]); - } - - printf(" FIFO 7 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo7[j], log_data->fifo7[j]); - } - - printf(" FIFO 8 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf("index value ascii_val"); - printf(" %d %d %c \n", j, log_data->fifo8[j], log_data->fifo8[j]); - } - - printf(" FIFO 9 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo9[j], log_data->fifo9[j]); - } - - printf(" FIFO 10 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo10[j], log_data->fifo10[j]); - } - - printf(" FIFO 11 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo11[j], log_data->fifo11[j]); - } - - printf(" FIFO 12 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo12[j], log_data->fifo12[j]); - } - - printf(" FIFO 13 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo13[j], log_data->fifo13[j]); - } - - printf(" FIFO 14 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo14[j], log_data->fifo14[j]); - } - - printf(" FIFO 15 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo15[j], log_data->fifo16[j]); - } - - printf(" FIFO 16 ASCII String\n"); - printf(" index value ascii_val\n"); - for (j = 0; j < 16; j++){ - printf(" %d %d %c \n", j, log_data->fifo16[j], log_data->fifo16[j]); - } - - printf(" Reserved : "); - for (j = 0; j < 48; j++) - printf("%d", log_data->reserved3[j]); - printf("\n"); - - memcpy(stat_id_str_table_arr, (__u8*)log_data_buf + stat_id_str_table_ofst, (log_data->sitsz * 4)); - memcpy(event_id_str_table_arr, (__u8*)log_data_buf + event_str_table_ofst, (log_data->estsz * 4)); - memcpy(vu_event_id_str_table_arr, (__u8*)log_data_buf + vu_event_str_table_ofst, (log_data->vu_eve_st_sz * 4)); - memcpy(ascii_table_info_arr, (__u8*)log_data_buf + ascii_table_ofst, (log_data->asctsz * 4)); - - printf(" Statistics Identifier String Table\n"); - for (j = 0; j < stat_id_index; j++){ - printf(" Vendor Specific Statistic Identifier : 0x%x\n",le16_to_cpu(stat_id_str_table_arr[j].vs_si)); - printf(" Reserved : 0x%d",stat_id_str_table_arr[j].reserved1); - printf(" ASCII ID Length : 0x%x\n",stat_id_str_table_arr[j].ascii_id_len); - printf(" ASCII ID offset : 0x%lx\n",le64_to_cpu(stat_id_str_table_arr[j].ascii_id_ofst)); - printf(" Reserved : 0x%d\n",stat_id_str_table_arr[j].reserved2); - } - - printf(" Event Identifier String Table Entry\n"); - for (j = 0; j < eve_id_index; j++){ - printf(" Debug Event Class : 0x%x\n",event_id_str_table_arr[j].deb_eve_class); - printf(" Event Identifier : 0x%x\n",le16_to_cpu(event_id_str_table_arr[j].ei)); - printf(" ASCII ID Length : 0x%x\n",event_id_str_table_arr[j].ascii_id_len); - printf(" ASCII ID offset : 0x%lx\n",le64_to_cpu(event_id_str_table_arr[j].ascii_id_ofst)); - printf(" Reserved : 0x%d\n",event_id_str_table_arr[j].reserved2); - - } - - printf(" VU Event Identifier String Table Entry\n"); - for (j = 0; j < vu_eve_index; j++){ - printf(" Debug Event Class : 0x%x\n",vu_event_id_str_table_arr[j].deb_eve_class); - printf(" VU Event Identifier : 0x%x\n",le16_to_cpu(vu_event_id_str_table_arr[j].vu_ei)); - printf(" ASCII ID Length : 0x%x\n",vu_event_id_str_table_arr[j].ascii_id_len); - printf(" ASCII ID offset : 0x%lx\n",le64_to_cpu(vu_event_id_str_table_arr[j].ascii_id_ofst)); - printf(" Reserved : 0x%d\n",vu_event_id_str_table_arr[j].reserved); - - } - - printf(" ASCII Table\n"); - printf(" Byte Data_Byte ASCII_Character\n"); - for (j = 0; j < ascii_table_index; j++){ - printf(" %lld 0x%x %c \n",ascii_table_ofst+j,ascii_table_info_arr[j],ascii_table_info_arr[j]); - } - return 0; + //calculating the index value for array + __le64 stat_id_index = (log_data->sitsz * 4) / 16; + __le64 eve_id_index = (log_data->estsz * 4) / 16; + __le64 vu_eve_index = (log_data->vu_eve_st_sz * 4) / 16; + __le64 ascii_table_index = (log_data->asctsz * 4); + //Calculating the offset for dynamic fields. + __le64 stat_id_str_table_ofst = C9_TELEMETRY_STR_LOG_SIST_OFST + (log_data->sitsz * 4); + __le64 event_str_table_ofst = stat_id_str_table_ofst + (log_data->estsz * 4); + __le64 vu_event_str_table_ofst = event_str_table_ofst + (log_data->vu_eve_st_sz * 4); + __le64 ascii_table_ofst = vu_event_str_table_ofst + (log_data->asctsz * 4); + struct statistics_id_str_table_entry stat_id_str_table_arr[stat_id_index]; + struct event_id_str_table_entry event_id_str_table_arr[eve_id_index]; + struct vu_event_id_str_table_entry vu_event_id_str_table_arr[vu_eve_index]; + __u8 ascii_table_info_arr[ascii_table_index]; + int j; + + printf(" Log Page Version : 0x%x\n", log_data->log_page_version); + + printf(" Reserved : "); + for (j = 0; j < 15; j++) + printf("%d", log_data->reserved1[j]); + printf("\n"); + + printf(" Log page GUID : 0x"); + for (j = C9_GUID_LENGTH - 1; j >= 0; j--) + printf("%x", log_data->log_page_guid[j]); + printf("\n"); + + printf(" Telemetry String Log Size : 0x%lx\n", le64_to_cpu(log_data->sls)); + + printf(" Reserved : "); + for (j = 0; j < 24; j++) + printf("%d", log_data->reserved2[j]); + printf("\n"); + + printf(" Statistics Identifier String Table Start : 0x%lx\n", le64_to_cpu(log_data->sits)); + printf(" Statistics Identifier String Table Size : 0x%lx\n", le64_to_cpu(log_data->sitsz)); + printf(" Event String Table Start : 0x%lx\n", le64_to_cpu(log_data->ests)); + printf(" Event String Table Size : 0x%lx\n", le64_to_cpu(log_data->estsz)); + printf(" VU Event String Table Start : 0x%lx\n", le64_to_cpu(log_data->vu_eve_sts)); + printf(" VU Event String Table Size : 0x%lx\n", le64_to_cpu(log_data->vu_eve_st_sz)); + printf(" ASCII Table Start : 0x%lx\n", le64_to_cpu(log_data->ascts)); + printf(" ASCII Table Size : 0x%lx\n", le64_to_cpu(log_data->asctsz)); + + printf(" FIFO 1 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo1[j], log_data->fifo1[j]); + } + + printf(" FIFO 2 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo2[j], log_data->fifo2[j]); + } + + printf(" FIFO 3 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo3[j], log_data->fifo3[j]); + } + + printf(" FIFO 4 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + + printf(" %d %d %c \n", j, log_data->fifo4[j], log_data->fifo4[j]); + } + + printf(" FIFO 5 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo5[j], log_data->fifo5[j]); + } + + printf(" FIFO 6 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo6[j], log_data->fifo6[j]); + } + + printf(" FIFO 7 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo7[j], log_data->fifo7[j]); + } + + printf(" FIFO 8 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf("index value ascii_val"); + printf(" %d %d %c \n", j, log_data->fifo8[j], log_data->fifo8[j]); + } + + printf(" FIFO 9 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo9[j], log_data->fifo9[j]); + } + + printf(" FIFO 10 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo10[j], log_data->fifo10[j]); + } + + printf(" FIFO 11 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo11[j], log_data->fifo11[j]); + } + + printf(" FIFO 12 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo12[j], log_data->fifo12[j]); + } + + printf(" FIFO 13 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo13[j], log_data->fifo13[j]); + } + + printf(" FIFO 14 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo14[j], log_data->fifo14[j]); + } + + printf(" FIFO 15 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo15[j], log_data->fifo16[j]); + } + + printf(" FIFO 16 ASCII String\n"); + printf(" index value ascii_val\n"); + for (j = 0; j < 16; j++){ + printf(" %d %d %c \n", j, log_data->fifo16[j], log_data->fifo16[j]); + } + + printf(" Reserved : "); + for (j = 0; j < 48; j++) + printf("%d", log_data->reserved3[j]); + printf("\n"); + + memcpy(stat_id_str_table_arr, (__u8*)log_data_buf + stat_id_str_table_ofst, (log_data->sitsz * 4)); + memcpy(event_id_str_table_arr, (__u8*)log_data_buf + event_str_table_ofst, (log_data->estsz * 4)); + memcpy(vu_event_id_str_table_arr, (__u8*)log_data_buf + vu_event_str_table_ofst, (log_data->vu_eve_st_sz * 4)); + memcpy(ascii_table_info_arr, (__u8*)log_data_buf + ascii_table_ofst, (log_data->asctsz * 4)); + + printf(" Statistics Identifier String Table\n"); + for (j = 0; j < stat_id_index; j++){ + printf(" Vendor Specific Statistic Identifier : 0x%x\n",le16_to_cpu(stat_id_str_table_arr[j].vs_si)); + printf(" Reserved : 0x%d",stat_id_str_table_arr[j].reserved1); + printf(" ASCII ID Length : 0x%x\n",stat_id_str_table_arr[j].ascii_id_len); + printf(" ASCII ID offset : 0x%lx\n",le64_to_cpu(stat_id_str_table_arr[j].ascii_id_ofst)); + printf(" Reserved : 0x%d\n",stat_id_str_table_arr[j].reserved2); + } + + printf(" Event Identifier String Table Entry\n"); + for (j = 0; j < eve_id_index; j++){ + printf(" Debug Event Class : 0x%x\n",event_id_str_table_arr[j].deb_eve_class); + printf(" Event Identifier : 0x%x\n",le16_to_cpu(event_id_str_table_arr[j].ei)); + printf(" ASCII ID Length : 0x%x\n",event_id_str_table_arr[j].ascii_id_len); + printf(" ASCII ID offset : 0x%lx\n",le64_to_cpu(event_id_str_table_arr[j].ascii_id_ofst)); + printf(" Reserved : 0x%d\n",event_id_str_table_arr[j].reserved2); + + } + + printf(" VU Event Identifier String Table Entry\n"); + for (j = 0; j < vu_eve_index; j++){ + printf(" Debug Event Class : 0x%x\n",vu_event_id_str_table_arr[j].deb_eve_class); + printf(" VU Event Identifier : 0x%x\n",le16_to_cpu(vu_event_id_str_table_arr[j].vu_ei)); + printf(" ASCII ID Length : 0x%x\n",vu_event_id_str_table_arr[j].ascii_id_len); + printf(" ASCII ID offset : 0x%lx\n",le64_to_cpu(vu_event_id_str_table_arr[j].ascii_id_ofst)); + printf(" Reserved : 0x%d\n",vu_event_id_str_table_arr[j].reserved); + + } + + printf(" ASCII Table\n"); + printf(" Byte Data_Byte ASCII_Character\n"); + for (j = 0; j < ascii_table_index; j++){ + printf(" %lld 0x%x %c \n",ascii_table_ofst+j,ascii_table_info_arr[j],ascii_table_info_arr[j]); + } + return 0; } static int ocp_print_C9_log_json(struct telemetry_str_log_format *log_data,__u8 *log_data_buf) { - struct json_object *root = json_create_object(); - struct json_object *stat_table = json_create_object(); - struct json_object *eve_table = json_create_object(); - struct json_object *vu_eve_table = json_create_object(); - struct json_object *entry = json_create_object(); - char res_arr[48]; - char *res = res_arr; - char guid_buf[C9_GUID_LENGTH]; - char *guid = guid_buf; - char fifo_arr[16]; - char *fifo = fifo_arr; - //calculating the index value for array - __le64 stat_id_index = (log_data->sitsz * 4) / 16; - __le64 eve_id_index = (log_data->estsz * 4) / 16; - __le64 vu_eve_index = (log_data->vu_eve_st_sz * 4) / 16; - __le64 ascii_table_index = (log_data->asctsz * 4); - //Calculating the offset for dynamic fields. - __le64 stat_id_str_table_ofst = C9_TELEMETRY_STR_LOG_SIST_OFST + (log_data->sitsz * 4); - __le64 event_str_table_ofst = stat_id_str_table_ofst + (log_data->estsz * 4); - __le64 vu_event_str_table_ofst = event_str_table_ofst + (log_data->vu_eve_st_sz * 4); - __le64 ascii_table_ofst = vu_event_str_table_ofst + (log_data->asctsz * 4); - struct statistics_id_str_table_entry stat_id_str_table_arr[stat_id_index]; - struct event_id_str_table_entry event_id_str_table_arr[eve_id_index]; - struct vu_event_id_str_table_entry vu_event_id_str_table_arr[vu_eve_index]; - __u8 ascii_table_info_arr[ascii_table_index]; - char ascii_buf[ascii_table_index]; - char *ascii = ascii_buf; - int j; - - json_object_add_value_int(root, "Log Page Version", le16_to_cpu(log_data->log_page_version)); - - memset((__u8 *)res, 0, 15); - for (j = 0; j < 15; j++) - res += sprintf(res, "%d", log_data->reserved1[j]); - json_object_add_value_string(root, "Reserved", res_arr); - - memset((void *)guid, 0, C9_GUID_LENGTH); - for (j = C9_GUID_LENGTH - 1; j >= 0; j--) - guid += sprintf(guid, "%02x", log_data->log_page_guid[j]); - json_object_add_value_string(root, "Log page GUID", guid_buf); - - json_object_add_value_int(root, "Telemetry String Log Size", le64_to_cpu(log_data->sls)); - - memset((__u8 *)res, 0, 24); - for (j = 0; j < 24; j++) - res += sprintf(res, "%d", log_data->reserved2[j]); - json_object_add_value_string(root, "Reserved", res_arr); - - json_object_add_value_int(root, "Statistics Identifier String Table Start", le64_to_cpu(log_data->sits)); - json_object_add_value_int(root, "Event String Table Start", le64_to_cpu(log_data->ests)); - json_object_add_value_int(root, "Event String Table Size", le64_to_cpu(log_data->estsz)); - json_object_add_value_int(root, "VU Event String Table Start", le64_to_cpu(log_data->vu_eve_sts)); - json_object_add_value_int(root, "VU Event String Table Size", le64_to_cpu(log_data->vu_eve_st_sz)); - json_object_add_value_int(root, "ASCII Table Start", le64_to_cpu(log_data->ascts)); - json_object_add_value_int(root, "ASCII Table Size", le64_to_cpu(log_data->asctsz)); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo1[j]); - json_object_add_value_string(root, "FIFO 1 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo2[j]); - json_object_add_value_string(root, "FIFO 2 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo3[j]); - json_object_add_value_string(root, "FIFO 3 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo4[j]); - json_object_add_value_string(root, "FIFO 4 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo5[j]); - json_object_add_value_string(root, "FIFO 5 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo6[j]); - json_object_add_value_string(root, "FIFO 6 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo7[j]); - json_object_add_value_string(root, "FIFO 7 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo8[j]); - json_object_add_value_string(root, "FIFO 8 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo9[j]); - json_object_add_value_string(root, "FIFO 9 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo10[j]); - json_object_add_value_string(root, "FIFO 10 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo11[j]); - json_object_add_value_string(root, "FIFO 11 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo12[j]); - json_object_add_value_string(root, "FIFO 12 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo13[j]); - json_object_add_value_string(root, "FIFO 13 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo14[j]); - json_object_add_value_string(root, "FIFO 14 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo15[j]); - json_object_add_value_string(root, "FIFO 15 ASCII String", fifo_arr); - - memset((void *)fifo, 0, 16); - for (j = 0; j < 16; j++) - fifo += sprintf(fifo, "%c", log_data->fifo16[j]); - json_object_add_value_string(root, "FIFO 16 ASCII String", fifo_arr); - - memset((__u8 *)res, 0, 48); - for (j = 0; j < 48; j++) - res += sprintf(res, "%d", log_data->reserved3[j]); - json_object_add_value_string(root, "Reserved", res_arr); - - memcpy(stat_id_str_table_arr, (__u8*)log_data_buf + stat_id_str_table_ofst, (log_data->sitsz * 4)); - memcpy(event_id_str_table_arr, (__u8*)log_data_buf + event_str_table_ofst, (log_data->estsz * 4)); - memcpy(vu_event_id_str_table_arr, (__u8*)log_data_buf + vu_event_str_table_ofst, (log_data->vu_eve_st_sz * 4)); - memcpy(ascii_table_info_arr, (__u8*)log_data_buf + ascii_table_ofst, (log_data->asctsz * 4)); - - for (j = 0; j < stat_id_index; j++){ - json_object_add_value_int(entry, "Vendor Specific Statistic Identifier", le16_to_cpu(stat_id_str_table_arr[j].vs_si)); - json_object_add_value_int(entry, "Reserved", le64_to_cpu(stat_id_str_table_arr[j].reserved1)); - json_object_add_value_int(entry, "ASCII ID Length", le64_to_cpu(stat_id_str_table_arr[j].ascii_id_len)); - json_object_add_value_int(entry, "ASCII ID offset", le64_to_cpu(stat_id_str_table_arr[j].ascii_id_ofst)); - json_object_add_value_int(entry, "Reserved", le64_to_cpu(stat_id_str_table_arr[j].reserved2)); - json_array_add_value_object(stat_table, entry); - } - json_object_add_value_array(root, "Statistics Identifier String Table", stat_table); - - for (j = 0; j < eve_id_index; j++){ - json_object_add_value_int(entry, "Debug Event Class", le16_to_cpu(event_id_str_table_arr[j].deb_eve_class)); - json_object_add_value_int(entry, "Event Identifier", le16_to_cpu(event_id_str_table_arr[j].ei)); - json_object_add_value_int(entry, "ASCII ID Length", le64_to_cpu(event_id_str_table_arr[j].ascii_id_len)); - json_object_add_value_int(entry, "ASCII ID offset", le64_to_cpu(event_id_str_table_arr[j].ascii_id_ofst)); - json_object_add_value_int(entry, "Reserved", le64_to_cpu(event_id_str_table_arr[j].reserved2)); - json_array_add_value_object(eve_table, entry); - } - json_object_add_value_array(root, "Event Identifier String Table Entry", eve_table); - - for (j = 0; j < vu_eve_index; j++){ - json_object_add_value_int(entry, "Debug Event Class", le16_to_cpu(vu_event_id_str_table_arr[j].deb_eve_class)); - json_object_add_value_int(entry, "VU Event Identifier", le16_to_cpu(vu_event_id_str_table_arr[j].vu_ei)); - json_object_add_value_int(entry, "ASCII ID Length", le64_to_cpu(vu_event_id_str_table_arr[j].ascii_id_len)); - json_object_add_value_int(entry, "ASCII ID offset", le64_to_cpu(vu_event_id_str_table_arr[j].ascii_id_ofst)); - json_object_add_value_int(entry, "Reserved", le64_to_cpu(vu_event_id_str_table_arr[j].reserved)); - json_array_add_value_object(vu_eve_table, entry); - } - json_object_add_value_array(root, "VU Event Identifier String Table Entry", vu_eve_table); - - memset((void *)ascii, 0, ascii_table_index); - for (j = 0; j < ascii_table_index; j++) - ascii += sprintf(ascii, "%c", ascii_table_info_arr[j]); - json_object_add_value_string(root, "ASCII Table", ascii_buf); - - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); - json_free_object(stat_table); - json_free_object(eve_table); - json_free_object(vu_eve_table); - - return 0; + struct json_object *root = json_create_object(); + struct json_object *stat_table = json_create_object(); + struct json_object *eve_table = json_create_object(); + struct json_object *vu_eve_table = json_create_object(); + struct json_object *entry = json_create_object(); + char res_arr[48]; + char *res = res_arr; + char guid_buf[C9_GUID_LENGTH]; + char *guid = guid_buf; + char fifo_arr[16]; + char *fifo = fifo_arr; + //calculating the index value for array + __le64 stat_id_index = (log_data->sitsz * 4) / 16; + __le64 eve_id_index = (log_data->estsz * 4) / 16; + __le64 vu_eve_index = (log_data->vu_eve_st_sz * 4) / 16; + __le64 ascii_table_index = (log_data->asctsz * 4); + //Calculating the offset for dynamic fields. + __le64 stat_id_str_table_ofst = C9_TELEMETRY_STR_LOG_SIST_OFST + (log_data->sitsz * 4); + __le64 event_str_table_ofst = stat_id_str_table_ofst + (log_data->estsz * 4); + __le64 vu_event_str_table_ofst = event_str_table_ofst + (log_data->vu_eve_st_sz * 4); + __le64 ascii_table_ofst = vu_event_str_table_ofst + (log_data->asctsz * 4); + struct statistics_id_str_table_entry stat_id_str_table_arr[stat_id_index]; + struct event_id_str_table_entry event_id_str_table_arr[eve_id_index]; + struct vu_event_id_str_table_entry vu_event_id_str_table_arr[vu_eve_index]; + __u8 ascii_table_info_arr[ascii_table_index]; + char ascii_buf[ascii_table_index]; + char *ascii = ascii_buf; + int j; + + json_object_add_value_int(root, "Log Page Version", le16_to_cpu(log_data->log_page_version)); + + memset((__u8 *)res, 0, 15); + for (j = 0; j < 15; j++) + res += sprintf(res, "%d", log_data->reserved1[j]); + json_object_add_value_string(root, "Reserved", res_arr); + + memset((void *)guid, 0, C9_GUID_LENGTH); + for (j = C9_GUID_LENGTH - 1; j >= 0; j--) + guid += sprintf(guid, "%02x", log_data->log_page_guid[j]); + json_object_add_value_string(root, "Log page GUID", guid_buf); + + json_object_add_value_int(root, "Telemetry String Log Size", le64_to_cpu(log_data->sls)); + + memset((__u8 *)res, 0, 24); + for (j = 0; j < 24; j++) + res += sprintf(res, "%d", log_data->reserved2[j]); + json_object_add_value_string(root, "Reserved", res_arr); + + json_object_add_value_int(root, "Statistics Identifier String Table Start", le64_to_cpu(log_data->sits)); + json_object_add_value_int(root, "Event String Table Start", le64_to_cpu(log_data->ests)); + json_object_add_value_int(root, "Event String Table Size", le64_to_cpu(log_data->estsz)); + json_object_add_value_int(root, "VU Event String Table Start", le64_to_cpu(log_data->vu_eve_sts)); + json_object_add_value_int(root, "VU Event String Table Size", le64_to_cpu(log_data->vu_eve_st_sz)); + json_object_add_value_int(root, "ASCII Table Start", le64_to_cpu(log_data->ascts)); + json_object_add_value_int(root, "ASCII Table Size", le64_to_cpu(log_data->asctsz)); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo1[j]); + json_object_add_value_string(root, "FIFO 1 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo2[j]); + json_object_add_value_string(root, "FIFO 2 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo3[j]); + json_object_add_value_string(root, "FIFO 3 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo4[j]); + json_object_add_value_string(root, "FIFO 4 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo5[j]); + json_object_add_value_string(root, "FIFO 5 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo6[j]); + json_object_add_value_string(root, "FIFO 6 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo7[j]); + json_object_add_value_string(root, "FIFO 7 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo8[j]); + json_object_add_value_string(root, "FIFO 8 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo9[j]); + json_object_add_value_string(root, "FIFO 9 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo10[j]); + json_object_add_value_string(root, "FIFO 10 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo11[j]); + json_object_add_value_string(root, "FIFO 11 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo12[j]); + json_object_add_value_string(root, "FIFO 12 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo13[j]); + json_object_add_value_string(root, "FIFO 13 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo14[j]); + json_object_add_value_string(root, "FIFO 14 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo15[j]); + json_object_add_value_string(root, "FIFO 15 ASCII String", fifo_arr); + + memset((void *)fifo, 0, 16); + for (j = 0; j < 16; j++) + fifo += sprintf(fifo, "%c", log_data->fifo16[j]); + json_object_add_value_string(root, "FIFO 16 ASCII String", fifo_arr); + + memset((__u8 *)res, 0, 48); + for (j = 0; j < 48; j++) + res += sprintf(res, "%d", log_data->reserved3[j]); + json_object_add_value_string(root, "Reserved", res_arr); + + memcpy(stat_id_str_table_arr, (__u8*)log_data_buf + stat_id_str_table_ofst, (log_data->sitsz * 4)); + memcpy(event_id_str_table_arr, (__u8*)log_data_buf + event_str_table_ofst, (log_data->estsz * 4)); + memcpy(vu_event_id_str_table_arr, (__u8*)log_data_buf + vu_event_str_table_ofst, (log_data->vu_eve_st_sz * 4)); + memcpy(ascii_table_info_arr, (__u8*)log_data_buf + ascii_table_ofst, (log_data->asctsz * 4)); + + for (j = 0; j < stat_id_index; j++){ + json_object_add_value_int(entry, "Vendor Specific Statistic Identifier", le16_to_cpu(stat_id_str_table_arr[j].vs_si)); + json_object_add_value_int(entry, "Reserved", le64_to_cpu(stat_id_str_table_arr[j].reserved1)); + json_object_add_value_int(entry, "ASCII ID Length", le64_to_cpu(stat_id_str_table_arr[j].ascii_id_len)); + json_object_add_value_int(entry, "ASCII ID offset", le64_to_cpu(stat_id_str_table_arr[j].ascii_id_ofst)); + json_object_add_value_int(entry, "Reserved", le64_to_cpu(stat_id_str_table_arr[j].reserved2)); + json_array_add_value_object(stat_table, entry); + } + json_object_add_value_array(root, "Statistics Identifier String Table", stat_table); + + for (j = 0; j < eve_id_index; j++){ + json_object_add_value_int(entry, "Debug Event Class", le16_to_cpu(event_id_str_table_arr[j].deb_eve_class)); + json_object_add_value_int(entry, "Event Identifier", le16_to_cpu(event_id_str_table_arr[j].ei)); + json_object_add_value_int(entry, "ASCII ID Length", le64_to_cpu(event_id_str_table_arr[j].ascii_id_len)); + json_object_add_value_int(entry, "ASCII ID offset", le64_to_cpu(event_id_str_table_arr[j].ascii_id_ofst)); + json_object_add_value_int(entry, "Reserved", le64_to_cpu(event_id_str_table_arr[j].reserved2)); + json_array_add_value_object(eve_table, entry); + } + json_object_add_value_array(root, "Event Identifier String Table Entry", eve_table); + + for (j = 0; j < vu_eve_index; j++){ + json_object_add_value_int(entry, "Debug Event Class", le16_to_cpu(vu_event_id_str_table_arr[j].deb_eve_class)); + json_object_add_value_int(entry, "VU Event Identifier", le16_to_cpu(vu_event_id_str_table_arr[j].vu_ei)); + json_object_add_value_int(entry, "ASCII ID Length", le64_to_cpu(vu_event_id_str_table_arr[j].ascii_id_len)); + json_object_add_value_int(entry, "ASCII ID offset", le64_to_cpu(vu_event_id_str_table_arr[j].ascii_id_ofst)); + json_object_add_value_int(entry, "Reserved", le64_to_cpu(vu_event_id_str_table_arr[j].reserved)); + json_array_add_value_object(vu_eve_table, entry); + } + json_object_add_value_array(root, "VU Event Identifier String Table Entry", vu_eve_table); + + memset((void *)ascii, 0, ascii_table_index); + for (j = 0; j < ascii_table_index; j++) + ascii += sprintf(ascii, "%c", ascii_table_info_arr[j]); + json_object_add_value_string(root, "ASCII Table", ascii_buf); + + json_print_object(root, NULL); + printf("\n"); + json_free_object(root); + json_free_object(stat_table); + json_free_object(eve_table); + json_free_object(vu_eve_table); + + return 0; } static void ocp_print_c9_log_binary(__u8 *log_data_buf,int total_log_page_size) { - return d_raw((unsigned char *)log_data_buf, total_log_page_size); + return d_raw((unsigned char *)log_data_buf, total_log_page_size); } static int get_c9_log_page(struct nvme_dev *dev, char *format) { - int ret = 0; - __u8 *header_data; - struct telemetry_str_log_format *log_data; + int ret = 0; + __u8 *header_data; + struct telemetry_str_log_format *log_data; enum nvme_print_flags fmt; - __u8 *full_log_buf_data = NULL; - __le64 stat_id_str_table_ofst = 0; - __le64 event_str_table_ofst = 0; - __le64 vu_event_str_table_ofst = 0; - __le64 ascii_table_ofst = 0; - __le64 total_log_page_sz = 0; - - ret = validate_output_format(format, &fmt); - if (ret < 0) { - fprintf(stderr, "ERROR : OCP : invalid output format\n"); - return ret; - } - - header_data = (__u8 *)malloc(sizeof(__u8) * C9_TELEMETRY_STR_LOG_LEN); - if (!header_data) { - fprintf(stderr, "ERROR : OCP : malloc : %s\n", strerror(errno)); - return -1; - } - memset(header_data, 0, sizeof(__u8) * C9_TELEMETRY_STR_LOG_LEN); - - ret = nvme_get_log_simple(dev_fd(dev), C9_TELEMETRY_STRING_LOG_ENABLE_OPCODE, - C9_TELEMETRY_STR_LOG_LEN, header_data); - - if (!ret) { - log_data = (struct telemetry_str_log_format *)header_data; - printf("Statistics Identifier String Table Size = %lld\n",log_data->sitsz); - printf("Event String Table Size = %lld\n",log_data->estsz); - printf("VU Event String Table Size = %lld\n",log_data->vu_eve_st_sz); - printf("ASCII Table Size = %lld\n",log_data->asctsz); - - //Calculating the offset for dynamic fields. - stat_id_str_table_ofst = C9_TELEMETRY_STR_LOG_SIST_OFST + (log_data->sitsz * 4); - event_str_table_ofst = stat_id_str_table_ofst + (log_data->estsz * 4); - vu_event_str_table_ofst = event_str_table_ofst + (log_data->vu_eve_st_sz * 4); - ascii_table_ofst = vu_event_str_table_ofst + (log_data->asctsz * 4); - total_log_page_sz = stat_id_str_table_ofst + event_str_table_ofst + vu_event_str_table_ofst + ascii_table_ofst; - - printf("stat_id_str_table_ofst = %lld\n",stat_id_str_table_ofst); - printf("event_str_table_ofst = %lld\n",event_str_table_ofst); - printf("vu_event_str_table_ofst = %lld\n",vu_event_str_table_ofst); - printf("ascii_table_ofst = %lld\n",ascii_table_ofst); - printf("total_log_page_sz = %lld\n",total_log_page_sz); - - full_log_buf_data = (__u8 *)malloc(sizeof(__u8) * total_log_page_sz); - if (!full_log_buf_data) { - fprintf(stderr, "ERROR : OCP : malloc : %s\n", strerror(errno)); - return -1; - } - memset(full_log_buf_data, 0, sizeof(__u8) * total_log_page_sz); - - ret = nvme_get_log_simple(dev_fd(dev), C9_TELEMETRY_STRING_LOG_ENABLE_OPCODE, - total_log_page_sz, full_log_buf_data); - - if (!ret) { - switch (fmt) { - case NORMAL: - ocp_print_C9_log_normal(log_data,full_log_buf_data); - break; - case JSON: - ocp_print_C9_log_json(log_data,full_log_buf_data); - break; - case BINARY: - ocp_print_c9_log_binary(full_log_buf_data,total_log_page_sz); - break; - default: - fprintf(stderr, "unhandled output format\n"); - break; - } - } else{ - fprintf(stderr, "ERROR : OCP : Unable to read C9 data from buffer\n"); - } - } else { - fprintf(stderr, "ERROR : OCP : Unable to read C9 data from buffer\n"); - } - - free(header_data); - free(full_log_buf_data); - - return ret; + __u8 *full_log_buf_data = NULL; + __le64 stat_id_str_table_ofst = 0; + __le64 event_str_table_ofst = 0; + __le64 vu_event_str_table_ofst = 0; + __le64 ascii_table_ofst = 0; + __le64 total_log_page_sz = 0; + + ret = validate_output_format(format, &fmt); + if (ret < 0) { + fprintf(stderr, "ERROR : OCP : invalid output format\n"); + return ret; + } + + header_data = (__u8 *)malloc(sizeof(__u8) * C9_TELEMETRY_STR_LOG_LEN); + if (!header_data) { + fprintf(stderr, "ERROR : OCP : malloc : %s\n", strerror(errno)); + return -1; + } + memset(header_data, 0, sizeof(__u8) * C9_TELEMETRY_STR_LOG_LEN); + + ret = nvme_get_log_simple(dev_fd(dev), C9_TELEMETRY_STRING_LOG_ENABLE_OPCODE, + C9_TELEMETRY_STR_LOG_LEN, header_data); + + if (!ret) { + log_data = (struct telemetry_str_log_format *)header_data; + printf("Statistics Identifier String Table Size = %lld\n",log_data->sitsz); + printf("Event String Table Size = %lld\n",log_data->estsz); + printf("VU Event String Table Size = %lld\n",log_data->vu_eve_st_sz); + printf("ASCII Table Size = %lld\n",log_data->asctsz); + + //Calculating the offset for dynamic fields. + stat_id_str_table_ofst = C9_TELEMETRY_STR_LOG_SIST_OFST + (log_data->sitsz * 4); + event_str_table_ofst = stat_id_str_table_ofst + (log_data->estsz * 4); + vu_event_str_table_ofst = event_str_table_ofst + (log_data->vu_eve_st_sz * 4); + ascii_table_ofst = vu_event_str_table_ofst + (log_data->asctsz * 4); + total_log_page_sz = stat_id_str_table_ofst + event_str_table_ofst + vu_event_str_table_ofst + ascii_table_ofst; + + printf("stat_id_str_table_ofst = %lld\n",stat_id_str_table_ofst); + printf("event_str_table_ofst = %lld\n",event_str_table_ofst); + printf("vu_event_str_table_ofst = %lld\n",vu_event_str_table_ofst); + printf("ascii_table_ofst = %lld\n",ascii_table_ofst); + printf("total_log_page_sz = %lld\n",total_log_page_sz); + + full_log_buf_data = (__u8 *)malloc(sizeof(__u8) * total_log_page_sz); + if (!full_log_buf_data) { + fprintf(stderr, "ERROR : OCP : malloc : %s\n", strerror(errno)); + return -1; + } + memset(full_log_buf_data, 0, sizeof(__u8) * total_log_page_sz); + + ret = nvme_get_log_simple(dev_fd(dev), C9_TELEMETRY_STRING_LOG_ENABLE_OPCODE, + total_log_page_sz, full_log_buf_data); + + if (!ret) { + switch (fmt) { + case NORMAL: + ocp_print_C9_log_normal(log_data,full_log_buf_data); + break; + case JSON: + ocp_print_C9_log_json(log_data,full_log_buf_data); + break; + case BINARY: + ocp_print_c9_log_binary(full_log_buf_data,total_log_page_sz); + break; + default: + fprintf(stderr, "unhandled output format\n"); + break; + } + } else{ + fprintf(stderr, "ERROR : OCP : Unable to read C9 data from buffer\n"); + } + } else { + fprintf(stderr, "ERROR : OCP : Unable to read C9 data from buffer\n"); + } + + free(header_data); + free(full_log_buf_data); + + return ret; } static int ocp_telemetry_str_log_format(int argc, char **argv, struct command *cmd, - struct plugin *plugin) + struct plugin *plugin) { - struct nvme_dev *dev; - int ret = 0; - const char *desc = "Retrieve telemetry string log format"; + struct nvme_dev *dev; + int ret = 0; + const char *desc = "Retrieve telemetry string log format"; - struct config { - char *output_format; - }; + struct config { + char *output_format; + }; - struct config cfg = { - .output_format = "normal", - }; + struct config cfg = { + .output_format = "normal", + }; - OPT_ARGS(opts) = { - OPT_FMT("output-format", 'o', &cfg.output_format, "output Format: normal|json"), - OPT_END() - }; + OPT_ARGS(opts) = { + OPT_FMT("output-format", 'o', &cfg.output_format, "output Format: normal|json"), + OPT_END() + }; - ret = parse_and_open(&dev, argc, argv, desc, opts); - if (ret) - return ret; + ret = parse_and_open(&dev, argc, argv, desc, opts); + if (ret) + return ret; - ret = get_c9_log_page(dev, cfg.output_format); - if (ret) - fprintf(stderr, "ERROR : OCP : Failure reading the C9 Log Page, ret = %d\n", ret); + ret = get_c9_log_page(dev, cfg.output_format); + if (ret) + fprintf(stderr, "ERROR : OCP : Failure reading the C9 Log Page, ret = %d\n", ret); - dev_close(dev); + dev_close(dev); - return ret; + return ret; } /////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/ocp/ocp-nvme.h b/plugins/ocp/ocp-nvme.h index 95539b0..0317ea7 100644 --- a/plugins/ocp/ocp-nvme.h +++ b/plugins/ocp/ocp-nvme.h @@ -30,6 +30,9 @@ PLUGIN(NAME("ocp", "OCP cloud SSD extensions", NVME_VERSION), ENTRY("set-plp-health-check-interval", "Set PLP Health Check Interval", set_plp_health_check_interval) ENTRY("get-plp-health-check-interval", "Get PLP Health Check Interval", get_plp_health_check_interval) ENTRY("telemetry-string-log", "Retrieve Telemetry string Log Page", ocp_telemetry_str_log_format) + ENTRY("set-telemetry-profile", "Set Telemetry Profile Feature", ocp_set_telemetry_profile_feature) + ENTRY("set-dssd-async-event-config", "Set DSSD Async Event Config", set_dssd_async_event_config) + ENTRY("get-dssd-async-event-config", "Get DSSD Async Event Config", get_dssd_async_event_config) ) ); diff --git a/plugins/ocp/ocp-utils.c b/plugins/ocp/ocp-utils.c index 1257b30..8a1462e 100644 --- a/plugins/ocp/ocp-utils.c +++ b/plugins/ocp/ocp-utils.c @@ -1,19 +1,32 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) 2022 Solidigm. + * Copyright (c) 2022-2024 Solidigm. * * Author: leonardo.da.cunha@solidigm.com */ #include +#include #include "ocp-utils.h" -#include "nvme-print.h" const unsigned char ocp_uuid[NVME_UUID_LEN] = { 0xc1, 0x94, 0xd5, 0x5b, 0xe0, 0x94, 0x47, 0x94, 0xa2, 0x1d, 0x29, 0x99, 0x8f, 0x56, 0xbe, 0x6f }; -int ocp_get_uuid_index(struct nvme_dev *dev, int *index) +int ocp_find_uuid_index(struct nvme_id_uuid_list *uuid_list, __u8 *index) +{ + int i = nvme_uuid_find(uuid_list, ocp_uuid); + + *index = 0; + if (i > 0) + *index = i; + else + return -errno; + + return 0; +} + +int ocp_get_uuid_index(struct nvme_dev *dev, __u8 *index) { struct nvme_id_uuid_list uuid_list; int err = nvme_identify_uuid(dev_fd(dev), &uuid_list); @@ -22,11 +35,5 @@ int ocp_get_uuid_index(struct nvme_dev *dev, int *index) if (err) return err; - for (int i = 0; i < NVME_ID_UUID_LIST_MAX; i++) { - if (memcmp(ocp_uuid, &uuid_list.entry[i].uuid, NVME_UUID_LEN) == 0) { - *index = i + 1; - break; - } - } - return err; + return ocp_find_uuid_index(&uuid_list, index); } diff --git a/plugins/ocp/ocp-utils.h b/plugins/ocp/ocp-utils.h index d02bea9..1512db8 100644 --- a/plugins/ocp/ocp-utils.h +++ b/plugins/ocp/ocp-utils.h @@ -1,18 +1,32 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* - * Copyright (c) 2022 Solidigm. + * Copyright (c) 2022-2024 Solidigm. * * Author: leonardo.da.cunha@solidigm.com */ #include "nvme.h" +/* + * UUID assigned for OCP. + */ +extern const unsigned char ocp_uuid[NVME_UUID_LEN]; + /** * ocp_get_uuid_index() - Get OCP UUID index * @dev: nvme device * @index: integer pointer to here to save the index - * @result: The command completion result from CQE dword0 * - * Return: Zero if nvme device has UUID list log page, or result of get uuid list otherwise. + * Return: Zero if nvme device has UUID list identify page, or positive result of get uuid list + * or negative POSIX error code otherwise. + */ +int ocp_get_uuid_index(struct nvme_dev *dev, __u8 *index); + +/** + * ocp_find_uuid_index() - Find OCP UUID index in UUID list + * @uuid_list: uuid_list retrieved from Identify UUID List (CNS 0x17) + * @index: integer pointer to here to save the index + * + * Return: Zero if nvme device has UUID list log page, Negative POSIX error code otherwise. */ -int ocp_get_uuid_index(struct nvme_dev *dev, int *index); +int ocp_find_uuid_index(struct nvme_id_uuid_list *uuid_list, __u8 *index); diff --git a/plugins/sed/sedopal_cmd.c b/plugins/sed/sedopal_cmd.c index 649e0b2..21ebd36 100644 --- a/plugins/sed/sedopal_cmd.c +++ b/plugins/sed/sedopal_cmd.c @@ -169,8 +169,10 @@ int sedopal_cmd_initialize(int fd) struct opal_key key; struct opal_lr_act lr_act = {}; struct opal_user_lr_setup lr_setup = {}; + struct opal_new_pw new_pw = {}; sedopal_ask_key = true; + sedopal_ask_new_key = true; rc = sedopal_set_key(&key); if (rc != 0) return rc; @@ -217,6 +219,21 @@ int sedopal_cmd_initialize(int fd) return rc; } + /* + * set password + */ + new_pw.new_user_pw.who = OPAL_ADMIN1; + new_pw.new_user_pw.opal_key.lr = 0; + new_pw.session.who = OPAL_ADMIN1; + new_pw.session.sum = 0; + new_pw.session.opal_key.lr = 0; + new_pw.session.opal_key = key; + new_pw.new_user_pw.opal_key = key; + + rc = ioctl(fd, IOC_OPAL_SET_PW, &new_pw); + if (rc != 0) + fprintf(stderr, "Error: failed setting password - %d\n", rc); + return rc; } @@ -455,7 +472,7 @@ int sedopal_cmd_discover(int fd) struct level_0_discovery_features *feat; struct level_0_discovery_features *feat_end; uint16_t code; - uint8_t locking_flags; + uint8_t locking_flags = 0; char buf[4096]; discover.data = (__u64)buf; diff --git a/plugins/solidigm/solidigm-garbage-collection.c b/plugins/solidigm/solidigm-garbage-collection.c index a37e9c5..002b187 100644 --- a/plugins/solidigm/solidigm-garbage-collection.c +++ b/plugins/solidigm/solidigm-garbage-collection.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) 2022 Solidigm. + * Copyright (c) 2022-2024 Solidigm. * * Author: leonardo.da.cunha@solidigm.com */ @@ -97,7 +97,7 @@ int solidigm_get_garbage_collection_log(int argc, char **argv, struct command *c return -EINVAL; } - uuid_index = solidigm_get_vu_uuid_index(dev); + sldgm_get_uuid_index(dev, &uuid_index); struct garbage_control_collection_log gc_log; const int solidigm_vu_gc_log_id = 0xfd; diff --git a/plugins/solidigm/solidigm-latency-tracking.c b/plugins/solidigm/solidigm-latency-tracking.c index 66f3c56..c6c3315 100644 --- a/plugins/solidigm/solidigm-latency-tracking.c +++ b/plugins/solidigm/solidigm-latency-tracking.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) 2022 Solidigm. + * Copyright (c) 2022-2024 Solidigm. * * Author: leonardo.da.cunha@solidigm.com */ @@ -430,7 +430,7 @@ int solidigm_get_latency_tracking_log(int argc, char **argv, struct command *cmd return -EINVAL; } - lt.uuid_index = solidigm_get_vu_uuid_index(dev); + sldgm_get_uuid_index(dev, <.uuid_index); err = latency_tracking_enable(<); if (err) { diff --git a/plugins/solidigm/solidigm-log-page-dir.c b/plugins/solidigm/solidigm-log-page-dir.c index bf272f8..7d7c027 100644 --- a/plugins/solidigm/solidigm-log-page-dir.c +++ b/plugins/solidigm/solidigm-log-page-dir.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) 2023 Solidigm. + * Copyright (c) 2023-2024 Solidigm. * * Author: karl.dedow@solidigm.com */ @@ -15,6 +15,7 @@ #include "nvme-print.h" #include "plugins/ocp/ocp-utils.h" +#include "solidigm-util.h" #define MIN_VENDOR_LID 0xC0 #define SOLIDIGM_MAX_UUID 2 @@ -38,41 +39,9 @@ static void init_lid_dir(struct lid_dir *lid_dir) } } -static bool is_invalid_uuid(const struct nvme_id_uuid_list_entry entry) -{ - static const unsigned char ALL_ZERO_UUID[NVME_UUID_LEN] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }; - - return memcmp(ALL_ZERO_UUID, entry.uuid, NVME_UUID_LEN) == 0; -} - -static bool is_solidigm_uuid(const struct nvme_id_uuid_list_entry entry) -{ - static const unsigned char SOLIDIGM_UUID[NVME_UUID_LEN] = { - 0x96, 0x19, 0x58, 0x6e, 0xc1, 0x1b, 0x43, 0xad, - 0xaa, 0xaa, 0x65, 0x41, 0x87, 0xf6, 0xbb, 0xb2 - }; - - return memcmp(SOLIDIGM_UUID, entry.uuid, NVME_UUID_LEN) == 0; -} - -static bool is_ocp_uuid(const struct nvme_id_uuid_list_entry entry) -{ - static const unsigned char OCP_UUID[NVME_UUID_LEN] = { - 0xc1, 0x94, 0xd5, 0x5b, 0xe0, 0x94, 0x47, 0x94, - 0xa2, 0x1d, 0x29, 0x99, 0x8f, 0x56, 0xbe, 0x6f - }; - - return memcmp(OCP_UUID, entry.uuid, NVME_UUID_LEN) == 0; -} - static int get_supported_log_pages_log(struct nvme_dev *dev, int uuid_index, struct nvme_supported_log_pages *supported) { - static const __u8 LID; - memset(supported, 0, sizeof(*supported)); struct nvme_get_log_args args = { .lpo = 0, @@ -81,7 +50,7 @@ static int get_supported_log_pages_log(struct nvme_dev *dev, int uuid_index, .args_size = sizeof(args), .fd = dev_fd(dev), .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .lid = LID, + .lid = NVME_LOG_LID_SUPPORTED_LOG_PAGES, .len = sizeof(*supported), .nsid = NVME_NSID_ALL, .csi = NVME_CSI_NVM, @@ -101,8 +70,8 @@ static struct lid_dir *get_standard_lids(struct nvme_supported_log_pages *suppor init_lid_dir(&standard_dir); - for (int lid = 0; lid < NVME_LOG_SUPPORTED_LOG_PAGES_MAX; lid++) { - if (!supported->lid_support[lid] || lid >= MIN_VENDOR_LID) + for (int lid = 0; lid < MIN_VENDOR_LID; lid++) { + if (!supported->lid_support[lid]) continue; standard_dir.lid[lid].supported = true; @@ -128,12 +97,15 @@ static struct lid_dir *get_solidigm_lids(struct nvme_supported_log_pages *suppor static struct lid_dir solidigm_dir = { 0 }; init_lid_dir(&solidigm_dir); + solidigm_dir.lid[0xC0].str = "OCP SMART / Health Information Extended"; solidigm_dir.lid[0xC1].str = "Read Commands Latency Statistics"; solidigm_dir.lid[0xC2].str = "Write Commands Latency Statistics"; + solidigm_dir.lid[0xC3].str = "OCP Latency Monitor"; solidigm_dir.lid[0xC4].str = "Endurance Manager Statistics"; solidigm_dir.lid[0xC5].str = "Temperature Statistics"; solidigm_dir.lid[0xCA].str = "SMART Attributes"; solidigm_dir.lid[0xCB].str = "VU NVMe IO Queue Metrics Log Page"; + solidigm_dir.lid[0xD5].str = solidigm_dir.lid[0xC5].str; solidigm_dir.lid[0xDD].str = "VU Marketing Description Log Page"; solidigm_dir.lid[0xEF].str = "Performance Rating and LBA Access Histogram"; solidigm_dir.lid[0xF2].str = "Get Power Usage Log Page"; @@ -222,7 +194,7 @@ int solidigm_get_log_page_directory_log(int argc, char **argv, struct command *c OPT_END() }; - struct nvme_dev *dev = NULL; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; int err = parse_and_open(&dev, argc, argv, description, options); if (err) @@ -247,16 +219,21 @@ int solidigm_get_log_page_directory_log(int argc, char **argv, struct command *c lid_dirs[NO_UUID_INDEX]->lid[lid] = solidigm_lid_dir->lid[lid]; } } else { - for (int uuid_index = 1; uuid_index <= SOLIDIGM_MAX_UUID; uuid_index++) { - if (is_invalid_uuid(uuid_list.entry[uuid_index - 1])) - break; - else if (get_supported_log_pages_log(dev, uuid_index, &supported)) - continue; - - if (is_solidigm_uuid(uuid_list.entry[uuid_index - 1])) - lid_dirs[uuid_index] = get_solidigm_lids(&supported); - else if (is_ocp_uuid(uuid_list.entry[uuid_index - 1])) - lid_dirs[uuid_index] = get_ocp_lids(&supported); + __u8 sldgm_idx; + __u8 ocp_idx; + + sldgm_find_uuid_index(&uuid_list, &sldgm_idx); + ocp_find_uuid_index(&uuid_list, &ocp_idx); + + if (sldgm_idx && (sldgm_idx <= SOLIDIGM_MAX_UUID)) { + err = get_supported_log_pages_log(dev, sldgm_idx, &supported); + if (!err) + lid_dirs[sldgm_idx] = get_solidigm_lids(&supported); + } + if (ocp_idx && (ocp_idx <= SOLIDIGM_MAX_UUID)) { + err = get_supported_log_pages_log(dev, ocp_idx, &supported); + if (!err) + lid_dirs[ocp_idx] = get_ocp_lids(&supported); } } } else { @@ -279,8 +256,5 @@ int solidigm_get_log_page_directory_log(int argc, char **argv, struct command *c } } - /* Redundant close() to make static code analysis happy */ - close(dev->direct.fd); - dev_close(dev); return err; } diff --git a/plugins/solidigm/solidigm-nvme.h b/plugins/solidigm/solidigm-nvme.h index bee8266..a639fd2 100644 --- a/plugins/solidigm/solidigm-nvme.h +++ b/plugins/solidigm/solidigm-nvme.h @@ -13,7 +13,7 @@ #include "cmd.h" -#define SOLIDIGM_PLUGIN_VERSION "1.1" +#define SOLIDIGM_PLUGIN_VERSION "1.2" PLUGIN(NAME("solidigm", "Solidigm vendor specific extensions", SOLIDIGM_PLUGIN_VERSION), COMMAND_LIST( diff --git a/plugins/solidigm/solidigm-smart.c b/plugins/solidigm/solidigm-smart.c index 62245fa..a97abe2 100644 --- a/plugins/solidigm/solidigm-smart.c +++ b/plugins/solidigm/solidigm-smart.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) 2022 Solidigm. + * Copyright (c) 2022-2024 Solidigm. * * Author: leonardo.da.cunha@solidigm.com */ @@ -229,7 +229,7 @@ int solidigm_get_additional_smart_log(int argc, char **argv, struct command *cmd return err; } - uuid_index = solidigm_get_vu_uuid_index(dev); + sldgm_get_uuid_index(dev, &uuid_index); struct nvme_get_log_args args = { .lpo = 0, diff --git a/plugins/solidigm/solidigm-temp-stats.c b/plugins/solidigm/solidigm-temp-stats.c index 85a3c37..7f385db 100644 --- a/plugins/solidigm/solidigm-temp-stats.c +++ b/plugins/solidigm/solidigm-temp-stats.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) 2023 Solidigm. + * Copyright (c) 2023-2024 Solidigm. * * Author: leonardo.da.cunha@solidigm.com */ @@ -11,7 +11,8 @@ #include "nvme-print.h" #include "solidigm-util.h" -#define SLDGM_TEMP_STATS_LID 0xC5 +#define SLDGM_LEGACY_TEMP_STATS_LID 0xC5 +#define SLDGM_TEMP_STATS_LID 0xD5 struct temp_stats { __le64 curr; @@ -40,7 +41,7 @@ static void show_temp_stats(struct temp_stats *stats) int sldgm_get_temp_stats_log(int argc, char **argv, struct command *cmd, struct plugin *plugin) { unsigned char buffer[4096] = {0}; - struct nvme_dev *dev; + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; __u8 uuid_idx; int err; @@ -63,7 +64,7 @@ int sldgm_get_temp_stats_log(int argc, char **argv, struct command *cmd, struct if (err) return err; - uuid_idx = solidigm_get_vu_uuid_index(dev); + sldgm_get_uuid_index(dev, &uuid_idx); struct nvme_get_log_args args = { .lpo = 0, @@ -84,25 +85,26 @@ int sldgm_get_temp_stats_log(int argc, char **argv, struct command *cmd, struct }; err = nvme_get_log(&args); - if (!err) { - uint64_t *guid = (uint64_t *)&buffer[4080]; + if (err > 0) { + args.lid = SLDGM_LEGACY_TEMP_STATS_LID; + err = nvme_get_log(&args); + if (!err) { + uint64_t *guid = (uint64_t *)&buffer[4080]; - if (guid[1] == 0xC7BB98B7D0324863 && guid[0] == 0xBB2C23990E9C722F) { - fprintf(stderr, "Error: Log page has 'OCP unsupported Requirements' GUID\n"); - err = -EBADMSG; - goto closefd; + if (guid[1] == 0xC7BB98B7D0324863 && guid[0] == 0xBB2C23990E9C722F) { + fprintf(stderr, + "Error: Log page has OCP unsupported Requirements GUID\n"); + return -EBADMSG; + } } + } + if (!err) { if (!cfg.raw_binary) show_temp_stats((struct temp_stats *) buffer); else d_raw(buffer, sizeof(struct temp_stats)); - } else if (err > 0) { + } else if (err > 0) nvme_show_status(err); - } -closefd: - /* Redundant close() to make static code analysis happy */ - close(dev->direct.fd); - dev_close(dev); return err; } diff --git a/plugins/solidigm/solidigm-util.c b/plugins/solidigm/solidigm-util.c index 0171a49..05d1537 100644 --- a/plugins/solidigm/solidigm-util.c +++ b/plugins/solidigm/solidigm-util.c @@ -1,20 +1,39 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) 2023 Solidigm. + * Copyright (c) 2023-2024 Solidigm. * * Author: leonardo.da.cunha@solidigm.com */ -#include "plugins/ocp/ocp-utils.h" +#include #include "solidigm-util.h" -__u8 solidigm_get_vu_uuid_index(struct nvme_dev *dev) +const unsigned char solidigm_uuid[NVME_UUID_LEN] = { + 0x96, 0x19, 0x58, 0x6e, 0xc1, 0x1b, 0x43, 0xad, + 0xaa, 0xaa, 0x65, 0x41, 0x87, 0xf6, 0xbb, 0xb2 +}; + +int sldgm_find_uuid_index(struct nvme_id_uuid_list *uuid_list, __u8 *index) { - int ocp_uuid_index = 0; + int i = nvme_uuid_find(uuid_list, solidigm_uuid); - if (ocp_get_uuid_index(dev, &ocp_uuid_index) == 0) - if (ocp_uuid_index == 2) - return 1; + *index = 0; + if (i > 0) + *index = i; + else + return -errno; return 0; } + +int sldgm_get_uuid_index(struct nvme_dev *dev, __u8 *index) +{ + struct nvme_id_uuid_list uuid_list; + int err = nvme_identify_uuid(dev_fd(dev), &uuid_list); + + *index = 0; + if (err) + return err; + + return sldgm_find_uuid_index(&uuid_list, index); +} diff --git a/plugins/solidigm/solidigm-util.h b/plugins/solidigm/solidigm-util.h index fa5032f..ed7bf0f 100644 --- a/plugins/solidigm/solidigm-util.h +++ b/plugins/solidigm/solidigm-util.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* - * Copyright (c) 2023 Solidigm. + * Copyright (c) 2023-2024 Solidigm. * * Author: leonardo.da.cunha@solidigm.com */ @@ -9,4 +9,5 @@ #define DRIVER_MAX_TX_256K (256 * 1024) -__u8 solidigm_get_vu_uuid_index(struct nvme_dev *dev); +int sldgm_find_uuid_index(struct nvme_id_uuid_list *uuid_list, __u8 *index); +int sldgm_get_uuid_index(struct nvme_dev *dev, __u8 *index); diff --git a/plugins/ssstc/ssstc-nvme.c b/plugins/ssstc/ssstc-nvme.c new file mode 100644 index 0000000..03e4fe3 --- /dev/null +++ b/plugins/ssstc/ssstc-nvme.c @@ -0,0 +1,430 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "nvme.h" +#include "libnvme.h" +#include "plugin.h" +#include "linux/types.h" +#include "nvme-print.h" + +#define CREATE_CMD +#include "ssstc-nvme.h" + +struct __packed nvme_additional_smart_log_item +{ + __u8 key; + __u8 norm; + union __packed { + __u8 raw[6]; + struct __packed wear_level + { + __le16 min; + __le16 max; + __le16 avg; + } wear_level; + }; + __u8 _rp[2]; +}; + +struct nvme_additional_smart_log { + struct nvme_additional_smart_log_item program_fail_cnt; + struct nvme_additional_smart_log_item erase_fail_cnt; + struct nvme_additional_smart_log_item wear_leveling_cnt; + struct nvme_additional_smart_log_item e2e_err_cnt; + struct nvme_additional_smart_log_item crc_err_cnt; + struct nvme_additional_smart_log_item nand_bytes_written; + struct nvme_additional_smart_log_item host_bytes_written; + struct nvme_additional_smart_log_item reallocated_sector_count; + struct nvme_additional_smart_log_item uncorrectable_sector_count; + struct nvme_additional_smart_log_item NAND_ECC_Detection_Count; + struct nvme_additional_smart_log_item NAND_ECC_Correction_Count; + struct nvme_additional_smart_log_item Bad_Block_Failure_Rate; + struct nvme_additional_smart_log_item GC_Count; + struct nvme_additional_smart_log_item DRAM_UECC_Detection_Count; + struct nvme_additional_smart_log_item SRAM_UECC_Detection_Count; + struct nvme_additional_smart_log_item Raid_Recovery_Fail_Count; + struct nvme_additional_smart_log_item Inflight_Command; + struct nvme_additional_smart_log_item Internal_End_to_End_Dect_Count; + struct nvme_additional_smart_log_item PCIe_Correctable_Error_Count; + struct nvme_additional_smart_log_item die_fail_count; + struct nvme_additional_smart_log_item wear_leveling_exec_count; + struct nvme_additional_smart_log_item read_disturb_count; + struct nvme_additional_smart_log_item data_retention_count; +}; + + +static +void show_ssstc_add_smart_log_jsn(struct nvme_additional_smart_log *smart, + unsigned int nsid, const char *devname) +{ + struct json_object *root, *entry_stats, *dev_stats, *multi; + __uint16_t wear_level_min = 0; + __uint16_t wear_level_max = 0; + __uint16_t wear_level_avg = 0; + uint64_t raw_val = 0; + + root = json_create_object(); + json_object_add_value_string(root, "SSSTC Smart log", devname); + + dev_stats = json_create_object(); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->program_fail_cnt.key); + json_object_add_value_int(entry_stats, "normalized", smart->program_fail_cnt.norm); + raw_val = int48_to_long(smart->program_fail_cnt.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "program_fail_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->erase_fail_cnt.key); + json_object_add_value_int(entry_stats, "normalized", smart->erase_fail_cnt.norm); + raw_val = int48_to_long(smart->erase_fail_cnt.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "erase_fail_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->wear_leveling_cnt.key); + json_object_add_value_int(entry_stats, "normalized", smart->wear_leveling_cnt.norm); + multi = json_create_object(); + wear_level_min = le16_to_cpu(smart->wear_leveling_cnt.wear_level.min); + wear_level_max = le16_to_cpu(smart->wear_leveling_cnt.wear_level.max); + wear_level_avg = le16_to_cpu(smart->wear_leveling_cnt.wear_level.avg); + json_object_add_value_int(multi, "min", wear_level_min); + json_object_add_value_int(multi, "max", wear_level_max); + json_object_add_value_int(multi, "avg", wear_level_avg); + json_object_add_value_object(entry_stats, "raw", multi); + json_object_add_value_object(dev_stats, "wear_leveling", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->e2e_err_cnt.key); + json_object_add_value_int(entry_stats, "normalized", smart->e2e_err_cnt.norm); + multi = json_create_object(); + wear_level_min = le16_to_cpu(smart->e2e_err_cnt.wear_level.min); + wear_level_max = le16_to_cpu(smart->e2e_err_cnt.wear_level.max); + wear_level_avg = le16_to_cpu(smart->e2e_err_cnt.wear_level.avg); + json_object_add_value_int(multi, "guard check error", wear_level_min); + json_object_add_value_int(multi, "application tag check error", wear_level_max); + json_object_add_value_int(multi, "reference tag check error", wear_level_avg); + json_object_add_value_object(entry_stats, "raw", multi); + json_object_add_value_object(dev_stats, "end_to_end_error_dect_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->crc_err_cnt.key); + json_object_add_value_int(entry_stats, "normalized", smart->crc_err_cnt.norm); + raw_val = int48_to_long(smart->crc_err_cnt.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "crc_error_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->nand_bytes_written.key); + json_object_add_value_int(entry_stats, "normalized", smart->nand_bytes_written.norm); + raw_val = int48_to_long(smart->nand_bytes_written.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "nand_bytes_written", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->host_bytes_written.key); + json_object_add_value_int(entry_stats, "normalized", smart->host_bytes_written.norm); + raw_val = int48_to_long(smart->host_bytes_written.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "host_bytes_written", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->reallocated_sector_count.key); + json_object_add_value_int(entry_stats, "normalized", smart->reallocated_sector_count.norm); + raw_val = int48_to_long(smart->reallocated_sector_count.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "reallocated_sector_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->uncorrectable_sector_count.key); + json_object_add_value_int(entry_stats, "normalized", + smart->uncorrectable_sector_count.norm); + raw_val = int48_to_long(smart->uncorrectable_sector_count.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "uncorrectable_sector_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->NAND_ECC_Detection_Count.key); + json_object_add_value_int(entry_stats, "normalized", smart->NAND_ECC_Detection_Count.norm); + raw_val = int48_to_long(smart->NAND_ECC_Detection_Count.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "NAND_ECC_detection_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->NAND_ECC_Correction_Count.key); + json_object_add_value_int(entry_stats, "normalized", smart->NAND_ECC_Correction_Count.norm); + raw_val = int48_to_long(smart->NAND_ECC_Correction_Count.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "NAND_ECC_correction_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->GC_Count.key); + json_object_add_value_int(entry_stats, "normalized", smart->GC_Count.norm); + raw_val = int48_to_long(smart->GC_Count.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "GC_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->DRAM_UECC_Detection_Count.key); + json_object_add_value_int(entry_stats, "normalized", smart->DRAM_UECC_Detection_Count.norm); + multi = json_create_object(); + wear_level_max = le16_to_cpu(smart->DRAM_UECC_Detection_Count.wear_level.max); + wear_level_avg = le16_to_cpu(smart->DRAM_UECC_Detection_Count.wear_level.avg); + json_object_add_value_int(multi, "1-Bit Err", wear_level_max); + json_object_add_value_int(multi, "2-Bit Err", wear_level_avg); + json_object_add_value_object(entry_stats, "raw", multi); + json_object_add_value_object(dev_stats, "DRAM_UECC_detection_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->SRAM_UECC_Detection_Count.key); + json_object_add_value_int(entry_stats, "normalized", smart->SRAM_UECC_Detection_Count.norm); + multi = json_create_object(); + wear_level_min = le16_to_cpu(smart->SRAM_UECC_Detection_Count.wear_level.min); + wear_level_max = le16_to_cpu(smart->SRAM_UECC_Detection_Count.wear_level.max); + wear_level_avg = le16_to_cpu(smart->SRAM_UECC_Detection_Count.wear_level.avg); + json_object_add_value_int(multi, "parity error detected", wear_level_min); + json_object_add_value_int(multi, "ecc error detection", wear_level_max); + json_object_add_value_int(multi, "axi data parity errors", wear_level_avg); + json_object_add_value_object(entry_stats, "raw", multi); + json_object_add_value_object(dev_stats, "SRAM_UECC_Detection_Count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->Raid_Recovery_Fail_Count.key); + json_object_add_value_int(entry_stats, "normalized", smart->Raid_Recovery_Fail_Count.norm); + raw_val = int48_to_long(smart->Raid_Recovery_Fail_Count.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "raid_Recovery_fail_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->Inflight_Command.key); + json_object_add_value_int(entry_stats, "normalized", smart->Inflight_Command.norm); + multi = json_create_object(); + wear_level_min = le16_to_cpu(smart->Inflight_Command.wear_level.min); + wear_level_max = le16_to_cpu(smart->Inflight_Command.wear_level.max); + wear_level_avg = le16_to_cpu(smart->Inflight_Command.wear_level.avg); + json_object_add_value_int(multi, "Read Cmd", wear_level_min); + json_object_add_value_int(multi, "Write Cmd", wear_level_max); + json_object_add_value_int(multi, "Admin Cmd", wear_level_avg); + json_object_add_value_object(entry_stats, "raw", multi); + json_object_add_value_object(dev_stats, "Inflight_Command", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->Internal_End_to_End_Dect_Count.key); + json_object_add_value_int(entry_stats, "normalized", 100); + multi = json_create_object(); + wear_level_min = le16_to_cpu(smart->Internal_End_to_End_Dect_Count.wear_level.min); + wear_level_max = le16_to_cpu(smart->Internal_End_to_End_Dect_Count.wear_level.max); + wear_level_avg = le16_to_cpu(smart->Internal_End_to_End_Dect_Count.wear_level.avg); + json_object_add_value_int(multi, "read hcrc", wear_level_min); + json_object_add_value_int(multi, "write hcrc", wear_level_max); + json_object_add_value_int(multi, "reserved", wear_level_avg); + json_object_add_value_object(entry_stats, "raw", multi); + json_object_add_value_object(dev_stats, "internal_end_to_end_dect_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->die_fail_count.key); + json_object_add_value_int(entry_stats, "normalized", smart->die_fail_count.norm); + raw_val = int48_to_long(smart->die_fail_count.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "die_fail_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->wear_leveling_exec_count.key); + json_object_add_value_int(entry_stats, "normalized", smart->wear_leveling_exec_count.norm); + raw_val = int48_to_long(smart->wear_leveling_exec_count.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "wear_leveling_exec_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->read_disturb_count.key); + json_object_add_value_int(entry_stats, "normalized", smart->read_disturb_count.norm); + raw_val = int48_to_long(smart->read_disturb_count.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "read_disturb_count", entry_stats); + + entry_stats = json_create_object(); + json_object_add_value_int(entry_stats, "#id", smart->data_retention_count.key); + json_object_add_value_int(entry_stats, "normalized", smart->data_retention_count.norm); + raw_val = int48_to_long(smart->data_retention_count.raw); + json_object_add_value_int(entry_stats, "raw", raw_val); + json_object_add_value_object(dev_stats, "data_retention_count", entry_stats); + + json_object_add_value_object(root, "Device stats", dev_stats); + + json_print_object(root, NULL); + json_free_object(root); +} + +static +void show_ssstc_add_smart_log(struct nvme_additional_smart_log *smart, + unsigned int nsid, const char *devname) +{ + printf("Additional Smart Log for NVME device:%s namespace-id:%x\n", + devname, nsid); + printf("key #id normalized raw\n"); + printf("program_fail_count : %03d %3d%% %"PRIu64"\n", + smart->program_fail_cnt.key, + smart->program_fail_cnt.norm, + int48_to_long(smart->program_fail_cnt.raw)); + printf("erase_fail_count : %03d %3d%% %"PRIu64"\n", + smart->erase_fail_cnt.key, + smart->erase_fail_cnt.norm, + int48_to_long(smart->erase_fail_cnt.raw)); + printf("wear_leveling : %03d %3d%% min: %u, max: %u, avg: %u\n", + smart->wear_leveling_cnt.key, + smart->wear_leveling_cnt.norm, + le16_to_cpu(smart->wear_leveling_cnt.wear_level.min), + le16_to_cpu(smart->wear_leveling_cnt.wear_level.max), + le16_to_cpu(smart->wear_leveling_cnt.wear_level.avg)); + printf("end_to_end_error_dect_count : %03d %3d%% " + "guard check error: %u, " + "application tag check error: %u, " + "reference tag check error: %u\n", + smart->e2e_err_cnt.key, + smart->e2e_err_cnt.norm, + le16_to_cpu(smart->e2e_err_cnt.wear_level.min), + le16_to_cpu(smart->e2e_err_cnt.wear_level.max), + le16_to_cpu(smart->e2e_err_cnt.wear_level.avg)); + printf("crc_error_count : %03d %3d%% %"PRIu64"\n", + smart->crc_err_cnt.key, + smart->crc_err_cnt.norm, + int48_to_long(smart->crc_err_cnt.raw)); + printf("nand_bytes_written : %03d %3d%% sectors: %"PRIu64"\n", + smart->nand_bytes_written.key, + smart->nand_bytes_written.norm, + int48_to_long(smart->nand_bytes_written.raw)); + printf("host_bytes_written : %3d %3d%% sectors: %"PRIu64"\n", + smart->host_bytes_written.key, + smart->host_bytes_written.norm, + int48_to_long(smart->host_bytes_written.raw)); + printf("reallocated_sector_count : %03d %3d%% %"PRIu64"\n", + smart->reallocated_sector_count.key, + smart->reallocated_sector_count.norm, + int48_to_long(smart->reallocated_sector_count.raw)); + printf("uncorrectable_sector_count : %03d %3d%% %"PRIu64"\n", + smart->uncorrectable_sector_count.key, + smart->uncorrectable_sector_count.norm, + int48_to_long(smart->uncorrectable_sector_count.raw)); + printf("NAND_ECC_detection_count : %03d %3d%% %"PRIu64"\n", + smart->NAND_ECC_Detection_Count.key, + smart->NAND_ECC_Detection_Count.norm, + int48_to_long(smart->NAND_ECC_Detection_Count.raw)); + printf("NAND_ECC_correction_count : %03d %3d%% %"PRIu64"\n", + smart->NAND_ECC_Correction_Count.key, + smart->NAND_ECC_Correction_Count.norm, + int48_to_long(smart->NAND_ECC_Correction_Count.raw)); + printf("GC_count : %03d %3d%% %"PRIu64"\n", + smart->GC_Count.key, + smart->GC_Count.norm, + int48_to_long(smart->GC_Count.raw)); + printf("DRAM_UECC_detection_count : %03d %3d%% 1-Bit Err: %u, 2-Bit Err: %u\n", + smart->DRAM_UECC_Detection_Count.key, + smart->DRAM_UECC_Detection_Count.norm, + le16_to_cpu(smart->DRAM_UECC_Detection_Count.wear_level.max), + le16_to_cpu(smart->DRAM_UECC_Detection_Count.wear_level.avg)); + printf("SRAM_UECC_Detection_Count : %03d %3d%% " + "parity error detected: %u, " + "ecc error detection: %u, " + "axi data parity errors: %u\n", + smart->SRAM_UECC_Detection_Count.key, + smart->SRAM_UECC_Detection_Count.norm, + le16_to_cpu(smart->SRAM_UECC_Detection_Count.wear_level.min), + le16_to_cpu(smart->SRAM_UECC_Detection_Count.wear_level.max), + le16_to_cpu(smart->SRAM_UECC_Detection_Count.wear_level.avg)); + printf("raid_recovery_fail_count : %03d %3d%% %"PRIu64"\n", + smart->Raid_Recovery_Fail_Count.key, + smart->Raid_Recovery_Fail_Count.norm, + int48_to_long(smart->Raid_Recovery_Fail_Count.raw)); + printf("Inflight_Command : %03d %3d%% " + "Read Cmd: %u, Write Cmd: %u, Admin Cmd: %u\n", + smart->Inflight_Command.key, + smart->Inflight_Command.norm, + le16_to_cpu(smart->Inflight_Command.wear_level.min), + le16_to_cpu(smart->Inflight_Command.wear_level.max), + le16_to_cpu(smart->Inflight_Command.wear_level.avg)); + printf("internal_end_to_end_dect_count : %03d %3d%% " + "read hcrc: %u, write hcrc: %u, reserved: %u\n", + smart->Internal_End_to_End_Dect_Count.key, + 100, + le16_to_cpu(smart->Internal_End_to_End_Dect_Count.wear_level.min), + le16_to_cpu(smart->Internal_End_to_End_Dect_Count.wear_level.max), + le16_to_cpu(smart->Internal_End_to_End_Dect_Count.wear_level.avg)); + printf("die_fail_count : %03d %3d%% %"PRIu64"\n", + smart->die_fail_count.key, + smart->die_fail_count.norm, + int48_to_long(smart->die_fail_count.raw)); + printf("wear_leveling_exec_count : %03d %3d%% %"PRIu64"\n", + smart->wear_leveling_exec_count.key, + smart->wear_leveling_exec_count.norm, + int48_to_long(smart->wear_leveling_exec_count.raw)); + printf("read_disturb_count : %03d %3d%% %"PRIu64"\n", + smart->read_disturb_count.key, + smart->read_disturb_count.norm, + int48_to_long(smart->read_disturb_count.raw)); + printf("data_retention_count : %03d %3d%% %"PRIu64"\n", + smart->data_retention_count.key, + smart->data_retention_count.norm, + int48_to_long(smart->data_retention_count.raw)); +} + +static +int ssstc_get_add_smart_log(int argc, char **argv, struct command *cmd, struct plugin *plugin) +{ + + const char *desc = + "Get SSSTC vendor specific additional smart log\n" + "(optionally, for the specified namespace), and show it."; + const char *namespace = "(optional) desired namespace"; + const char *raw = "Dump output in binary format"; + const char *json = "Dump output in json format"; + + struct nvme_additional_smart_log smart_log_add; + struct nvme_dev *dev; + int err; + + struct config { + __u32 namespace_id; + bool raw_binary; + bool json; + }; + + struct config cfg = { + .namespace_id = NVME_NSID_ALL, + }; + + OPT_ARGS(opts) = { + OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace), + OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw), + OPT_FLAG("json", 'j', &cfg.json, json), + OPT_END() + }; + + err = parse_and_open(&dev, argc, argv, desc, opts); + if (err) + return err; + + err = nvme_get_log_simple(dev_fd(dev), 0xca, sizeof(smart_log_add), + &smart_log_add); + if (!err) { + if (cfg.json) + show_ssstc_add_smart_log_jsn(&smart_log_add, cfg.namespace_id, + dev->name); + else if (!cfg.raw_binary) + show_ssstc_add_smart_log(&smart_log_add, cfg.namespace_id, + dev->name); + else + d_raw((unsigned char *)&smart_log_add, sizeof(smart_log_add)); + } else if (err > 0) { + nvme_show_status(err); + } + dev_close(dev); + return err; + +} diff --git a/plugins/ssstc/ssstc-nvme.h b/plugins/ssstc/ssstc-nvme.h new file mode 100644 index 0000000..e34fa50 --- /dev/null +++ b/plugins/ssstc/ssstc-nvme.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#undef CMD_INC_FILE +#define CMD_INC_FILE plugins/ssstc/ssstc-nvme + +#if !defined(SSSTC_NVME) || defined(CMD_HEADER_MULTI_READ) +#define SSSTC_NVME + +#include "cmd.h" +PLUGIN(NAME("ssstc", "SSSTC vendor specific extensions", NVME_VERSION), + COMMAND_LIST( + ENTRY("smart-log-add", "Retrieve ssstc SMART Log, show it", ssstc_get_add_smart_log) + ) +); +#endif + +#include "define_cmd.h" diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c index 8cbcf2e..7525055 100644 --- a/plugins/wdc/wdc-nvme.c +++ b/plugins/wdc/wdc-nvme.c @@ -1383,6 +1383,11 @@ struct __packed wdc_fw_act_history_log_format_c2 { __u8 log_page_guid[WDC_C2_GUID_LENGTH]; }; +static __u8 ocp_C2_guid[WDC_C2_GUID_LENGTH] = { + 0x6D, 0x79, 0x9A, 0x76, 0xB4, 0xDA, 0xF6, 0xA3, + 0xE2, 0x4D, 0xB2, 0x8A, 0xAC, 0xF3, 0x1C, 0xD1 +}; + #define WDC_OCP_C4_GUID_LENGTH 16 #define WDC_DEV_CAP_LOG_BUF_LEN 4096 #define WDC_DEV_CAP_LOG_ID 0xC4 @@ -1726,7 +1731,6 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) case WDC_NVME_VID_2: switch (read_device_id) { case WDC_NVME_SN630_DEV_ID: - fallthrough; case WDC_NVME_SN630_DEV_ID_1: capabilities = (WDC_DRIVE_CAP_CAP_DIAG | WDC_DRIVE_CAP_INTERNAL_LOG | WDC_DRIVE_CAP_DRIVE_STATUS | WDC_DRIVE_CAP_CLEAR_ASSERT | @@ -1743,19 +1747,12 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) break; case WDC_NVME_SN640_DEV_ID: - fallthrough; case WDC_NVME_SN640_DEV_ID_1: - fallthrough; case WDC_NVME_SN640_DEV_ID_2: - fallthrough; case WDC_NVME_SN640_DEV_ID_3: - fallthrough; case WDC_NVME_SN560_DEV_ID_1: - fallthrough; case WDC_NVME_SN560_DEV_ID_2: - fallthrough; case WDC_NVME_SN560_DEV_ID_3: - fallthrough; case WDC_NVME_SN660_DEV_ID: /* verify the 0xC0 log page is supported */ if (wdc_nvme_check_supported_log_page(r, dev, @@ -1816,9 +1813,7 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) break; case WDC_NVME_SN840_DEV_ID: - fallthrough; case WDC_NVME_SN840_DEV_ID_1: - fallthrough; case WDC_NVME_SN860_DEV_ID: /* verify the 0xC0 log page is supported */ if (wdc_nvme_check_supported_log_page(r, dev, @@ -1826,7 +1821,6 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) capabilities |= WDC_DRIVE_CAP_C0_LOG_PAGE; fallthrough; case WDC_NVME_ZN540_DEV_ID: - fallthrough; case WDC_NVME_SN540_DEV_ID: capabilities |= (WDC_DRIVE_CAP_CAP_DIAG | WDC_DRIVE_CAP_INTERNAL_LOG | WDC_DRIVE_CAP_DRIVE_STATUS | WDC_DRIVE_CAP_CLEAR_ASSERT | @@ -1847,17 +1841,11 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) break; case WDC_NVME_SN650_DEV_ID: - fallthrough; case WDC_NVME_SN650_DEV_ID_1: - fallthrough; case WDC_NVME_SN650_DEV_ID_2: - fallthrough; case WDC_NVME_SN650_DEV_ID_3: - fallthrough; case WDC_NVME_SN650_DEV_ID_4: - fallthrough; case WDC_NVME_SN655_DEV_ID: - fallthrough; case WDC_NVME_SN550_DEV_ID: /* verify the 0xC0 log page is supported */ if (wdc_nvme_check_supported_log_page(r, dev, @@ -1907,7 +1895,6 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) break; case WDC_NVME_SN861_DEV_ID: - fallthrough; case WDC_NVME_SN861_DEV_ID_1: capabilities |= (WDC_DRIVE_CAP_C0_LOG_PAGE | WDC_DRIVE_CAP_C3_LOG_PAGE | @@ -1921,6 +1908,7 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) WDC_DRIVE_CAP_INFO | WDC_DRIVE_CAP_CLOUD_SSD_VERSION | WDC_DRIVE_CAP_LOG_PAGE_DIR | + WDC_DRIVE_CAP_DRIVE_STATUS | WDC_DRIVE_CAP_SET_LATENCY_MONITOR); break; @@ -1936,11 +1924,8 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) break; case WDC_NVME_SN520_DEV_ID: - fallthrough; case WDC_NVME_SN520_DEV_ID_1: - fallthrough; case WDC_NVME_SN520_DEV_ID_2: - fallthrough; case WDC_NVME_SN810_DEV_ID: capabilities = WDC_DRIVE_CAP_DUI_DATA; break; @@ -2010,19 +1995,14 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) case WDC_NVME_SN8000S_DEV_ID: fallthrough; case WDC_NVME_SN740_DEV_ID: - fallthrough; case WDC_NVME_SN740_DEV_ID_1: - fallthrough; case WDC_NVME_SN740_DEV_ID_2: - fallthrough; case WDC_NVME_SN740_DEV_ID_3: - fallthrough; case WDC_NVME_SN340_DEV_ID: capabilities = WDC_DRIVE_CAP_DUI; break; case WDC_NVME_ZN350_DEV_ID: - fallthrough; case WDC_NVME_ZN350_DEV_ID_1: capabilities = WDC_DRIVE_CAP_DUI_DATA | WDC_DRIVE_CAP_VU_FID_CLEAR_PCIE | WDC_DRIVE_CAP_C0_LOG_PAGE | @@ -2450,23 +2430,32 @@ static bool get_dev_mgment_cbs_data(nvme_root_t r, struct nvme_dev *dev, uuid_index = index + 1; } - if (!uuid_index && needs_c2_log_page_check(device_id)) { - /* In certain devices that don't support UUID lists, there are multiple - * definitions of the C2 logpage. In those cases, the code - * needs to try two UUID indexes and use an identification algorithm - * to determine which is returning the correct log page data. - */ - uuid_ix = 1; - } + if (uuid_present) { + /* use the uuid index found above */ + found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid, log_id, uuid_index); + } else if (device_id == WDC_NVME_ZN350_DEV_ID || device_id == WDC_NVME_ZN350_DEV_ID_1) { + uuid_index = 0; + found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid, log_id, uuid_index); + } else { + if (!uuid_index && needs_c2_log_page_check(device_id)) { + /* In certain devices that don't support UUID lists, there are multiple + * definitions of the C2 logpage. In those cases, the code + * needs to try two UUID indexes and use an identification algorithm + * to determine which is returning the correct log page data. + */ + uuid_ix = 1; + } - found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid, log_id, uuid_ix); + found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid, log_id, uuid_ix); - if (!found) { - /* not found with uuid = 1 try with uuid = 0 */ - uuid_ix = 0; - fprintf(stderr, "Not found, requesting log page with uuid_index %d\n", uuid_index); + if (!found) { + /* not found with uuid = 1 try with uuid = 0 */ + uuid_ix = 0; + fprintf(stderr, "Not found, requesting log page with uuid_index %d\n", + uuid_index); - found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid, log_id, uuid_ix); + found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid, log_id, uuid_ix); + } } return found; @@ -5538,17 +5527,18 @@ static void wdc_print_fw_act_history_log_normal(__u8 *data, int num_entries, char previous_fw[9]; char new_fw[9]; char commit_action_bin[8]; - char time_str[11]; + char time_str[100]; __u16 oldestEntryIdx = 0, entryIdx = 0; + uint64_t timestamp; + __u64 timestamp_sec; char *null_fw = "--------"; - memset((void *)time_str, 0, 11); + memset((void *)time_str, '\0', 100); if (data[0] == WDC_NVME_GET_FW_ACT_HISTORY_C2_LOG_ID) { printf(" Firmware Activate History Log\n"); if (cust_id == WDC_CUSTOMER_ID_0x1005 || - vendor_id == WDC_NVME_SNDK_VID || - wdc_is_sn861(device_id)) { + vendor_id == WDC_NVME_SNDK_VID) { printf(" Power on Hour Power Cycle Previous New\n"); printf(" Entry hh:mm:ss Count Firmware Firmware Slot Action Result\n"); printf(" ----- ----------------- ----------------- --------- --------- ----- ------ -------\n"); @@ -5589,48 +5579,33 @@ static void wdc_print_fw_act_history_log_normal(__u8 *data, int num_entries, memcpy(new_fw, null_fw, 8); printf("%5"PRIu16"", (uint16_t)le16_to_cpu(fw_act_history_entry->entry[entryIdx].fw_act_hist_entries)); + + timestamp = (0x0000FFFFFFFFFFFF & + le64_to_cpu( + fw_act_history_entry->entry[entryIdx].timestamp)); + timestamp_sec = timestamp / 1000; if (cust_id == WDC_CUSTOMER_ID_0x1005) { printf(" "); memset((void *)time_str, 0, 9); - sprintf((char *)time_str, "%04d:%02d:%02d", (int)(le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp)/3600), - (int)((le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp%3600)/60)), - (int)(le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp%60))); + sprintf((char *)time_str, "%"PRIu32":%u:%u", + (__u32)(timestamp_sec/3600), + (__u8)(timestamp_sec%3600/60), + (__u8)(timestamp_sec%60)); printf("%s", time_str); printf(" "); } else if (vendor_id == WDC_NVME_SNDK_VID) { printf(" "); - uint64_t timestamp = (0x0000FFFFFFFFFFFF & le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp)); memset((void *)time_str, 0, 9); - sprintf((char *)time_str, "%04d:%02d:%02d", (int)((timestamp/(3600*1000))%24), (int)((timestamp/(1000*60))%60), - (int)((timestamp/1000)%60)); + sprintf((char *)time_str, "%"PRIu32":%u:%u", + (__u32)((timestamp_sec/3600)%24), + (__u8)((timestamp_sec/60)%60), + (__u8)(timestamp_sec%60)); printf("%s", time_str); printf(" "); - } else if (wdc_is_sn861(device_id)) { - printf(" "); - char timestamp[20]; - __u64 hour; - __u8 min; - __u8 sec; - __u64 timestamp_sec; - - timestamp_sec = - le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp) - / 1000; - hour = timestamp_sec / 3600; - min = (timestamp_sec % 3600) / 60; - sec = timestamp_sec % 60; - - sprintf(timestamp, - "%"PRIu64":%02"PRIu8":%02"PRIu8, - (uint64_t)hour, min, sec); - printf("%-11s", timestamp); - printf(" "); } else { printf(" "); - uint64_t timestamp = (0x0000FFFFFFFFFFFF & le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp)); - printf("%16"PRIu64"", timestamp); printf(" "); } @@ -5735,13 +5710,15 @@ static void wdc_print_fw_act_history_log_json(__u8 *data, int num_entries, char new_fw[9]; char commit_action_bin[8]; char fail_str[32]; - char time_str[11]; + char time_str[100]; char ext_time_str[20]; + uint64_t timestamp; + __u64 timestamp_sec; memset((void *)previous_fw, 0, 9); memset((void *)new_fw, 0, 9); memset((void *)commit_action_bin, 0, 8); - memset((void *)time_str, 0, 11); + memset((void *)time_str, '\0', 100); memset((void *)ext_time_str, 0, 20); memset((void *)fail_str, 0, 11); char *null_fw = "--------"; @@ -5781,33 +5758,25 @@ static void wdc_print_fw_act_history_log_json(__u8 *data, int num_entries, json_object_add_value_int(root, "Entry", le16_to_cpu(fw_act_history_entry->entry[entryIdx].fw_act_hist_entries)); + timestamp = (0x0000FFFFFFFFFFFF & + le64_to_cpu( + fw_act_history_entry->entry[entryIdx].timestamp)); + timestamp_sec = timestamp / 1000; if (cust_id == WDC_CUSTOMER_ID_0x1005) { - sprintf((char *)time_str, "%04d:%02d:%02d", (int)(le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp)/3600), - (int)((le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp%3600)/60)), - (int)(le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp%60))); + sprintf((char *)time_str, "%"PRIu32":%u:%u", + (__u32)(timestamp_sec/3600), + (__u8)(timestamp_sec%3600/60), + (__u8)(timestamp_sec%60)); json_object_add_value_string(root, "Power on Hour", time_str); } else if (vendor_id == WDC_NVME_SNDK_VID) { - uint64_t timestamp = (0x0000FFFFFFFFFFFF & le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp)); - - sprintf((char *)time_str, "%04d:%02d:%02d", (int)((timestamp/(3600*1000))%24), (int)((timestamp/(1000*60))%60), - (int)((timestamp/1000)%60)); + sprintf((char *)time_str, "%"PRIu32":%u:%u", + (__u32)((timestamp_sec/3600)%24), + (__u8)((timestamp_sec/60)%60), + (__u8)(timestamp_sec%60)); json_object_add_value_string(root, "Power on Hour", time_str); - } else if (wdc_is_sn861(device_id)) { - __u64 timestamp_sec = - le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp) - / 1000; - - sprintf((char *)ext_time_str, - "%"PRIu64":%02"PRIu8":%02"PRIu8, - (uint64_t)(__u64)(timestamp_sec/3600), - (__u8)((timestamp_sec%3600)/60), - (__u8)(timestamp_sec%60)); - json_object_add_value_string(root, "Power on Hour", ext_time_str); } else { - uint64_t timestamp = (0x0000FFFFFFFFFFFF & le64_to_cpu(fw_act_history_entry->entry[entryIdx].timestamp)); - json_object_add_value_uint64(root, "Timestamp", timestamp); } @@ -7047,39 +7016,23 @@ static int wdc_get_c0_log_page(nvme_root_t r, struct nvme_dev *dev, char *format switch (device_id) { case WDC_NVME_SN640_DEV_ID: - fallthrough; case WDC_NVME_SN640_DEV_ID_1: - fallthrough; case WDC_NVME_SN640_DEV_ID_2: - fallthrough; case WDC_NVME_SN640_DEV_ID_3: - fallthrough; case WDC_NVME_SN840_DEV_ID: - fallthrough; case WDC_NVME_SN840_DEV_ID_1: - fallthrough; case WDC_NVME_SN860_DEV_ID: - fallthrough; case WDC_NVME_SN560_DEV_ID_1: - fallthrough; case WDC_NVME_SN560_DEV_ID_2: - fallthrough; case WDC_NVME_SN560_DEV_ID_3: - fallthrough; case WDC_NVME_SN550_DEV_ID: ret = wdc_get_c0_log_page_sn(r, dev, uuid_index, format, namespace_id, fmt); break; - case WDC_NVME_SN650_DEV_ID: - fallthrough; case WDC_NVME_SN650_DEV_ID_1: - fallthrough; case WDC_NVME_SN650_DEV_ID_2: - fallthrough; case WDC_NVME_SN650_DEV_ID_3: - fallthrough; case WDC_NVME_SN650_DEV_ID_4: - fallthrough; case WDC_NVME_SN655_DEV_ID: if (uuid_index == 0) { log_id = WDC_NVME_GET_SMART_CLOUD_ATTR_LOG_ID; @@ -7137,9 +7090,7 @@ static int wdc_get_c0_log_page(nvme_root_t r, struct nvme_dev *dev, char *format } free(data); break; - case WDC_NVME_ZN350_DEV_ID: - fallthrough; case WDC_NVME_ZN350_DEV_ID_1: data = (__u8 *)malloc(sizeof(__u8) * WDC_NVME_SMART_CLOUD_ATTR_LEN); if (!data) { @@ -7405,17 +7356,11 @@ static int wdc_get_ca_log_page(nvme_root_t r, struct nvme_dev *dev, char *format } break; case WDC_NVME_SN640_DEV_ID: - fallthrough; case WDC_NVME_SN640_DEV_ID_1: - fallthrough; case WDC_NVME_SN640_DEV_ID_2: - fallthrough; case WDC_NVME_SN640_DEV_ID_3: - fallthrough; case WDC_NVME_SN840_DEV_ID: - fallthrough; case WDC_NVME_SN840_DEV_ID_1: - fallthrough; case WDC_NVME_SN860_DEV_ID: if (cust_id == WDC_CUSTOMER_ID_0x1005) { data = (__u8 *)malloc(sizeof(__u8) * WDC_FB_CA_LOG_BUF_LEN); @@ -9074,6 +9019,7 @@ static int wdc_get_fw_act_history_C2(nvme_root_t r, struct nvme_dev *dev, enum nvme_print_flags fmt; __u8 *data; int ret; + bool c2GuidMatch = false; if (!wdc_check_device(r, dev)) return -1; @@ -9102,29 +9048,40 @@ static int wdc_get_fw_act_history_C2(nvme_root_t r, struct nvme_dev *dev, nvme_show_status(ret); if (!ret) { - /* parse the data */ + /* Get the log page data and verify the GUID */ fw_act_history_log = (struct wdc_fw_act_history_log_format_c2 *)(data); - tot_entries = le32_to_cpu(fw_act_history_log->num_entries); - if (tot_entries > 0) { - /* get the FW customer id */ - if (!wdc_is_sn861(device_id)) { - cust_id = wdc_get_fw_cust_id(r, dev); - if (cust_id == WDC_INVALID_CUSTOMER_ID) { - fprintf(stderr, - "%s: ERROR: WDC: invalid customer id\n", - __func__); - ret = -1; - goto freeData; + c2GuidMatch = !memcmp(ocp_C2_guid, + fw_act_history_log->log_page_guid, + WDC_C2_GUID_LENGTH); + + if (c2GuidMatch) { + /* parse the data */ + tot_entries = le32_to_cpu(fw_act_history_log->num_entries); + + if (tot_entries > 0) { + /* get the FW customer id */ + if (!wdc_is_sn861(device_id)) { + cust_id = wdc_get_fw_cust_id(r, dev); + if (cust_id == WDC_INVALID_CUSTOMER_ID) { + fprintf(stderr, + "%s: ERROR: WDC: invalid customer id\n", + __func__); + ret = -1; + goto freeData; + } } + num_entries = (tot_entries < WDC_MAX_NUM_ACT_HIST_ENTRIES) ? + tot_entries : WDC_MAX_NUM_ACT_HIST_ENTRIES; + ret = wdc_print_fw_act_history_log(data, num_entries, + fmt, cust_id, vendor_id, device_id); + } else { + fprintf(stderr, "INFO: WDC: No entries found.\n"); + ret = 0; } - num_entries = (tot_entries < WDC_MAX_NUM_ACT_HIST_ENTRIES) ? tot_entries : - WDC_MAX_NUM_ACT_HIST_ENTRIES; - ret = wdc_print_fw_act_history_log(data, num_entries, - fmt, cust_id, vendor_id, device_id); - } else { - fprintf(stderr, "INFO: WDC: No FW Activate History entries found.\n"); - ret = 0; + } else { + fprintf(stderr, "ERROR: WDC: Invalid C2 log page GUID\n"); + ret = -1; } } else { fprintf(stderr, "ERROR: WDC: Unable to read FW Activate History Log Page data\n"); @@ -9143,7 +9100,7 @@ static int wdc_vs_fw_activate_history(int argc, char **argv, struct command *com __u64 capabilities = 0; struct nvme_dev *dev; nvme_root_t r; - int ret; + int ret = -1; struct config { char *output_format; @@ -9171,61 +9128,23 @@ static int wdc_vs_fw_activate_history(int argc, char **argv, struct command *com } if (capabilities & WDC_DRIVE_CAP_FW_ACTIVATE_HISTORY) { - int uuid_index = 0; - bool c0GuidMatch = false; - __u8 *data; - int i; - - /* - * check for the GUID in the 0xC0 log page to determine which log page to use to - * retrieve fw activate history data - */ - data = (__u8 *)malloc(sizeof(__u8) * WDC_NVME_SMART_CLOUD_ATTR_LEN); - if (!data) { - fprintf(stderr, "ERROR: WDC: malloc: %s\n", strerror(errno)); + __u32 cust_fw_id = 0; + /* get the FW customer id */ + cust_fw_id = wdc_get_fw_cust_id(r, dev); + if (cust_fw_id == WDC_INVALID_CUSTOMER_ID) { + fprintf(stderr, "%s: ERROR: WDC: invalid customer id\n", __func__); ret = -1; goto out; } - /* Get the 0xC0 log data */ - struct nvme_get_log_args args = { - .args_size = sizeof(args), - .fd = dev_fd(dev), - .lid = WDC_NVME_GET_SMART_CLOUD_ATTR_LOG_ID, - .nsid = 0xFFFFFFFF, - .lpo = 0, - .lsp = NVME_LOG_LSP_NONE, - .lsi = 0, - .rae = false, - .uuidx = uuid_index, - .csi = NVME_CSI_NVM, - .ot = false, - .len = WDC_NVME_SMART_CLOUD_ATTR_LEN, - .log = data, - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .result = NULL, - }; - ret = nvme_get_log(&args); - - if (!ret) { - /* Verify GUID matches */ - for (i = 0; i < 16; i++) { - if (scao_guid[i] != data[SCAO_LPG + i]) { - c0GuidMatch = false; - break; - } - } - - if (i == 16) - c0GuidMatch = true; - } - - free(data); - if (c0GuidMatch) + if ((cust_fw_id == WDC_CUSTOMER_ID_0x1004) || + (cust_fw_id == WDC_CUSTOMER_ID_0x1008) || + (cust_fw_id == WDC_CUSTOMER_ID_0x1005) || + (cust_fw_id == WDC_CUSTOMER_ID_0x1304)) ret = wdc_get_fw_act_history_C2(r, dev, cfg.output_format); else ret = wdc_get_fw_act_history(r, dev, cfg.output_format); - } else { + } else if (capabilities & WDC_DRIVE_CAP_FW_ACTIVATE_HISTORY_C2) { ret = wdc_get_fw_act_history_C2(r, dev, cfg.output_format); } @@ -9648,10 +9567,10 @@ static int wdc_fetch_log_file_from_device(struct nvme_dev *dev, __u32 fileId, __u16 spiDestn, __u64 fileSize, __u8 *dataBuffer) { int ret = WDC_STATUS_FAILURE; - __u32 chunckSize = WDC_DE_VU_READ_BUFFER_STANDARD_OFFSET; - __u32 maximumTransferLength = 0; - __u32 buffSize = 0; - __u64 offsetIdx = 0; + __u32 chunckSize = WDC_DE_VU_READ_BUFFER_STANDARD_OFFSET; + __u32 maximumTransferLength = 0; + __u32 buffSize = 0; + __u64 offsetIdx = 0; if (!dev || !dataBuffer || !fileSize) { ret = WDC_STATUS_INVALID_PARAMETER; @@ -9699,18 +9618,17 @@ end: static int wdc_de_get_dump_trace(struct nvme_dev *dev, char *filePath, __u16 binFileNameLen, char *binFileName) { - int ret = WDC_STATUS_FAILURE; - __u8 *readBuffer = NULL; - __u32 readBufferLen = 0; - __u32 lastPktReadBufferLen = 0; - __u32 maxTransferLen = 0; - __u32 dumptraceSize = 0; - __u32 chunkSize = 0; - __u32 chunks = 0; - __u32 offset = 0; - __u8 loop = 0; - __u16 i = 0; - __u32 maximumTransferLength = 0; + int ret = WDC_STATUS_FAILURE; + __u8 *readBuffer = NULL; + __u32 readBufferLen = 0; + __u32 lastPktReadBufferLen = 0; + __u32 maxTransferLen = 0; + __u32 dumptraceSize = 0; + __u32 chunkSize; + __u32 chunks; + __u32 offset; + __u32 i; + __u32 maximumTransferLength = 0; if (!dev || !binFileName || !filePath) { ret = WDC_STATUS_INVALID_PARAMETER; @@ -9759,7 +9677,7 @@ static int wdc_de_get_dump_trace(struct nvme_dev *dev, char *filePath, __u16 bin } for (i = 0; i < chunks; i++) { - offset = ((i*chunkSize) / 4); + offset = (i * chunkSize) / 4; /* Last loop call, Assign readBufferLen to read only left over bytes */ if (i == (chunks - 1)) @@ -9774,7 +9692,7 @@ static int wdc_de_get_dump_trace(struct nvme_dev *dev, char *filePath, __u16 bin break; } } - } while (loop); + } while (0); if (ret == WDC_STATUS_SUCCESS) { ret = wdc_WriteToFile(binFileName, (char *)readBuffer, dumptraceSize); @@ -11678,7 +11596,6 @@ static int wdc_vs_drive_info(int argc, char **argv, break; case WDC_NVME_SN861_DEV_ID: - fallthrough; case WDC_NVME_SN861_DEV_ID_1: data_len = sizeof(info); num_dwords = data_len / 4; diff --git a/plugins/wdc/wdc-nvme.h b/plugins/wdc/wdc-nvme.h index d3692bc..65d2de3 100644 --- a/plugins/wdc/wdc-nvme.h +++ b/plugins/wdc/wdc-nvme.h @@ -5,7 +5,7 @@ #if !defined(WDC_NVME) || defined(CMD_HEADER_MULTI_READ) #define WDC_NVME -#define WDC_PLUGIN_VERSION "2.7.0" +#define WDC_PLUGIN_VERSION "2.8.1" #include "cmd.h" PLUGIN(NAME("wdc", "Western Digital vendor specific extensions", WDC_PLUGIN_VERSION), diff --git a/plugins/wdc/wdc-utils.c b/plugins/wdc/wdc-utils.c index 414a06a..1b52e7c 100644 --- a/plugins/wdc/wdc-utils.c +++ b/plugins/wdc/wdc-utils.c @@ -192,5 +192,5 @@ bool wdc_CheckUuidListSupport(struct nvme_dev *dev, struct nvme_id_uuid_list *uu bool wdc_UuidEqual(struct nvme_id_uuid_list_entry *entry1, struct nvme_id_uuid_list_entry *entry2) { - return !memcmp(entry1, entry2, NVME_UUID_LEN); + return !memcmp(entry1->uuid, entry2->uuid, NVME_UUID_LEN); } diff --git a/subprojects/libnvme.wrap b/subprojects/libnvme.wrap index 5bf470a..271bc75 100644 --- a/subprojects/libnvme.wrap +++ b/subprojects/libnvme.wrap @@ -1,6 +1,6 @@ [wrap-git] url = https://github.com/linux-nvme/libnvme.git -revision = bff7dda7e2a0f883d0b89e23fed725c916de3e61 +revision = 80c5cf2aa45f4afc7571dc48850fae3fd62828af [provide] libnvme = libnvme_dep diff --git a/util/logging.c b/util/logging.c new file mode 100644 index 0000000..c26d9e2 --- /dev/null +++ b/util/logging.c @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +#include +#include +#include +#include +#include + +#include + +#include "logging.h" + +int log_level; + +int map_log_level(int verbose, bool quiet) +{ + int log_level; + + /* + * LOG_NOTICE is unused thus the user has to provide two 'v' for getting + * any feedback at all. Thus skip this level + */ + verbose++; + + switch (verbose) { + case 0: + log_level = LOG_WARNING; + break; + case 1: + log_level = LOG_NOTICE; + break; + case 2: + log_level = LOG_INFO; + break; + default: + log_level = LOG_DEBUG; + break; + } + if (quiet) + log_level = LOG_ERR; + + return log_level; +} + +static void nvme_show_common(struct nvme_passthru_cmd *cmd) +{ + printf("opcode : %02x\n", cmd->opcode); + printf("flags : %02x\n", cmd->flags); + printf("rsvd1 : %04x\n", cmd->rsvd1); + printf("nsid : %08x\n", cmd->nsid); + printf("cdw2 : %08x\n", cmd->cdw2); + printf("cdw3 : %08x\n", cmd->cdw3); + printf("data_len : %08x\n", cmd->data_len); + printf("metadata_len : %08x\n", cmd->metadata_len); + printf("addr : %"PRIx64"\n", (uint64_t)(uintptr_t)cmd->addr); + printf("metadata : %"PRIx64"\n", (uint64_t)(uintptr_t)cmd->metadata); + printf("cdw10 : %08x\n", cmd->cdw10); + printf("cdw11 : %08x\n", cmd->cdw11); + printf("cdw12 : %08x\n", cmd->cdw12); + printf("cdw13 : %08x\n", cmd->cdw13); + printf("cdw14 : %08x\n", cmd->cdw14); + printf("cdw15 : %08x\n", cmd->cdw15); + printf("timeout_ms : %08x\n", cmd->timeout_ms); +} + +static void nvme_show_command(struct nvme_passthru_cmd *cmd, int err) +{ + nvme_show_common(cmd); + printf("result : %08x\n", cmd->result); + printf("err : %d\n", err); +} + +static void nvme_show_command64(struct nvme_passthru_cmd64 *cmd, int err) +{ + nvme_show_common((struct nvme_passthru_cmd *)cmd); + printf("result : %"PRIx64"\n", (uint64_t)(uintptr_t)cmd->result); + printf("err : %d\n", err); +} + +static void nvme_show_latency(struct timeval start, struct timeval end) +{ + printf("latency : %lu us\n", + (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_usec - start.tv_usec)); +} + +int nvme_submit_passthru(int fd, unsigned long ioctl_cmd, + struct nvme_passthru_cmd *cmd, __u32 *result) +{ + struct timeval start; + struct timeval end; + int err; + + if (log_level >= LOG_INFO) + gettimeofday(&start, NULL); + + err = ioctl(fd, ioctl_cmd, cmd); + + if (log_level >= LOG_INFO) { + gettimeofday(&end, NULL); + if (log_level >= LOG_DEBUG) + nvme_show_command(cmd, err); + nvme_show_latency(start, end); + } + + if (err >= 0 && result) + *result = cmd->result; + + return err; +} + +int nvme_submit_passthru64(int fd, unsigned long ioctl_cmd, + struct nvme_passthru_cmd64 *cmd, + __u64 *result) +{ + struct timeval start; + struct timeval end; + int err; + + if (log_level >= LOG_INFO) + gettimeofday(&start, NULL); + + + err = ioctl(fd, ioctl_cmd, cmd); + + if (log_level >= LOG_INFO) { + gettimeofday(&end, NULL); + if (log_level >= LOG_DEBUG) + nvme_show_command64(cmd, err); + nvme_show_latency(start, end); + } + + if (err >= 0 && result) + *result = cmd->result; + + return err; +} diff --git a/util/logging.h b/util/logging.h new file mode 100644 index 0000000..7b1814c --- /dev/null +++ b/util/logging.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef DEBUG_H_ +#define DEBUG_H_ + +#include + +extern int log_level; + +int map_log_level(int verbose, bool quiet); + +#endif // DEBUG_H_ diff --git a/util/meson.build b/util/meson.build index dfc683b..0065b86 100644 --- a/util/meson.build +++ b/util/meson.build @@ -4,6 +4,7 @@ sources += [ 'util/argconfig.c', 'util/base64.c', 'util/crc32.c', + 'util/logging.c', 'util/mem.c', 'util/suffix.c', 'util/types.c', -- cgit v1.2.3