From d6e1a5d456961e2c1ad7d615e3e050b1b5148cb6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 16 Feb 2025 12:25:41 +0100 Subject: [PATCH] Adding upstream version 2.7.1. Signed-off-by: Daniel Baumann --- .github/AppImageBuilder.yml | 1 - .github/codeql/codeql-config.yml | 3 + .github/workflows/appimage.yml | 6 +- .github/workflows/build.yml | 16 +- .github/workflows/checkpatch.yml | 15 + .github/workflows/codeql.yml | 71 + .github/workflows/coverage.yml | 1 + .github/workflows/release.yml | 2 +- .mailmap | 1 + Documentation/nvme-admin-passthru.1 | 55 +- Documentation/nvme-admin-passthru.html | 62 +- Documentation/nvme-admin-passthru.txt | 46 +- Documentation/nvme-ana-log.1 | 17 +- Documentation/nvme-ana-log.html | 26 +- Documentation/nvme-ana-log.txt | 17 +- Documentation/nvme-attach-ns.1 | 21 +- Documentation/nvme-attach-ns.html | 30 +- Documentation/nvme-attach-ns.txt | 12 +- Documentation/nvme-boot-part-log.1 | 20 +- Documentation/nvme-boot-part-log.html | 27 +- Documentation/nvme-boot-part-log.txt | 18 +- Documentation/nvme-capacity-mgmt.1 | 23 +- Documentation/nvme-capacity-mgmt.html | 42 +- Documentation/nvme-capacity-mgmt.txt | 24 +- Documentation/nvme-changed-ns-list-log.1 | 16 +- Documentation/nvme-changed-ns-list-log.html | 25 +- Documentation/nvme-changed-ns-list-log.txt | 16 +- Documentation/nvme-check-dhchap-key.txt | 12 +- Documentation/nvme-check-tls-key.txt | 38 +- Documentation/nvme-cmdset-ind-id-ns.1 | 19 +- Documentation/nvme-cmdset-ind-id-ns.html | 26 +- Documentation/nvme-cmdset-ind-id-ns.txt | 16 +- Documentation/nvme-compare.1 | 39 +- Documentation/nvme-compare.html | 41 +- Documentation/nvme-compare.txt | 19 +- Documentation/nvme-config.txt | 65 +- Documentation/nvme-connect-all.1 | 76 +- Documentation/nvme-connect-all.html | 87 +- Documentation/nvme-connect-all.txt | 79 +- Documentation/nvme-connect.1 | 81 +- Documentation/nvme-connect.html | 98 +- Documentation/nvme-connect.txt | 76 +- Documentation/nvme-copy.1 | 63 +- Documentation/nvme-copy.html | 114 +- Documentation/nvme-copy.txt | 52 +- Documentation/nvme-create-ns.1 | 29 +- Documentation/nvme-create-ns.html | 36 +- Documentation/nvme-create-ns.txt | 18 +- Documentation/nvme-delete-ns.1 | 19 +- Documentation/nvme-delete-ns.html | 28 +- Documentation/nvme-delete-ns.txt | 10 + Documentation/nvme-dera-stat.1 | 4 +- Documentation/nvme-dera-stat.html | 2 +- Documentation/nvme-dera-stat.txt | 1 - Documentation/nvme-detach-ns.1 | 21 +- Documentation/nvme-detach-ns.html | 30 +- Documentation/nvme-detach-ns.txt | 12 +- Documentation/nvme-device-self-test.1 | 21 +- Documentation/nvme-device-self-test.html | 28 +- Documentation/nvme-device-self-test.txt | 24 +- Documentation/nvme-dim.1 | 25 +- Documentation/nvme-dim.html | 32 +- Documentation/nvme-dim.txt | 19 +- Documentation/nvme-dir-receive.1 | 48 +- Documentation/nvme-dir-receive.html | 44 +- Documentation/nvme-dir-receive.txt | 30 +- Documentation/nvme-dir-send.1 | 50 +- Documentation/nvme-dir-send.html | 46 +- Documentation/nvme-dir-send.txt | 32 +- Documentation/nvme-disconnect-all.1 | 21 +- Documentation/nvme-disconnect-all.html | 34 +- Documentation/nvme-disconnect-all.txt | 13 +- Documentation/nvme-disconnect.1 | 24 +- Documentation/nvme-disconnect.html | 33 +- Documentation/nvme-disconnect.txt | 18 +- Documentation/nvme-discover.1 | 84 +- Documentation/nvme-discover.html | 104 +- Documentation/nvme-discover.txt | 94 +- Documentation/nvme-dsm.1 | 32 +- Documentation/nvme-dsm.html | 39 +- Documentation/nvme-dsm.txt | 24 +- Documentation/nvme-effects-log.1 | 28 +- Documentation/nvme-effects-log.html | 44 +- Documentation/nvme-effects-log.txt | 24 +- Documentation/nvme-endurance-event-agg-log.1 | 16 +- .../nvme-endurance-event-agg-log.html | 33 +- .../nvme-endurance-event-agg-log.txt | 24 +- Documentation/nvme-endurance-log.1 | 16 +- Documentation/nvme-endurance-log.html | 23 +- Documentation/nvme-endurance-log.txt | 14 +- Documentation/nvme-error-log.1 | 20 +- Documentation/nvme-error-log.html | 27 +- Documentation/nvme-error-log.txt | 17 +- Documentation/nvme-fdp-configs.1 | 11 +- Documentation/nvme-fdp-configs.html | 11 +- Documentation/nvme-fdp-configs.txt | 9 +- Documentation/nvme-fdp-events.1 | 12 +- Documentation/nvme-fdp-events.html | 12 +- Documentation/nvme-fdp-events.txt | 10 +- Documentation/nvme-fdp-set-events.1 | 11 +- Documentation/nvme-fdp-set-events.html | 11 +- Documentation/nvme-fdp-set-events.txt | 9 +- Documentation/nvme-fdp-stats.1 | 11 +- Documentation/nvme-fdp-stats.html | 11 +- Documentation/nvme-fdp-stats.txt | 9 +- Documentation/nvme-fdp-status.1 | 11 +- Documentation/nvme-fdp-status.html | 11 +- Documentation/nvme-fdp-status.txt | 9 +- Documentation/nvme-fdp-update.1 | 6 +- Documentation/nvme-fdp-update.html | 4 +- Documentation/nvme-fdp-update.txt | 2 +- Documentation/nvme-fdp-usage.1 | 11 +- Documentation/nvme-fdp-usage.html | 11 +- Documentation/nvme-fdp-usage.txt | 9 +- Documentation/nvme-fid-support-effects-log.1 | 28 +- .../nvme-fid-support-effects-log.html | 39 +- .../nvme-fid-support-effects-log.txt | 16 +- Documentation/nvme-flush.1 | 19 +- Documentation/nvme-flush.html | 28 +- Documentation/nvme-flush.txt | 10 + Documentation/nvme-format.1 | 34 +- Documentation/nvme-format.html | 41 +- Documentation/nvme-format.txt | 25 +- Documentation/nvme-fw-commit.1 | 23 +- Documentation/nvme-fw-commit.html | 30 +- Documentation/nvme-fw-commit.txt | 14 +- Documentation/nvme-fw-download.1 | 25 +- Documentation/nvme-fw-download.html | 32 +- Documentation/nvme-fw-download.txt | 16 +- Documentation/nvme-fw-log.1 | 16 +- Documentation/nvme-fw-log.html | 23 +- Documentation/nvme-fw-log.txt | 13 +- Documentation/nvme-gen-dhchap-key.txt | 16 +- Documentation/nvme-gen-hostnqn.1 | 22 +- Documentation/nvme-gen-hostnqn.html | 30 +- Documentation/nvme-gen-hostnqn.txt | 11 +- Documentation/nvme-gen-tls-key.txt | 40 +- Documentation/nvme-get-feature.1 | 31 +- Documentation/nvme-get-feature.html | 38 +- Documentation/nvme-get-feature.txt | 22 +- Documentation/nvme-get-lba-status.1 | 26 +- Documentation/nvme-get-lba-status.html | 33 +- Documentation/nvme-get-lba-status.txt | 24 +- Documentation/nvme-get-log.1 | 43 +- Documentation/nvme-get-log.html | 50 +- Documentation/nvme-get-log.txt | 34 +- Documentation/nvme-get-ns-id.1 | 22 +- Documentation/nvme-get-ns-id.html | 30 +- Documentation/nvme-get-ns-id.txt | 11 +- Documentation/nvme-get-property.1 | 25 +- Documentation/nvme-get-property.html | 32 +- Documentation/nvme-get-property.txt | 20 +- Documentation/nvme-help.1 | 4 +- Documentation/nvme-help.html | 2 +- Documentation/nvme-huawei-id-ctrl.1 | 10 +- Documentation/nvme-huawei-id-ctrl.html | 14 +- Documentation/nvme-huawei-id-ctrl.txt | 12 +- Documentation/nvme-huawei-list.1 | 8 +- Documentation/nvme-huawei-list.html | 8 +- Documentation/nvme-huawei-list.txt | 6 +- Documentation/nvme-id-ctrl.1 | 22 +- Documentation/nvme-id-ctrl.html | 29 +- Documentation/nvme-id-ctrl.txt | 20 +- Documentation/nvme-id-domain.1 | 16 +- Documentation/nvme-id-domain.html | 23 +- Documentation/nvme-id-domain.txt | 14 +- Documentation/nvme-id-iocs.1 | 16 +- Documentation/nvme-id-iocs.html | 23 +- Documentation/nvme-id-iocs.txt | 14 +- Documentation/nvme-id-ns-granularity.txt | 46 + Documentation/nvme-id-ns-lba-format.txt | 16 +- Documentation/nvme-id-ns.1 | 26 +- Documentation/nvme-id-ns.html | 33 +- Documentation/nvme-id-ns.txt | 24 +- Documentation/nvme-id-nvmset.1 | 18 +- Documentation/nvme-id-nvmset.html | 27 +- Documentation/nvme-id-nvmset.txt | 18 +- Documentation/nvme-id-uuid.txt | 55 + Documentation/nvme-inspur-nvme-vendor-log.1 | 4 +- .../nvme-inspur-nvme-vendor-log.html | 2 +- Documentation/nvme-inspur-nvme-vendor-log.txt | 1 - Documentation/nvme-intel-id-ctrl.1 | 10 +- Documentation/nvme-intel-id-ctrl.html | 14 +- Documentation/nvme-intel-id-ctrl.txt | 12 +- Documentation/nvme-intel-internal-log.1 | 4 +- Documentation/nvme-intel-internal-log.html | 2 +- Documentation/nvme-intel-internal-log.txt | 1 - 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 | 7 +- Documentation/nvme-intel-smart-log-add.html | 7 +- Documentation/nvme-intel-smart-log-add.txt | 8 +- Documentation/nvme-intel-temp-stats.1 | 4 +- Documentation/nvme-intel-temp-stats.html | 2 +- Documentation/nvme-io-mgmt-recv.1 | 26 +- Documentation/nvme-io-mgmt-recv.html | 33 +- Documentation/nvme-io-mgmt-recv.txt | 16 +- Documentation/nvme-io-mgmt-send.1 | 26 +- Documentation/nvme-io-mgmt-send.html | 33 +- Documentation/nvme-io-mgmt-send.txt | 16 +- Documentation/nvme-io-passthru.1 | 53 +- Documentation/nvme-io-passthru.html | 60 +- Documentation/nvme-io-passthru.txt | 44 +- Documentation/nvme-lba-status-log.1 | 17 +- Documentation/nvme-lba-status-log.html | 24 +- Documentation/nvme-lba-status-log.txt | 15 +- Documentation/nvme-list-ctrl.1 | 42 +- Documentation/nvme-list-ctrl.html | 54 +- Documentation/nvme-list-ctrl.txt | 16 +- Documentation/nvme-list-endgrp.1 | 18 +- Documentation/nvme-list-endgrp.html | 27 +- Documentation/nvme-list-endgrp.txt | 23 +- Documentation/nvme-list-ns.1 | 20 +- Documentation/nvme-list-ns.html | 24 +- Documentation/nvme-list-ns.txt | 15 +- Documentation/nvme-list-secondary.txt | 54 + Documentation/nvme-list-subsys.1 | 18 +- Documentation/nvme-list-subsys.html | 23 +- Documentation/nvme-list-subsys.txt | 14 +- Documentation/nvme-list.1 | 13 +- Documentation/nvme-list.html | 12 +- Documentation/nvme-list.txt | 11 +- Documentation/nvme-lockdown.1 | 31 +- Documentation/nvme-lockdown.html | 50 +- Documentation/nvme-lockdown.txt | 25 +- Documentation/nvme-media-unit-stat-log.txt | 18 +- .../nvme-mi-cmd-support-effects-log.1 | 30 +- .../nvme-mi-cmd-support-effects-log.html | 43 +- .../nvme-mi-cmd-support-effects-log.txt | 20 +- Documentation/nvme-micron-clear-pcie-errors.1 | 4 +- .../nvme-micron-clear-pcie-errors.html | 2 +- Documentation/nvme-micron-internal-log.1 | 6 +- Documentation/nvme-micron-internal-log.html | 15 +- Documentation/nvme-micron-internal-log.txt | 18 +- 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 +- .../nvme-micron-selective-download.1 | 13 +- .../nvme-micron-selective-download.html | 16 +- .../nvme-micron-selective-download.txt | 31 +- Documentation/nvme-micron-smart-add-log.1 | 13 +- Documentation/nvme-micron-smart-add-log.html | 15 +- Documentation/nvme-micron-smart-add-log.txt | 6 +- Documentation/nvme-micron-temperature-stats.1 | 4 +- .../nvme-micron-temperature-stats.html | 2 +- Documentation/nvme-netapp-ontapdevices.1 | 6 +- Documentation/nvme-netapp-ontapdevices.html | 8 +- Documentation/nvme-netapp-ontapdevices.txt | 6 +- Documentation/nvme-netapp-smdevices.1 | 6 +- Documentation/nvme-netapp-smdevices.html | 4 +- Documentation/nvme-netapp-smdevices.txt | 2 +- Documentation/nvme-ns-descs.1 | 19 +- Documentation/nvme-ns-descs.html | 26 +- Documentation/nvme-ns-descs.txt | 16 +- Documentation/nvme-ns-rescan.1 | 22 +- Documentation/nvme-ns-rescan.html | 30 +- Documentation/nvme-ns-rescan.txt | 11 +- Documentation/nvme-nvm-id-ctrl.1 | 16 +- Documentation/nvme-nvm-id-ctrl.html | 23 +- Documentation/nvme-nvm-id-ctrl.txt | 14 +- Documentation/nvme-nvm-id-ns-lba-format.txt | 13 +- Documentation/nvme-nvm-id-ns.txt | 13 +- Documentation/nvme-nvme-mi-recv.1 | 36 +- Documentation/nvme-nvme-mi-recv.html | 43 +- Documentation/nvme-nvme-mi-recv.txt | 27 +- Documentation/nvme-nvme-mi-send.1 | 36 +- Documentation/nvme-nvme-mi-send.html | 43 +- Documentation/nvme-nvme-mi-send.txt | 27 +- .../nvme-ocp-clear-fw-activate-history.1 | 4 +- .../nvme-ocp-clear-fw-activate-history.html | 2 +- .../nvme-ocp-clear-fw-activate-history.txt | 2 +- ...cp-clear-pcie-correctable-error-counters.1 | 4 +- ...clear-pcie-correctable-error-counters.html | 2 +- ...-clear-pcie-correctable-error-counters.txt | 2 +- .../nvme-ocp-device-capability-log.txt | 4 +- Documentation/nvme-ocp-eol-plp-failure-mode.1 | 9 +- .../nvme-ocp-eol-plp-failure-mode.html | 10 +- .../nvme-ocp-eol-plp-failure-mode.txt | 15 +- Documentation/nvme-ocp-error-recovery-log.txt | 4 +- ...nvme-ocp-get-plp-health-check-interval.txt | 54 + Documentation/nvme-ocp-latency-monitor-log.1 | 6 +- .../nvme-ocp-latency-monitor-log.html | 6 +- .../nvme-ocp-latency-monitor-log.txt | 4 +- .../nvme-ocp-set-dssd-power-state-feature.txt | 9 +- ...nvme-ocp-set-plp-health-check-interval.txt | 53 + Documentation/nvme-ocp-smart-add-log.1 | 6 +- Documentation/nvme-ocp-smart-add-log.html | 6 +- Documentation/nvme-ocp-smart-add-log.txt | 4 +- ...=> nvme-ocp-telemetry-string-log-page.txt} | 24 +- .../nvme-ocp-unsupported-reqs-log-pages.txt | 4 +- Documentation/nvme-persistent-event-log.1 | 19 +- Documentation/nvme-persistent-event-log.html | 48 +- Documentation/nvme-persistent-event-log.txt | 39 +- Documentation/nvme-phy-rx-eom-log.txt | 27 +- Documentation/nvme-pred-lat-event-agg-log.1 | 11 +- .../nvme-pred-lat-event-agg-log.html | 25 +- Documentation/nvme-pred-lat-event-agg-log.txt | 23 +- Documentation/nvme-predictable-lat-log.1 | 16 +- Documentation/nvme-predictable-lat-log.html | 31 +- Documentation/nvme-predictable-lat-log.txt | 22 +- Documentation/nvme-primary-ctrl-caps.1 | 28 +- Documentation/nvme-primary-ctrl-caps.html | 39 +- Documentation/nvme-primary-ctrl-caps.txt | 16 +- Documentation/nvme-read.1 | 54 +- Documentation/nvme-read.html | 81 +- Documentation/nvme-read.txt | 45 +- Documentation/nvme-reset.1 | 22 +- Documentation/nvme-reset.html | 30 +- Documentation/nvme-reset.txt | 11 +- Documentation/nvme-resv-acquire.1 | 28 +- Documentation/nvme-resv-acquire.html | 37 +- Documentation/nvme-resv-acquire.txt | 21 +- Documentation/nvme-resv-notif-log.1 | 16 +- Documentation/nvme-resv-notif-log.html | 25 +- Documentation/nvme-resv-notif-log.txt | 16 +- Documentation/nvme-resv-register.1 | 28 +- Documentation/nvme-resv-register.html | 35 +- Documentation/nvme-resv-register.txt | 19 +- Documentation/nvme-resv-release.1 | 26 +- Documentation/nvme-resv-release.html | 33 +- Documentation/nvme-resv-release.txt | 17 +- Documentation/nvme-resv-report.1 | 19 +- Documentation/nvme-resv-report.html | 26 +- Documentation/nvme-resv-report.txt | 16 +- Documentation/nvme-rpmb.1 | 32 +- Documentation/nvme-rpmb.html | 39 +- Documentation/nvme-rpmb.txt | 26 +- Documentation/nvme-sanitize-log.1 | 32 +- Documentation/nvme-sanitize-log.html | 51 +- Documentation/nvme-sanitize-log.txt | 28 +- Documentation/nvme-sanitize.1 | 31 +- Documentation/nvme-sanitize.html | 100 +- Documentation/nvme-sanitize.txt | 84 +- .../nvme-seagate-clear-fw-activate-history.1 | 4 +- ...vme-seagate-clear-fw-activate-history.html | 4 +- ...nvme-seagate-clear-fw-activate-history.txt | 4 +- ...me-seagate-clear-pcie-correctable-errors.1 | 6 +- ...seagate-clear-pcie-correctable-errors.html | 6 +- ...-seagate-clear-pcie-correctable-errors.txt | 6 +- .../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 | 4 +- Documentation/nvme-seagate-get-ctrl-tele.txt | 6 +- Documentation/nvme-seagate-get-host-tele.1 | 6 +- Documentation/nvme-seagate-get-host-tele.html | 11 +- Documentation/nvme-seagate-get-host-tele.txt | 15 +- Documentation/nvme-seagate-help.1 | 4 +- Documentation/nvme-seagate-help.html | 2 +- Documentation/nvme-seagate-plugin-version.1 | 4 +- .../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 | 4 +- .../nvme-seagate-vs-fw-activate-history.txt | 6 +- Documentation/nvme-seagate-vs-internal-log.1 | 4 +- .../nvme-seagate-vs-internal-log.html | 11 +- .../nvme-seagate-vs-internal-log.txt | 13 +- Documentation/nvme-seagate-vs-log-page-sup.1 | 6 +- .../nvme-seagate-vs-log-page-sup.html | 8 +- .../nvme-seagate-vs-log-page-sup.txt | 8 +- Documentation/nvme-seagate-vs-pcie-stats.1 | 6 +- Documentation/nvme-seagate-vs-pcie-stats.html | 8 +- Documentation/nvme-seagate-vs-pcie-stats.txt | 8 +- Documentation/nvme-seagate-vs-smart-add-log.1 | 4 +- .../nvme-seagate-vs-smart-add-log.html | 4 +- .../nvme-seagate-vs-smart-add-log.txt | 10 +- .../nvme-seagate-vs-temperature-stats.1 | 6 +- .../nvme-seagate-vs-temperature-stats.html | 8 +- .../nvme-seagate-vs-temperature-stats.txt | 8 +- Documentation/nvme-security-recv.1 | 30 +- Documentation/nvme-security-recv.html | 37 +- Documentation/nvme-security-recv.txt | 21 +- Documentation/nvme-security-send.1 | 29 +- Documentation/nvme-security-send.html | 36 +- Documentation/nvme-security-send.txt | 20 +- Documentation/nvme-self-test-log.1 | 16 +- Documentation/nvme-self-test-log.html | 23 +- Documentation/nvme-self-test-log.txt | 13 +- Documentation/nvme-set-feature.1 | 32 +- Documentation/nvme-set-feature.html | 41 +- Documentation/nvme-set-feature.txt | 25 +- Documentation/nvme-set-property.1 | 27 +- Documentation/nvme-set-property.html | 36 +- Documentation/nvme-set-property.txt | 21 +- Documentation/nvme-show-hostnqn.1 | 22 +- Documentation/nvme-show-hostnqn.html | 32 +- Documentation/nvme-show-hostnqn.txt | 13 +- Documentation/nvme-show-regs.1 | 18 +- Documentation/nvme-show-regs.html | 27 +- Documentation/nvme-show-regs.txt | 18 +- Documentation/nvme-show-topology.1 | 22 +- Documentation/nvme-show-topology.html | 31 +- Documentation/nvme-show-topology.txt | 15 +- Documentation/nvme-smart-log.1 | 16 +- Documentation/nvme-smart-log.html | 23 +- Documentation/nvme-smart-log.txt | 14 +- Documentation/nvme-subsystem-reset.1 | 21 +- Documentation/nvme-subsystem-reset.html | 31 +- Documentation/nvme-subsystem-reset.txt | 10 +- .../nvme-supported-cap-config-log.txt | 23 +- Documentation/nvme-supported-log-pages.1 | 17 +- Documentation/nvme-supported-log-pages.html | 16 +- Documentation/nvme-supported-log-pages.txt | 14 +- Documentation/nvme-telemetry-log.1 | 25 +- Documentation/nvme-telemetry-log.html | 32 +- Documentation/nvme-telemetry-log.txt | 16 +- ...me-toshiba-clear-pcie-correctable-errors.1 | 4 +- ...toshiba-clear-pcie-correctable-errors.html | 2 +- ...-toshiba-clear-pcie-correctable-errors.txt | 2 - Documentation/nvme-toshiba-vs-internal-log.1 | 4 +- .../nvme-toshiba-vs-internal-log.html | 2 +- .../nvme-toshiba-vs-internal-log.txt | 2 - Documentation/nvme-toshiba-vs-smart-add-log.1 | 4 +- .../nvme-toshiba-vs-smart-add-log.html | 7 +- .../nvme-toshiba-vs-smart-add-log.txt | 11 +- Documentation/nvme-transcend-badblock.1 | 4 +- Documentation/nvme-transcend-badblock.html | 2 +- Documentation/nvme-transcend-badblock.txt | 1 - Documentation/nvme-transcend-healthvalue.1 | 4 +- Documentation/nvme-transcend-healthvalue.html | 5 +- Documentation/nvme-transcend-healthvalue.txt | 7 +- Documentation/nvme-verify.1 | 56 +- Documentation/nvme-verify.html | 81 +- Documentation/nvme-verify.txt | 47 +- Documentation/nvme-virt-mgmt.txt | 70 + .../nvme-virtium-save-smart-to-vtview-log.1 | 8 +- ...nvme-virtium-save-smart-to-vtview-log.html | 36 +- .../nvme-virtium-save-smart-to-vtview-log.txt | 42 +- Documentation/nvme-virtium-show-identify.1 | 4 +- Documentation/nvme-virtium-show-identify.html | 2 +- Documentation/nvme-virtium-show-identify.txt | 5 +- Documentation/nvme-wdc-cap-diag.1 | 4 +- Documentation/nvme-wdc-cap-diag.html | 4 +- Documentation/nvme-wdc-cap-diag.txt | 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-assert-dump.txt | 1 - .../nvme-wdc-clear-fw-activate-history.1 | 4 +- .../nvme-wdc-clear-fw-activate-history.html | 2 +- .../nvme-wdc-clear-fw-activate-history.txt | 1 - .../nvme-wdc-clear-pcie-correctable-errors.1 | 4 +- ...vme-wdc-clear-pcie-correctable-errors.html | 2 +- ...nvme-wdc-clear-pcie-correctable-errors.txt | 1 - .../nvme-wdc-cloud-SSD-plugin-version.1 | 4 +- .../nvme-wdc-cloud-SSD-plugin-version.html | 2 +- .../nvme-wdc-cloud-boot-SSD-version.1 | 4 +- .../nvme-wdc-cloud-boot-SSD-version.html | 2 +- Documentation/nvme-wdc-drive-essentials.1 | 4 +- Documentation/nvme-wdc-drive-essentials.html | 9 +- Documentation/nvme-wdc-drive-essentials.txt | 10 +- Documentation/nvme-wdc-drive-log.1 | 4 +- Documentation/nvme-wdc-drive-log.html | 2 +- Documentation/nvme-wdc-drive-log.txt | 1 - Documentation/nvme-wdc-drive-resize.1 | 4 +- Documentation/nvme-wdc-drive-resize.html | 2 +- Documentation/nvme-wdc-enc-get-log.1 | 8 +- Documentation/nvme-wdc-enc-get-log.html | 17 +- Documentation/nvme-wdc-enc-get-log.txt | 18 +- Documentation/nvme-wdc-get-crash-dump.1 | 4 +- Documentation/nvme-wdc-get-crash-dump.html | 2 +- .../nvme-wdc-get-dev-capabilities-log.1 | 9 +- .../nvme-wdc-get-dev-capabilities-log.html | 11 +- .../nvme-wdc-get-dev-capabilities-log.txt | 9 +- Documentation/nvme-wdc-get-drive-status.1 | 4 +- Documentation/nvme-wdc-get-drive-status.html | 10 +- Documentation/nvme-wdc-get-drive-status.txt | 12 +- .../nvme-wdc-get-error-recovery-log.1 | 6 +- .../nvme-wdc-get-error-recovery-log.html | 8 +- .../nvme-wdc-get-error-recovery-log.txt | 6 +- .../nvme-wdc-get-latency-monitor-log.1 | 6 +- .../nvme-wdc-get-latency-monitor-log.html | 6 +- .../nvme-wdc-get-latency-monitor-log.txt | 4 +- Documentation/nvme-wdc-get-pfail-dump.1 | 4 +- Documentation/nvme-wdc-get-pfail-dump.html | 2 +- .../nvme-wdc-get-unsupported-reqs-log.1 | 6 +- .../nvme-wdc-get-unsupported-reqs-log.html | 6 +- .../nvme-wdc-get-unsupported-reqs-log.txt | 4 +- Documentation/nvme-wdc-id-ctrl.1 | 12 +- Documentation/nvme-wdc-id-ctrl.html | 16 +- Documentation/nvme-wdc-id-ctrl.txt | 14 +- Documentation/nvme-wdc-log-page-directory.1 | 6 +- .../nvme-wdc-log-page-directory.html | 8 +- Documentation/nvme-wdc-log-page-directory.txt | 6 +- Documentation/nvme-wdc-namespace-resize.1 | 28 +- Documentation/nvme-wdc-namespace-resize.html | 30 +- Documentation/nvme-wdc-namespace-resize.txt | 26 +- Documentation/nvme-wdc-purge-monitor.1 | 4 +- Documentation/nvme-wdc-purge-monitor.html | 2 +- Documentation/nvme-wdc-purge-monitor.txt | 1 - Documentation/nvme-wdc-purge.1 | 4 +- Documentation/nvme-wdc-purge.html | 2 +- .../nvme-wdc-set-latency-monitor-feature.txt | 118 + Documentation/nvme-wdc-vs-cloud-log.1 | 6 +- Documentation/nvme-wdc-vs-cloud-log.html | 6 +- Documentation/nvme-wdc-vs-cloud-log.txt | 4 +- Documentation/nvme-wdc-vs-device-waf.1 | 6 +- Documentation/nvme-wdc-vs-device-waf.html | 6 +- Documentation/nvme-wdc-vs-device-waf.txt | 4 +- Documentation/nvme-wdc-vs-drive-info.1 | 4 +- Documentation/nvme-wdc-vs-drive-info.html | 2 +- Documentation/nvme-wdc-vs-drive-info.txt | 2 - .../nvme-wdc-vs-error-reason-identifier.1 | 4 +- .../nvme-wdc-vs-error-reason-identifier.html | 4 +- .../nvme-wdc-vs-error-reason-identifier.txt | 6 +- .../nvme-wdc-vs-fw-activate-history.1 | 6 +- .../nvme-wdc-vs-fw-activate-history.html | 10 +- .../nvme-wdc-vs-fw-activate-history.txt | 9 +- Documentation/nvme-wdc-vs-hw-rev-log.1 | 6 +- Documentation/nvme-wdc-vs-hw-rev-log.html | 6 +- Documentation/nvme-wdc-vs-hw-rev-log.txt | 4 +- Documentation/nvme-wdc-vs-internal-log.1 | 13 +- Documentation/nvme-wdc-vs-internal-log.html | 48 +- Documentation/nvme-wdc-vs-internal-log.txt | 46 +- Documentation/nvme-wdc-vs-nand-stats.1 | 6 +- Documentation/nvme-wdc-vs-nand-stats.html | 6 +- Documentation/nvme-wdc-vs-nand-stats.txt | 4 +- Documentation/nvme-wdc-vs-smart-add-log.1 | 6 +- Documentation/nvme-wdc-vs-smart-add-log.html | 23 +- Documentation/nvme-wdc-vs-smart-add-log.txt | 25 +- .../nvme-wdc-vs-telemetry-controller-option.1 | 10 +- ...me-wdc-vs-telemetry-controller-option.html | 14 +- ...vme-wdc-vs-telemetry-controller-option.txt | 16 +- Documentation/nvme-wdc-vs-temperature-stats.1 | 4 +- .../nvme-wdc-vs-temperature-stats.html | 2 +- Documentation/nvme-write-uncor.1 | 25 +- Documentation/nvme-write-uncor.html | 40 +- Documentation/nvme-write-uncor.txt | 16 +- Documentation/nvme-write-zeroes.1 | 49 +- Documentation/nvme-write-zeroes.html | 82 +- Documentation/nvme-write-zeroes.txt | 40 +- Documentation/nvme-write.1 | 58 +- Documentation/nvme-write.html | 93 +- Documentation/nvme-write.txt | 53 +- Documentation/nvme-zns-changed-zone-list.1 | 11 +- Documentation/nvme-zns-changed-zone-list.html | 15 +- Documentation/nvme-zns-changed-zone-list.txt | 13 +- 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 | 8 +- Documentation/nvme-zns-id-ctrl.html | 14 +- Documentation/nvme-zns-id-ctrl.txt | 12 +- Documentation/nvme-zns-id-ns.1 | 11 +- Documentation/nvme-zns-id-ns.html | 17 +- Documentation/nvme-zns-id-ns.txt | 17 +- Documentation/nvme-zns-offline-zone.1 | 4 +- Documentation/nvme-zns-offline-zone.html | 2 +- Documentation/nvme-zns-open-zone.1 | 10 +- Documentation/nvme-zns-open-zone.html | 8 +- Documentation/nvme-zns-open-zone.txt | 6 +- Documentation/nvme-zns-report-zones.1 | 8 +- Documentation/nvme-zns-report-zones.html | 12 +- Documentation/nvme-zns-report-zones.txt | 10 +- Documentation/nvme-zns-reset-zone.1 | 10 +- Documentation/nvme-zns-reset-zone.html | 8 +- Documentation/nvme-zns-reset-zone.txt | 6 +- Documentation/nvme-zns-set-zone-desc.1 | 14 +- Documentation/nvme-zns-set-zone-desc.html | 14 +- Documentation/nvme-zns-set-zone-desc.txt | 12 +- Documentation/nvme-zns-zone-append.1 | 4 +- Documentation/nvme-zns-zone-append.html | 2 +- Documentation/nvme-zns-zone-mgmt-recv.1 | 18 +- Documentation/nvme-zns-zone-mgmt-recv.html | 20 +- Documentation/nvme-zns-zone-mgmt-recv.txt | 16 +- Documentation/nvme-zns-zone-mgmt-send.1 | 20 +- Documentation/nvme-zns-zone-mgmt-send.html | 20 +- Documentation/nvme-zns-zone-mgmt-send.txt | 16 +- Documentation/nvme-zns-zrwa-flush-zone.txt | 4 +- Documentation/nvme.1 | 4 +- Documentation/nvme.html | 2 +- Makefile | 8 + README.md | 66 +- codecov.yml | 6 + completions/_nvme | 99 +- completions/bash-nvme-completion.sh | 53 +- fabrics.c | 24 +- libnvme-wrap.c | 31 +- meson.build | 21 +- nvme-builtin.h | 4 +- nvme-print-binary.c | 31 + nvme-print-json.c | 4808 +++++++++++------ nvme-print-stdout.c | 410 +- nvme-print.c | 163 +- nvme-print.h | 44 +- nvme-rpmb.c | 8 +- nvme.c | 730 ++- nvme.h | 12 +- nvme.spec.in | 2 +- .../systemd/nvmf-autoconnect.service.in | 3 +- .../systemd/nvmf-connect-nbft.service.in | 14 + .../65-persistent-net-nbft.rules.in | 2 + ...etapp.rules.in => 71-nvmf-netapp.rules.in} | 3 + plugins/fdp/fdp.c | 10 +- plugins/huawei/huawei-nvme.c | 8 +- plugins/intel/intel-nvme.c | 2 +- plugins/memblaze/memblaze-nvme.c | 645 ++- plugins/memblaze/memblaze-nvme.h | 3 + plugins/memblaze/memblaze-utils.h | 4 +- plugins/micron/micron-nvme.c | 13 +- plugins/nbft/nbft-plugin.c | 2 +- plugins/ocp/meson.build | 2 +- .../ocp/{ocp-utils.c => ocp-clear-features.c} | 44 +- plugins/ocp/ocp-clear-features.h | 12 + plugins/ocp/ocp-clear-fw-update-history.c | 20 - plugins/ocp/ocp-clear-fw-update-history.h | 10 - plugins/ocp/ocp-fw-activation-history.c | 12 +- plugins/ocp/ocp-nvme.c | 1116 +++- plugins/ocp/ocp-nvme.h | 5 +- plugins/ocp/ocp-smart-extended-log.c | 12 +- plugins/ocp/ocp-utils.c | 63 - plugins/ocp/ocp-utils.h | 4 +- plugins/scaleflux/sfx-nvme.c | 21 +- plugins/seagate/seagate-nvme.c | 6 +- plugins/solidigm/meson.build | 3 + .../solidigm/solidigm-garbage-collection.c | 6 +- plugins/solidigm/solidigm-get-drive-info.c | 79 + ...idigm-util.h => solidigm-get-drive-info.h} | 4 +- plugins/solidigm/solidigm-internal-logs.c | 34 +- plugins/solidigm/solidigm-latency-tracking.c | 4 +- plugins/solidigm/solidigm-log-page-dir.c | 46 +- plugins/solidigm/solidigm-nvme.c | 27 +- plugins/solidigm/solidigm-nvme.h | 6 +- plugins/solidigm/solidigm-ocp-version.c | 25 + ...solidigm-util.h => solidigm-ocp-version.h} | 4 +- plugins/solidigm/solidigm-smart.c | 12 +- plugins/solidigm/solidigm-telemetry.c | 35 +- plugins/solidigm/solidigm-telemetry/config.c | 2 +- .../solidigm/solidigm-telemetry/data-area.c | 2 +- plugins/solidigm/solidigm-temp-stats.c | 108 + ...{solidigm-util.h => solidigm-temp-stats.h} | 4 +- plugins/solidigm/solidigm-util.h | 2 + plugins/wdc/wdc-nvme.c | 1835 +++++-- plugins/wdc/wdc-nvme.h | 88 +- plugins/wdc/wdc-utils.c | 46 +- plugins/wdc/wdc-utils.h | 4 +- plugins/ymtc/ymtc-nvme.c | 2 +- plugins/ymtc/ymtc-utils.h | 2 +- plugins/zns/zns.c | 47 +- plugins/zns/zns.h | 2 +- scripts/build.sh | 74 +- scripts/release.sh | 4 +- subprojects/json-c.wrap | 17 +- subprojects/libnvme.wrap | 2 +- tests/meson.build | 2 +- tests/nvme_attach_detach_ns_test.py | 2 +- tests/nvme_copy_test.py | 92 +- tests/nvme_create_max_ns_test.py | 2 +- tests/nvme_format_test.py | 2 +- tests/nvme_get_features_test.py | 2 +- tests/nvme_test.py | 26 +- util/cleanup.c | 5 - util/cleanup.h | 8 +- util/mem.c | 109 + util/mem.h | 20 + util/meson.build | 2 +- 663 files changed, 15529 insertions(+), 6994 deletions(-) create mode 100644 .github/codeql/codeql-config.yml create mode 100644 .github/workflows/checkpatch.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .mailmap create mode 100755 Documentation/nvme-id-ns-granularity.txt create mode 100755 Documentation/nvme-id-uuid.txt create mode 100755 Documentation/nvme-list-secondary.txt mode change 100644 => 100755 Documentation/nvme-nvme-mi-recv.txt mode change 100644 => 100755 Documentation/nvme-nvme-mi-send.txt create mode 100644 Documentation/nvme-ocp-get-plp-health-check-interval.txt create mode 100644 Documentation/nvme-ocp-set-plp-health-check-interval.txt copy Documentation/{nvme-ocp-unsupported-reqs-log-pages.txt => nvme-ocp-telemetry-string-log-page.txt} (51%) create mode 100755 Documentation/nvme-virt-mgmt.txt create mode 100644 Documentation/nvme-wdc-set-latency-monitor-feature.txt create mode 100644 codecov.yml create mode 100644 nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in create mode 100644 nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in rename nvmf-autoconnect/udev-rules/{71-nvmf-iopolicy-netapp.rules.in => 71-nvmf-netapp.rules.in} (62%) copy plugins/ocp/{ocp-utils.c => ocp-clear-features.c} (62%) create mode 100644 plugins/ocp/ocp-clear-features.h delete mode 100644 plugins/ocp/ocp-clear-fw-update-history.c delete mode 100644 plugins/ocp/ocp-clear-fw-update-history.h create mode 100644 plugins/solidigm/solidigm-get-drive-info.c copy plugins/solidigm/{solidigm-util.h => solidigm-get-drive-info.h} (58%) create mode 100644 plugins/solidigm/solidigm-ocp-version.c copy plugins/solidigm/{solidigm-util.h => solidigm-ocp-version.h} (59%) create mode 100644 plugins/solidigm/solidigm-temp-stats.c copy plugins/solidigm/{solidigm-util.h => solidigm-temp-stats.h} (57%) delete mode 100644 util/cleanup.c create mode 100644 util/mem.c create mode 100644 util/mem.h diff --git a/.github/AppImageBuilder.yml b/.github/AppImageBuilder.yml index 67b215c..cce4689 100644 --- a/.github/AppImageBuilder.yml +++ b/.github/AppImageBuilder.yml @@ -27,7 +27,6 @@ AppDir: - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse include: - libjson-c5 - - libhugetlbfs0 - libssl3 files: include: diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 0000000..d9079fd --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,3 @@ +name: "CodeQL Config" +paths-ignore: + - subprojects/** diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 526c879..6c0d3e5 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -24,7 +24,7 @@ jobs: uses: AppImageCrafters/build-appimage@v1.3 with: recipe: .github/AppImageBuilder.yml - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 name: upload artifacts to github with: name: AppImage @@ -34,10 +34,10 @@ jobs: name: deploy AppImage runs-on: ubuntu-latest needs: build-appimage - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'linux-nvme/nvme-cli' }} steps: - name: Download artifact - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: workflow: ${{ github.event.workflow_run.workflow_id }} workflow_conclusion: success diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9903645..0b12517 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: - name: build run: | scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 name: upload logs if: failure() with: @@ -53,7 +53,7 @@ jobs: scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross params: "--platform linux/amd64" pull-params: "--platform linux/amd64" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 name: upload logs if: failure() with: @@ -72,7 +72,7 @@ jobs: - name: build run: | scripts/build.sh -b release -c gcc fallback - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: log files @@ -89,3 +89,13 @@ jobs: - name: build run: | scripts/build.sh -m muon + build-make-static: + name: make static + runs-on: ubuntu-latest + container: + image: ghcr.io/igaw/linux-nvme/debian:latest + steps: + - uses: actions/checkout@v4 + - name: build + run: | + make static diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml new file mode 100644 index 0000000..c0a09b7 --- /dev/null +++ b/.github/workflows/checkpatch.yml @@ -0,0 +1,15 @@ +name: checkpatch review +on: [pull_request] +jobs: + checkpatch: + name: checkpatch review + runs-on: ubuntu-latest + steps: + - name: 'Calculate PR commits + 1' + run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - name: Run checkpatch review + uses: webispy/checkpatch-action@v9 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..d57e17a --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,71 @@ +# CodeQL build configuration for nvme-cli +# Mostly based on auto-configuration with additions and tweaks for: +# * meson install +# * language detection +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '24 2 * * 5' + +jobs: + analyze: + name: Analyze + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners + # Consider using larger runners for possible analysis time improvements. + runs-on: 'ubuntu-latest' + timeout-minutes: 360 + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'c-cpp', 'python' ] + # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] + # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install build tools + run: | + sudo apt-get update + sudo apt-get install meson + + # Initializes the CodeQL tools for scanning. + - if: matrix.language == 'c-cpp' + name: Initialize CodeQL C + uses: github/codeql-action/init@v3 + with: + languages: 'c-cpp' + + - if: matrix.language == 'python' + name: Initialize CodeQL Python + uses: github/codeql-action/init@v3 + with: + languages: 'python' + config-file: ./.github/codeql/codeql-config.yml + + - name: meson build + run: | + meson setup --force-fallback-for=libnvme,json-c .build + ninja -C .build + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 39ea739..d272d0f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -7,6 +7,7 @@ on: jobs: code-coverage: + if: github.repository == 'linux-nvme/nvme-cli' name: code coverage runs-on: ubuntu-latest container: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8259480..8a5651c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ on: jobs: build: runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'linux-nvme/nvme-cli' permissions: contents: write steps: diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..b506f85 --- /dev/null +++ b/.mailmap @@ -0,0 +1 @@ +Vigneshwaran Saravanan diff --git a/Documentation/nvme-admin-passthru.1 b/Documentation/nvme-admin-passthru.1 index 4929a23..38fbba7 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ADMIN\-PASSTHR" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ADMIN\-PASSTHR" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,23 +32,24 @@ nvme-admin-passthru \- Submit an arbitrary admin command, return results .SH "SYNOPSIS" .sp .nf -\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 ] - [\-\-data\-len= | \-l ] - [\-\-metadata\-len= | \-m ] - [\-\-input\-file= | \-i ] - [\-\-read | \-r ] [\-\-write | \-w] - [\-\-timeout= | \-t ] - [\-\-show\-command | \-s] - [\-\-dry\-run | \-d] - [\-\-raw\-binary | \-b] - [\-\-prefill= | \-p ] - [\-\-latency | \-T] +\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 ] + [\-\-data\-len= | \-l ] + [\-\-metadata\-len= | \-m ] + [\-\-input\-file= | \-i ] + [\-\-read | \-r] [\-\-write | \-w] + [\-\-timeout= | \-t ] + [\-\-show\-command | \-s] + [\-\-dry\-run | \-d] + [\-\-raw\-binary | \-b] + [\-\-prefill= | \-p ] + [\-\-latency | \-T] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -59,7 +60,7 @@ The parameter is mandatory and may be either the NVMe character device On success, the returned structure (if applicable) may be returned in one of several ways depending on the option flags; the structure may printed by the program as a hex dump, or may be returned as a raw buffer printed to stdout for another program to parse\&. .SH "OPTIONS" .PP -\-o , \-\-opcode= +\-O , \-\-opcode= .RS 4 The NVMe opcode to send to the device in the command .RE @@ -131,6 +132,20 @@ Prefill the buffer with a predetermined byte value\&. Defaults to 0\&. This may .RS 4 Print out the latency the IOCTL took (in us)\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-admin-passthru.html b/Documentation/nvme-admin-passthru.html index 59bc115..b5ba02a 100644 --- a/Documentation/nvme-admin-passthru.html +++ b/Documentation/nvme-admin-passthru.html @@ -749,23 +749,24 @@ nvme-admin-passthru(1) Manual Page

SYNOPSIS

-
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>]
-                [--data-len=<data-len> | -l <data-len>]
-                [--metadata-len=<len> | -m <len>]
-                [--input-file=<file> | -i <file>]
-                [--read | -r ] [--write | -w]
-                [--timeout=<to> | -t <to>]
-                [--show-command | -s]
-                [--dry-run | -d]
-                [--raw-binary | -b]
-                [--prefill=<prefill> | -p <prefill>]
-                [--latency | -T]
+
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>]
+                        [--data-len=<data-len> | -l <data-len>]
+                        [--metadata-len=<len> | -m <len>]
+                        [--input-file=<file> | -i <file>]
+                        [--read | -r] [--write | -w]
+                        [--timeout=<to> | -t <to>]
+                        [--show-command | -s]
+                        [--dry-run | -d]
+                        [--raw-binary | -b]
+                        [--prefill=<prefill> | -p <prefill>]
+                        [--latency | -T]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -790,7 +791,7 @@ printed to stdout for another program to parse.

--o <opcode> +-O <opcode>
--opcode=<opcode> @@ -961,6 +962,29 @@ printed to stdout for another program to parse.

Print out the latency the IOCTL took (in us).

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -1003,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 5a20ff8..22559db 100644 --- a/Documentation/nvme-admin-passthru.txt +++ b/Documentation/nvme-admin-passthru.txt @@ -8,23 +8,24 @@ nvme-admin-passthru - Submit an arbitrary admin command, return results SYNOPSIS -------- [verse] -'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 ] - [--data-len= | -l ] - [--metadata-len= | -m ] - [--input-file= | -i ] - [--read | -r ] [--write | -w] - [--timeout= | -t ] - [--show-command | -s] - [--dry-run | -d] - [--raw-binary | -b] - [--prefill= | -p ] - [--latency | -T] +'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 ] + [--data-len= | -l ] + [--metadata-len= | -m ] + [--input-file= | -i ] + [--read | -r] [--write | -w] + [--timeout= | -t ] + [--show-command | -s] + [--dry-run | -d] + [--raw-binary | -b] + [--prefill= | -p ] + [--latency | -T] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -43,7 +44,7 @@ printed to stdout for another program to parse. OPTIONS ------- --o :: +-O :: --opcode=:: The NVMe opcode to send to the device in the command @@ -113,6 +114,15 @@ OPTIONS --latency:: Print out the latency the IOCTL took (in us). +-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 admin command with opcode=6 and cdw10=1, which diff --git a/Documentation/nvme-ana-log.1 b/Documentation/nvme-ana-log.1 index 28cbf41..cbddd88 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ANA\-LOG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ANA\-LOG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,8 @@ nvme-ana-log \- Send NVMe ANA log page request, returns result and log .SH "SYNOPSIS" .sp .nf -\fInvme ana\-log\fR [\-o | \-\-output\-format=] +\fInvme ana\-log\fR [\-\-groups | \-g] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -48,13 +49,19 @@ On success, the returned ANA log structure may be returned in one of several way Return the list of ANA groups without the namespace listing\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-ana-log.html b/Documentation/nvme-ana-log.html index db71a5c..be72490 100644 --- a/Documentation/nvme-ana-log.html +++ b/Documentation/nvme-ana-log.html @@ -749,7 +749,8 @@ nvme-ana-log(1) Manual Page

SYNOPSIS

-
nvme ana-log <device> [-o <fmt> | --output-format=<fmt>]
+
nvme ana-log <device> [--groups | -g]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -778,19 +779,30 @@ printed to stdout for another program to parse.

- Return the list of ANA groups without the namespace listing. + Return the list of ANA groups without the namespace listing.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -823,7 +835,7 @@ Print the ANA log page in a human readable format: diff --git a/Documentation/nvme-ana-log.txt b/Documentation/nvme-ana-log.txt index b6dc9c5..92dc12a 100644 --- a/Documentation/nvme-ana-log.txt +++ b/Documentation/nvme-ana-log.txt @@ -8,7 +8,8 @@ nvme-ana-log - Send NVMe ANA log page request, returns result and log SYNOPSIS -------- [verse] -'nvme ana-log' [-o | --output-format=] +'nvme ana-log' [--groups | -g] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -26,12 +27,16 @@ OPTIONS ------- -g:: --groups:: - Return the list of ANA groups without the namespace listing. + Return the list of ANA groups without the namespace listing. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-attach-ns.1 b/Documentation/nvme-attach-ns.1 index 6864869..95bacce 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ATTACH\-NS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ATTACH\-NS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,6 +34,7 @@ nvme-attach-ns \- Send NVMe attach namespace, return result\&. .nf \fInvme attach\-ns\fR [\-\-namespace\-id= | \-n ] [\-\-controllers= | \-c ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -49,6 +50,20 @@ The namespace identifier to attach\&. .RS 4 The comma separated list of controller identifiers to attach the namespace too\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .if n \{\ @@ -65,7 +80,7 @@ Attach namespace to the controller: .RS 4 .\} .nf -# nvme attach\-ns /dev/nvme1 \-n 0x2 \-c 0x21 +# nvme attach\-ns /dev/nvme1 \-n 0x2 \-c 0x21 .fi .if n \{\ .RE diff --git a/Documentation/nvme-attach-ns.html b/Documentation/nvme-attach-ns.html index 127aa33..6fb6183 100644 --- a/Documentation/nvme-attach-ns.html +++ b/Documentation/nvme-attach-ns.html @@ -750,7 +750,8 @@ nvme-attach-ns(1) Manual Page
nvme attach-ns <device> [--namespace-id=<nsid> | -n <nsid>]
-                        [--controllers=<ctrl-list,> | -c <ctrl-list,>]
+ [--controllers=<ctrl-list,> | -c <ctrl-list,>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -790,6 +791,29 @@ controller identifiers.

the namespace too.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -802,7 +826,7 @@ controller identifiers.

-
# nvme attach-ns /dev/nvme1  -n 0x2 -c 0x21
+
# nvme attach-ns /dev/nvme1 -n 0x2 -c 0x21
@@ -817,7 +841,7 @@ controller identifiers.

diff --git a/Documentation/nvme-attach-ns.txt b/Documentation/nvme-attach-ns.txt index 64ab9d1..601c20d 100644 --- a/Documentation/nvme-attach-ns.txt +++ b/Documentation/nvme-attach-ns.txt @@ -10,6 +10,7 @@ SYNOPSIS [verse] 'nvme attach-ns' [--namespace-id= | -n ] [--controllers= | -c ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -28,11 +29,20 @@ OPTIONS The comma separated list of controller identifiers to attach the namespace too. +-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 -------- Attach namespace to the controller: - # nvme attach-ns /dev/nvme1 -n 0x2 -c 0x21 + # nvme attach-ns /dev/nvme1 -n 0x2 -c 0x21 NVME ---- diff --git a/Documentation/nvme-boot-part-log.1 b/Documentation/nvme-boot-part-log.1 index 53b6dad..0596416 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-BOOT\-PART\-LO" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-BOOT\-PART\-LO" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,8 +33,8 @@ nvme-boot-part-log \- Retrieves a Boot Partition log page from an NVMe device .sp .nf \fInvme boot\-part\-log\fR [\-\-lsp= | \-s ] - [\-\-output\-file= | \-o ] - [\-\-output\-format= | \-o ] + [\-\-output\-file= | \-f ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -50,18 +50,24 @@ On success, the returned log structure will be in raw binary format \fIonly\fR w The log specified field of LID\&. .RE .PP -\-o , \-\-output\-file= +\-f , \-\-output\-file= .RS 4 File name to which raw binary data will be saved to\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-boot-part-log.html b/Documentation/nvme-boot-part-log.html index 02b0cdc..28fce1d 100644 --- a/Documentation/nvme-boot-part-log.html +++ b/Documentation/nvme-boot-part-log.html @@ -750,8 +750,8 @@ nvme-boot-part-log(1) Manual Page
nvme boot-part-log <device> [--lsp=<field> | -s <field>]
-                    [--output-file=<file> | -o <file>]
-                    [--output-format=<fmt> | -o <fmt>]
+ [--output-file=<file> | -f <file>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -783,7 +783,7 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

--o <file> +-f <file>
--output-file=<file> @@ -794,15 +794,26 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -835,7 +846,7 @@ Retrieve Boot Partition data to boot_part_log.bin diff --git a/Documentation/nvme-boot-part-log.txt b/Documentation/nvme-boot-part-log.txt index 2dd32a6..0999071 100644 --- a/Documentation/nvme-boot-part-log.txt +++ b/Documentation/nvme-boot-part-log.txt @@ -9,8 +9,8 @@ SYNOPSIS -------- [verse] 'nvme boot-part-log' [--lsp= | -s ] - [--output-file= | -o ] - [--output-format= | -o ] + [--output-file= | -f ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -29,14 +29,18 @@ OPTIONS --lsp=:: The log specified field of LID. --o :: +-f :: --output-file=:: File name to which raw binary data will be saved to. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-capacity-mgmt.1 b/Documentation/nvme-capacity-mgmt.1 index c96ee58..ac995fe 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CAPACITY\-MGMT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-CAPACITY\-MGMT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,10 +32,11 @@ nvme-capacity-mgmt \- Send capacity management command to configure/create/delet .SH "SYNOPSIS" .sp .nf -\fInvme capacity\-mgmt\fR [\-\-operation= | \-o ] +\fInvme capacity\-mgmt\fR [\-\-operation= | \-O ] [\-\-element\-id= | \-i ] [\-\-cap\-lower= | \-l ] [\-\-cap\-upper= | \-u ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -44,7 +45,7 @@ For the NVMe device given, sends a capacity management command to configure/crea The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&. .SH "OPTIONS" .PP -\-o , \-\-operation= +\-O , \-\-operation= .RS 4 Operation to be performed by the controller .RE @@ -63,6 +64,20 @@ Least significant 32 bits of the capacity in bytes of the Endurance Group or NVM .RS 4 Most significant 32 bits of the capacity in bytes of the Endurance Group or NVM Set to be created .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples provided yet\&. diff --git a/Documentation/nvme-capacity-mgmt.html b/Documentation/nvme-capacity-mgmt.html index 3d17b8b..4892aba 100644 --- a/Documentation/nvme-capacity-mgmt.html +++ b/Documentation/nvme-capacity-mgmt.html @@ -740,7 +740,7 @@ nvme-capacity-mgmt(1) Manual Page

NAME

nvme-capacity-mgmt - - Send capacity management command to configure/create/delete Endurance Groups or NVM Sets, returns results. + Send capacity management command to configure/create/delete Endurance Groups or NVM Sets, returns results.

@@ -749,10 +749,11 @@ nvme-capacity-mgmt(1) Manual Page

SYNOPSIS

-
nvme capacity-mgmt <device> [--operation=<operation> | -o <operation>]
+
nvme capacity-mgmt <device> [--operation=<operation> | -O <operation>]
                         [--element-id=<element-id> | -i <element-id>]
                         [--cap-lower=<cap-lower> | -l <cap-lower>]
-                        [--cap-upper=<cap-upper> | -u <cap-upper>]
+ [--cap-upper=<cap-upper> | -u <cap-upper>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -774,14 +775,14 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

--o <operation> +-O <operation>
--operation=<operation>

- Operation to be performed by the controller + Operation to be performed by the controller

@@ -792,7 +793,7 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

- Value specific to the value of the Operation field. + Value specific to the value of the Operation field.

@@ -804,7 +805,7 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

Least significant 32 bits of the capacity in bytes of the Endurance Group or - NVM Set to be created + NVM Set to be created

@@ -816,7 +817,30 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

Most significant 32 bits of the capacity in bytes of the Endurance Group or - NVM Set to be created + NVM Set to be created +

+ +
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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.

@@ -839,7 +863,7 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-capacity-mgmt.txt b/Documentation/nvme-capacity-mgmt.txt index 96274cf..a20561f 100644 --- a/Documentation/nvme-capacity-mgmt.txt +++ b/Documentation/nvme-capacity-mgmt.txt @@ -4,15 +4,16 @@ nvme-capacity-mgmt(1) NAME ---- nvme-capacity-mgmt - Send capacity management command to configure/create/delete - Endurance Groups or NVM Sets, returns results. +Endurance Groups or NVM Sets, returns results. SYNOPSIS -------- [verse] -'nvme capacity-mgmt' [--operation= | -o ] +'nvme capacity-mgmt' [--operation= | -O ] [--element-id= | -i ] [--cap-lower= | -l ] [--cap-upper= | -u ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -27,23 +28,32 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). OPTIONS ------- --o :: +-O :: --operation=:: - Operation to be performed by the controller + Operation to be performed by the controller -i :: --element-id=:: - Value specific to the value of the Operation field. + Value specific to the value of the Operation field. -l :: --cap-lower=:: Least significant 32 bits of the capacity in bytes of the Endurance Group or - NVM Set to be created + NVM Set to be created -u :: --cap-upper=:: Most significant 32 bits of the capacity in bytes of the Endurance Group or - NVM Set to be created + NVM Set to be created + +-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 -------- diff --git a/Documentation/nvme-changed-ns-list-log.1 b/Documentation/nvme-changed-ns-list-log.1 index 5e39559..017de32 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CHANGED\-NS\-L" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-CHANGED\-NS\-L" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,7 +33,7 @@ nvme-changed-ns-list-log \- Send NVMe Changed Namespace List log page request, r .sp .nf \fInvme changed\-ns\-list\-log\fR [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -49,13 +49,19 @@ On success, the returned Changed Namespace List log structure may be returned in Print the raw Changed Namespace List log buffer to stdout\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-changed-ns-list-log.html b/Documentation/nvme-changed-ns-list-log.html index 15ec1b9..6c7f5fb 100644 --- a/Documentation/nvme-changed-ns-list-log.html +++ b/Documentation/nvme-changed-ns-list-log.html @@ -740,7 +740,7 @@ nvme-changed-ns-list-log(1) Manual Page

NAME

nvme-changed-ns-list-log - - Send NVMe Changed Namespace List log page request, returns result and log. + Send NVMe Changed Namespace List log page request, returns result and log.

@@ -750,7 +750,7 @@ nvme-changed-ns-list-log(1) Manual Page
nvme changed-ns-list-log <device> [--raw-binary | -b]
-                        [--output-format=<fmt> | -o <fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -784,15 +784,26 @@ the raw buffer may be printed to stdout for another program to parse.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -835,7 +846,7 @@ Print the raw Changed Namespace List log to a file: diff --git a/Documentation/nvme-changed-ns-list-log.txt b/Documentation/nvme-changed-ns-list-log.txt index 4cfd065..22e552f 100644 --- a/Documentation/nvme-changed-ns-list-log.txt +++ b/Documentation/nvme-changed-ns-list-log.txt @@ -4,13 +4,13 @@ nvme-changed-ns-list-log(1) NAME ---- nvme-changed-ns-list-log - Send NVMe Changed Namespace List log page - request, returns result and log. +request, returns result and log. SYNOPSIS -------- [verse] 'nvme changed-ns-list-log' [--raw-binary | -b] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -31,10 +31,14 @@ OPTIONS --raw-binary:: Print the raw Changed Namespace List log buffer to stdout. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-check-dhchap-key.txt b/Documentation/nvme-check-dhchap-key.txt index 9cfa1f7..b131afe 100644 --- a/Documentation/nvme-check-dhchap-key.txt +++ b/Documentation/nvme-check-dhchap-key.txt @@ -8,7 +8,8 @@ nvme-check-dhchap-key - Check a generated host DH-HMAC-CHAP key SYNOPSIS -------- [verse] -'nvme check-dhchap-key' [--key= ] +'nvme check-dhchap-key' [--key=] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -22,6 +23,15 @@ OPTIONS --key=:: Key to be checked. +-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 -------- No Examples diff --git a/Documentation/nvme-check-tls-key.txt b/Documentation/nvme-check-tls-key.txt index a676f04..2df4fca 100644 --- a/Documentation/nvme-check-tls-key.txt +++ b/Documentation/nvme-check-tls-key.txt @@ -8,17 +8,22 @@ nvme-check-tls-key - Check a generated NVMe TLS PSK SYNOPSIS -------- [verse] -'nvme check-tls-key' [--keyring= | -k ] - [--keytype= | -t ] - [--hostnqn= | -n ] - [--subsysnqn= | -c ] - [--keydata= | -d ] +'nvme check-tls-key' [--keyring= | -k ] + [--keytype= | -t ] + [--hostnqn= | -n ] + [--subsysnqn= | -c ] + [--keydata= | -d ] + [--output-format= | -o ] + [--identity= | -I ] + [--insert | -i ] + [--verbose | -v] DESCRIPTION ----------- Checks if the key is a valid NVMe TLS PSK in the PSK interchange format -'NVMeTLSkey-1:01::', and stores the derived 'retained' -TLS key in the keyring if the subsystem NQN is specified. +'NVMeTLSkey-1:01::'. If '--insert' is specified the +the derived 'retained' TLS key is stored in the keyring, otherwise the +TLS identity of the key is printed out. OPTIONS ------- @@ -46,6 +51,25 @@ OPTIONS --keydata=:: Key to be checked. +-I :: +--identity=:: + NVMe TLS key identity version to be used; '0' for the default + identity, and '1' for the TLS identity suffixed by the PSK hash + as specified in TP8018. + +-i: +--insert: + Insert the derived 'retained' key in the keyring. + +-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 -------- No Examples diff --git a/Documentation/nvme-cmdset-ind-id-ns.1 b/Documentation/nvme-cmdset-ind-id-ns.1 index 09a2858..5790734 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CMDSET\-IND\-I" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-CMDSET\-IND\-I" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,9 +33,8 @@ nvme-cmdset-ind-id-ns \- Send NVMe I/O Command Set Independent Identify Namespac .sp .nf \fInvme cmdset\-ind\-id\-ns\fR [\-\-namespace\-id= | \-n ] - [\-b | \-\-raw\-binary] - [\-\-human\-readable | \-H] - [\-\-output\-format= | \-o ] + [\-\-raw\-binary | \-b] [\-\-human\-readable | \-H] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -61,13 +60,19 @@ Print the raw buffer to stdout\&. Structure is not parsed by program\&. This ove This option will parse and format many of the bit fields into human\-readable formats\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-cmdset-ind-id-ns.html b/Documentation/nvme-cmdset-ind-id-ns.html index 387a375..6635308 100644 --- a/Documentation/nvme-cmdset-ind-id-ns.html +++ b/Documentation/nvme-cmdset-ind-id-ns.html @@ -750,9 +750,8 @@ nvme-cmdset-ind-id-ns(1) Manual Page
nvme cmdset-ind-id-ns <device> [--namespace-id=<nsid> | -n <nsid>]
-                        [-b | --raw-binary]
-                    [--human-readable | -H]
-                    [--output-format=<fmt> | -o <fmt>]
+ [--raw-binary | -b] [--human-readable | -H] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -815,15 +814,26 @@ raw buffer may be printed to stdout.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -879,7 +889,7 @@ Have the program return the raw structure in binary: diff --git a/Documentation/nvme-cmdset-ind-id-ns.txt b/Documentation/nvme-cmdset-ind-id-ns.txt index fa55c83..5bf3862 100644 --- a/Documentation/nvme-cmdset-ind-id-ns.txt +++ b/Documentation/nvme-cmdset-ind-id-ns.txt @@ -9,9 +9,8 @@ SYNOPSIS -------- [verse] 'nvme cmdset-ind-id-ns' [--namespace-id= | -n ] - [-b | --raw-binary] - [--human-readable | -H] - [--output-format= | -o ] + [--raw-binary | -b] [--human-readable | -H] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -47,11 +46,14 @@ OPTIONS This option will parse and format many of the bit fields into human-readable formats. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-compare.1 b/Documentation/nvme-compare.1 index da550ce..b7f82b5 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-COMPARE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-COMPARE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -47,12 +47,13 @@ nvme-compare \- Send an NVMe Compare command, provide results [\-\-dir\-type= | \-T ] [\-\-dir\-spec= | \-S ] [\-\-dsm= | \-D ] - [\-\-show\-command | \-v] + [\-\-show\-command | \-V] [\-\-dry\-run | \-w] [\-\-latency | \-t] [\-\-storage\-tag | \-g ] [\-\-storage\-tag\-check | \-C] [\-\-force] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -97,9 +98,6 @@ Metadata file\&. \-p , \-\-prinfo= .RS 4 Protection Information and check field\&. -.RE -.sp -+ .TS allbox tab(:); lt lt @@ -109,49 +107,38 @@ lt lt lt lt lt lt. T{ -.sp Bit T}:T{ -.sp Description T} T{ -.sp 3 T}:T{ -.sp PRACT: Protection Information Action\&. When set to 1, PI is stripped/inserted on read/write when the block format\(cqs metadata size is 8\&. When set to 0, metadata is passes\&. T} T{ -.sp 2:0 T}:T{ -.sp PRCHK: Protection Information Check: T} T{ -.sp 2 T}:T{ -.sp Set to 1 enables checking the guard tag T} T{ -.sp 1 T}:T{ -.sp Set to 1 enables checking the application tag T} T{ -.sp 0 T}:T{ -.sp Set to 1 enables checking the reference tag T} .TE .sp 1 +.RE .PP \-m , \-\-app\-tag\-mask= .RS 4 @@ -188,7 +175,7 @@ Optional field for directive specifics\&. When used with write streams, this val The optional data set management attributes for this command\&. The argument for this is the least significant 8 bits of the DSM field in a write command; the most significant 16 bits of the field come from the directive specific field, if used\&. This may be used to set attributes for the LBAs being written, like access frequency, type, latency, among other things, as well as yet to be defined types\&. Please consult the NVMe specification for detailed breakdown of how to use this field\&. .RE .PP -\-v, \-\-show\-cmd +\-V, \-\-show\-cmd .RS 4 Print out the command to be sent\&. .RE @@ -220,6 +207,20 @@ This flag enables Storage Tag field checking as part of end\-to\-end data protec .RS 4 Ignore namespace is currently busy and performed the operation even though\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-compare.html b/Documentation/nvme-compare.html index 9ee2c38..7334107 100644 --- a/Documentation/nvme-compare.html +++ b/Documentation/nvme-compare.html @@ -764,12 +764,13 @@ nvme-compare(1) Manual Page [--dir-type=<type> | -T <type>] [--dir-spec=<spec> | -S <spec>] [--dsm=<dsm> | -D <dsm>] - [--show-command | -v] + [--show-command | -V] [--dry-run | -w] [--latency | -t] [--storage-tag<storage-tag> | -g <storage-tag>] [--storage-tag-check | -C] - [--force] + [--force] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -877,9 +878,6 @@ provided, then a comparison is also performed for the metadata.

Protection Information and check field.

- - -

+

-
+
-m <appmask>
@@ -1009,7 +1007,7 @@ metadata is passes.

--v +-V
--show-cmd @@ -1071,8 +1069,31 @@ metadata is passes.

- Ignore namespace is currently busy and performed the operation - even though. + Ignore namespace is currently busy and performed the operation + even though. +

+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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.

@@ -1095,7 +1116,7 @@ metadata is passes.

diff --git a/Documentation/nvme-compare.txt b/Documentation/nvme-compare.txt index 12121ab..59d1ea9 100644 --- a/Documentation/nvme-compare.txt +++ b/Documentation/nvme-compare.txt @@ -23,12 +23,13 @@ SYNOPSIS [--dir-type= | -T ] [--dir-spec= | -S ] [--dsm= | -D ] - [--show-command | -v] + [--show-command | -V] [--dry-run | -w] [--latency | -t] [--storage-tag | -g ] [--storage-tag-check | -C] [--force] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -73,7 +74,6 @@ OPTIONS -p :: --prinfo=:: Protection Information and check field. - + [] |================= @@ -127,7 +127,7 @@ metadata is passes. among other things, as well as yet to be defined types. Please consult the NVMe specification for detailed breakdown of how to use this field. --v:: +-V:: --show-cmd:: Print out the command to be sent. @@ -151,8 +151,17 @@ metadata is passes. data protection processing. --force:: - Ignore namespace is currently busy and performed the operation - even though. + Ignore namespace is currently busy and performed the operation + even though. + +-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 -------- diff --git a/Documentation/nvme-config.txt b/Documentation/nvme-config.txt index 5b76925..aea6f6a 100644 --- a/Documentation/nvme-config.txt +++ b/Documentation/nvme-config.txt @@ -8,33 +8,28 @@ nvme-config - NVMe-over-Fabrics configuration. SYNOPSIS -------- [verse] -'nvme config' - [--scan | -R] - [--modify | -M] - [--update | -U] - [--dump | -O] - [--config= | -J ] - [--transport= | -t ] - [--nqn= | -n ] - [--traddr= | -a ] - [--trsvcid= | -s ] - [--host-traddr= | -w ] - [--host-iface= | -f ] - [--hostnqn= | -q ] - [--hostid= | -I ] - [--dhchap-secret= | -S ] - [--dhchap-ctrl-secret= | -C ] - [--nr-io-queues=<#> | -i <#>] - [--nr-write-queues=<#> | -W <#>] - [--nr-poll-queues=<#> | -P <#>] - [--queue-size=<#> | -Q <#>] - [--keep-alive-tmo=<#> | -k <#>] - [--reconnect-delay=<#> | -c <#>] - [--ctrl-loss-tmo=<#> | -l <#>] - [--duplicate-connect | -D] - [--disable-sqflow | -d] - [--hdr-digest | -g] - [--data-digest | -G] +'nvme config' [--scan | -R] [--modify | -M] [--update | -U] [--dump | -O] + [--config= | -J ] + [--transport= | -t ] + [--nqn= | -n ] + [--traddr= | -a ] + [--trsvcid= | -s ] + [--host-traddr= | -w ] + [--host-iface= | -f ] + [--hostnqn= | -q ] + [--hostid= | -I ] + [--dhchap-secret= | -S ] + [--dhchap-ctrl-secret= | -C ] + [--nr-io-queues=<#> | -i <#>] + [--nr-write-queues=<#> | -W <#>] + [--nr-poll-queues=<#> | -P <#>] + [--queue-size=<#> | -Q <#>] + [--keep-alive-tmo=<#> | -k <#>] + [--reconnect-delay=<#> | -c <#>] + [--ctrl-loss-tmo=<#> | -l <#>] + [--duplicate-connect | -D] [--disable-sqflow | -d] + [--hdr-digest | -g] [--data-digest | -G] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -52,7 +47,7 @@ OPTIONS -M:: --modify:: Add or modify entries in the configuration based on the values from - the commandline. + the commandline. -U:: --update:: @@ -71,7 +66,7 @@ OPTIONS -t :: --transport=:: This field specifies the network fabric being used for - a NVMe-over-Fabrics network. Current string values include: + a NVMe-over-Fabrics network. Current string values include: + [] |================= @@ -94,7 +89,7 @@ OPTIONS -s :: --trsvcid=:: - This field specifies the transport service id. For transports using IP + This field specifies the transport service id. For transports using IP addressing (e.g. rdma) this field is the port number. By default, the IP port number for the RDMA transport is 4420. @@ -186,6 +181,15 @@ OPTIONS --data-digest:: Generates/verifies data digest (TCP). +-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 -------- * Read the current system configuration and write the contents to /tmp/config.json: @@ -200,7 +204,6 @@ nvme-discover(1) nvme-connect(1) https://github.com/linux-nvme/libnvme/doc/config-schema.json - AUTHORS ------- This was written by mailto:hare@suse.com[Hannes Reinecke] diff --git a/Documentation/nvme-connect-all.1 b/Documentation/nvme-connect-all.1 index 9e795f5..4f37956 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CONNECT\-ALL" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-CONNECT\-ALL" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,37 +32,29 @@ nvme-connect-all \- Discover and Connect to Fabrics controllers\&. .SH "SYNOPSIS" .sp .nf -\fInvme connect\-all\fR - [\-\-transport= | \-t ] - [\-\-nqn= | \-n ] - [\-\-traddr= | \-a ] - [\-\-trsvcid= | \-s ] - [\-\-host\-traddr= | \-w ] - [\-\-host\-iface= | \-f ] - [\-\-hostnqn= | \-q ] - [\-\-hostid= | \-I ] - [\-\-raw= | \-r ] - [\-\-device= | \-d ] - [\-\-cfg\-file= | \-C ] - [\-\-keep\-alive\-tmo= | \-k ] - [\-\-reconnect\-delay=<#> | \-c <#>] - [\-\-ctrl\-loss\-tmo=<#> | \-l <#>] - [\-\-nr\-io\-queues=<#> | \-i <#>] - [\-\-nr\-write\-queues=<#> | \-W <#>] - [\-\-nr\-poll\-queues=<#> | \-P <#>] - [\-\-queue\-size=<#> | \-Q <#>] - [\-\-keyring=<#> ] - [\-\-tls_key=<#> ] - [\-\-hdr\-digest | \-g] - [\-\-data\-digest | \-G] - [\-\-persistent | \-p] - [\-\-tls ] - [\-\-quiet | \-S] - [\-\-dump\-config | \-O] - [\-\-nbft] - [\-\-no\-nbft] - [\-\-nbft\-path=] - [\-\-context=] +\fInvme connect\-all\fR [\-\-transport= | \-t ] + [\-\-nqn= | \-n ] + [\-\-traddr= | \-a ] + [\-\-trsvcid= | \-s ] + [\-\-host\-traddr= | \-w ] + [\-\-host\-iface= | \-f ] + [\-\-hostnqn= | \-q ] + [\-\-hostid= | \-I ] + [\-\-raw= | \-r ] + [\-\-device= | \-d ] + [\-\-cfg\-file= | \-C ] + [\-\-keep\-alive\-tmo= | \-k ] + [\-\-reconnect\-delay=<#> | \-c <#>] + [\-\-ctrl\-loss\-tmo=<#> | \-l <#>] + [\-\-nr\-io\-queues=<#> | \-i <#>] + [\-\-nr\-write\-queues=<#> | \-W <#>] + [\-\-nr\-poll\-queues=<#> | \-P <#>] + [\-\-queue\-size=<#> | \-Q <#>] [\-\-keyring=<#>] + [\-\-tls_key=<#>] [\-\-hdr\-digest | \-g] [\-\-data\-digest | \-G] + [\-\-persistent | \-p] [\-\-tls] [\-\-quiet | \-S] + [\-\-dump\-config | \-O] [\-\-nbft] [\-\-no\-nbft] + [\-\-nbft\-path=] [\-\-context=] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -266,6 +258,20 @@ Use a user\-defined path to the NBFT tables .RS 4 Set the execution context to \&. This allows to coordinate the management of the global resources\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 @@ -352,9 +358,9 @@ command using a /usr/local/etc/nvme/discovery\&.conf file: .RS 4 .\} .nf -# Machine default \*(Aqnvme discover\*(Aq commands\&. Query the +# Machine default \*(Aqnvme discover\*(Aq commands\&. Query the # Discovery Controller\*(Aqs two ports (some resources may only -# be accessible on a single port)\&. Note an official +# be accessible on a single port)\&. Note an official # nqn (Host) name defined in the NVMe specification is being used # in this example\&. \-t rdma \-a 192\&.168\&.69\&.33 \-s 4420 \-q nqn\&.2014\-08\&.com\&.example:nvme:nvm\-subsystem\-sn\-d78432 diff --git a/Documentation/nvme-connect-all.html b/Documentation/nvme-connect-all.html index ced16c3..d579c1f 100644 --- a/Documentation/nvme-connect-all.html +++ b/Documentation/nvme-connect-all.html @@ -749,37 +749,29 @@ nvme-connect-all(1) Manual Page

SYNOPSIS

-
nvme connect-all
-                [--transport=<trtype>     | -t <trtype>]
-                [--nqn=<subnqn>           | -n <subnqn>]
-                [--traddr=<traddr>        | -a <traddr>]
-                [--trsvcid=<trsvcid>      | -s <trsvcid>]
-                [--host-traddr=<traddr>   | -w <traddr>]
-                [--host-iface=<iface>     | -f <iface>]
-                [--hostnqn=<hostnqn>      | -q <hostnqn>]
-                [--hostid=<hostid>        | -I <hostid>]
-                [--raw=<filename>         | -r <filename>]
-                [--device=<device>        | -d <device>]
-                [--cfg-file=<cfg>         | -C <cfg>]
-                [--keep-alive-tmo=<sec>   | -k <sec>]
-                [--reconnect-delay=<#>    | -c <#>]
-                [--ctrl-loss-tmo=<#>      | -l <#>]
-                [--nr-io-queues=<#>       | -i <#>]
-                [--nr-write-queues=<#>    | -W <#>]
-                [--nr-poll-queues=<#>     | -P <#>]
-                [--queue-size=<#>         | -Q <#>]
-                [--keyring=<#>                    ]
-                [--tls_key=<#>                    ]
-                [--hdr-digest             | -g]
-                [--data-digest            | -G]
-                [--persistent             | -p]
-                [--tls                        ]
-                [--quiet                  | -S]
-                [--dump-config            | -O]
-                [--nbft]
-                [--no-nbft]
-                [--nbft-path=<STR>]
-                [--context=<STR>]
+
nvme connect-all [--transport=<trtype> | -t <trtype>]
+                        [--nqn=<subnqn> | -n <subnqn>]
+                        [--traddr=<traddr> | -a <traddr>]
+                        [--trsvcid=<trsvcid> | -s <trsvcid>]
+                        [--host-traddr=<traddr> | -w <traddr>]
+                        [--host-iface=<iface> | -f <iface>]
+                        [--hostnqn=<hostnqn> | -q <hostnqn>]
+                        [--hostid=<hostid> | -I <hostid>]
+                        [--raw=<filename> | -r <filename>]
+                        [--device=<device> | -d <device>]
+                        [--cfg-file=<cfg> | -C <cfg>]
+                        [--keep-alive-tmo=<sec> | -k <sec>]
+                        [--reconnect-delay=<#> | -c <#>]
+                        [--ctrl-loss-tmo=<#>     | -l <#>]
+                        [--nr-io-queues=<#> | -i <#>]
+                        [--nr-write-queues=<#> | -W <#>]
+                        [--nr-poll-queues=<#> | -P <#>]
+                        [--queue-size=<#> | -Q <#>] [--keyring=<#>]
+                        [--tls_key=<#>] [--hdr-digest | -g] [--data-digest | -G]
+                        [--persistent | -p] [--tls] [--quiet | -S]
+                        [--dump-config | -O] [--nbft] [--no-nbft]
+                        [--nbft-path=<STR>] [--context=<STR>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -813,7 +805,7 @@ background.

This field specifies the network fabric being used for - a NVMe-over-Fabrics network. Current string values include: + a NVMe-over-Fabrics network. Current string values include:

- This field specifies the transport service id. For transports using IP + This field specifies the transport service id. For transports using IP addressing (e.g. rdma) this field is the port number. By default, the IP port number for the RDMA transport is 4420.

@@ -1178,6 +1170,29 @@ cellspacing="0" cellpadding="4"> the management of the global resources.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -1221,9 +1236,9 @@ Issue a nvme connect-all command using a /usr/local/etc/nvme/discovery.

-
# Machine default 'nvme discover' commands.  Query the
+
# Machine default 'nvme discover' commands. Query the
 # Discovery Controller's two ports (some resources may only
-# be accessible on a single port).  Note an official
+# be accessible on a single port). Note an official
 # nqn (Host) name defined in the NVMe specification is being used
 # in this example.
 -t rdma -a 192.168.69.33 -s 4420 -q nqn.2014-08.com.example:nvme:nvm-subsystem-sn-d78432
@@ -1253,7 +1268,7 @@ nvme-connect(1)

diff --git a/Documentation/nvme-connect-all.txt b/Documentation/nvme-connect-all.txt index 46b0911..faa2cf8 100644 --- a/Documentation/nvme-connect-all.txt +++ b/Documentation/nvme-connect-all.txt @@ -8,37 +8,29 @@ nvme-connect-all - Discover and Connect to Fabrics controllers. SYNOPSIS -------- [verse] -'nvme connect-all' - [--transport= | -t ] - [--nqn= | -n ] - [--traddr= | -a ] - [--trsvcid= | -s ] - [--host-traddr= | -w ] - [--host-iface= | -f ] - [--hostnqn= | -q ] - [--hostid= | -I ] - [--raw= | -r ] - [--device= | -d ] - [--cfg-file= | -C ] - [--keep-alive-tmo= | -k ] - [--reconnect-delay=<#> | -c <#>] - [--ctrl-loss-tmo=<#> | -l <#>] - [--nr-io-queues=<#> | -i <#>] - [--nr-write-queues=<#> | -W <#>] - [--nr-poll-queues=<#> | -P <#>] - [--queue-size=<#> | -Q <#>] - [--keyring=<#> ] - [--tls_key=<#> ] - [--hdr-digest | -g] - [--data-digest | -G] - [--persistent | -p] - [--tls ] - [--quiet | -S] - [--dump-config | -O] - [--nbft] - [--no-nbft] - [--nbft-path=] - [--context=] +'nvme connect-all' [--transport= | -t ] + [--nqn= | -n ] + [--traddr= | -a ] + [--trsvcid= | -s ] + [--host-traddr= | -w ] + [--host-iface= | -f ] + [--hostnqn= | -q ] + [--hostid= | -I ] + [--raw= | -r ] + [--device= | -d ] + [--cfg-file= | -C ] + [--keep-alive-tmo= | -k ] + [--reconnect-delay=<#> | -c <#>] + [--ctrl-loss-tmo=<#> | -l <#>] + [--nr-io-queues=<#> | -i <#>] + [--nr-write-queues=<#> | -W <#>] + [--nr-poll-queues=<#> | -P <#>] + [--queue-size=<#> | -Q <#>] [--keyring=<#>] + [--tls_key=<#>] [--hdr-digest | -g] [--data-digest | -G] + [--persistent | -p] [--tls] [--quiet | -S] + [--dump-config | -O] [--nbft] [--no-nbft] + [--nbft-path=] [--context=] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -62,13 +54,13 @@ OPTIONS -t :: --transport=:: This field specifies the network fabric being used for - a NVMe-over-Fabrics network. Current string values include: + a NVMe-over-Fabrics network. Current string values include: + [] |================= |Value|Definition |rdma|The network fabric is an rdma network (RoCE, iWARP, Infiniband, basic rdma, etc) -|fc |*WIP* The network fabric is a Fibre Channel network. +|fc |*WIP* The network fabric is a Fibre Channel network. |tcp |The network fabric is a TCP/IP network. |loop|Connect to a NVMe over Fabrics target on the local host |================= @@ -85,7 +77,7 @@ OPTIONS -s :: --trsvcid=:: - This field specifies the transport service id. For transports using IP + This field specifies the transport service id. For transports using IP addressing (e.g. rdma) this field is the port number. By default, the IP port number for the RDMA transport is 4420. @@ -203,18 +195,27 @@ OPTIONS Print out resulting JSON configuration file to stdout. --nbft:: - Only look at NBFT tables + Only look at NBFT tables --no-nbft:: - Do not look at NBFT tables + Do not look at NBFT tables --nbft-path=:: - Use a user-defined path to the NBFT tables + Use a user-defined path to the NBFT tables --context :: Set the execution context to . This allows to coordinate the management of the global resources. +-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 -------- * Connect to all records returned by the Discover Controller with IP4 address @@ -241,9 +242,9 @@ the RDMA network. Port 4420 is used by default: * Issue a 'nvme connect-all' command using a @SYSCONFDIR@/nvme/discovery.conf file: + ----------- -# Machine default 'nvme discover' commands. Query the +# Machine default 'nvme discover' commands. Query the # Discovery Controller's two ports (some resources may only -# be accessible on a single port). Note an official +# be accessible on a single port). Note an official # nqn (Host) name defined in the NVMe specification is being used # in this example. -t rdma -a 192.168.69.33 -s 4420 -q nqn.2014-08.com.example:nvme:nvm-subsystem-sn-d78432 diff --git a/Documentation/nvme-connect.1 b/Documentation/nvme-connect.1 index b27680a..4eb8bb6 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CONNECT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-CONNECT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,36 +32,29 @@ nvme-connect \- Connect to a Fabrics controller\&. .SH "SYNOPSIS" .sp .nf -\fInvme connect\fR - [\-\-transport= | \-t ] - [\-\-nqn= | \-n ] - [\-\-traddr= | \-a ] - [\-\-trsvcid= | \-s ] - [\-\-host\-traddr= | \-w ] - [\-\-host\-iface= | \-f ] - [\-\-hostnqn= | \-q ] - [\-\-hostid= | \-I ] - [\-\-config\-file= | \-J ] - [\-\-dhchap\-secret= | \-S ] - [\-\-dhchap\-ctrl\-secret= | \-C ] - [\-\-nr\-io\-queues=<#> | \-i <#>] - [\-\-nr\-write\-queues=<#> | \-W <#>] - [\-\-nr\-poll\-queues=<#> | \-P <#>] - [\-\-queue\-size=<#> | \-Q <#>] - [\-\-keep\-alive\-tmo=<#> | \-k <#>] - [\-\-reconnect\-delay=<#> | \-c <#>] - [\-\-ctrl\-loss\-tmo=<#> | \-l <#>] - [\-\-tos=<#> | \-T <#>] - [\-\-keyring=<#> ] - [\-\-tls_key=<#> ] - [\-\-duplicate\-connect | \-D] - [\-\-disable\-sqflow | \-d] - [\-\-hdr\-digest | \-g] - [\-\-data\-digest | \-G] - [\-\-tls ] - [\-\-dump\-config | \-O] - [\-\-output\-format= | \-o ] - [\-\-application= ] +\fInvme connect\fR [\-\-transport= | \-t ] + [\-\-nqn= | \-n ] + [\-\-traddr= | \-a ] + [\-\-trsvcid= | \-s ] + [\-\-host\-traddr= | \-w ] + [\-\-host\-iface= | \-f ] + [\-\-hostnqn= | \-q ] + [\-\-hostid= | \-I ] + [\-\-config\-file= | \-J ] + [\-\-dhchap\-secret= | \-S ] + [\-\-dhchap\-ctrl\-secret= | \-C ] + [\-\-nr\-io\-queues=<#> | \-i <#>] + [\-\-nr\-write\-queues=<#> | \-W <#>] + [\-\-nr\-poll\-queues=<#> | \-P <#>] + [\-\-queue\-size=<#> | \-Q <#>] + [\-\-keep\-alive\-tmo=<#> | \-k <#>] + [\-\-reconnect\-delay=<#> | \-c <#>] + [\-\-ctrl\-loss\-tmo=<#> | \-l <#>] [\-\-tos=<#> | \-T <#>] + [\-\-keyring=<#>] [\-\-tls_key=<#>] + [\-\-duplicate\-connect | \-D] [\-\-disable\-sqflow | \-d] + [\-\-hdr\-digest | \-g] [\-\-data\-digest | \-G] [\-\-tls] + [\-\-dump\-config | \-O] [\-\-application=] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -154,7 +147,7 @@ to not read in an existing configuration file\&. The JSON configuration file for \-S , \-\-dhchap\-secret= .RS 4 NVMe In\-band authentication secret; needs to be in ASCII format as specified in NVMe 2\&.0 section 8\&.13\&.5\&.8 -\fISecret representation\fR\&. If this option is not specified, the default is read from /usr/local/etc/nvme/hostkey\&. If that does not exist no in\-band authentication is attempted\&. +\fISecret representation\fR\&. .RE .PP \-C , \-\-dhchap\-ctrl\-secret= @@ -243,18 +236,24 @@ Enable TLS encryption (TCP)\&. Print out resulting JSON configuration file to stdout\&. .RE .PP -\-o , \-\-output\-format= -.RS 4 -Set the reporting format to -\fInormal\fR -or -\fIjson\fR\&. Only one output format can be used at a time\&. When this option is specified, the device associated with the connection will be printed\&. Nothing is printed otherwise\&. -.RE -.PP \-\-context .RS 4 Set the execution context to \&. This allows to coordinate the management of the global resources\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-connect.html b/Documentation/nvme-connect.html index 7b0c2e6..4282f24 100644 --- a/Documentation/nvme-connect.html +++ b/Documentation/nvme-connect.html @@ -749,36 +749,29 @@ nvme-connect(1) Manual Page

SYNOPSIS

-
nvme connect
-                [--transport=<trtype>     | -t <trtype>]
-                [--nqn=<subnqn>           | -n <subnqn>]
-                [--traddr=<traddr>        | -a <traddr>]
-                [--trsvcid=<trsvcid>      | -s <trsvcid>]
-                [--host-traddr=<traddr>   | -w <traddr>]
-                [--host-iface=<iface>     | -f <iface>]
-                [--hostnqn=<hostnqn>      | -q <hostnqn>]
-                [--hostid=<hostid>        | -I <hostid>]
-                [--config-file=<cfg>      | -J <cfg> ]
-                [--dhchap-secret=<secret> | -S <secret>]
-                [--dhchap-ctrl-secret=<secret> | -C <secret>]
-                [--nr-io-queues=<#>       | -i <#>]
-                [--nr-write-queues=<#>    | -W <#>]
-                [--nr-poll-queues=<#>     | -P <#>]
-                [--queue-size=<#>         | -Q <#>]
-                [--keep-alive-tmo=<#>     | -k <#>]
-                [--reconnect-delay=<#>    | -c <#>]
-                [--ctrl-loss-tmo=<#>      | -l <#>]
-                [--tos=<#>                | -T <#>]
-                [--keyring=<#>                    ]
-                [--tls_key=<#>                    ]
-                [--duplicate-connect      | -D]
-                [--disable-sqflow         | -d]
-                [--hdr-digest             | -g]
-                [--data-digest            | -G]
-                [--tls                        ]
-                [--dump-config            | -O]
-                [--output-format=<fmt>    | -o <fmt>]
-                [--application=<id>                 ]
+
nvme connect [--transport=<trtype> | -t <trtype>]
+                        [--nqn=<subnqn> | -n <subnqn>]
+                        [--traddr=<traddr> | -a <traddr>]
+                        [--trsvcid=<trsvcid> | -s <trsvcid>]
+                        [--host-traddr=<traddr> | -w <traddr>]
+                        [--host-iface=<iface> | -f <iface>]
+                        [--hostnqn=<hostnqn> | -q <hostnqn>]
+                        [--hostid=<hostid> | -I <hostid>]
+                        [--config-file=<cfg> | -J <cfg>]
+                        [--dhchap-secret=<secret> | -S <secret>]
+                        [--dhchap-ctrl-secret=<secret> | -C <secret>]
+                        [--nr-io-queues=<#> | -i <#>]
+                        [--nr-write-queues=<#> | -W <#>]
+                        [--nr-poll-queues=<#> | -P <#>]
+                        [--queue-size=<#> | -Q <#>]
+                        [--keep-alive-tmo=<#> | -k <#>]
+                        [--reconnect-delay=<#> | -c <#>]
+                        [--ctrl-loss-tmo=<#> | -l <#>] [--tos=<#> | -T <#>]
+                        [--keyring=<#>] [--tls_key=<#>]
+                        [--duplicate-connect | -D] [--disable-sqflow | -d]
+                        [--hdr-digest | -g] [--data-digest | -G] [--tls]
+                        [--dump-config | -O] [--application=<id>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -804,7 +797,7 @@ specified by the --nqn option.

This field specifies the network fabric being used for - a NVMe-over-Fabrics network. Current string values include: + a NVMe-over-Fabrics network. Current string values include:

- This field specifies the transport service id. For transports using IP + This field specifies the transport service id. For transports using IP addressing (e.g. rdma) this field is the port number. By default, the IP port number for the RDMA transport is 4420.

@@ -953,9 +946,6 @@ cellspacing="0" cellpadding="4">

NVMe In-band authentication secret; needs to be in ASCII format as specified in NVMe 2.0 section 8.13.5.8 Secret representation. - If this option is not specified, the default is read from - /usr/local/etc/nvme/hostkey. If that does not exist no in-band authentication - is attempted.

@@ -1144,19 +1134,6 @@ cellspacing="0" cellpadding="4">

--o <format> -
-
---output-format=<format> -
-
-

- Set the reporting format to normal or json. Only one output format can - be used at a time. When this option is specified, the device associated with - the connection will be printed. Nothing is printed otherwise. -

-
-
--context <STR>
@@ -1165,6 +1142,29 @@ cellspacing="0" cellpadding="4"> the management of the global resources.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -1211,7 +1211,7 @@ and Christoph Hellwig

diff --git a/Documentation/nvme-connect.txt b/Documentation/nvme-connect.txt index a6effaf..af3e7d3 100644 --- a/Documentation/nvme-connect.txt +++ b/Documentation/nvme-connect.txt @@ -8,36 +8,29 @@ nvme-connect - Connect to a Fabrics controller. SYNOPSIS -------- [verse] -'nvme connect' - [--transport= | -t ] - [--nqn= | -n ] - [--traddr= | -a ] - [--trsvcid= | -s ] - [--host-traddr= | -w ] - [--host-iface= | -f ] - [--hostnqn= | -q ] - [--hostid= | -I ] - [--config-file= | -J ] - [--dhchap-secret= | -S ] - [--dhchap-ctrl-secret= | -C ] - [--nr-io-queues=<#> | -i <#>] - [--nr-write-queues=<#> | -W <#>] - [--nr-poll-queues=<#> | -P <#>] - [--queue-size=<#> | -Q <#>] - [--keep-alive-tmo=<#> | -k <#>] - [--reconnect-delay=<#> | -c <#>] - [--ctrl-loss-tmo=<#> | -l <#>] - [--tos=<#> | -T <#>] - [--keyring=<#> ] - [--tls_key=<#> ] - [--duplicate-connect | -D] - [--disable-sqflow | -d] - [--hdr-digest | -g] - [--data-digest | -G] - [--tls ] - [--dump-config | -O] - [--output-format= | -o ] - [--application= ] +'nvme connect' [--transport= | -t ] + [--nqn= | -n ] + [--traddr= | -a ] + [--trsvcid= | -s ] + [--host-traddr= | -w ] + [--host-iface= | -f ] + [--hostnqn= | -q ] + [--hostid= | -I ] + [--config-file= | -J ] + [--dhchap-secret= | -S ] + [--dhchap-ctrl-secret= | -C ] + [--nr-io-queues=<#> | -i <#>] + [--nr-write-queues=<#> | -W <#>] + [--nr-poll-queues=<#> | -P <#>] + [--queue-size=<#> | -Q <#>] + [--keep-alive-tmo=<#> | -k <#>] + [--reconnect-delay=<#> | -c <#>] + [--ctrl-loss-tmo=<#> | -l <#>] [--tos=<#> | -T <#>] + [--keyring=<#>] [--tls_key=<#>] + [--duplicate-connect | -D] [--disable-sqflow | -d] + [--hdr-digest | -g] [--data-digest | -G] [--tls] + [--dump-config | -O] [--application=] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -50,7 +43,7 @@ OPTIONS -t :: --transport=:: This field specifies the network fabric being used for - a NVMe-over-Fabrics network. Current string values include: + a NVMe-over-Fabrics network. Current string values include: + [] |================= @@ -73,7 +66,7 @@ OPTIONS -s :: --trsvcid=:: - This field specifies the transport service id. For transports using IP + This field specifies the transport service id. For transports using IP addressing (e.g. rdma) this field is the port number. By default, the IP port number for the RDMA transport is 4420. @@ -114,9 +107,6 @@ OPTIONS --dhchap-secret=:: NVMe In-band authentication secret; needs to be in ASCII format as specified in NVMe 2.0 section 8.13.5.8 'Secret representation'. - If this option is not specified, the default is read from - @SYSCONFDIR@/nvme/hostkey. If that does not exist no in-band authentication - is attempted. -C :: --dhchap-ctrl-secret=:: @@ -190,16 +180,19 @@ OPTIONS --dump-config:: Print out resulting JSON configuration file to stdout. --o :: ---output-format=:: - Set the reporting format to 'normal' or 'json'. Only one output format can - be used at a time. When this option is specified, the device associated with - the connection will be printed. Nothing is printed otherwise. - --context :: Set the execution context to . This allows to coordinate the management of the global resources. +-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 -------- * Connect to a subsystem named nqn.2014-08.com.example:nvme:nvm-subsystem-sn-d78432 @@ -215,7 +208,6 @@ SEE ALSO nvme-discover(1) nvme-connect-all(1) - AUTHORS ------- This was co-written by mailto:james.p.freyensee@intel.com[Jay Freyensee] diff --git a/Documentation/nvme-copy.1 b/Documentation/nvme-copy.1 index 4228451..b3fe795 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-COPY" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-COPY" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -35,6 +35,8 @@ nvme-copy \- Send an NVMe Simple Copy command, provide results \fInvme\-copy\fR [\-\-sdlba= | \-d ] [\-\-blocks= | \-b ] [\-\-slbs= | \-s ] + [\-\-snsids= | \-N ] + [\-\-sopts= | \-O ] [\-\-limited\-retry | \-l] [\-\-force\-unit\-access | \-f] [\-\-prinfow= | \-p ] @@ -48,91 +50,116 @@ nvme-copy \- Send an NVMe Simple Copy command, provide results [\-\-dir\-type= | \-T ] [\-\-dir\-spec= | \-S ] [\-\-format= | \-F ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp The Copy command is used by the host to copy data from one or more source logical block ranges to a single consecutive destination logical block range\&. .SH "OPTIONS" .PP -\-\-sdlba=, \-d +\-d , \-\-sdlba= .RS 4 64\-bit addr of first destination logical block .RE .PP -\-\-blocks=, \-b +\-b , \-\-blocks= .RS 4 Comma separated list of the number of blocks in each range .RE .PP -\-\-slbs=, \-s +\-s , \-\-slbs= .RS 4 Comma separated list of the starting blocks in each range .RE .PP -\-\-limited\-retry, \-l +\-\-snsids=, \-N +.RS 4 +Comma separated list of the source namespace identifiers in each range +.RE +.PP +\-\-sopts=, \-O +.RS 4 +Comma separated list of the source options in each range +.RE +.PP +\-l, \-\-limited\-retry .RS 4 Sets the limited retry flag\&. .RE .PP -\-\-force\-unit\-access, \-f +\-f, \-\-force\-unit\-access .RS 4 Set the force\-unit access flag\&. .RE .PP -\-\-prinfow=, \-p +\-p , \-\-prinfow= .RS 4 Protection Information field write definition\&. .RE .PP -\-\-prinfor=, \-P +\-P , \-\-prinfor= .RS 4 Protection Information field read definition\&. .RE .PP -\-\-ref\-tag=, \-r +\-r , \-\-ref\-tag= .RS 4 initial lba reference tag\&. .RE .PP -\-\-expected\-ref\-tags=, \-R +\-R , \-\-expected\-ref\-tags= .RS 4 expected lba reference tags (comma\-separated list)\&. .RE .PP -\-\-app\-tag=, \-a +\-a , \-\-app\-tag= .RS 4 lba app tag .RE .PP -\-\-expected\-app\-tags=, \-A +\-A , \-\-expected\-app\-tags= .RS 4 expected lba app tags (comma\-separated list) .RE .PP -\-\-app\-mask=, \-m +\-m , \-\-app\-mask= .RS 4 lba tag mask .RE .PP -\-\-expected\-app\-masks=, \-M +\-M , \-\-expected\-app\-masks= .RS 4 expected lba tag masks (comma\-separated list) .RE .PP -\-\-dir\-type=, \-T +\-T , \-\-dir\-type= .RS 4 Optional directive type\&. The nvme\-cli only enforces the value be in the defined range for the directive type, though the NVMe specification (1\&.3a) defines only one directive, 01h, for write stream identifiers\&. .RE .PP -\-\-dir\-spec=, \-S +\-S , \-\-dir\-spec= .RS 4 Optional field for directive specifics\&. When used with write streams, this value is defined to be the write stream identifier\&. The nvme\-cli will not validate the stream requested is within the controller\(cqs capabilities\&. .RE .PP -\-\-format=, \-F +\-F , \-\-format= .RS 4 source range entry format .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-copy.html b/Documentation/nvme-copy.html index e9f7ee3..010361e 100644 --- a/Documentation/nvme-copy.html +++ b/Documentation/nvme-copy.html @@ -752,6 +752,8 @@ nvme-copy(1) Manual Page
nvme-copy <device> [--sdlba=<sdlba> | -d <sdlba>]
                         [--blocks=<nlb-list,> | -b <nlb-list,>]
                         [--slbs=<slbas,> | -s <slbas,>]
+                        [--snsids=<snsids,> | -N <snsids,>]
+                        [--sopts=<sopts,> | -O <sopts,>]
                         [--limited-retry | -l]
                         [--force-unit-access | -f]
                         [--prinfow=<prinfow> | -p <prinfow>]
@@ -764,7 +766,8 @@ nvme-copy(1) Manual Page
                         [--expected-app-masks=<appmask,> | -M <appmask,>]
                         [--dir-type=<type> | -T <type>]
                         [--dir-spec=<spec> | -S <spec>]
-                        [--format=<entry-format> | -F <entry-format>]
+ [--format=<entry-format> | -F <entry-format>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -781,10 +784,10 @@ logical block ranges to a single consecutive destination logical block range.

---sdlba=<sdlba> +-d <sdlba>
--d <sdlba> +--sdlba=<sdlba>

@@ -792,10 +795,10 @@ logical block ranges to a single consecutive destination logical block range.

---blocks=<nlb-list,> +-b <nlb-list,>
--b <nlb-list,> +--blocks=<nlb-list,>

@@ -803,10 +806,10 @@ logical block ranges to a single consecutive destination logical block range.

---slbs=<slbas,> +-s <slbas,>
--s <slbas,> +--slbs=<slbas,>

@@ -814,21 +817,43 @@ logical block ranges to a single consecutive destination logical block range.

---limited-retry +--snsids=<snsids,>
+-N <snsids,> +
+
+

+ Comma separated list of the source namespace identifiers in each range +

+
+
+--sopts=<sopts,> +
+
+-O <sopts,> +
+
+

+ Comma separated list of the source options in each range +

+
+
-l
+
+--limited-retry +

Sets the limited retry flag.

---force-unit-access +-f
--f +--force-unit-access

@@ -836,10 +861,10 @@ logical block ranges to a single consecutive destination logical block range.

---prinfow=<prinfow> +-p <prinfow>
--p <prinfow> +--prinfow=<prinfow>

@@ -847,10 +872,10 @@ logical block ranges to a single consecutive destination logical block range.

---prinfor=<prinfor> +-P <prinfor>
--P <prinfor> +--prinfor=<prinfor>

@@ -858,10 +883,10 @@ logical block ranges to a single consecutive destination logical block range.

---ref-tag=<reftag> +-r <reftag>
--r <reftag> +--ref-tag=<reftag>

@@ -869,10 +894,10 @@ logical block ranges to a single consecutive destination logical block range.

---expected-ref-tags=<reftag,> +-R <reftag,>
--R <reftag,> +--expected-ref-tags=<reftag,>

@@ -880,10 +905,10 @@ logical block ranges to a single consecutive destination logical block range.

---app-tag=<apptag> +-a <apptag>
--a <apptag> +--app-tag=<apptag>

@@ -891,10 +916,10 @@ logical block ranges to a single consecutive destination logical block range.

---expected-app-tags=<apptag,> +-A <apptag,>
--A <apptag,> +--expected-app-tags=<apptag,>

@@ -902,10 +927,10 @@ logical block ranges to a single consecutive destination logical block range.

---app-mask=<appmask> +-m <appmask>
--m <appmask> +--app-mask=<appmask>

@@ -913,10 +938,10 @@ logical block ranges to a single consecutive destination logical block range.

---expected-app-masks=<appmask,> +-M <appmask,>
--M <appmask,> +--expected-app-masks=<appmask,>

@@ -924,10 +949,10 @@ logical block ranges to a single consecutive destination logical block range.

---dir-type=<type> +-T <type>
--T <type> +--dir-type=<type>

@@ -938,10 +963,10 @@ logical block ranges to a single consecutive destination logical block range.

---dir-spec=<spec> +-S <spec>
--S <spec> +--dir-spec=<spec>

@@ -952,16 +977,39 @@ logical block ranges to a single consecutive destination logical block range.

---format=<entry-format> +-F <entry-format>
--F <entry-format> +--format=<entry-format>

source range entry format

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -982,7 +1030,7 @@ logical block ranges to a single consecutive destination logical block range.

diff --git a/Documentation/nvme-copy.txt b/Documentation/nvme-copy.txt index 1fad952..7c5fb0e 100644 --- a/Documentation/nvme-copy.txt +++ b/Documentation/nvme-copy.txt @@ -11,6 +11,8 @@ SYNOPSIS 'nvme-copy' [--sdlba= | -d ] [--blocks= | -b ] [--slbs= | -s ] + [--snsids= | -N ] + [--sopts= | -O ] [--limited-retry | -l] [--force-unit-access | -f] [--prinfow= | -p ] @@ -24,6 +26,7 @@ SYNOPSIS [--dir-type= | -T ] [--dir-spec= | -S ] [--format= | -F ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -32,76 +35,93 @@ logical block ranges to a single consecutive destination logical block range. OPTIONS ------- ---sdlba=:: -d :: +--sdlba=:: 64-bit addr of first destination logical block ---blocks=:: -b :: +--blocks=:: Comma separated list of the number of blocks in each range ---slbs=:: -s :: +--slbs=:: Comma separated list of the starting blocks in each range ---limited-retry:: +--snsids=:: +-N :: + Comma separated list of the source namespace identifiers in each range + +--sopts=:: +-O :: + Comma separated list of the source options in each range + -l:: +--limited-retry:: Sets the limited retry flag. ---force-unit-access:: -f:: +--force-unit-access:: Set the force-unit access flag. ---prinfow=:: -p :: +--prinfow=:: Protection Information field write definition. ---prinfor=:: -P :: +--prinfor=:: Protection Information field read definition. ---ref-tag=:: -r :: +--ref-tag=:: initial lba reference tag. ---expected-ref-tags=:: -R :: +--expected-ref-tags=:: expected lba reference tags (comma-separated list). ---app-tag=:: -a :: +--app-tag=:: lba app tag ---expected-app-tags=:: -A :: +--expected-app-tags=:: expected lba app tags (comma-separated list) ---app-mask=:: -m :: +--app-mask=:: lba tag mask ---expected-app-masks=:: -M :: +--expected-app-masks=:: expected lba tag masks (comma-separated list) ---dir-type=:: -T :: +--dir-type=:: Optional directive type. The nvme-cli only enforces the value be in the defined range for the directive type, though the NVMe specification (1.3a) defines only one directive, 01h, for write stream identifiers. ---dir-spec=:: -S :: +--dir-spec=:: Optional field for directive specifics. When used with write streams, this value is defined to be the write stream identifier. The nvme-cli will not validate the stream requested is within the controller's capabilities. ---format=:: -F :: +--format=:: source range entry format +-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 -------- No examples yet. diff --git a/Documentation/nvme-create-ns.1 b/Documentation/nvme-create-ns.1 index a63aaad..89cf2a9 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-CREATE\-NS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-CREATE\-NS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -39,6 +39,7 @@ nvme-create-ns \- Send NVMe Namespace management command to create namespace, re [\-\-nmic= | \-m ] [\-\-anagrp\-id= | \-a ] [\-\-nvmset\-id= | \-i ] + [\-\-endg\-id= | \-e ] [\-\-csi= | \-y ] [\-\-lbstm= | \-l ] [\-\-nphndls= | \-n ] @@ -48,9 +49,10 @@ nvme-create-ns \- Send NVMe Namespace management command to create namespace, re [\-\-ncap\-si= | \-C ] [\-\-azr | \-z] [\-\-rar= | \-r ] - [\-\-ror= | \-o ] + [\-\-ror= | \-O ] [\-\-rnumzrwa= | \-u ] [\-\-phndls= | \-p ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -94,6 +96,11 @@ ANA Group Identifier\&. If this value is 0h specifies that the controller determ This field specifies the identifier of the NVM Set\&. .RE .PP +\-e , \-\-endg\-id= +.RS 4 +This field specifies the identifier of the endurance group\&. +.RE +.PP \-y , \-\-csi= .RS 4 This field specifies the identifier of command set\&. if not issued, NVM Command Set will be selected\&. @@ -134,7 +141,7 @@ Allocate ZRWA Resources\&. If set to 1, then the namespace is to be created with Requested Active Resources\&. This field specifies the number of active resources to be allocated to the created namespace\&. .RE .PP -\-o , \-\-ror= +\-O , \-\-ror= .RS 4 Requested Open Resources\&. This field specifies the number of open resources to be allocated to the created namespace\&. .RE @@ -148,6 +155,20 @@ Requested Number of ZRWA Resources\&. This field specifies the number of ZRWA re .RS 4 The comma separated list of Reclaim Unit Handle Identifier to be associated with each Placement Handle\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-create-ns.html b/Documentation/nvme-create-ns.html index c36f5b0..1ff077a 100644 --- a/Documentation/nvme-create-ns.html +++ b/Documentation/nvme-create-ns.html @@ -766,9 +766,10 @@ nvme-create-ns(1) Manual Page [--ncap-si=<ncap-si> | -C <ncap-si>] [--azr | -z] [--rar=<rar> | -r <rar>] - [--ror=<ror> | -o <ror>] + [--ror=<ror> | -O <ror>] [--rnumzrwa=<rnumzrwa> | -u <rnumzrwa>] - [--phndls=<placement-handle-list,> | -p <placement-handle-list,>] + [--phndls=<placement-handle-list,> | -p <placement-handle-list,>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -922,8 +923,8 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

Target block size the new namespace should be formatted as. Potential FLBAS - values will be values will be scanned and the lowest numbered will be - selected for the create-ns operation. Conflicts with --flbas argument. + values will be values will be scanned and the lowest numbered will be + selected for the create-ns operation. Conflicts with --flbas argument.

@@ -979,7 +980,7 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

--o <ror> +-O <ror>
--ror=<ror> @@ -1014,6 +1015,29 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -1045,7 +1069,7 @@ Create a namespace: diff --git a/Documentation/nvme-create-ns.txt b/Documentation/nvme-create-ns.txt index 28046b6..740d05b 100644 --- a/Documentation/nvme-create-ns.txt +++ b/Documentation/nvme-create-ns.txt @@ -25,9 +25,10 @@ SYNOPSIS [--ncap-si= | -C ] [--azr | -z] [--rar= | -r ] - [--ror= | -o ] + [--ror= | -O ] [--rnumzrwa= | -u ] [--phndls= | -p ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -92,8 +93,8 @@ OPTIONS -b:: --block-size:: Target block size the new namespace should be formatted as. Potential FLBAS - values will be values will be scanned and the lowest numbered will be - selected for the create-ns operation. Conflicts with --flbas argument. + values will be values will be scanned and the lowest numbered will be + selected for the create-ns operation. Conflicts with --flbas argument. -S:: --nsze-si:: @@ -119,7 +120,7 @@ OPTIONS Requested Active Resources. This field specifies the number of active resources to be allocated to the created namespace. --o :: +-O :: --ror=:: Requested Open Resources. This field specifies the number of open resources to be allocated to the created namespace. @@ -134,6 +135,15 @@ OPTIONS The comma separated list of Reclaim Unit Handle Identifier to be associated with each Placement Handle. +-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 -------- * Create a namespace: diff --git a/Documentation/nvme-delete-ns.1 b/Documentation/nvme-delete-ns.1 index d50ed5d..c9d8a0f 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-NS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-NS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,6 +33,7 @@ nvme-delete-ns \- Send NVMe Namespace Management delete namespace command, retur .sp .nf \fInvme delete\-ns\fR [\-\-namespace\-id= | \-n ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -45,6 +46,20 @@ The parameter is mandatory and may be either the NVMe character device .RS 4 The namespace identifier to delete\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-delete-ns.html b/Documentation/nvme-delete-ns.html index 7db9073..057d0bf 100644 --- a/Documentation/nvme-delete-ns.html +++ b/Documentation/nvme-delete-ns.html @@ -749,7 +749,8 @@ nvme-id-ns(1) Manual Page

SYNOPSIS

-
nvme delete-ns <device> [--namespace-id=<nsid> | -n <nsid>]
+
nvme delete-ns <device> [--namespace-id=<nsid> | -n <nsid>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -779,6 +780,29 @@ The '--namespace-id' option is mandatory.

The namespace identifier to delete.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -799,7 +823,7 @@ The '--namespace-id' option is mandatory.

diff --git a/Documentation/nvme-delete-ns.txt b/Documentation/nvme-delete-ns.txt index 62301b4..1b306b2 100644 --- a/Documentation/nvme-delete-ns.txt +++ b/Documentation/nvme-delete-ns.txt @@ -9,6 +9,7 @@ SYNOPSIS -------- [verse] 'nvme delete-ns' [--namespace-id= | -n ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -25,6 +26,15 @@ OPTIONS --namespace-id=:: The namespace identifier to delete. +-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 -------- No examples yet. diff --git a/Documentation/nvme-dera-stat.1 b/Documentation/nvme-dera-stat.1 index 8a206ed..02c6e73 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DERA\-STAT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-DERA\-STAT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-dera-stat.html b/Documentation/nvme-dera-stat.html index 0dee6a3..13b9f84 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-dera-stat.txt b/Documentation/nvme-dera-stat.txt index 512e584..f3a87ae 100644 --- a/Documentation/nvme-dera-stat.txt +++ b/Documentation/nvme-dera-stat.txt @@ -24,7 +24,6 @@ OPTIONS ------- none - EXAMPLES -------- * Print the Dera Device status and Additional SMART log page in a human readable format: diff --git a/Documentation/nvme-detach-ns.1 b/Documentation/nvme-detach-ns.1 index 824166b..70d895d 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DETACH\-NS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-DETACH\-NS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,6 +34,7 @@ nvme-detach-ns \- Send NVMe detach namespace, return result\&. .nf \fInvme detach\-ns\fR [\-\-namespace\-id= | \-n ] [\-\-controllers= | \-c + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -45,10 +46,24 @@ For the NVMe device given, sends the nvme namespace detach command for the provi The namespace identifier to detach\&. .RE .PP -\-c , \-controllers= +\-c , \-\-controllers= .RS 4 The comma separated list of controller identifiers to detach the namespace from\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-detach-ns.html b/Documentation/nvme-detach-ns.html index 0b6e583..469f5ed 100644 --- a/Documentation/nvme-detach-ns.html +++ b/Documentation/nvme-detach-ns.html @@ -750,7 +750,8 @@ nvme-detach-ns(1) Manual Page
nvme detach-ns <device> [--namespace-id=<nsid> | -n <nsid>]
-                        [--controllers=<ctrl-list,> | -c <ctrl-list,>
+ [--controllers=<ctrl-list,> | -c <ctrl-list,> + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -782,7 +783,7 @@ controller identifiers.

-c <ctrl-list,>
--controllers=<ctrl-list,> +--controllers=<ctrl-list,>

@@ -790,6 +791,29 @@ controller identifiers.

the namespace from.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -810,7 +834,7 @@ controller identifiers.

diff --git a/Documentation/nvme-detach-ns.txt b/Documentation/nvme-detach-ns.txt index ed23c15..842889c 100644 --- a/Documentation/nvme-detach-ns.txt +++ b/Documentation/nvme-detach-ns.txt @@ -10,6 +10,7 @@ SYNOPSIS [verse] 'nvme detach-ns' [--namespace-id= | -n ] [--controllers= | -c + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -24,10 +25,19 @@ OPTIONS The namespace identifier to detach. -c :: --controllers=:: +--controllers=:: The comma separated list of controller identifiers to detach the namespace from. +-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 -------- No examples yet. diff --git a/Documentation/nvme-device-self-test.1 b/Documentation/nvme-device-self-test.1 index 393bd02..f37be3f 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DEVICE\-SELF\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-DEVICE\-SELF\-" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,7 +33,8 @@ nvme-device-self-test \- Perform the necessary tests to observe the performance .sp .nf \fInvme device\-self\-test\fR [\-\-namespace\-id= | \-n ] - [\-\-self\-test\-code= | \-s ] [\-\-wait | \-w] + [\-\-self\-test\-code= | \-s ] [\-\-wait | \-w] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -58,6 +59,20 @@ This field specifies the action taken by the device self\-test command : 0h: Sho .RS 4 Wait for the device self test to complete before exiting The device self\-test is aborted by SIGINT signal interrupt for the wait The option is ignored if the abort self\-test code option specified\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-device-self-test.html b/Documentation/nvme-device-self-test.html index f2180a9..ce0251e 100644 --- a/Documentation/nvme-device-self-test.html +++ b/Documentation/nvme-device-self-test.html @@ -750,7 +750,8 @@ nvme-device-self-test(1) Manual Page
nvme device-self-test <device> [--namespace-id=<NUM> | -n <NUM>]
-                        [--self-test-code=<NUM> | -s <NUM>]  [--wait | -w]
+ [--self-test-code=<NUM> | -s <NUM>] [--wait | -w] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -809,6 +810,29 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -848,7 +872,7 @@ Abort the device self-test operation in the namespace-id 1: diff --git a/Documentation/nvme-device-self-test.txt b/Documentation/nvme-device-self-test.txt index d098277..17fe875 100644 --- a/Documentation/nvme-device-self-test.txt +++ b/Documentation/nvme-device-self-test.txt @@ -9,7 +9,8 @@ SYNOPSIS -------- [verse] 'nvme device-self-test' [--namespace-id= | -n ] - [--self-test-code= | -s ] [--wait | -w] + [--self-test-code= | -s ] [--wait | -w] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -28,12 +29,12 @@ OPTIONS -s :: --self-test-code=:: - This field specifies the action taken by the device self-test command : - 0h: Show current state of device self-test operation - 1h: Start a short device self-test operation - 2h: Start a extended device self-test operation - eh: Start a vendor specific device self-test operation - fh: Abort the device self-test operation + This field specifies the action taken by the device self-test command : + 0h: Show current state of device self-test operation + 1h: Start a short device self-test operation + 2h: Start a extended device self-test operation + eh: Start a vendor specific device self-test operation + fh: Abort the device self-test operation Default is 0h. -w:: @@ -42,6 +43,15 @@ OPTIONS The device self-test is aborted by SIGINT signal interrupt for the wait The option is ignored if the abort self-test code option specified. +-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 -------- * Start a short device self-test in the namespace-id 1: diff --git a/Documentation/nvme-dim.1 b/Documentation/nvme-dim.1 index c417d2e..c944163 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DIM" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-DIM" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,10 +32,9 @@ nvme-dim \- Send Discovery Information Management command to one or more Discove .SH "SYNOPSIS" .sp .nf -\fInvme dim\fR - [\-\-task= | \-t ] - [\-\-nqn= | \-n ] - [\-\-device= | \-d ] +\fInvme dim\fR [\-\-task= | \-t ] [\-\-nqn= | \-n ] + [\-\-device= | \-d ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -62,6 +61,20 @@ The DIM command will be sent to the Discovery Controller (DC) matching this NQN\ .RS 4 The DIM command will be sent to the Discovery Controllers (DC) associated with this NVMe device handle\&. A list of comma\-separated device handles can be supplied to apply the command to more than one DC\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-dim.html b/Documentation/nvme-dim.html index e31d59a..d88df34 100644 --- a/Documentation/nvme-dim.html +++ b/Documentation/nvme-dim.html @@ -749,10 +749,9 @@ nvme-dim(1) Manual Page

SYNOPSIS

-
nvme dim
-                [--task=<task>     | -t <task>]
-                [--nqn=<nqn>       | -n <nqn>]
-                [--device=<device> | -d <device>]
+
nvme dim [--task=<task> | -t <task>] [--nqn=<nqn> | -n <nqn>]
+                        [--device=<device> | -d <device>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -817,6 +816,29 @@ with the nvme-discover(1) command using the --persistent option.

be supplied to apply the command to more than one DC.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -863,7 +885,7 @@ Deregister from Central Discovery Controller (CDC) associated with nvme4 diff --git a/Documentation/nvme-dim.txt b/Documentation/nvme-dim.txt index 52df256..fcfc9b8 100644 --- a/Documentation/nvme-dim.txt +++ b/Documentation/nvme-dim.txt @@ -3,15 +3,15 @@ nvme-dim(1) NAME ---- -nvme-dim - Send Discovery Information Management command to one or more Discovery Controllers. +nvme-dim - Send Discovery Information Management command to one or more +Discovery Controllers. SYNOPSIS -------- [verse] -'nvme dim' - [--task= | -t ] - [--nqn= | -n ] - [--device= | -d ] +'nvme dim' [--task= | -t ] [--nqn= | -n ] + [--device= | -d ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -51,6 +51,15 @@ OPTIONS with this NVMe device handle. A list of comma-separated device handles can be supplied to apply the command to more than one DC. +-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 -------- * Register with the Central Discovery Controller (CDC) named diff --git a/Documentation/nvme-dir-receive.1 b/Documentation/nvme-dir-receive.1 index f34b23e..fce97d6 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DIR\-RECEIVE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-DIR\-RECEIVE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,13 +33,13 @@ nvme-dir-receive \- Send a directive receive command, returns applicable results .sp .nf \fInvme dir\-receive\fR [\-\-namespace\-id= | \-n ] - [\-\-data\-len= | \-l ] - [\-\-dir\-type= | \-D ] - [\-\-dir\-spec= | \-S ] - [\-\-dir\-oper= | \-O ] - [\-\-req\-resource= | \-r ] - [\-\-human\-readable | \-H] - [\-\-raw\-binary | \-b] + [\-\-data\-len= | \-l ] + [\-\-dir\-type= | \-D ] + [\-\-dir\-spec= | \-S ] + [\-\-dir\-oper= | \-O ] + [\-\-req\-resource= | \-r ] + [\-\-human\-readable | \-H] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -73,9 +73,6 @@ Directive operation \-r , \-\-req\-resource= .RS 4 Directive requested resource count -.RE -.sp -+ .TS allbox tab(:); lt lt @@ -85,49 +82,38 @@ lt lt lt lt lt lt. T{ -.sp Select T}:T{ -.sp Description T} T{ -.sp 0 T}:T{ -.sp Current T} T{ -.sp 1 T}:T{ -.sp Default T} T{ -.sp 2 T}:T{ -.sp Saved T} T{ -.sp 3 T}:T{ -.sp Supported capabilities T} T{ -.sp 4\(en7 T}:T{ -.sp Reserved T} .TE .sp 1 +.RE .PP \-l , \-\-data\-len= .RS 4 @@ -143,6 +129,20 @@ Print the raw receive buffer to stdout if the command returns a structure\&. .RS 4 Print the decoded receive buffer to stdout if the command returns a structure\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-dir-receive.html b/Documentation/nvme-dir-receive.html index 64ecda3..112a3f4 100644 --- a/Documentation/nvme-dir-receive.html +++ b/Documentation/nvme-dir-receive.html @@ -750,13 +750,13 @@ nvme-dir-receive(1) Manual Page
nvme dir-receive <device> [--namespace-id=<nsid> | -n <nsid>]
-                          [--data-len=<data-len> | -l <data-len>]
-                          [--dir-type=<dtype> | -D <dtype>]
-                          [--dir-spec=<dspec> | -S <dspec>]
-                          [--dir-oper=<doper> | -O <doper>]
-                          [--req-resource=<nsr> | -r <nsr>]
-                          [--human-readable | -H]
-                          [--raw-binary | -b]
+ [--data-len=<data-len> | -l <data-len>] + [--dir-type=<dtype> | -D <dtype>] + [--dir-spec=<dspec> | -S <dspec>] + [--dir-oper=<doper> | -O <doper>] + [--req-resource=<nsr> | -r <nsr>] + [--human-readable | -H] [--raw-binary | -b] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -835,9 +835,6 @@ printed to stdout for another program to parse.

Directive requested resource count

- - -

+

-
+
-l <data-len>
@@ -911,6 +908,29 @@ cellspacing="0" cellpadding="4"> a structure.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -969,7 +989,7 @@ Get streams directive status : diff --git a/Documentation/nvme-dir-receive.txt b/Documentation/nvme-dir-receive.txt index b412c0b..f3f31ba 100644 --- a/Documentation/nvme-dir-receive.txt +++ b/Documentation/nvme-dir-receive.txt @@ -9,13 +9,13 @@ SYNOPSIS -------- [verse] 'nvme dir-receive' [--namespace-id= | -n ] - [--data-len= | -l ] - [--dir-type= | -D ] - [--dir-spec= | -S ] - [--dir-oper= | -O ] - [--req-resource= | -r ] - [--human-readable | -H] - [--raw-binary | -b] + [--data-len= | -l ] + [--dir-type= | -D ] + [--dir-spec= | -S ] + [--dir-oper= | -O ] + [--req-resource= | -r ] + [--human-readable | -H] [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -41,20 +41,19 @@ OPTIONS -D :: --dir-type=:: - Directive type + Directive type -S :: --dir-spec=:: - Directive specific + Directive specific -O :: --dir-oper=:: - Directive operation + Directive operation -r :: --req-resource=:: Directive requested resource count - + [] |================== @@ -82,6 +81,15 @@ OPTIONS Print the decoded receive buffer to stdout if the command returns a structure. +-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 -------- * Identify directive type supported : diff --git a/Documentation/nvme-dir-send.1 b/Documentation/nvme-dir-send.1 index 7476e8b..cfb2087 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DIR\-SEND" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-DIR\-SEND" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,14 +33,14 @@ nvme-dir-send \- Issue a directive send command, returns applicable results .sp .nf \fInvme dir\-send\fR [\-\-namespace\-id= | \-n ] - [\-\-data\-len= | \-l ] - [\-\-dir\-type= | \-D ] - [\-\-dir\-spec= | \-S ] - [\-\-dir\-oper= | \-O ] - [\-\-endir= | \-e ] - [\-\-target\-dir= | \-T ] - [\-\-human\-readable | \-H] - [\-\-raw\-binary | \-b] + [\-\-data\-len= | \-l ] + [\-\-dir\-type= | \-D ] + [\-\-dir\-spec= | \-S ] + [\-\-dir\-oper= | \-O ] + [\-\-endir= | \-e ] + [\-\-target\-dir= | \-T ] + [\-\-human\-readable | \-H] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -79,9 +79,6 @@ Target directive of the operation \-e , \-\-endir= .RS 4 Target directive enable(1) or disable (0) operation -.RE -.sp -+ .TS allbox tab(:); lt lt @@ -91,49 +88,38 @@ lt lt lt lt lt lt. T{ -.sp Select T}:T{ -.sp Description T} T{ -.sp 0 T}:T{ -.sp Current T} T{ -.sp 1 T}:T{ -.sp Default T} T{ -.sp 2 T}:T{ -.sp Saved T} T{ -.sp 3 T}:T{ -.sp Supported capabilities T} T{ -.sp 4\(en7 T}:T{ -.sp Reserved T} .TE .sp 1 +.RE .PP \-l , \-\-data\-len= .RS 4 @@ -149,6 +135,20 @@ Print the raw receive buffer to stdout if the command returns a structure\&. .RS 4 Print the decoded receive buffer to stdout if the command returns a structure\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-dir-send.html b/Documentation/nvme-dir-send.html index 20d0c63..8ffbf30 100644 --- a/Documentation/nvme-dir-send.html +++ b/Documentation/nvme-dir-send.html @@ -750,14 +750,14 @@ nvme-dir-send(1) Manual Page
nvme dir-send <device> [--namespace-id=<nsid> | -n <nsid>]
-                          [--data-len=<data-len> | -l <data-len>]
-                          [--dir-type=<dtype> | -D <dtype>]
-                          [--dir-spec=<dspec> | -S <dspec>]
-                          [--dir-oper=<doper> | -O <doper>]
-                          [--endir=<endir> | -e <endir>]
-                          [--target-dir=<tdir> | -T <tdir>]
-                          [--human-readable | -H]
-                          [--raw-binary | -b]
+ [--data-len=<data-len> | -l <data-len>] + [--dir-type=<dtype> | -D <dtype>] + [--dir-spec=<dspec> | -S <dspec>] + [--dir-oper=<doper> | -O <doper>] + [--endir=<endir> | -e <endir>] + [--target-dir=<tdir> | -T <tdir>] + [--human-readable | -H] [--raw-binary | -b] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -848,9 +848,6 @@ printed to stdout for another program to parse.

Target directive enable(1) or disable (0) operation

- - -

+

-
+
-l <data-len>
@@ -924,6 +921,29 @@ cellspacing="0" cellpadding="4"> a structure.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -982,7 +1002,7 @@ Release stream ID 3 : diff --git a/Documentation/nvme-dir-send.txt b/Documentation/nvme-dir-send.txt index eb5dad0..1e3743d 100644 --- a/Documentation/nvme-dir-send.txt +++ b/Documentation/nvme-dir-send.txt @@ -9,14 +9,14 @@ SYNOPSIS -------- [verse] 'nvme dir-send' [--namespace-id= | -n ] - [--data-len= | -l ] - [--dir-type= | -D ] - [--dir-spec= | -S ] - [--dir-oper= | -O ] - [--endir= | -e ] - [--target-dir= | -T ] - [--human-readable | -H] - [--raw-binary | -b] + [--data-len= | -l ] + [--dir-type= | -D ] + [--dir-spec= | -S ] + [--dir-oper= | -O ] + [--endir= | -e ] + [--target-dir= | -T ] + [--human-readable | -H] [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -43,15 +43,15 @@ OPTIONS -D :: --dir-type=:: - Directive type + Directive type -S :: --dir-spec=:: - Directive specific + Directive specific -O :: --dir-oper=:: - Directive operation + Directive operation -T :: --target-dir=:: @@ -60,7 +60,6 @@ OPTIONS -e :: --endir=:: Target directive enable(1) or disable (0) operation - + [] |================== @@ -88,6 +87,15 @@ OPTIONS Print the decoded receive buffer to stdout if the command returns a structure. +-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 -------- * Enable streams directive : diff --git a/Documentation/nvme-disconnect-all.1 b/Documentation/nvme-disconnect-all.1 index bee5db7..a2cde6a 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DISCONNECT\-AL" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-DISCONNECT\-AL" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,13 +32,28 @@ nvme-disconnect-all \- Disconnect from all connected Fabrics controllers\&. .SH "SYNOPSIS" .sp .nf -\fInvme disconnect\-all\fR +\fInvme disconnect\-all\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp Disconnects and removes all existing NVMe over Fabrics controllers\&. .sp See the documentation for the nvme\-disconnect(1) command for further background\&. +.SH "OPTIONS" +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-disconnect-all.html b/Documentation/nvme-disconnect-all.html index d1a0402..6bd3efc 100644 --- a/Documentation/nvme-disconnect-all.html +++ b/Documentation/nvme-disconnect-all.html @@ -749,7 +749,7 @@ nvme-disconnect-all(1) Manual Page

SYNOPSIS

-
nvme disconnect-all
+
nvme disconnect-all [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -763,6 +763,36 @@ background.

+

OPTIONS

+
+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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

    @@ -795,7 +825,7 @@ Disconnect all existing nvme controllers: diff --git a/Documentation/nvme-disconnect-all.txt b/Documentation/nvme-disconnect-all.txt index 6be7e41..9f023ea 100644 --- a/Documentation/nvme-disconnect-all.txt +++ b/Documentation/nvme-disconnect-all.txt @@ -8,7 +8,7 @@ nvme-disconnect-all - Disconnect from all connected Fabrics controllers. SYNOPSIS -------- [verse] -'nvme disconnect-all' +'nvme disconnect-all' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -17,6 +17,17 @@ Disconnects and removes all existing NVMe over Fabrics controllers. See the documentation for the nvme-disconnect(1) command for further background. +OPTIONS +------- +-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 -------- * Disconnect all existing nvme controllers: diff --git a/Documentation/nvme-disconnect.1 b/Documentation/nvme-disconnect.1 index 58120ba..18ae643 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DISCONNECT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-DISCONNECT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,9 @@ nvme-disconnect \- Disconnect one or more Fabrics controller(s)\&. .SH "SYNOPSIS" .sp .nf -\fInvme disconnect\fR - [\-\-nqn= | \-n ] - [\-\-device= | \-d ] +\fInvme disconnect\fR [\-\-nqn= | \-n ] + [\-\-device= | \-d ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -50,6 +50,20 @@ Indicates that all controllers for the NVMe subsystems specified should be remov .RS 4 Indicates that the controller with the specified name should be removed\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-disconnect.html b/Documentation/nvme-disconnect.html index 8c80005..5ffdd76 100644 --- a/Documentation/nvme-disconnect.html +++ b/Documentation/nvme-disconnect.html @@ -749,9 +749,9 @@ nvme-disconnect(1) Manual Page

    SYNOPSIS

    -
    nvme disconnect
    -                [--nqn=<subnqn>           | -n <subnqn>]
    -                [--device=<device>        | -d <device>]
    +
    nvme disconnect [--nqn=<subnqn> | -n <subnqn>]
    +                        [--device=<device> | -d <device>]
    +                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
    @@ -761,7 +761,7 @@ nvme-disconnect(1) Manual Page

    Disconnects and removes one or more existing NVMe over Fabrics controllers. If the --nqn option is specified all controllers connecting to the Subsystem -identified by subnqn will be removed. If the --device option is specified +identified by subnqn will be removed. If the --device option is specified the controller specified by the --device option will be removed.

@@ -793,6 +793,29 @@ the controller specified by the --device option will be removed.

removed.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -839,7 +862,7 @@ Disconnect the controller nvme4 diff --git a/Documentation/nvme-disconnect.txt b/Documentation/nvme-disconnect.txt index badb86f..d3b8c52 100644 --- a/Documentation/nvme-disconnect.txt +++ b/Documentation/nvme-disconnect.txt @@ -8,15 +8,15 @@ nvme-disconnect - Disconnect one or more Fabrics controller(s). SYNOPSIS -------- [verse] -'nvme disconnect' - [--nqn= | -n ] - [--device= | -d ] +'nvme disconnect' [--nqn= | -n ] + [--device= | -d ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- Disconnects and removes one or more existing NVMe over Fabrics controllers. If the --nqn option is specified all controllers connecting to the Subsystem -identified by subnqn will be removed. If the --device option is specified +identified by subnqn will be removed. If the --device option is specified the controller specified by the --device option will be removed. OPTIONS @@ -31,6 +31,15 @@ OPTIONS Indicates that the controller with the specified name should be removed. +-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 -------- * Disconnect all controllers for a subsystem named @@ -50,7 +59,6 @@ SEE ALSO -------- nvme-connect(1) - NVME ---- Part of the nvme-user suite diff --git a/Documentation/nvme-discover.1 b/Documentation/nvme-discover.1 index fb940a5..0a5f2bf 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DISCOVER" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-DISCOVER" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,39 +32,30 @@ nvme-discover \- Send Get Log Page request to Discovery Controller\&. .SH "SYNOPSIS" .sp .nf -\fInvme discover\fR - [\-\-transport= | \-t ] - [\-\-nqn= | \-n ] - [\-\-traddr= | \-a ] - [\-\-trsvcid= | \-s ] - [\-\-host\-traddr= | \-w ] - [\-\-host\-iface= | \-f ] - [\-\-hostnqn= | \-q ] - [\-\-hostid= | \-I ] - [\-\-raw= | \-r ] - [\-\-device= | \-d ] - [\-\-cfg\-file= | \-C ] - [\-\-keep\-alive\-tmo= | \-k ] - [\-\-reconnect\-delay=<#> | \-c <#>] - [\-\-ctrl\-loss\-tmo=<#> | \-l <#>] - [\-\-nr\-io\-queues=<#> | \-i <#>] - [\-\-nr\-write\-queues=<#> | \-W <#>] - [\-\-nr\-poll\-queues=<#> | \-P <#>] - [\-\-queue\-size=<#> | \-Q <#>] - [\-\-keyring=<#> ] - [\-\-tls_key=<#> ] - [\-\-hdr\-digest | \-g] - [\-\-data\-digest | \-G] - [\-\-persistent | \-p] - [\-\-quiet | \-S] - [\-\-tls ] - [\-\-dump\-config | \-O] - [\-\-output\-format= | \-o ] - [\-\-force] - [\-\-nbft] - [\-\-no\-nbft] - [\-\-nbft\-path=] - [\-\-context=] +\fInvme discover\fR [\-\-transport= | \-t ] + [\-\-nqn= | \-n ] + [\-\-traddr= | \-a ] + [\-\-trsvcid= | \-s ] + [\-\-host\-traddr= | \-w ] + [\-\-host\-iface= | \-f ] + [\-\-hostnqn= | \-q ] + [\-\-hostid= | \-I ] + [\-\-raw= | \-r ] + [\-\-device= | \-d ] + [\-\-cfg\-file= | \-C ] + [\-\-keep\-alive\-tmo= | \-k ] + [\-\-reconnect\-delay=<#> | \-c <#>] + [\-\-ctrl\-loss\-tmo=<#> | \-l <#>] + [\-\-nr\-io\-queues=<#> | \-i <#>] + [\-\-nr\-write\-queues=<#> | \-W <#>] + [\-\-nr\-poll\-queues=<#> | \-P <#>] + [\-\-queue\-size=<#> | \-Q <#>] [\-\-keyring=<#>] + [\-\-tls_key=<#>] [\-\-hdr\-digest | \-g] [\-\-data\-digest | \-G] + [\-\-persistent | \-p] [\-\-quiet | \-S] [\-\-tls] + [\-\-dump\-config | \-O] [\-\-output\-format= | \-o ] + [\-\-force] [\-\-nbft] [\-\-no\-nbft] [\-\-nbft\-path=] + [\-\-context=] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -254,11 +245,12 @@ Suppress already connected errors\&. Print out resulting JSON configuration file to stdout\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE .PP @@ -286,6 +278,20 @@ Use a user\-defined path to the NBFT tables .RS 4 Set the execution context to \&. This allows to coordinate the management of the global resources\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 @@ -372,9 +378,9 @@ command using a /usr/local/etc/nvme/discovery\&.conf file: .RS 4 .\} .nf -# Machine default \*(Aqnvme discover\*(Aq commands\&. Query the +# Machine default \*(Aqnvme discover\*(Aq commands\&. Query the # Discovery Controller\*(Aqs two ports (some resources may only -# be accessible on a single port)\&. Note an official +# be accessible on a single port)\&. Note an official # nqn (Host) name defined in the NVMe specification is being used # in this example\&. \-t rdma \-a 192\&.168\&.69\&.33 \-s 4420 \-q nqn\&.2014\-08\&.com\&.example:nvme:nvm\-subsystem\-sn\-d78432 diff --git a/Documentation/nvme-discover.html b/Documentation/nvme-discover.html index dfd3b79..dc56c6b 100644 --- a/Documentation/nvme-discover.html +++ b/Documentation/nvme-discover.html @@ -749,39 +749,30 @@ nvme-discover(1) Manual Page

SYNOPSIS

-
nvme discover
-                [--transport=<trtype>     | -t <trtype>]
-                [--nqn=<subnqn>           | -n <subnqn>]
-                [--traddr=<traddr>        | -a <traddr>]
-                [--trsvcid=<trsvcid>      | -s <trsvcid>]
-                [--host-traddr=<traddr>   | -w <traddr>]
-                [--host-iface=<iface>     | -f <iface>]
-                [--hostnqn=<hostnqn>      | -q <hostnqn>]
-                [--hostid=<hostid>        | -I <hostid>]
-                [--raw=<filename>         | -r <filename>]
-                [--device=<device>        | -d <device>]
-                [--cfg-file=<cfg>         | -C <cfg> ]
-                [--keep-alive-tmo=<sec>   | -k <sec>]
-                [--reconnect-delay=<#>    | -c <#>]
-                [--ctrl-loss-tmo=<#>      | -l <#>]
-                [--nr-io-queues=<#>       | -i <#>]
-                [--nr-write-queues=<#>    | -W <#>]
-                [--nr-poll-queues=<#>     | -P <#>]
-                [--queue-size=<#>         | -Q <#>]
-                [--keyring=<#>                    ]
-                [--tls_key=<#>                    ]
-                [--hdr-digest             | -g]
-                [--data-digest            | -G]
-                [--persistent             | -p]
-                [--quiet                  | -S]
-                [--tls                        ]
-                [--dump-config            | -O]
-                [--output-format=<fmt>    | -o <fmt>]
-                [--force]
-                [--nbft]
-                [--no-nbft]
-                [--nbft-path=<STR>]
-                [--context=<STR>]
+
nvme discover [--transport=<trtype> | -t <trtype>]
+                        [--nqn=<subnqn> | -n <subnqn>]
+                        [--traddr=<traddr> | -a <traddr>]
+                        [--trsvcid=<trsvcid> | -s <trsvcid>]
+                        [--host-traddr=<traddr> | -w <traddr>]
+                        [--host-iface=<iface> | -f <iface>]
+                        [--hostnqn=<hostnqn> | -q <hostnqn>]
+                        [--hostid=<hostid> | -I <hostid>]
+                        [--raw=<filename> | -r <filename>]
+                        [--device=<device> | -d <device>]
+                        [--cfg-file=<cfg> | -C <cfg>]
+                        [--keep-alive-tmo=<sec> | -k <sec>]
+                        [--reconnect-delay=<#> | -c <#>]
+                        [--ctrl-loss-tmo=<#> | -l <#>]
+                        [--nr-io-queues=<#> | -i <#>]
+                        [--nr-write-queues=<#> | -W <#>]
+                        [--nr-poll-queues=<#> | -P <#>]
+                        [--queue-size=<#> | -Q <#>] [--keyring=<#>]
+                        [--tls_key=<#>] [--hdr-digest | -g] [--data-digest | -G]
+                        [--persistent | -p] [--quiet | -S] [--tls]
+                        [--dump-config | -O] [--output-format=<fmt> | -o <fmt>]
+                        [--force] [--nbft] [--no-nbft] [--nbft-path=<STR>]
+                        [--context=<STR>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -793,7 +784,7 @@ nvme-discover(1) Manual Page Controller.

If no parameters are given, then nvme discover will attempt to find a /usr/local/etc/nvme/discovery.conf file to use to supply a list of -Discovery commands to run. If no /usr/local/etc/nvme/discovery.conf file +Discovery commands to run. If no /usr/local/etc/nvme/discovery.conf file exists, the command will quit with an error.

Otherwise, a specific Discovery Controller should be specified using the --transport, --traddr, and if necessary the --trsvcid flags. A Discovery @@ -806,7 +797,7 @@ request will then be sent to the specified Discovery Controller.

The NVMe-over-Fabrics specification defines the concept of a Discovery Controller that an NVMe Host can query on a fabric network to discover NVMe subsystems contained in NVMe Targets -which it can connect to on the network. The Discovery Controller +which it can connect to on the network. The Discovery Controller will return Discovery Log Pages that provide the NVMe Host with specific information (such as network address and unique subsystem NQN) the NVMe Host can use to issue an @@ -819,7 +810,7 @@ In particular, the Host NQN uniquely identifies the NVMe Host, and may be used by the Discovery Controller to control what NVMe Target resources are allocated to the NVMe Host for a connection.

A Discovery Controller has it’s own NQN defined in the NVMe-over-Fabrics -specification, nqn.2014-08.org.nvmexpress.discovery. All Discovery +specification, nqn.2014-08.org.nvmexpress.discovery. All Discovery Controllers must use this NQN name. This NQN is used by default by nvme-cli for the discover command.

@@ -837,7 +828,7 @@ nvme-cli for the discover command.

This field specifies the network fabric being used for - a NVMe-over-Fabrics network. Current string values include: + a NVMe-over-Fabrics network. Current string values include:

- This field specifies the transport service id. For transports using IP + This field specifies the transport service id. For transports using IP addressing (e.g. rdma) this field is the port number. By default, the IP port number for the RDMA transport is 4420.

@@ -1168,15 +1159,15 @@ cellspacing="0" cellpadding="4">

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + Set the reporting format to normal, json or binary. Only one + output format can be used at a time.

@@ -1222,6 +1213,29 @@ cellspacing="0" cellpadding="4"> the management of the global resources.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -1265,9 +1279,9 @@ Issue a nvme discover command using a /usr/local/etc/nvme/discovery.con

-
# Machine default 'nvme discover' commands.  Query the
+
# Machine default 'nvme discover' commands. Query the
 # Discovery Controller's two ports (some resources may only
-# be accessible on a single port).  Note an official
+# be accessible on a single port). Note an official
 # nqn (Host) name defined in the NVMe specification is being used
 # in this example.
 -t rdma -a 192.168.69.33 -s 4420 -q nqn.2014-08.com.example:nvme:nvm-subsystem-sn-d78432
@@ -1303,7 +1317,7 @@ nvme-connect-all(1)

diff --git a/Documentation/nvme-discover.txt b/Documentation/nvme-discover.txt index a0ffb36..32f10bc 100644 --- a/Documentation/nvme-discover.txt +++ b/Documentation/nvme-discover.txt @@ -8,39 +8,30 @@ nvme-discover - Send Get Log Page request to Discovery Controller. SYNOPSIS -------- [verse] -'nvme discover' - [--transport= | -t ] - [--nqn= | -n ] - [--traddr= | -a ] - [--trsvcid= | -s ] - [--host-traddr= | -w ] - [--host-iface= | -f ] - [--hostnqn= | -q ] - [--hostid= | -I ] - [--raw= | -r ] - [--device= | -d ] - [--cfg-file= | -C ] - [--keep-alive-tmo= | -k ] - [--reconnect-delay=<#> | -c <#>] - [--ctrl-loss-tmo=<#> | -l <#>] - [--nr-io-queues=<#> | -i <#>] - [--nr-write-queues=<#> | -W <#>] - [--nr-poll-queues=<#> | -P <#>] - [--queue-size=<#> | -Q <#>] - [--keyring=<#> ] - [--tls_key=<#> ] - [--hdr-digest | -g] - [--data-digest | -G] - [--persistent | -p] - [--quiet | -S] - [--tls ] - [--dump-config | -O] - [--output-format= | -o ] - [--force] - [--nbft] - [--no-nbft] - [--nbft-path=] - [--context=] +'nvme discover' [--transport= | -t ] + [--nqn= | -n ] + [--traddr= | -a ] + [--trsvcid= | -s ] + [--host-traddr= | -w ] + [--host-iface= | -f ] + [--hostnqn= | -q ] + [--hostid= | -I ] + [--raw= | -r ] + [--device= | -d ] + [--cfg-file= | -C ] + [--keep-alive-tmo= | -k ] + [--reconnect-delay=<#> | -c <#>] + [--ctrl-loss-tmo=<#> | -l <#>] + [--nr-io-queues=<#> | -i <#>] + [--nr-write-queues=<#> | -W <#>] + [--nr-poll-queues=<#> | -P <#>] + [--queue-size=<#> | -Q <#>] [--keyring=<#>] + [--tls_key=<#>] [--hdr-digest | -g] [--data-digest | -G] + [--persistent | -p] [--quiet | -S] [--tls] + [--dump-config | -O] [--output-format= | -o ] + [--force] [--nbft] [--no-nbft] [--nbft-path=] + [--context=] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -49,7 +40,7 @@ Controller. If no parameters are given, then 'nvme discover' will attempt to find a @SYSCONFDIR@/nvme/discovery.conf file to use to supply a list of -Discovery commands to run. If no @SYSCONFDIR@/nvme/discovery.conf file +Discovery commands to run. If no @SYSCONFDIR@/nvme/discovery.conf file exists, the command will quit with an error. Otherwise, a specific Discovery Controller should be specified using the @@ -61,7 +52,7 @@ BACKGROUND The NVMe-over-Fabrics specification defines the concept of a Discovery Controller that an NVMe Host can query on a fabric network to discover NVMe subsystems contained in NVMe Targets -which it can connect to on the network. The Discovery Controller +which it can connect to on the network. The Discovery Controller will return Discovery Log Pages that provide the NVMe Host with specific information (such as network address and unique subsystem NQN) the NVMe Host can use to issue an @@ -76,7 +67,7 @@ may be used by the Discovery Controller to control what NVMe Target resources are allocated to the NVMe Host for a connection. A Discovery Controller has it's own NQN defined in the NVMe-over-Fabrics -specification, *nqn.2014-08.org.nvmexpress.discovery*. All Discovery +specification, *nqn.2014-08.org.nvmexpress.discovery*. All Discovery Controllers must use this NQN name. This NQN is used by default by nvme-cli for the 'discover' command. @@ -85,7 +76,7 @@ OPTIONS -t :: --transport=:: This field specifies the network fabric being used for - a NVMe-over-Fabrics network. Current string values include: + a NVMe-over-Fabrics network. Current string values include: + [] |================= @@ -108,7 +99,7 @@ OPTIONS -s :: --trsvcid=:: - This field specifies the transport service id. For transports using IP + This field specifies the transport service id. For transports using IP addressing (e.g. rdma) this field is the port number. By default, the IP port number for the RDMA transport is 4420. @@ -223,10 +214,10 @@ OPTIONS --dump-config:: Print out resulting JSON configuration file to stdout. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json' or 'binary'. Only one + output format can be used at a time. --force:: Disable the built-in persistent discover connection rules. @@ -234,18 +225,27 @@ OPTIONS persistent discovery connection. --nbft:: - Only look at NBFT tables + Only look at NBFT tables --no-nbft:: - Do not look at NBFT tables + Do not look at NBFT tables --nbft-path=:: - Use a user-defined path to the NBFT tables + Use a user-defined path to the NBFT tables --context :: Set the execution context to . This allows to coordinate the management of the global resources. +-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 -------- * Query the Discover Controller with IP4 address 192.168.1.3 for all @@ -272,9 +272,9 @@ Port 4420 is used by default: * Issue a 'nvme discover' command using a @SYSCONFDIR@/nvme/discovery.conf file: + ----------- -# Machine default 'nvme discover' commands. Query the +# Machine default 'nvme discover' commands. Query the # Discovery Controller's two ports (some resources may only -# be accessible on a single port). Note an official +# be accessible on a single port). Note an official # nqn (Host) name defined in the NVMe specification is being used # in this example. -t rdma -a 192.168.69.33 -s 4420 -q nqn.2014-08.com.example:nvme:nvm-subsystem-sn-d78432 diff --git a/Documentation/nvme-dsm.1 b/Documentation/nvme-dsm.1 index 1f228e6..d5b3222 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-DSM" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-DSM" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,12 +32,14 @@ nvme-dsm \- Send NVMe Data Set Management, return results .SH "SYNOPSIS" .sp .nf -\fInvme dsm\fR [ \-\-namespace\-id= | \-n ] - [ \-\-ctx\-attrs= | \-a ] - [ \-\-blocks= | \-b ] - [ \-\-slbs= | \-s ] - [ \-\-ad | \-d ] [ \-\-idw | \-w ] [ \-\-idr | \-r ] - [ \-\-cdw11= | \-c ] +\fInvme dsm\fR [\-\-namespace\-id= | \-n ] + [\-\-ctx\-attrs= | \-a ] + [\-\-blocks= | \-b ] + [\-\-slbs= | \-s ] + [\-\-ad= | \-d ] + [\-\-idw= | \-w ] [\-\-idr= | \-r ] + [\-\-cdw11= | \-c ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -89,6 +91,20 @@ Attribute Integral Dataset for Read\&. .RS 4 All the command command dword 11 attributes\&. Use exclusive from specifying individual attributes .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet diff --git a/Documentation/nvme-dsm.html b/Documentation/nvme-dsm.html index e6312a6..e522e97 100644 --- a/Documentation/nvme-dsm.html +++ b/Documentation/nvme-dsm.html @@ -749,12 +749,14 @@ nvme-dsm(1) Manual Page

SYNOPSIS

-
nvme dsm <device>  [ --namespace-id=<nsid> | -n <nsid> ]
-                        [ --ctx-attrs=<attribute-list,> | -a <attribute-list,> ]
-                        [ --blocks=<nlb-list,> | -b <nlb-list,> ]
-                        [ --slbs=<slba-list,> | -s <slba-list,> ]
-                        [ --ad | -d ] [ --idw | -w ] [ --idr | -r ]
-                        [ --cdw11=<cdw11> | -c <cdw11> ]
+
nvme dsm <device> [--namespace-id=<nsid> | -n <nsid>]
+                        [--ctx-attrs=<attribute-list,> | -a <attribute-list,>]
+                        [--blocks=<nlb-list,> | -b <nlb-list,>]
+                        [--slbs=<slba-list,> | -s <slba-list,>]
+                        [--ad=<deallocate> | -d <deallocate>]
+                        [--idw=<write> | -w <write>] [--idr=<read> | -r <read>]
+                        [--cdw11=<cdw11> | -c <cdw11>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -873,6 +875,29 @@ any settings from the flags may have provided.

specifying individual attributes

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -893,7 +918,7 @@ any settings from the flags may have provided.

diff --git a/Documentation/nvme-dsm.txt b/Documentation/nvme-dsm.txt index ff658a7..6a2e61a 100644 --- a/Documentation/nvme-dsm.txt +++ b/Documentation/nvme-dsm.txt @@ -8,13 +8,14 @@ nvme-dsm - Send NVMe Data Set Management, return results SYNOPSIS -------- [verse] -'nvme dsm' [ --namespace-id= | -n ] - [ --ctx-attrs= | -a ] - [ --blocks= | -b ] - [ --slbs= | -s ] - [ --ad | -d ] [ --idw | -w ] [ --idr | -r ] - [ --cdw11= | -c ] - +'nvme dsm' [--namespace-id= | -n ] + [--ctx-attrs= | -a ] + [--blocks= | -b ] + [--slbs= | -s ] + [--ad= | -d ] + [--idw= | -w ] [--idr= | -r ] + [--cdw11= | -c ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -73,6 +74,15 @@ OPTIONS All the command command dword 11 attributes. Use exclusive from specifying individual attributes +-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 -------- No examples yet diff --git a/Documentation/nvme-effects-log.1 b/Documentation/nvme-effects-log.1 index 66741c3..c97df78 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-EFFECTS\-LOG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-EFFECTS\-LOG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,8 @@ nvme-effects-log \- Send NVMe Command Effects log page request, returns result a .SH "SYNOPSIS" .sp .nf -\fInvme effects\-log\fR [\-\-output\-format= | \-o ] - [\-\-human\-readable | \-H] - [\-\-raw\-binary | \-b] +\fInvme effects\-log\fR [\-\-human\-readable | \-H] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -45,11 +44,6 @@ The parameter is mandatory and should be the NVMe character device (ex: On success, the returned command effects log structure will be printed for each command that is supported\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= -.RS 4 -This option will set the reporting format to normal, json, or binary\&. Only one output format can be used at a time\&. -.RE -.PP \-H, \-\-human\-readable .RS 4 This option will parse and format many of the bit fields into a human\-readable format\&. @@ -59,6 +53,20 @@ This option will parse and format many of the bit fields into a human\-readable .RS 4 This option will print the raw buffer to stdout\&. Structure is not parsed by program\&. This overrides the human\-readable option\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-effects-log.html b/Documentation/nvme-effects-log.html index 8a08210..17ec867 100644 --- a/Documentation/nvme-effects-log.html +++ b/Documentation/nvme-effects-log.html @@ -749,9 +749,8 @@ nvme-effects-log(1) Manual Page

SYNOPSIS

-
nvme effects-log <device> [--output-format=<fmt> | -o <fmt>]
-                            [--human-readable | -H]
-                            [--raw-binary | -b]
+
nvme effects-log <device> [--human-readable | -H] [--raw-binary | -b]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -772,18 +771,6 @@ for each command that is supported.

--o <format> -
-
---output-format=<format> -
-
-

- This option will set the reporting format to normal, json, or binary. - Only one output format can be used at a time. -

-
-
-H
@@ -804,7 +791,30 @@ for each command that is supported.

This option will print the raw buffer to stdout. Structure is not - parsed by program. This overrides the human-readable option. + parsed by program. This overrides the human-readable option. +

+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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.

@@ -847,7 +857,7 @@ Have the program return the raw structure in binary: diff --git a/Documentation/nvme-effects-log.txt b/Documentation/nvme-effects-log.txt index f7d0092..57a1369 100644 --- a/Documentation/nvme-effects-log.txt +++ b/Documentation/nvme-effects-log.txt @@ -3,14 +3,14 @@ nvme-effects-log(1) NAME ---- -nvme-effects-log - Send NVMe Command Effects log page request, returns result and log +nvme-effects-log - Send NVMe Command Effects log page request, returns result +and log SYNOPSIS -------- [verse] -'nvme effects-log' [--output-format= | -o ] - [--human-readable | -H] - [--raw-binary | -b] +'nvme effects-log' [--human-readable | -H] [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -26,11 +26,6 @@ for each command that is supported. OPTIONS ------- --o :: ---output-format=:: - This option will set the reporting format to normal, json, or binary. - Only one output format can be used at a time. - -H:: --human-readable:: This option will parse and format many of the bit fields into a @@ -39,7 +34,16 @@ OPTIONS -b:: --raw-binary:: This option will print the raw buffer to stdout. Structure is not - parsed by program. This overrides the human-readable option. + parsed by program. This overrides the human-readable option. + +-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 -------- diff --git a/Documentation/nvme-endurance-event-agg-log.1 b/Documentation/nvme-endurance-event-agg-log.1 index c908d90..72bf8a6 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ENDURANCE\-EVE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ENDURANCE\-EVE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,7 +34,7 @@ nvme-endurance-event-agg-log \- Send NVMe Endurance log page request, returns re .nf \fInvme endurance\-event\-agg\-log\fR [\-\-log\-entries= | \-e ] [\-\-rae | \-r] [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -55,13 +55,19 @@ Retrieve the Endurance Group Event Aggregate Log pending entries\&. This argumen Retain an Asynchronous Event\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-endurance-event-agg-log.html b/Documentation/nvme-endurance-event-agg-log.html index f34dfa9..c80cd0d 100644 --- a/Documentation/nvme-endurance-event-agg-log.html +++ b/Documentation/nvme-endurance-event-agg-log.html @@ -751,7 +751,7 @@ nvme-endurance-event-agg-log(1) Manual Page
nvme endurance-event-agg-log <device> [--log-entries=<log_entries> | -e <log_entries>]
                         [--rae | -r] [--raw-binary | -b]
-                        [--output-format=<fmt> | -o <fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -781,11 +781,11 @@ printed to stdout for another program to parse, or reported in json format.

<

- Retrieve the Endurance Group Event Aggregate Log pending entries. - This argument is mandatory and its success may depend on the device’s - statistics to provide this log For More details see NVM Express 1.4 Spec. - Section 5.14.1.15. The maximum number of log entries supported is 2044 - for the device. + Retrieve the Endurance Group Event Aggregate Log pending entries. + This argument is mandatory and its success may depend on the device’s + statistics to provide this log For More details see NVM Express 1.4 Spec. + Section 5.14.1.15. The maximum number of log entries supported is 2044 + for the device.

@@ -800,15 +800,26 @@ printed to stdout for another program to parse, or reported in json format.

<

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -851,7 +862,7 @@ Print the raw Endurance log to a file: diff --git a/Documentation/nvme-endurance-event-agg-log.txt b/Documentation/nvme-endurance-event-agg-log.txt index 69701e3..7cbceb1 100644 --- a/Documentation/nvme-endurance-event-agg-log.txt +++ b/Documentation/nvme-endurance-event-agg-log.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'nvme endurance-event-agg-log' [--log-entries= | -e ] [--rae | -r] [--raw-binary | -b] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -29,20 +29,24 @@ OPTIONS ------- -e :: --log-entries=:: - Retrieve the Endurance Group Event Aggregate Log pending entries. - This argument is mandatory and its success may depend on the device's - statistics to provide this log For More details see NVM Express 1.4 Spec. - Section 5.14.1.15. The maximum number of log entries supported is 2044 - for the device. + Retrieve the Endurance Group Event Aggregate Log pending entries. + This argument is mandatory and its success may depend on the device's + statistics to provide this log For More details see NVM Express 1.4 Spec. + Section 5.14.1.15. The maximum number of log entries supported is 2044 + for the device. -r:: --rae:: Retain an Asynchronous Event. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-endurance-log.1 b/Documentation/nvme-endurance-log.1 index ec34603..5d653e1 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ENDURANCE\-LOG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ENDURANCE\-LOG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,7 +33,7 @@ nvme-endurance-log \- Send NVMe Endurance log page request, returns result and l .sp .nf \fInvme endurance\-log\fR [\-\-group\-id= | \-g ] - [\-\-output\-format= | \-o ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -49,13 +49,19 @@ On success, the returned endurance log structure may be returned in one of sever The endurance group identifier\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-endurance-log.html b/Documentation/nvme-endurance-log.html index c286558..1ec51f6 100644 --- a/Documentation/nvme-endurance-log.html +++ b/Documentation/nvme-endurance-log.html @@ -750,7 +750,7 @@ nvme-endurance-log(1) Manual Page
nvme endurance-log <device> [--group-id=<group> | -g <group>]
-                        [--output-format=<fmt> | -o <fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -783,15 +783,26 @@ printed to stdout for another program to parse, or reported in json format.

<

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -834,7 +845,7 @@ Print the raw Endurance log to a file: diff --git a/Documentation/nvme-endurance-log.txt b/Documentation/nvme-endurance-log.txt index 5e18b57..c263834 100644 --- a/Documentation/nvme-endurance-log.txt +++ b/Documentation/nvme-endurance-log.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'nvme endurance-log' [--group-id= | -g ] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -29,10 +29,14 @@ OPTIONS --group-id=:: The endurance group identifier. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-error-log.1 b/Documentation/nvme-error-log.1 index 1666278..3a0d154 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ERROR\-LOG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ERROR\-LOG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,9 @@ nvme-error-log \- Send NVME Error log page request, return result and log .SH "SYNOPSIS" .sp .nf -\fInvme error\-log\fR [\-\-log\-entries= | \-e ] - [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] +\fInvme error\-log\fR [\-\-log\-entries= | \-e ] + [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -55,13 +55,19 @@ Specifies how many log entries the program should request from the device\&. Thi Print the raw error log buffer to stdout\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-error-log.html b/Documentation/nvme-error-log.html index 148f4af..229b883 100644 --- a/Documentation/nvme-error-log.html +++ b/Documentation/nvme-error-log.html @@ -749,9 +749,9 @@ nvme-error-log(1) Manual Page

SYNOPSIS

-
nvme error-log <device>  [--log-entries=<entries> | -e <entries>]
-                         [--raw-binary | -b]
-                         [--output-format=<fmt> | -o <fmt>]
+
nvme error-log <device> [--log-entries=<entries> | -e <entries>]
+                        [--raw-binary | -b]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -798,15 +798,26 @@ printed to stdout for another program to parse.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -849,7 +860,7 @@ Print the raw output to a file: diff --git a/Documentation/nvme-error-log.txt b/Documentation/nvme-error-log.txt index eebaca7..94442ee 100644 --- a/Documentation/nvme-error-log.txt +++ b/Documentation/nvme-error-log.txt @@ -8,9 +8,9 @@ nvme-error-log - Send NVME Error log page request, return result and log SYNOPSIS -------- [verse] -'nvme error-log' [--log-entries= | -e ] - [--raw-binary | -b] - [--output-format= | -o ] +'nvme error-log' [--log-entries= | -e ] + [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -37,11 +37,14 @@ OPTIONS --raw-binary:: Print the raw error log buffer to stdout. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-fdp-configs.1 b/Documentation/nvme-fdp-configs.1 index bafe726..2b7903f 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-CONFIGS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-CONFIGS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,9 +33,8 @@ nvme-fdp-configs \- Get Flexible Data Placement Configurations .sp .nf \fInvme fdp configs\fR [\-\-endgrp\-id= | \-e ] - [\-\-human\-readable | \-H] - [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] + [\-\-human\-readable | \-H] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -57,7 +56,7 @@ Parse, print and describe individual parts of bitfields\&. Print the raw buffer to the standard output stream\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-fdp-configs.html b/Documentation/nvme-fdp-configs.html index 4ae6e1c..fe68c4a 100644 --- a/Documentation/nvme-fdp-configs.html +++ b/Documentation/nvme-fdp-configs.html @@ -750,9 +750,8 @@ nvme-fdp-configs(1) Manual Page
nvme fdp configs <device> [--endgrp-id=<NUM> | -e <NUM>]
-                            [--human-readable | -H]
-                            [--raw-binary | -b]
-                            [--output-format=<FMT> | -o <FMT>]
+ [--human-readable | -H] [--raw-binary | -b] + [--output-format=<fmt> | -o <fmt>]
@@ -802,10 +801,10 @@ the possible configurations for Flexible Data Placement.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -827,7 +826,7 @@ the possible configurations for Flexible Data Placement.

diff --git a/Documentation/nvme-fdp-configs.txt b/Documentation/nvme-fdp-configs.txt index c4311fb..d5cc487 100644 --- a/Documentation/nvme-fdp-configs.txt +++ b/Documentation/nvme-fdp-configs.txt @@ -9,9 +9,8 @@ SYNOPSIS -------- [verse] 'nvme fdp configs' [--endgrp-id= | -e ] - [--human-readable | -H] - [--raw-binary | -b] - [--output-format= | -o ] + [--human-readable | -H] [--raw-binary | -b] + [--output-format= | -o ] DESCRIPTION ----------- @@ -32,8 +31,8 @@ OPTIONS --raw-binary:: Print the raw buffer to the standard output stream. --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', 'json', or 'binary'. Only one output format can be used at a time. diff --git a/Documentation/nvme-fdp-events.1 b/Documentation/nvme-fdp-events.1 index 6a1017a..1949d3d 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-EVENTS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-EVENTS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,10 +32,8 @@ nvme-fdp-events \- Get Flexible Data Placement Events .SH "SYNOPSIS" .sp .nf -\fInvme fdp events\fR [\-\-endgrp\-id= | \-e ] - [\-\-host\-events | \-E] - [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] +\fInvme fdp events\fR [\-\-endgrp\-id= | \-e ] [\-\-host\-events | \-E] + [\-\-raw\-binary | \-b] [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -57,7 +55,7 @@ Request the controller to report host events\&. Print the raw buffer to the standard output stream\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-fdp-events.html b/Documentation/nvme-fdp-events.html index c7833d6..91f7d2f 100644 --- a/Documentation/nvme-fdp-events.html +++ b/Documentation/nvme-fdp-events.html @@ -749,10 +749,8 @@ nvme-fdp-events(1) Manual Page

SYNOPSIS

-
nvme fdp events <device> [--endgrp-id=<NUM> | -e <NUM>]
-                           [--host-events | -E]
-                           [--raw-binary | -b]
-                           [--output-format=<FMT> | -o <FMT>]
+
nvme fdp events <device> [--endgrp-id=<NUM> | -e <NUM>] [--host-events | -E]
+                        [--raw-binary | -b] [--output-format=<fmt> | -o <fmt>]
@@ -802,10 +800,10 @@ Units and media usage in an Endurance Group.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -827,7 +825,7 @@ Units and media usage in an Endurance Group.

diff --git a/Documentation/nvme-fdp-events.txt b/Documentation/nvme-fdp-events.txt index 606a163..5602f44 100644 --- a/Documentation/nvme-fdp-events.txt +++ b/Documentation/nvme-fdp-events.txt @@ -8,10 +8,8 @@ nvme-fdp-events - Get Flexible Data Placement Events SYNOPSIS -------- [verse] -'nvme fdp events' [--endgrp-id= | -e ] - [--host-events | -E] - [--raw-binary | -b] - [--output-format= | -o ] +'nvme fdp events' [--endgrp-id= | -e ] [--host-events | -E] + [--raw-binary | -b] [--output-format= | -o ] DESCRIPTION ----------- @@ -32,8 +30,8 @@ OPTIONS --raw-binary:: Print the raw buffer to the standard output stream. --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', 'json', or 'binary'. Only one output format can be used at a time. diff --git a/Documentation/nvme-fdp-set-events.1 b/Documentation/nvme-fdp-set-events.1 index 82be4a0..860f6e0 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-SET\-EVEN" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-SET\-EVEN" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,9 +33,8 @@ nvme-fdp-set-events \- Enable or disable FDP events .sp .nf \fInvme fdp set\-events\fR [\-\-namespace\-id= | \-n ] - [\-\-placement\-handle= | \-p ] - [\-\-enable | \-e] - [\-\-event\-types= | \-t ] + [\-\-placement\-handle= | \-p ] [\-\-enable | \-e] + [\-\-event\-types= | \-t ] .fi .SH "DESCRIPTION" .sp @@ -52,7 +51,7 @@ Namespace identifier\&. Print the raw buffer to the standard output stream\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-fdp-set-events.html b/Documentation/nvme-fdp-set-events.html index accaae6..95c3e6e 100644 --- a/Documentation/nvme-fdp-set-events.html +++ b/Documentation/nvme-fdp-set-events.html @@ -750,9 +750,8 @@ nvme-fdp-set-events(1) Manual Page
nvme fdp set-events <device> [--namespace-id=<NUM> | -n <NUM>]
-                               [--placement-handle=<NUM> | -p <NUM>]
-                               [--enable | -e]
-                               [--event-types=<NUM,> | -t <NUM,>]
+ [--placement-handle=<NUM> | -p <NUM>] [--enable | -e] + [--event-types=<NUM,> | -t <NUM,>]
@@ -792,10 +791,10 @@ Handle.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -817,7 +816,7 @@ Handle.

diff --git a/Documentation/nvme-fdp-set-events.txt b/Documentation/nvme-fdp-set-events.txt index b45819b..b93cdc3 100644 --- a/Documentation/nvme-fdp-set-events.txt +++ b/Documentation/nvme-fdp-set-events.txt @@ -9,9 +9,8 @@ SYNOPSIS -------- [verse] 'nvme fdp set-events' [--namespace-id= | -n ] - [--placement-handle= | -p ] - [--enable | -e] - [--event-types= | -t ] + [--placement-handle= | -p ] [--enable | -e] + [--event-types= | -t ] DESCRIPTION ----------- @@ -29,8 +28,8 @@ OPTIONS --raw-binary:: Print the raw buffer to the standard output stream. --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', 'json', or 'binary'. Only one output format can be used at a time. diff --git a/Documentation/nvme-fdp-stats.1 b/Documentation/nvme-fdp-stats.1 index 703382c..629162d 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-STATS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-STATS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,8 @@ nvme-fdp-stats \- Get Flexible Data Placement Statistics .SH "SYNOPSIS" .sp .nf -\fInvme fdp stats\fR [\-\-endgrp\-id= | \-e ] - [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] +\fInvme fdp stats\fR [\-\-endgrp\-id= | \-e ] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -51,7 +50,7 @@ The endurance group identifier to use when requesting the log page\&. Print the raw buffer to the standard output stream\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-fdp-stats.html b/Documentation/nvme-fdp-stats.html index d5c4762..8d81eef 100644 --- a/Documentation/nvme-fdp-stats.html +++ b/Documentation/nvme-fdp-stats.html @@ -749,9 +749,8 @@ nvme-fdp-stats(1) Manual Page

SYNOPSIS

-
nvme fdp stats <device> [--endgrp-id=<NUM> | -e <NUM>]
-                          [--raw-binary | -b]
-                          [--output-format=<FMT> | -o <FMT>]
+
nvme fdp stats <device> [--endgrp-id=<NUM> | -e <NUM>] [--raw-binary | -b]
+                        [--output-format=<fmt> | -o <fmt>]
@@ -790,10 +789,10 @@ the life of the FDP configuration in an Endurance Group.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -815,7 +814,7 @@ the life of the FDP configuration in an Endurance Group.

diff --git a/Documentation/nvme-fdp-stats.txt b/Documentation/nvme-fdp-stats.txt index 7f96065..0b184a9 100644 --- a/Documentation/nvme-fdp-stats.txt +++ b/Documentation/nvme-fdp-stats.txt @@ -8,9 +8,8 @@ nvme-fdp-stats - Get Flexible Data Placement Statistics SYNOPSIS -------- [verse] -'nvme fdp stats' [--endgrp-id= | -e ] - [--raw-binary | -b] - [--output-format= | -o ] +'nvme fdp stats' [--endgrp-id= | -e ] [--raw-binary | -b] + [--output-format= | -o ] DESCRIPTION ----------- @@ -27,8 +26,8 @@ OPTIONS --raw-binary:: Print the raw buffer to the standard output stream. --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', 'json', or 'binary'. Only one output format can be used at a time. diff --git a/Documentation/nvme-fdp-status.1 b/Documentation/nvme-fdp-status.1 index 752b00e..6fefff4 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-STATUS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-STATUS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,8 @@ nvme-fdp-status \- Get Reclaim Unit Handle Status .SH "SYNOPSIS" .sp .nf -\fInvme fdp status\fR [\-\-namespace\-id= | \-n ] - [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] +\fInvme fdp status\fR [\-\-namespace\-id= | \-n ] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -51,7 +50,7 @@ Namespace identifier\&. Print the raw buffer to the standard output stream\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-fdp-status.html b/Documentation/nvme-fdp-status.html index 2ec10bf..01a7b60 100644 --- a/Documentation/nvme-fdp-status.html +++ b/Documentation/nvme-fdp-status.html @@ -749,9 +749,8 @@ nvme-fdp-status(1) Manual Page

SYNOPSIS

-
nvme fdp status <device> [--namespace-id=<NUM> | -n <NUM>]
-                           [--raw-binary | -b]
-                           [--output-format=<FMT> | -o <FMT>]
+
nvme fdp status <device> [--namespace-id=<NUM> | -n <NUM>] [--raw-binary | -b]
+                        [--output-format=<fmt> | -o <fmt>]
@@ -790,10 +789,10 @@ are accessible by the specified namespace.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -815,7 +814,7 @@ are accessible by the specified namespace.

diff --git a/Documentation/nvme-fdp-status.txt b/Documentation/nvme-fdp-status.txt index 263cb4c..78dddae 100644 --- a/Documentation/nvme-fdp-status.txt +++ b/Documentation/nvme-fdp-status.txt @@ -8,9 +8,8 @@ nvme-fdp-status - Get Reclaim Unit Handle Status SYNOPSIS -------- [verse] -'nvme fdp status' [--namespace-id= | -n ] - [--raw-binary | -b] - [--output-format= | -o ] +'nvme fdp status' [--namespace-id= | -n ] [--raw-binary | -b] + [--output-format= | -o ] DESCRIPTION ----------- @@ -27,8 +26,8 @@ OPTIONS --raw-binary:: Print the raw buffer to the standard output stream. --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', 'json', or 'binary'. Only one output format can be used at a time. diff --git a/Documentation/nvme-fdp-update.1 b/Documentation/nvme-fdp-update.1 index 5bb9528..abf36fd 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-UPDATE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-UPDATE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,7 +33,7 @@ nvme-fdp-update \- Reclaim Unit Handle Update .sp .nf \fInvme fdp update\fR [\-\-namespace\-id= | \-n ] - [\-\-pids= | \-p ] + [\-\-pids= | \-p ] .fi .SH "DESCRIPTION" .sp diff --git a/Documentation/nvme-fdp-update.html b/Documentation/nvme-fdp-update.html index 0bcdeb5..1fd97c7 100644 --- a/Documentation/nvme-fdp-update.html +++ b/Documentation/nvme-fdp-update.html @@ -750,7 +750,7 @@ nvme-fdp-update(1) Manual Page
nvme fdp update <device> [--namespace-id=<NUM> | -n <NUM>]
-                           [--pids=<NUM,> | -p <NUM,>]
+ [--pids=<NUM,> | -p <NUM,>]
@@ -802,7 +802,7 @@ a different Reclaim Unit accessible by the specified namespace.

diff --git a/Documentation/nvme-fdp-update.txt b/Documentation/nvme-fdp-update.txt index 4b70c24..5af83e5 100644 --- a/Documentation/nvme-fdp-update.txt +++ b/Documentation/nvme-fdp-update.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'nvme fdp update' [--namespace-id= | -n ] - [--pids= | -p ] + [--pids= | -p ] DESCRIPTION ----------- diff --git a/Documentation/nvme-fdp-usage.1 b/Documentation/nvme-fdp-usage.1 index 41873e4..b561adb 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FDP\-USAGE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FDP\-USAGE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,8 @@ nvme-fdp-usage \- Get Reclaim Unit Handle Usage .SH "SYNOPSIS" .sp .nf -\fInvme fdp usage\fR [\-\-endgrp\-id= | \-e ] - [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] +\fInvme fdp usage\fR [\-\-endgrp\-id= | \-e ] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -51,7 +50,7 @@ The endurance group identifier to use when requesting the log page\&. Print the raw buffer to the standard output stream\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-fdp-usage.html b/Documentation/nvme-fdp-usage.html index 40adfdc..a617aa0 100644 --- a/Documentation/nvme-fdp-usage.html +++ b/Documentation/nvme-fdp-usage.html @@ -749,9 +749,8 @@ nvme-fdp-usage(1) Manual Page

SYNOPSIS

-
nvme fdp usage <device> [--endgrp-id=<NUM> | -e <NUM>]
-                          [--raw-binary | -b]
-                          [--output-format=<FMT> | -o <FMT>]
+
nvme fdp usage <device> [--endgrp-id=<NUM> | -e <NUM>] [--raw-binary | -b]
+                        [--output-format=<fmt> | -o <fmt>]
@@ -791,10 +790,10 @@ Endurance Group.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -816,7 +815,7 @@ Endurance Group.

diff --git a/Documentation/nvme-fdp-usage.txt b/Documentation/nvme-fdp-usage.txt index ad9d1eb..3e0fb98 100644 --- a/Documentation/nvme-fdp-usage.txt +++ b/Documentation/nvme-fdp-usage.txt @@ -8,9 +8,8 @@ nvme-fdp-usage - Get Reclaim Unit Handle Usage SYNOPSIS -------- [verse] -'nvme fdp usage' [--endgrp-id= | -e ] - [--raw-binary | -b] - [--output-format= | -o ] +'nvme fdp usage' [--endgrp-id= | -e ] [--raw-binary | -b] + [--output-format= | -o ] DESCRIPTION ----------- @@ -28,8 +27,8 @@ OPTIONS --raw-binary:: Print the raw buffer to the standard output stream. --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', 'json', or 'binary'. Only one output format can be used at a time. diff --git a/Documentation/nvme-fid-support-effects-log.1 b/Documentation/nvme-fid-support-effects-log.1 index d833b37..8c2ab58 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FID\-SUPPORT\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FID\-SUPPORT\-" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,7 @@ nvme-fid-support-effects-log \- Send NVMe FID Support and Effects log, return re .SH "SYNOPSIS" .sp .nf -\fInvme fid\-support\-effects\-log\fR [\-o | \-\-output\-format=] +\fInvme fid\-support\-effects\-log\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -43,18 +43,24 @@ The parameter is mandatory and may be either the NVMe character device On success, the structure may be returned in one of several ways depending on the option flags; the structure may be parsed by the program or the raw buffer may be printed to stdout\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= -.RS 4 -Set the reporting format to -\fInormal\fR, -\fIjson\fR, or -\fIbinary\fR\&. Only one output format can be used at a time\&. -.RE -.PP \-H, \-\-human\-readable .RS 4 This option will parse and format many of the bit fields into human\-readable formats\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-fid-support-effects-log.html b/Documentation/nvme-fid-support-effects-log.html index acd7e3b..255a1bc 100644 --- a/Documentation/nvme-fid-support-effects-log.html +++ b/Documentation/nvme-fid-support-effects-log.html @@ -749,7 +749,7 @@ nvme-fid-support-effects-log(1) Manual Page

SYNOPSIS

-
nvme fid-support-effects-log <device> [-o <fmt> | --output-format=<fmt>]
+
nvme fid-support-effects-log <device> [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -771,18 +771,6 @@ raw buffer may be printed to stdout.

--o <format> -
-
---output-format=<format> -
-
-

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. -

-
-
-H
@@ -794,6 +782,29 @@ raw buffer may be printed to stdout.

into human-readable formats.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -814,7 +825,7 @@ raw buffer may be printed to stdout.

diff --git a/Documentation/nvme-fid-support-effects-log.txt b/Documentation/nvme-fid-support-effects-log.txt index 5d12b18..9670b88 100644 --- a/Documentation/nvme-fid-support-effects-log.txt +++ b/Documentation/nvme-fid-support-effects-log.txt @@ -8,7 +8,7 @@ nvme-fid-support-effects-log - Send NVMe FID Support and Effects log, return res SYNOPSIS -------- [verse] -'nvme fid-support-effects-log' [-o | --output-format=] +'nvme fid-support-effects-log' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -24,16 +24,20 @@ raw buffer may be printed to stdout. OPTIONS ------- --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. - -H:: --human-readable:: This option will parse and format many of the bit fields into human-readable formats. +-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 -------- No examples yet. diff --git a/Documentation/nvme-flush.1 b/Documentation/nvme-flush.1 index b21d3fb..4e60728 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FLUSH" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FLUSH" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,6 +33,7 @@ nvme-flush \- Flush command\&. .sp .nf \fInvme flush\fR [\-\-namespace\-id= | \-n ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -43,6 +44,20 @@ The Flush command shall commit data and metadata associated with the specified n .RS 4 Specify the optional namespace id for this command\&. Defaults to 0xffffffff, indicating flush for all namespaces\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-flush.html b/Documentation/nvme-flush.html index 5095761..d0fefd2 100644 --- a/Documentation/nvme-flush.html +++ b/Documentation/nvme-flush.html @@ -749,7 +749,8 @@ nvme-flush(1) Manual Page

SYNOPSIS

-
nvme flush <device> [--namespace-id=<nsid> | -n <nsid>]
+
nvme flush <device> [--namespace-id=<nsid> | -n <nsid>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -780,6 +781,29 @@ any namespace.

0xffffffff, indicating flush for all namespaces.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -800,7 +824,7 @@ any namespace.

diff --git a/Documentation/nvme-flush.txt b/Documentation/nvme-flush.txt index 28cfa63..102cd71 100644 --- a/Documentation/nvme-flush.txt +++ b/Documentation/nvme-flush.txt @@ -9,6 +9,7 @@ SYNOPSIS -------- [verse] 'nvme flush' [--namespace-id= | -n ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -25,6 +26,15 @@ OPTIONS Specify the optional namespace id for this command. Defaults to 0xffffffff, indicating flush for all namespaces. +-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 -------- No examples yet. diff --git a/Documentation/nvme-format.1 b/Documentation/nvme-format.1 index 63a099c..8fbcaaf 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FORMAT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FORMAT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,15 +33,13 @@ nvme-format \- Format an NVMe device .sp .nf \fInvme format\fR [\-\-namespace\-id= | \-n ] - [\-\-lbaf= | \-l ] - [\-\-block\-size=] - [\-\-ses= | \-s ] - [\-\-pil= | \-p ] - [\-\-pi= | \-i ] - [\-\-ms= | \-m ] - [\-\-reset | \-r ] - [\-\-force ] - [\-\-timeout= | \-t ] + [\-\-lbaf= | \-l ] + [\-\-block\-size=] + [\-\-ses= | \-s ] [\-\-pil= | \-p ] + [\-\-pi= | \-i ] [\-\-ms= | \-m ] + [\-\-reset | \-r] [\-\-force] + [\-\-timeout= | \-t ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -177,6 +175,20 @@ Just send the command immediately without warning of the implications\&. .RS 4 Override default timeout value\&. In milliseconds\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-format.html b/Documentation/nvme-format.html index 6afcbc2..cc7f899 100644 --- a/Documentation/nvme-format.html +++ b/Documentation/nvme-format.html @@ -750,15 +750,13 @@ nvme-format(1) Manual Page
nvme format <device> [--namespace-id=<nsid> | -n <nsid>]
-                    [--lbaf=<lbaf> | -l <lbaf>]
-                    [--block-size=<block size | -b <block size>]
-                    [--ses=<ses> | -s <ses>]
-                    [--pil=<pil> | -p <pil>]
-                    [--pi=<pi> | -i <pi>]
-                    [--ms=<ms> | -m <ms>]
-                    [--reset | -r ]
-                    [--force ]
-                    [--timeout=<timeout> | -t <timeout> ]
+ [--lbaf=<lbaf> | -l <lbaf>] + [--block-size=<block size | -b <block size>] + [--ses=<ses> | -s <ses>] [--pil=<pil> | -p <pil>] + [--pi=<pi> | -i <pi>] [--ms=<ms> | -m <ms>] + [--reset | -r] [--force] + [--timeout=<timeout> | -t <timeout>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -995,6 +993,29 @@ cellspacing="0" cellpadding="4"> Override default timeout value. In milliseconds.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -1035,7 +1056,7 @@ information: diff --git a/Documentation/nvme-format.txt b/Documentation/nvme-format.txt index cbadd1d..e4623f1 100644 --- a/Documentation/nvme-format.txt +++ b/Documentation/nvme-format.txt @@ -9,15 +9,13 @@ SYNOPSIS -------- [verse] 'nvme format' [--namespace-id= | -n ] - [--lbaf= | -l ] - [--block-size=] - [--ses= | -s ] - [--pil= | -p ] - [--pi= | -i ] - [--ms= | -m ] - [--reset | -r ] - [--force ] - [--timeout= | -t ] + [--lbaf= | -l ] + [--block-size=] + [--ses= | -s ] [--pil= | -p ] + [--pi= | -i ] [--ms= | -m ] + [--reset | -r] [--force] + [--timeout= | -t ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -135,6 +133,15 @@ cryptographically. This is accomplished by deleting the encryption key. --timeout=:: Override default timeout value. In milliseconds. +-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 -------- * Format the device using all defaults: diff --git a/Documentation/nvme-fw-commit.1 b/Documentation/nvme-fw-commit.1 index 748b9b0..d002b07 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FW\-COMMIT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FW\-COMMIT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,8 +33,9 @@ nvme-fw-commit \- Used to verify and commit a firmware image\&. .sp .nf \fInvme fw\-commit\fR [\-\-slot= | \-s ] - [\-\-action= | \-a ] - [\-\-bpid= | \-b ] + [\-\-action= | \-a ] + [\-\-bpid= | \-b ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -117,6 +118,20 @@ Firmware Slot: Specifies the firmware slot that shall be used for the Commit Act .RS 4 Specifies the Boot partition that shall be used for the Commit Action, if applicable (default: 0) .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-fw-commit.html b/Documentation/nvme-fw-commit.html index a76b0e1..82f1b8e 100644 --- a/Documentation/nvme-fw-commit.html +++ b/Documentation/nvme-fw-commit.html @@ -750,8 +750,9 @@ nvme-fw-commit(1) Manual Page
nvme fw-commit <device> [--slot=<slot> | -s <slot>]
-                    [--action=<action> | -a <action>]
-                    [--bpid=<boot-partid> | -b <boot-partid> ]
+ [--action=<action> | -a <action>] + [--bpid=<boot-partid> | -b <boot-partid>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -869,6 +870,29 @@ BPINFO.ABPID.

if applicable (default: 0)

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -905,7 +929,7 @@ commit the last downloaded fw to slot 1. diff --git a/Documentation/nvme-fw-commit.txt b/Documentation/nvme-fw-commit.txt index 337e783..8e08bd4 100644 --- a/Documentation/nvme-fw-commit.txt +++ b/Documentation/nvme-fw-commit.txt @@ -9,8 +9,9 @@ SYNOPSIS -------- [verse] 'nvme fw-commit' [--slot= | -s ] - [--action= | -a ] - [--bpid= | -b ] + [--action= | -a ] + [--bpid= | -b ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -75,6 +76,15 @@ BPINFO.ABPID. Specifies the Boot partition that shall be used for the Commit Action, if applicable (default: 0) +-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 -------- * commit the last downloaded fw to slot 1. diff --git a/Documentation/nvme-fw-download.1 b/Documentation/nvme-fw-download.1 index 6839e72..39e181b 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FW\-DOWNLOAD" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FW\-DOWNLOAD" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,8 +33,9 @@ nvme-fw-download \- Download all or a portion of an nvme firmware image\&. .sp .nf \fInvme fw\-download\fR [\-\-fw= | \-f ] - [\-\-xfer= | \-x ] - [\-\-offset= | \-o ] + [\-\-xfer= | \-x ] + [\-\-offset= | \-O ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -55,12 +56,26 @@ Required argument\&. This specifies the path to the device\(cqs firmware file on This specifies the size to split each transfer\&. This is useful if the device has a max transfer size requirement for firmware\&. It defaults to 4k\&. .RE .PP -\-o , \-\-offset= +\-O , \-\-offset= .RS 4 This specifies the starting offset in dwords\&. This is really only useful if your firmware is split in multiple files; otherwise the offset starts at zero and automatically adjusts based on the \fIxfer\fR size given\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-fw-download.html b/Documentation/nvme-fw-download.html index b4ff3a7..d39f1e5 100644 --- a/Documentation/nvme-fw-download.html +++ b/Documentation/nvme-fw-download.html @@ -750,8 +750,9 @@ nvme-fw-download(1) Manual Page
nvme fw-download <device> [--fw=<firmware-file> | -f <firmware-file>]
-                    [--xfer=<transfer-size> | -x <transfer-size>]
-                    [--offset=<offset> | -o <offset>]
+ [--xfer=<transfer-size> | -x <transfer-size>] + [--offset=<offset> | -O <offset>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -809,7 +810,7 @@ the Firmware Commit command (nvme fw-commit <args>).

--o <offset> +-O <offset>
--offset=<offset> @@ -822,6 +823,29 @@ the Firmware Commit command (nvme fw-commit <args>).

xfer size given.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -852,7 +876,7 @@ Transfer a firmware size 128KiB at a time: diff --git a/Documentation/nvme-fw-download.txt b/Documentation/nvme-fw-download.txt index 84e407e..1ec466f 100644 --- a/Documentation/nvme-fw-download.txt +++ b/Documentation/nvme-fw-download.txt @@ -9,8 +9,9 @@ SYNOPSIS -------- [verse] 'nvme fw-download' [--fw= | -f ] - [--xfer= | -x ] - [--offset= | -o ] + [--xfer= | -x ] + [--offset= | -O ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -48,13 +49,22 @@ OPTIONS the device has a max transfer size requirement for firmware. It defaults to 4k. --o :: +-O :: --offset=:: This specifies the starting offset in dwords. This is really only useful if your firmware is split in multiple files; otherwise the offset starts at zero and automatically adjusts based on the 'xfer' size given. +-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 -------- * Transfer a firmware size 128KiB at a time: diff --git a/Documentation/nvme-fw-log.1 b/Documentation/nvme-fw-log.1 index 09f9bdd..63fe225 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-FW\-LOG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-FW\-LOG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,7 +33,7 @@ nvme-fw-log \- Send NVMe Firmware log page request, returns result and log .sp .nf \fInvme fw\-log\fR [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -49,13 +49,19 @@ On success, the returned f/w log structure may be returned in one of several way Print the raw fw log buffer to stdout\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-fw-log.html b/Documentation/nvme-fw-log.html index 83eafeb..627d5d9 100644 --- a/Documentation/nvme-fw-log.html +++ b/Documentation/nvme-fw-log.html @@ -750,7 +750,7 @@ nvme-fw-log(1) Manual Page
nvme fw-log <device> [--raw-binary | -b]
-                        [--output-format=<fmt> | -o <fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -784,15 +784,26 @@ printed to stdout for another program to parse.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -835,7 +846,7 @@ Print the log firmware to a file: diff --git a/Documentation/nvme-fw-log.txt b/Documentation/nvme-fw-log.txt index 4b73577..d957548 100644 --- a/Documentation/nvme-fw-log.txt +++ b/Documentation/nvme-fw-log.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'nvme fw-log' [--raw-binary | -b] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -30,11 +30,14 @@ OPTIONS --raw-binary:: Print the raw fw log buffer to stdout. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-gen-dhchap-key.txt b/Documentation/nvme-gen-dhchap-key.txt index 79e8ed5..1e5f969 100644 --- a/Documentation/nvme-gen-dhchap-key.txt +++ b/Documentation/nvme-gen-dhchap-key.txt @@ -9,9 +9,10 @@ SYNOPSIS -------- [verse] 'nvme gen-dhchap-key' [--hmac= | -h ] - [--secret= | -s ] - [--key-length= | -l ] - [--nqn= | -n ] + [--secret= | -s ] + [--key-length= | -l ] + [--nqn= | -n ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -43,6 +44,15 @@ OPTIONS Host-NQN to be used for the transformation. This parameter is only valid if a non-zero HMAC function has been specified. +-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 -------- No Examples diff --git a/Documentation/nvme-gen-hostnqn.1 b/Documentation/nvme-gen-hostnqn.1 index 37e9229..abdba4c 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GEN\-HOSTNQN" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-GEN\-HOSTNQN" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,14 +32,26 @@ nvme-gen-hostnqn \- Generate a host NVMe Qualified Name .SH "SYNOPSIS" .sp .nf -\fInvme gen\-hostnqn\fR +\fInvme gen\-hostnqn\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp Generate a random host NQN in the form: nqn\&.2014\-08\&.org\&.nvmexpress:uuid:1b4e28ba\-2fa1\-11d2\-883f\-0016d3cca427 and prints it to stdout\&. .SH "OPTIONS" -.sp -No options needed +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp nvme gen\-hostnqn diff --git a/Documentation/nvme-gen-hostnqn.html b/Documentation/nvme-gen-hostnqn.html index 4eedd6d..c4ee073 100644 --- a/Documentation/nvme-gen-hostnqn.html +++ b/Documentation/nvme-gen-hostnqn.html @@ -749,7 +749,7 @@ nvme-gen-hostnqn(1) Manual Page

SYNOPSIS

-
nvme gen-hostnqn
+
nvme gen-hostnqn [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -765,7 +765,31 @@ and prints it to stdout.

OPTIONS

-

No options needed

+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
+
@@ -785,7 +809,7 @@ and prints it to stdout.

diff --git a/Documentation/nvme-gen-hostnqn.txt b/Documentation/nvme-gen-hostnqn.txt index 9efefb5..7b7d776 100644 --- a/Documentation/nvme-gen-hostnqn.txt +++ b/Documentation/nvme-gen-hostnqn.txt @@ -8,7 +8,7 @@ nvme-gen-hostnqn - Generate a host NVMe Qualified Name SYNOPSIS -------- [verse] -'nvme gen-hostnqn' +'nvme gen-hostnqn' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -18,7 +18,14 @@ and prints it to stdout. OPTIONS ------- -No options needed +-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 -------- diff --git a/Documentation/nvme-gen-tls-key.txt b/Documentation/nvme-gen-tls-key.txt index 9a03e3a..772c7bc 100644 --- a/Documentation/nvme-gen-tls-key.txt +++ b/Documentation/nvme-gen-tls-key.txt @@ -9,24 +9,29 @@ SYNOPSIS -------- [verse] 'nvme gen-tls-key' [--keyring= | -k ] - [--keytype= | -t ] - [--hostnqn= | -n ] - [--subsysnqn= | -c ] - [--hmac= | -h ] - [--secret= | -s ] - [--insert | -i ] + [--keytype= | -t ] + [--hostnqn= | -n ] + [--subsysnqn= | -c ] + [--hmac= | -h ] + [--identity= | -I ] + [--secret= | -s ] + [--insert | -i] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- Generate a base64-encoded NVMe TLS pre-shared key (PSK). The resulting key is either printed in the PSK interchange format -'NVMeTLSkey-1:01::', -inserted as a 'retained' key into the specified keyring, or both. +'NVMeTLSkey-1:01::' or inserted as a +'retained' key into the specified keyring if the '--insert' option +is given. When the PSK should be inserted into the keyring a 'retained' key -is derived from the secret key material, and the resulting 'retained' +is derived from the secret key material. The resulting 'retained' key is stored with the identity 'NVMe0R0 ' -in the keyring. +(for identity version '0') or +'NVMe1R0 ' +(for identity version '1') in the keyring. The 'retained' key is derived from the secret key material, the specified subsystem NQN, and the host NQN. Once the 'retained' key is stored in the keyring the original @@ -60,6 +65,12 @@ OPTIONS 1 - SHA-256 (default) 2 - SHA-384 +-I :: +--identity=:: + Select the TLS identity to use. Possible values are: + 0 - Original NVMe TLS 1.0c identity + 1 - NVMe TLS 2.0 (TP8018) identity + -s :: --secret=:: Secret value (in hexadecimal) to be used for the key. If none are @@ -70,6 +81,15 @@ OPTIONS Insert the resulting TLS key into the keyring without printing out the key in PSK interchange format. +-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 -------- No Examples diff --git a/Documentation/nvme-get-feature.1 b/Documentation/nvme-get-feature.1 index 015d5c2..ea7653a 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GET\-FEATURE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-GET\-FEATURE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,12 +33,13 @@ nvme-get-feature \- Gets an NVMe feature, returns applicable results .sp .nf \fInvme get\-feature\fR [\-\-namespace\-id= | \-n ] - [\-\-feature\-id= | \-f ] [\-\-cdw11=] - [\-\-uuid\-index= | \-U ] - [\-\-data\-len= | \-l ] - [\-\-sel=] - [\-\-raw\-binary | \-b] - [\-\-human\-readable | \-H] + [\-\-feature\-id= | \-f ] [\-\-cdw11=] + [\-\-uuid\-index= | \-U ] + [\-\-data\-len= | \-l ] + [\-\-sel=] + [\-\-raw\-binary | \-b] + [\-\-human\-readable | \-H] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -128,6 +129,20 @@ Print the raw feature buffer to stdout if the feature returns a structure\&. .RS 4 This option will parse and format many of the bit fields into human\-readable formats\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-get-feature.html b/Documentation/nvme-get-feature.html index fc34d16..6ee42ae 100644 --- a/Documentation/nvme-get-feature.html +++ b/Documentation/nvme-get-feature.html @@ -750,12 +750,13 @@ nvme-get-feature(1) Manual Page
nvme get-feature <device> [--namespace-id=<nsid> | -n <nsid>]
-                          [--feature-id=<fid> | -f <fid>] [--cdw11=<cdw11>]
-                          [--uuid-index=<uuid-index> | -U <uuid_index>]
-                          [--data-len=<data-len> | -l <data-len>]
-                          [--sel=<select> | -s <select>]
-                          [--raw-binary | -b]
-                          [--human-readable | -H]
+ [--feature-id=<fid> | -f <fid>] [--cdw11=<cdw11>] + [--uuid-index=<uuid-index> | -U <uuid_index>] + [--data-len=<data-len> | -l <data-len>] + [--sel=<select> | -s <select>] + [--raw-binary | -b] + [--human-readable | -H] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -906,6 +907,29 @@ cellspacing="0" cellpadding="4"> into human-readable formats.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -977,7 +1001,7 @@ format: diff --git a/Documentation/nvme-get-feature.txt b/Documentation/nvme-get-feature.txt index 34df0c3..6477bc6 100644 --- a/Documentation/nvme-get-feature.txt +++ b/Documentation/nvme-get-feature.txt @@ -9,12 +9,13 @@ SYNOPSIS -------- [verse] 'nvme get-feature' [--namespace-id= | -n ] - [--feature-id= | -f ] [--cdw11=] - [--uuid-index= | -U ] - [--data-len= | -l ] - [--sel=] - [--raw-binary | -b] - [--human-readable | -H] + [--feature-id= | -f ] [--cdw11=] + [--uuid-index= | -U ] + [--data-len= | -l ] + [--sel=] + [--raw-binary | -b] + [--human-readable | -H] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -81,6 +82,15 @@ OPTIONS This option will parse and format many of the bit fields into human-readable formats. +-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 -------- * Retrieves the feature for Number of Queues, or feature id 7: diff --git a/Documentation/nvme-get-lba-status.1 b/Documentation/nvme-get-lba-status.1 index b42f2e5..97efab3 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GET\-LBA\-STAT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-GET\-LBA\-STAT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,12 +33,12 @@ nvme-get-lba-status \- Get LBA Status from NVMe device .sp .nf \fInvme get\-lba\-status\fR [\-\-namespace\-id= | \-n ] - [\-\-start\-lba= | \-s ] - [\-\-max\-dw= | \-m ] - [\-\-action= | \-a ] - [\-\-range\-len= | \-l ] - [\-\-timeout= | \-t ] - [\-\-output\-format= | \-o ] + [\-\-start\-lba= | \-s ] + [\-\-max\-dw= | \-m ] + [\-\-action= | \-a ] + [\-\-range\-len= | \-l ] + [\-\-timeout= | \-t ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -79,13 +79,19 @@ Range Length(RL) specifies the length of the range of contiguous LBAs beginning Override default timeout value\&. In milliseconds\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-get-lba-status.html b/Documentation/nvme-get-lba-status.html index 58a06ef..e739871 100644 --- a/Documentation/nvme-get-lba-status.html +++ b/Documentation/nvme-get-lba-status.html @@ -750,12 +750,12 @@ nvme-get-lba-status(1) Manual Page
nvme get-lba-status <device> [--namespace-id=<nsid> | -n <nsid>]
-                    [--start-lba=<slba> | -s <slba>]
-                    [--max-dw=<max-dw> | -m <max-dw>]
-                    [--action=<action-type> | -a <action-type>]
-                    [--range-len=<range-len> | -l <range-len>]
-                    [--timeout=<timeout> | -t <timeout> ]
-                   [--output-format=<format> | -o <format>]
+ [--start-lba=<slba> | -s <slba>] + [--max-dw=<max-dw> | -m <max-dw>] + [--action=<action-type> | -a <action-type>] + [--range-len=<range-len> | -l <range-len>] + [--timeout=<timeout> | -t <timeout>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -846,15 +846,26 @@ printed to stdout for another program to parse.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -896,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-lba-status.txt b/Documentation/nvme-get-lba-status.txt index 157dc41..9ef9d59 100644 --- a/Documentation/nvme-get-lba-status.txt +++ b/Documentation/nvme-get-lba-status.txt @@ -9,12 +9,12 @@ SYNOPSIS -------- [verse] 'nvme get-lba-status' [--namespace-id= | -n ] - [--start-lba= | -s ] - [--max-dw= | -m ] - [--action= | -a ] - [--range-len= | -l ] - [--timeout= | -t ] - [--output-format= | -o ] + [--start-lba= | -s ] + [--max-dw= | -m ] + [--action= | -a ] + [--range-len= | -l ] + [--timeout= | -t ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -57,10 +57,14 @@ OPTIONS --timeout=:: Override default timeout value. In milliseconds. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-get-log.1 b/Documentation/nvme-get-log.1 index 804e18c..66a3573 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GET\-LOG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-GET\-LOG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,17 +33,18 @@ nvme-get-log \- Retrieves a log page from an NVMe device .sp .nf \fInvme get\-log\fR [\-\-log\-id= | \-i ] - [\-\-log\-len= | \-l ] - [\-\-aen= | \-a ] - [\-\-namespace\-id= | \-n ] - [\-\-raw\-binary | \-b] - [\-\-lpo= | \-o ] - [\-\-lsp= | \-s ] - [\-\-lsi= | \-S ] - [\-\-rae | \-r] - [\-\-csi= | \-y ] - [\-\-ot= | \-O ] - [\-\-xfer\-len= | \-x ] + [\-\-log\-len= | \-l ] + [\-\-aen= | \-a ] + [\-\-namespace\-id= | \-n ] + [\-\-raw\-binary | \-b] + [\-\-lpo= | \-L ] + [\-\-lsp= | \-s ] + [\-\-lsi= | \-S ] + [\-\-rae | \-r] + [\-\-csi= | \-y ] + [\-\-ot= | \-O ] + [\-\-xfer\-len= | \-x ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -79,7 +80,7 @@ Sets the command\(cqs nsid value to the given nsid\&. Defaults to 0xffffffff if Print the raw log buffer to stdout\&. .RE .PP -\-o , \-\-lpo= +\-L , \-\-lpo= .RS 4 The log page offset specifies the location within a log page to start returning data from\&. It\(cqs Dword\-aligned and 64\-bits\&. .RE @@ -113,6 +114,20 @@ This field specifies the offset type\&. If set to false, the Log Page Offset Low .RS 4 \-\-xfer\-len : Specify the read chunk size\&. The length argument is expected to be a multiple of 4096\&. The default size is 4096\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-get-log.html b/Documentation/nvme-get-log.html index 1b4957c..2c25c2b 100644 --- a/Documentation/nvme-get-log.html +++ b/Documentation/nvme-get-log.html @@ -750,17 +750,18 @@ nvme-get-log(1) Manual Page
nvme get-log <device> [--log-id=<log-id> | -i <log-id>]
-              [--log-len=<log-len> | -l <log-len>]
-              [--aen=<aen> | -a <aen>]
-              [--namespace-id=<nsid> | -n <nsid>]
-              [--raw-binary | -b]
-              [--lpo=<offset> | -o <offset>]
-              [--lsp=<field> | -s <field>]
-              [--lsi=<field> | -S <field>]
-              [--rae | -r]
-              [--csi=<command_set_identifier> | -y <command_set_identifier>]
-              [--ot=<offset_type> | -O <offset_type>]
-                    [--xfer-len=<length> | -x <length>]
+ [--log-len=<log-len> | -l <log-len>] + [--aen=<aen> | -a <aen>] + [--namespace-id=<nsid> | -n <nsid>] + [--raw-binary | -b] + [--lpo=<offset> | -L <offset>] + [--lsp=<field> | -s <field>] + [--lsi=<field> | -S <field>] + [--rae | -r] + [--csi=<command_set_identifier> | -y <command_set_identifier>] + [--ot=<offset_type> | -O <offset_type>] + [--xfer-len=<length> | -x <length>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -845,7 +846,7 @@ program to parse.

--o <offset> +-L <offset>
--lpo=<offset> @@ -929,6 +930,29 @@ program to parse.

a multiple of 4096. The default size is 4096.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -973,7 +997,7 @@ Have the program return the raw log page in binary: diff --git a/Documentation/nvme-get-log.txt b/Documentation/nvme-get-log.txt index a51c435..98b1f9c 100644 --- a/Documentation/nvme-get-log.txt +++ b/Documentation/nvme-get-log.txt @@ -9,17 +9,18 @@ SYNOPSIS -------- [verse] 'nvme get-log' [--log-id= | -i ] - [--log-len= | -l ] - [--aen= | -a ] - [--namespace-id= | -n ] - [--raw-binary | -b] - [--lpo= | -o ] - [--lsp= | -s ] - [--lsi= | -S ] - [--rae | -r] - [--csi= | -y ] - [--ot= | -O ] - [--xfer-len= | -x ] + [--log-len= | -l ] + [--aen= | -a ] + [--namespace-id= | -n ] + [--raw-binary | -b] + [--lpo= | -L ] + [--lsp= | -s ] + [--lsi= | -S ] + [--rae | -r] + [--csi= | -y ] + [--ot= | -O ] + [--xfer-len= | -x ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -63,7 +64,7 @@ OPTIONS --raw-binary:: Print the raw log buffer to stdout. --o :: +-L :: --lpo=:: The log page offset specifies the location within a log page to start returning data from. It's Dword-aligned and 64-bits. @@ -101,6 +102,15 @@ OPTIONS Specify the read chunk size. The length argument is expected to be a multiple of 4096. The default size is 4096. +-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 -------- * Get 512 bytes from log page 2 diff --git a/Documentation/nvme-get-ns-id.1 b/Documentation/nvme-get-ns-id.1 index e42c26e..f317c17 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GET\-NS\-ID" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-GET\-NS\-ID" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,14 +32,26 @@ nvme-get-ns-id \- Retrieves the namespace ID for an NVMe block device .SH "SYNOPSIS" .sp .nf -\fInvme get\-ns\-id\fR +\fInvme get\-ns\-id\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp Retrieves the namespace ID for an NVMe block device\&. The param is mandatory and must be an NVMe block device (ex: /dev/nvme0n1)\&. .SH "OPTIONS" -.sp -None +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-get-ns-id.html b/Documentation/nvme-get-ns-id.html index 37cfc2c..dcdc39e 100644 --- a/Documentation/nvme-get-ns-id.html +++ b/Documentation/nvme-get-ns-id.html @@ -749,7 +749,7 @@ nvme-get-ns-id(1) Manual Page

SYNOPSIS

-
nvme get-ns-id <device>
+
nvme get-ns-id <device> [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -764,7 +764,31 @@ is mandatory and must be an NVMe block device (ex: /dev/nvme0n1).

OPTIONS

-

None

+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
+
@@ -794,7 +818,7 @@ Shows the namespace id for the given block device: diff --git a/Documentation/nvme-get-ns-id.txt b/Documentation/nvme-get-ns-id.txt index 5dcdc6d..8516cb8 100644 --- a/Documentation/nvme-get-ns-id.txt +++ b/Documentation/nvme-get-ns-id.txt @@ -8,7 +8,7 @@ nvme-get-ns-id - Retrieves the namespace ID for an NVMe block device SYNOPSIS -------- [verse] -'nvme get-ns-id' +'nvme get-ns-id' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -17,7 +17,14 @@ is mandatory and must be an NVMe block device (ex: /dev/nvme0n1). OPTIONS ------- -None +-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 -------- diff --git a/Documentation/nvme-get-property.1 b/Documentation/nvme-get-property.1 index 6735f12..79ed8c6 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-GET\-PROPERTY" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-GET\-PROPERTY" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,15 +32,16 @@ nvme-get-property \- Reads and shows the defined NVMe controller property for NV .SH "SYNOPSIS" .sp .nf -\fInvme get\-property\fR [\-\-offset= | \-o ] - [\-\-human\-readable | \-H ] +\fInvme get\-property\fR [\-\-offset= | \-O ] + [\-\-human\-readable | \-H] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp 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 @@ -49,6 +50,20 @@ The offset of the property\&. One of CAP=0x0, VS=0x8, CC=0x14, CSTS=0x1c, NSSR=0 .RS 4 \-\-human\-readable: Show the fields packed in the property .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-get-property.html b/Documentation/nvme-get-property.html index 5f7cdd3..9b2a793 100644 --- a/Documentation/nvme-get-property.html +++ b/Documentation/nvme-get-property.html @@ -749,8 +749,9 @@ nvme-get-property(1) Manual Page

SYNOPSIS

-
nvme get-property <device> [--offset=<offset> | -o <offset>]
-                                [--human-readable | -H ]
+
nvme get-property <device> [--offset=<offset> | -O <offset>]
+                        [--human-readable | -H]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -766,7 +767,7 @@ nvme-get-property(1) Manual Page
--o +-O
--offset @@ -785,6 +786,29 @@ nvme-get-property(1) Manual Page Show the fields packed in the property

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -843,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 b2b7d29..601b8a4 100644 --- a/Documentation/nvme-get-property.txt +++ b/Documentation/nvme-get-property.txt @@ -9,25 +9,32 @@ for NVMe over Fabric SYNOPSIS -------- [verse] -'nvme get-property' [--offset= | -o ] - [--human-readable | -H ] - +'nvme get-property' [--offset= | -O ] + [--human-readable | -H] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- Reads and shows the defined NVMe controller property for NVMe over Fabric. - OPTIONS ------- --o:: +-O:: --offset:: - The offset of the property. One of CAP=0x0, VS=0x8, CC=0x14, CSTS=0x1c, NSSR=0x20 + The offset of the property. One of CAP=0x0, VS=0x8, CC=0x14, CSTS=0x1c, NSSR=0x20 -H:: --human-readable: Show the fields packed in the property +-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 -------- @@ -37,7 +44,6 @@ EXAMPLES # nvme get-property /dev/nvme0 --offset=0x0 --human-readable ------------ - BUGS ---- Currently the CAP value is truncated to 32 bits due to a limitation in diff --git a/Documentation/nvme-help.1 b/Documentation/nvme-help.1 index 4b68960..e22061a 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-HELP" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-HELP" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-help.html b/Documentation/nvme-help.html index 2d93925..3091633 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 2d11b8b..570bb01 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-HUAWEI\-ID\-CT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-HUAWEI\-ID\-CT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,8 +32,8 @@ nvme-huawei-id-ctrl \- Send NVMe Identify Controller, return result and structur .SH "SYNOPSIS" .sp .nf -\fInvme huawei id\-ctrl\fR [\-v | \-\-vendor\-specific] [\-b | \-\-raw\-binary] - [\-o | \-\-output\-format=] +\fInvme huawei id\-ctrl\fR [\-\-vendor\-specific | \-v] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -63,7 +63,7 @@ In addition to parsing known fields, this option will dump the vendor specific r This option will parse and format many of the bit fields into human\-readable formats\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-huawei-id-ctrl.html b/Documentation/nvme-huawei-id-ctrl.html index 2a4e7cd..2bbd642 100644 --- a/Documentation/nvme-huawei-id-ctrl.html +++ b/Documentation/nvme-huawei-id-ctrl.html @@ -749,8 +749,8 @@ nvme-huawei-id-ctrl(1) Manual Page

SYNOPSIS

-
nvme huawei id-ctrl <device> [-v | --vendor-specific] [-b | --raw-binary]
-                        [-o <fmt> | --output-format=<fmt>]
+
nvme huawei id-ctrl <device> [--vendor-specific | -v] [--raw-binary | -b]
+                        [--output-format=<fmt> | -o <fmt>]
@@ -813,15 +813,15 @@ will decode Huawei vendor unique portions of the structure.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + Set the reporting format to normal, json, or + binary. Only one output format can be used at a time.

@@ -855,7 +855,7 @@ fields in a human readable format: diff --git a/Documentation/nvme-huawei-id-ctrl.txt b/Documentation/nvme-huawei-id-ctrl.txt index f4d2f80..47225d1 100644 --- a/Documentation/nvme-huawei-id-ctrl.txt +++ b/Documentation/nvme-huawei-id-ctrl.txt @@ -8,8 +8,8 @@ nvme-huawei-id-ctrl - Send NVMe Identify Controller, return result and structure SYNOPSIS -------- [verse] -'nvme huawei id-ctrl' [-v | --vendor-specific] [-b | --raw-binary] - [-o | --output-format=] +'nvme huawei id-ctrl' [--vendor-specific | -v] [--raw-binary | -b] + [--output-format= | -o ] DESCRIPTION ----------- @@ -47,10 +47,10 @@ OPTIONS This option will parse and format many of the bit fields into human-readable formats. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json', or + 'binary'. Only one output format can be used at a time. EXAMPLES -------- diff --git a/Documentation/nvme-huawei-list.1 b/Documentation/nvme-huawei-list.1 index f093e7e..70a1da9 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LIST" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-LIST" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,14 +32,14 @@ nvme-huawei-list \- List all recognized Huawei NVMe devices .SH "SYNOPSIS" .sp .nf -\fInvme huawei list\fR [\-o | \-\-output\-format=] +\fInvme huawei list\fR [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp Scan the sysfs tree for NVM Express devices and return the /dev node for those Huawei devices as well as some pertinent information about them\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR diff --git a/Documentation/nvme-huawei-list.html b/Documentation/nvme-huawei-list.html index 7c866d3..c4e865f 100644 --- a/Documentation/nvme-huawei-list.html +++ b/Documentation/nvme-huawei-list.html @@ -749,7 +749,7 @@ nvme-list(1) Manual Page

SYNOPSIS

-
nvme huawei list [-o <fmt> | --output-format=<fmt>]
+
nvme huawei list [--output-format=<fmt> | -o <fmt>]
@@ -766,10 +766,10 @@ for those Huawei devices as well as some pertinent information about them.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -797,7 +797,7 @@ for those Huawei devices as well as some pertinent information about them.

diff --git a/Documentation/nvme-huawei-list.txt b/Documentation/nvme-huawei-list.txt index 65a6c21..95f1099 100644 --- a/Documentation/nvme-huawei-list.txt +++ b/Documentation/nvme-huawei-list.txt @@ -8,7 +8,7 @@ nvme-huawei-list - List all recognized Huawei NVMe devices SYNOPSIS -------- [verse] -'nvme huawei list' [-o | --output-format=] +'nvme huawei list' [--output-format= | -o ] DESCRIPTION ----------- @@ -17,8 +17,8 @@ for those Huawei devices as well as some pertinent information about them. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal' or 'json'. Only one output format can be used at a time. diff --git a/Documentation/nvme-id-ctrl.1 b/Documentation/nvme-id-ctrl.1 index 0e4c7bc..f8acb1c 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-CTRL" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-CTRL" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,8 +32,8 @@ nvme-id-ctrl \- Send NVMe Identify Controller, return result and structure .SH "SYNOPSIS" .sp .nf -\fInvme id\-ctrl\fR [\-v | \-\-vendor\-specific] [\-b | \-\-raw\-binary] - [\-o | \-\-output\-format=] +\fInvme id\-ctrl\fR [\-\-vendor\-specific | \-V] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -49,7 +49,7 @@ On success, the structure may be returned in one of several ways depending on th Print the raw buffer to stdout\&. Structure is not parsed by program\&. This overrides the vendor specific and human readable options\&. .RE .PP -\-v, \-\-vendor\-specific +\-V, \-\-vendor\-specific .RS 4 In addition to parsing known fields, this option will dump the vendor specific region of the structure in hex with ascii interpretation\&. .RE @@ -59,13 +59,19 @@ In addition to parsing known fields, this option will dump the vendor specific r This option will parse and format many of the bit fields into human\-readable formats\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 @@ -104,7 +110,7 @@ In addition to showing the known fields, has the program to display the vendor u .\} .nf # nvme id\-ctrl /dev/nvme0 \-\-vendor\-specific -# nvme id\-ctrl /dev/nvme0 \-v +# nvme id\-ctrl /dev/nvme0 \-V .fi .if n \{\ .RE diff --git a/Documentation/nvme-id-ctrl.html b/Documentation/nvme-id-ctrl.html index e845a2a..40040e6 100644 --- a/Documentation/nvme-id-ctrl.html +++ b/Documentation/nvme-id-ctrl.html @@ -749,8 +749,8 @@ nvme-id-ctrl(1) Manual Page

SYNOPSIS

-
nvme id-ctrl <device> [-v | --vendor-specific] [-b | --raw-binary]
-                        [-o <fmt> | --output-format=<fmt>]
+
nvme id-ctrl <device> [--vendor-specific | -V] [--raw-binary | -b]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -784,7 +784,7 @@ raw buffer may be printed to stdout.

--v +-V
--vendor-specific @@ -809,15 +809,26 @@ raw buffer may be printed to stdout.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -845,7 +856,7 @@ the vendor unique field:
# nvme id-ctrl /dev/nvme0 --vendor-specific
-# nvme id-ctrl /dev/nvme0 -v
+# nvme id-ctrl /dev/nvme0 -V

The above will dump the vs buffer in hex since it doesn’t know how to interpret it.

@@ -910,7 +921,7 @@ int main(int argc, char **argv) diff --git a/Documentation/nvme-id-ctrl.txt b/Documentation/nvme-id-ctrl.txt index b9fcffc..3667c63 100644 --- a/Documentation/nvme-id-ctrl.txt +++ b/Documentation/nvme-id-ctrl.txt @@ -8,8 +8,8 @@ nvme-id-ctrl - Send NVMe Identify Controller, return result and structure SYNOPSIS -------- [verse] -'nvme id-ctrl' [-v | --vendor-specific] [-b | --raw-binary] - [-o | --output-format=] +'nvme id-ctrl' [--vendor-specific | -V] [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -30,7 +30,7 @@ OPTIONS Print the raw buffer to stdout. Structure is not parsed by program. This overrides the vendor specific and human readable options. --v:: +-V:: --vendor-specific:: In addition to parsing known fields, this option will dump the vendor specific region of the structure in hex with ascii @@ -41,10 +41,14 @@ OPTIONS This option will parse and format many of the bit fields into human-readable formats. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- @@ -61,7 +65,7 @@ the vendor unique field: + ------------ # nvme id-ctrl /dev/nvme0 --vendor-specific -# nvme id-ctrl /dev/nvme0 -v +# nvme id-ctrl /dev/nvme0 -V ------------ + The above will dump the 'vs' buffer in hex since it doesn't know how to diff --git a/Documentation/nvme-id-domain.1 b/Documentation/nvme-id-domain.1 index 67304a1..b260dc0 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-DOMAIN" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-DOMAIN" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,7 +33,7 @@ nvme-id-domain \- Send NVMe Identify Domain List, return result and structure .sp .nf \fInvme id\-domain\fR [\-\-dom\-id= | \-d ] - [\-o | \-\-output\-format=] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -47,13 +47,19 @@ The parameter is mandatory and may be either the NVMe character device Retrieve the identify domain list data structure for the given domain id\&. If this value is not given, domain id will be 0xffff\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-id-domain.html b/Documentation/nvme-id-domain.html index decc53a..6a22d19 100644 --- a/Documentation/nvme-id-domain.html +++ b/Documentation/nvme-id-domain.html @@ -750,7 +750,7 @@ nvme-id-domain(1) Manual Page
nvme id-domain <device> [--dom-id=<domian_id> | -d <domian_id>]
-                        [-o <fmt> | --output-format=<fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -781,15 +781,26 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -812,7 +823,7 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-id-domain.txt b/Documentation/nvme-id-domain.txt index 87883c5..1d6ec48 100644 --- a/Documentation/nvme-id-domain.txt +++ b/Documentation/nvme-id-domain.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'nvme id-domain' [--dom-id= | -d ] - [-o | --output-format=] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -26,10 +26,14 @@ OPTIONS Retrieve the identify domain list data structure for the given domain id. If this value is not given, domain id will be 0xffff. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-id-iocs.1 b/Documentation/nvme-id-iocs.1 index 58ae111..942fe4e 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-IOCS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-IOCS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,7 +33,7 @@ nvme-id-iocs \- Send NVMe Identify I/O Command Set, return result and structure .sp .nf \fInvme id\-iocs\fR [\-\-controller\-id= | \-c ] - [\-o | \-\-output\-format=] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -52,13 +52,19 @@ Retrieve the identify I/O Command set data structure for the given cntid\&. If t This option will parse and format many of the bit fields into human\-readable formats\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-id-iocs.html b/Documentation/nvme-id-iocs.html index c3b2dc1..c823d1a 100644 --- a/Documentation/nvme-id-iocs.html +++ b/Documentation/nvme-id-iocs.html @@ -750,7 +750,7 @@ nvme-id-iocs(1) Manual Page
nvme id-iocs <device> [--controller-id=<cntid> | -c <cntid>]
-                        [-o <fmt> | --output-format=<fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -793,15 +793,26 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -844,7 +855,7 @@ show the fields in human readable format diff --git a/Documentation/nvme-id-iocs.txt b/Documentation/nvme-id-iocs.txt index a35217e..bb85aef 100644 --- a/Documentation/nvme-id-iocs.txt +++ b/Documentation/nvme-id-iocs.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'nvme id-iocs' [--controller-id= | -c ] - [-o | --output-format=] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -30,10 +30,14 @@ OPTIONS This option will parse and format many of the bit fields into human-readable formats. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-id-ns-granularity.txt b/Documentation/nvme-id-ns-granularity.txt new file mode 100755 index 0000000..67006c3 --- /dev/null +++ b/Documentation/nvme-id-ns-granularity.txt @@ -0,0 +1,46 @@ +nvme-id-ns-granularity(1) +========================= + +NAME +---- +nvme-id-ns-granularity - Send a Identify Namespace Granularity List command to +the specified device + +SYNOPSIS +-------- +[verse] +'nvme id-ns-granularity' + [--output-format= | -o ] [--verbose | -v] + +DESCRIPTION +----------- +Send a Identify Namespace Granularity List command command to the specified +device, return results. + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1). + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-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 +-------- +* Has the program issue a id-ns-granularity to display structure. ++ +------------ +# nvme id-ns-granularity /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-id-ns-lba-format.txt b/Documentation/nvme-id-ns-lba-format.txt index 32df2f6..514ba48 100644 --- a/Documentation/nvme-id-ns-lba-format.txt +++ b/Documentation/nvme-id-ns-lba-format.txt @@ -9,9 +9,9 @@ SYNOPSIS -------- [verse] 'nvme id-ns' [--uuid-index= | -U ] - [--lba-format-index= | -i ] - [-v | --verbose] - [--output-format= | -o ] + [--lba-format-index= | -i ] + [--verbose | -v] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -31,7 +31,7 @@ OPTIONS -U :: --uuid-index=:: UUID Index of the feature - + -i :: --lba-format-index=:: This field specifies the index into the LBA Format list identifying @@ -41,10 +41,10 @@ OPTIONS --verbose:: Increase the information detail in the output. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json' or 'binary'. Only one + output format can be used at a time. EXAMPLES -------- diff --git a/Documentation/nvme-id-ns.1 b/Documentation/nvme-id-ns.1 index 4bac15e..be219cc 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-NS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-NS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,10 +32,10 @@ nvme-id-ns \- Send NVMe Identify Namespace, return result and structure .SH "SYNOPSIS" .sp .nf -\fInvme id\-ns\fR [\-v | \-\-vendor\-specific] [\-b | \-\-raw\-binary] - [\-\-namespace\-id= | \-n ] [\-\-force] - [\-\-human\-readable | \-H] - [\-\-output\-format= | \-o ] +\fInvme id\-ns\fR [\-\-vendor\-specific | \-v] [\-\-raw\-binary | \-b] + [\-\-namespace\-id= | \-n ] [\-\-force] + [\-\-human\-readable | \-H] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -61,7 +61,7 @@ Request controller return the identify namespace structure even if the namespace Print the raw buffer to stdout\&. Structure is not parsed by program\&. This overrides the vendor specific and human readable options\&. .RE .PP -\-v, \-\-vendor\-specific +\-V, \-\-vendor\-specific .RS 4 In addition to parsing known fields, this option will dump the vendor specific region of the structure in hex with ascii interpretation\&. .RE @@ -71,13 +71,19 @@ In addition to parsing known fields, this option will dump the vendor specific r This option will parse and format many of the bit fields into human\-readable formats\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 @@ -139,7 +145,7 @@ In addition to showing the known fields, have the program to display the vendor .\} .nf # nvme id\-ns /dev/nvme0n1 \-\-vendor\-specific -# nvme id\-ns /dev/nvme0n1 \-v +# nvme id\-ns /dev/nvme0n1 \-V .fi .if n \{\ .RE diff --git a/Documentation/nvme-id-ns.html b/Documentation/nvme-id-ns.html index f28f969..48ac22b 100644 --- a/Documentation/nvme-id-ns.html +++ b/Documentation/nvme-id-ns.html @@ -749,10 +749,10 @@ nvme-id-ns(1) Manual Page

SYNOPSIS

-
nvme id-ns <device> [-v | --vendor-specific] [-b | --raw-binary]
-                    [--namespace-id=<nsid> | -n <nsid>] [--force]
-                    [--human-readable | -H]
-                    [--output-format=<fmt> | -o <fmt>]
+
nvme id-ns <device> [--vendor-specific | -v] [--raw-binary | -b]
+                        [--namespace-id=<nsid> | -n <nsid>] [--force]
+                        [--human-readable | -H]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -817,7 +817,7 @@ raw buffer may be printed to stdout.

--v +-V
--vendor-specific @@ -842,15 +842,26 @@ raw buffer may be printed to stdout.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -889,7 +900,7 @@ the vendor unique field:
# nvme id-ns /dev/nvme0n1 --vendor-specific
-# nvme id-ns /dev/nvme0n1 -v
+# nvme id-ns /dev/nvme0n1 -V

The above will dump the 'vs' buffer in hex since it doesn’t know how to interpret it.

@@ -955,7 +966,7 @@ int main(int argc, char **argv) diff --git a/Documentation/nvme-id-ns.txt b/Documentation/nvme-id-ns.txt index a2ac155..0791250 100644 --- a/Documentation/nvme-id-ns.txt +++ b/Documentation/nvme-id-ns.txt @@ -8,10 +8,10 @@ nvme-id-ns - Send NVMe Identify Namespace, return result and structure SYNOPSIS -------- [verse] -'nvme id-ns' [-v | --vendor-specific] [-b | --raw-binary] - [--namespace-id= | -n ] [--force] - [--human-readable | -H] - [--output-format= | -o ] +'nvme id-ns' [--vendor-specific | -v] [--raw-binary | -b] + [--namespace-id= | -n ] [--force] + [--human-readable | -H] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -51,7 +51,7 @@ OPTIONS Print the raw buffer to stdout. Structure is not parsed by program. This overrides the vendor specific and human readable options. --v:: +-V:: --vendor-specific:: In addition to parsing known fields, this option will dump the vendor specific region of the structure in hex with ascii @@ -62,12 +62,14 @@ OPTIONS This option will parse and format many of the bit fields into human-readable formats. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. - +-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 -------- @@ -93,7 +95,7 @@ the vendor unique field: + ------------ # nvme id-ns /dev/nvme0n1 --vendor-specific -# nvme id-ns /dev/nvme0n1 -v +# nvme id-ns /dev/nvme0n1 -V ------------ + The above will dump the \'vs' buffer in hex since it doesn't know how to diff --git a/Documentation/nvme-id-nvmset.1 b/Documentation/nvme-id-nvmset.1 index fe06cc6..3ce9705 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-NVMSET" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-NVMSET" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,8 +32,8 @@ nvme-id-nvmset \- Send NVMe Identify NVM Set List, return result and structure .SH "SYNOPSIS" .sp .nf -\fInvme id\-nvmset\fR [\-i | \-\-nvmset_id= ] - [\-o | \-\-output\-format=] +\fInvme id\-nvmset\fR [\-\-nvmset_id= | \-i ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -49,13 +49,19 @@ On success, the structure may be returned in one of several ways depending on th This field specifies the identifier of the NVM Set\&. If given, NVM set identifier whose entry is to be in result data will be greater than or equal to this value\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-id-nvmset.html b/Documentation/nvme-id-nvmset.html index 4da3bf7..96c5382 100644 --- a/Documentation/nvme-id-nvmset.html +++ b/Documentation/nvme-id-nvmset.html @@ -749,8 +749,8 @@ nvme-id-nvmset(1) Manual Page

SYNOPSIS

-
nvme id-nvmset <device> [-i <id> | --nvmset_id=<id> ]
-                        [-o <fmt> | --output-format=<fmt>]
+
nvme id-nvmset <device> [--nvmset_id=<id> | -i <id>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -779,21 +779,32 @@ raw buffer may be printed to stdout.

- This field specifies the identifier of the NVM Set. If given, NVM set + This field specifies the identifier of the NVM Set. If given, NVM set identifier whose entry is to be in result data will be greater than or equal to this value.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -851,7 +862,7 @@ as shown in the above example, or you can 'cat' a saved output buff diff --git a/Documentation/nvme-id-nvmset.txt b/Documentation/nvme-id-nvmset.txt index c331410..e2894e3 100644 --- a/Documentation/nvme-id-nvmset.txt +++ b/Documentation/nvme-id-nvmset.txt @@ -8,8 +8,8 @@ nvme-id-nvmset - Send NVMe Identify NVM Set List, return result and structure SYNOPSIS -------- [verse] -'nvme id-nvmset' [-i | --nvmset_id= ] - [-o | --output-format=] +'nvme id-nvmset' [--nvmset_id= | -i ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -27,14 +27,18 @@ OPTIONS ------- -i :: --nvmset_id=:: - This field specifies the identifier of the NVM Set. If given, NVM set + This field specifies the identifier of the NVM Set. If given, NVM set identifier whose entry is to be in result data will be greater than or equal to this value. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-id-uuid.txt b/Documentation/nvme-id-uuid.txt new file mode 100755 index 0000000..f7cc1c0 --- /dev/null +++ b/Documentation/nvme-id-uuid.txt @@ -0,0 +1,55 @@ +nvme-id-uuid(1) +=============== + +NAME +---- +nvme-id-uuid - Send a Identify UUID List command to the specified device + +SYNOPSIS +-------- +[verse] +'nvme id-uuid' [--raw-binary | -b] [--human-readable | -H] + [--output-format= | -o ] [--verbose | -v] + +DESCRIPTION +----------- +Send a Identify UUID List command command to the specified device, return +results. + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1). + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-b:: +--raw-binary:: + Print the raw buffer to stdout. Structure is not parsed by + program. This overrides the vendor specific and human readable options. + +-H:: +--human-readable:: + This option will parse and format many of the bit fields + into human-readable formats. + +-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 +-------- +* Has the program issue a id-uuid to display structure. ++ +------------ +# nvme id-uuid /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-inspur-nvme-vendor-log.1 b/Documentation/nvme-inspur-nvme-vendor-log.1 index 63f338e..e3905b6 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INSPUR\-NVME\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-INSPUR\-NVME\-" "1" "12/21/2023" "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 99f8840..0eec2c2 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-inspur-nvme-vendor-log.txt b/Documentation/nvme-inspur-nvme-vendor-log.txt index cd0266b..c860497 100644 --- a/Documentation/nvme-inspur-nvme-vendor-log.txt +++ b/Documentation/nvme-inspur-nvme-vendor-log.txt @@ -23,7 +23,6 @@ OPTIONS ------- none - EXAMPLES -------- * 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 ab2c374..63f2915 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-ID\-CTR" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-ID\-CTR" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,8 +32,8 @@ nvme-intel-id-ctrl \- Send NVMe Identify Controller, return result and structure .SH "SYNOPSIS" .sp .nf -\fInvme intel id\-ctrl\fR [\-v | \-\-vendor\-specific] [\-b | \-\-raw\-binary] - [\-o | \-\-output\-format=] +\fInvme intel id\-ctrl\fR [\-\-vendor\-specific | \-v] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -61,7 +61,7 @@ In addition to parsing known fields, this option will dump the vendor specific r This option will parse and format many of the bit fields into human\-readable formats\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-intel-id-ctrl.html b/Documentation/nvme-intel-id-ctrl.html index 30c9e1a..10c0645 100644 --- a/Documentation/nvme-intel-id-ctrl.html +++ b/Documentation/nvme-intel-id-ctrl.html @@ -749,8 +749,8 @@ nvme-intel-id-ctrl(1) Manual Page

SYNOPSIS

-
nvme intel id-ctrl <device> [-v | --vendor-specific] [-b | --raw-binary]
-                        [-o <fmt> | --output-format=<fmt>]
+
nvme intel id-ctrl <device> [--vendor-specific | -v] [--raw-binary | -b]
+                        [--output-format=<fmt> | -o <fmt>]
@@ -811,15 +811,15 @@ will decode Intel vendor unique portions of the structure.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + Set the reporting format to normal, json, or + binary. Only one output format can be used at a time.

@@ -853,7 +853,7 @@ fields in a human readable format: diff --git a/Documentation/nvme-intel-id-ctrl.txt b/Documentation/nvme-intel-id-ctrl.txt index 1a6369c..469d60e 100644 --- a/Documentation/nvme-intel-id-ctrl.txt +++ b/Documentation/nvme-intel-id-ctrl.txt @@ -8,8 +8,8 @@ nvme-intel-id-ctrl - Send NVMe Identify Controller, return result and structure SYNOPSIS -------- [verse] -'nvme intel id-ctrl' [-v | --vendor-specific] [-b | --raw-binary] - [-o | --output-format=] +'nvme intel id-ctrl' [--vendor-specific | -v] [--raw-binary | -b] + [--output-format= | -o ] DESCRIPTION ----------- @@ -44,10 +44,10 @@ OPTIONS This option will parse and format many of the bit fields into human-readable formats. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json', or + 'binary'. Only one output format can be used at a time. EXAMPLES -------- diff --git a/Documentation/nvme-intel-internal-log.1 b/Documentation/nvme-intel-internal-log.1 index 9649a14..ff324dd 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-INTERNA" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-INTERNA" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-intel-internal-log.html b/Documentation/nvme-intel-internal-log.html index 060b62d..6f5d120 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-internal-log.txt b/Documentation/nvme-intel-internal-log.txt index 2f00313..a1e1792 100644 --- a/Documentation/nvme-intel-internal-log.txt +++ b/Documentation/nvme-intel-internal-log.txt @@ -53,7 +53,6 @@ OPTIONS When used with 'nlog', this specifies which nlog to read. -1 for all, if supported by the device. - EXAMPLES -------- * Gets the nlog from the device and saves to default file: diff --git a/Documentation/nvme-intel-lat-stats.1 b/Documentation/nvme-intel-lat-stats.1 index 7e52cbb..6cf57e7 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-LAT\-ST" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-LAT\-ST" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-intel-lat-stats.html b/Documentation/nvme-intel-lat-stats.html index 3d72747..dfb4582 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 a7c45d4..d46eb33 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-MARKET\" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-MARKET\" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-intel-market-name.html b/Documentation/nvme-intel-market-name.html index 0e0e596..ee06f92 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 cdcdaf3..91fe4eb 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-SMART\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-SMART\-" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,8 +33,7 @@ nvme-intel-smart-log-add \- Send NVMe Intel Additional SMART log page request, r .sp .nf \fInvme intel smart\-log\-add\fR [\-\-namespace\-id= | \-n ] - [\-\-raw\-binary | \-b] - [\-\-json | \-j] + [\-\-raw\-binary | \-b] [\-\-json | \-j] .fi .SH "DESCRIPTION" .sp diff --git a/Documentation/nvme-intel-smart-log-add.html b/Documentation/nvme-intel-smart-log-add.html index 0af652b..6895f39 100644 --- a/Documentation/nvme-intel-smart-log-add.html +++ b/Documentation/nvme-intel-smart-log-add.html @@ -750,8 +750,7 @@ nvme-intel-smart-log-add(1) Manual Page
nvme intel smart-log-add <device> [--namespace-id=<nsid> | -n <nsid>]
-                        [--raw-binary | -b]
-                        [--json | -j]
+ [--raw-binary | -b] [--json | -j]
@@ -807,7 +806,7 @@ printed to stdout for another program to parse.

- Dump output in json format. + Dump output in json format.

@@ -850,7 +849,7 @@ Print the raw Intel Additional SMART log to a file: diff --git a/Documentation/nvme-intel-smart-log-add.txt b/Documentation/nvme-intel-smart-log-add.txt index 7cfe794..0ed1f10 100644 --- a/Documentation/nvme-intel-smart-log-add.txt +++ b/Documentation/nvme-intel-smart-log-add.txt @@ -3,14 +3,14 @@ nvme-intel-smart-log-add(1) NAME ---- -nvme-intel-smart-log-add - Send NVMe Intel Additional SMART log page request, returns result and log +nvme-intel-smart-log-add - Send NVMe Intel Additional SMART log page request, +returns result and log SYNOPSIS -------- [verse] 'nvme intel smart-log-add' [--namespace-id= | -n ] - [--raw-binary | -b] - [--json | -j] + [--raw-binary | -b] [--json | -j] DESCRIPTION ----------- @@ -41,7 +41,7 @@ OPTIONS -j:: --json:: - Dump output in json format. + Dump output in json format. EXAMPLES -------- diff --git a/Documentation/nvme-intel-temp-stats.1 b/Documentation/nvme-intel-temp-stats.1 index b47065c..234c6eb 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-INTEL\-TEMP\-S" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-INTEL\-TEMP\-S" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-intel-temp-stats.html b/Documentation/nvme-intel-temp-stats.html index d485ae2..1269805 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 2251125..93f0fea 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-IO\-MGMT\-RECV" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-IO\-MGMT\-RECV" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,10 +33,10 @@ nvme-io-mgmt-recv \- I/O Management Receive command .sp .nf \fInvme io\-mgmt\-recv\fR [\-\-namespace\-id= | \-n ] - [\-\-mos= | \-s ] - [\-\-mo= | \-m ] - [\-\-data= | \-d ] - [\-\-data\-len= | \-l ] + [\-\-mos= | \-s ] [\-\-mo= | \-m ] + [\-\-data= | \-d ] + [\-\-data\-len= | \-l ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -67,6 +67,20 @@ Management Operation to perform\&. .RS 4 Management Operation Specific parameter\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "NVME" .sp Part of nvme\-cli diff --git a/Documentation/nvme-io-mgmt-recv.html b/Documentation/nvme-io-mgmt-recv.html index 72ace1b..795d64a 100644 --- a/Documentation/nvme-io-mgmt-recv.html +++ b/Documentation/nvme-io-mgmt-recv.html @@ -750,10 +750,10 @@ nvme-io-mgmt-recv(1) Manual Page
nvme io-mgmt-recv <device> [--namespace-id=<NUM> | -n <NUM>]
-                             [--mos=<NUM> | -s <NUM>]
-                             [--mo=<NUM> | -m <NUM>]
-                             [--data=<FILE> | -d <FILE>]
-                             [--data-len=<NUM> | -l <NUM>]
+ [--mos=<NUM> | -s <NUM>] [--mo=<NUM> | -m <NUM>] + [--data=<FILE> | -d <FILE>] + [--data-len=<NUM> | -l <NUM>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -832,6 +832,29 @@ a hex dump, or binary.

Management Operation Specific parameter.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -846,7 +869,7 @@ a hex dump, or binary.

diff --git a/Documentation/nvme-io-mgmt-recv.txt b/Documentation/nvme-io-mgmt-recv.txt index e611c15..332d0bb 100644 --- a/Documentation/nvme-io-mgmt-recv.txt +++ b/Documentation/nvme-io-mgmt-recv.txt @@ -9,10 +9,10 @@ SYNOPSIS -------- [verse] 'nvme io-mgmt-recv' [--namespace-id= | -n ] - [--mos= | -s ] - [--mo= | -m ] - [--data= | -d ] - [--data-len= | -l ] + [--mos= | -s ] [--mo= | -m ] + [--data= | -d ] + [--data-len= | -l ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -49,6 +49,14 @@ OPTIONS --mos=:: Management Operation Specific parameter. +-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. NVME ---- diff --git a/Documentation/nvme-io-mgmt-send.1 b/Documentation/nvme-io-mgmt-send.1 index 044cb77..47e869e 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-IO\-MGMT\-SEND" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-IO\-MGMT\-SEND" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,10 +33,10 @@ nvme-io-mgmt-send \- I/O Management Send command .sp .nf \fInvme io\-mgmt\-send\fR [\-\-namespace\-id= | \-n ] - [\-\-mos= | \-s ] - [\-\-mo= | \-m ] - [\-\-data= | \-d ] - [\-\-data\-len= | \-l ] + [\-\-mos= | \-s ] [\-\-mo= | \-m ] + [\-\-data= | \-d ] + [\-\-data\-len= | \-l ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -67,6 +67,20 @@ Management Operation to perform\&. .RS 4 Management Operation Specific parameter\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "NVME" .sp Part of nvme\-cli diff --git a/Documentation/nvme-io-mgmt-send.html b/Documentation/nvme-io-mgmt-send.html index 7c455e1..a0df7b0 100644 --- a/Documentation/nvme-io-mgmt-send.html +++ b/Documentation/nvme-io-mgmt-send.html @@ -750,10 +750,10 @@ nvme-io-mgmt-send(1) Manual Page
nvme io-mgmt-send <device> [--namespace-id=<NUM> | -n <NUM>]
-                             [--mos=<NUM> | -s <NUM>]
-                             [--mo=<NUM> | -m <NUM>]
-                             [--data=<FILE> | -d <FILE>]
-                             [--data-len=<NUM> | -l <NUM>]
+ [--mos=<NUM> | -s <NUM>] [--mo=<NUM> | -m <NUM>] + [--data=<FILE> | -d <FILE>] + [--data-len=<NUM> | -l <NUM>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -831,6 +831,29 @@ convenience parameters to produce the binary payload.

Management Operation Specific parameter.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -845,7 +868,7 @@ convenience parameters to produce the binary payload.

diff --git a/Documentation/nvme-io-mgmt-send.txt b/Documentation/nvme-io-mgmt-send.txt index ce8d8d2..f7e8f6d 100644 --- a/Documentation/nvme-io-mgmt-send.txt +++ b/Documentation/nvme-io-mgmt-send.txt @@ -9,10 +9,10 @@ SYNOPSIS -------- [verse] 'nvme io-mgmt-send' [--namespace-id= | -n ] - [--mos= | -s ] - [--mo= | -m ] - [--data= | -d ] - [--data-len= | -l ] + [--mos= | -s ] [--mo= | -m ] + [--data= | -d ] + [--data-len= | -l ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -48,6 +48,14 @@ OPTIONS --mos=:: Management Operation Specific parameter. +-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. NVME ---- diff --git a/Documentation/nvme-io-passthru.1 b/Documentation/nvme-io-passthru.1 index da0e301..102da64 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-IO\-PASSTHRU" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-IO\-PASSTHRU" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,23 +32,22 @@ nvme-io-passthru \- Submit an arbitrary io command, return results .SH "SYNOPSIS" .sp .nf -\fInvme\-io\-passthru\fR [\-\-opcode= | \-o ] - [\-\-flags= | \-f ] [\-rsvd= | \-R ] - [\-\-namespace\-id= | \-nsid ] - [\-\-cdw2=] [\-\-cdw3=] [\-\-cdw10=] - [\-\-cdw11=] [\-\-cdw12=] [\-\-cdw13=] - [\-\-cdw14=] [\-\-cdw15=] - [\-\-data\-len= | \-l ] - [\-\-metadata\-len= | \-m ] - [\-\-read | \-r ] [\-\-write | \-w] - [\-\-input\-file= | \-i ] - [\-\-metadata= | \-M ] - [\-\-timeout= | \-t ] - [\-\-show\-command | \-s] - [\-\-dry\-run | \-d] - [\-\-raw\-binary | \-b] - [\-\-prefill= | \-p ] - [\-\-latency | \-T] +\fInvme\-io\-passthru\fR [\-\-opcode= | \-O ] + [\-\-flags= | \-f ] [\-rsvd= | \-R ] + [\-\-namespace\-id= | \-nsid ] + [\-\-cdw2=] [\-\-cdw3=] [\-\-cdw10=] + [\-\-cdw11=] [\-\-cdw12=] [\-\-cdw13=] + [\-\-cdw14=] [\-\-cdw15=] + [\-\-data\-len= | \-l ] + [\-\-metadata\-len= | \-m ] + [\-\-read | \-r] [\-\-write | \-w] + [\-\-input\-file= | \-i ] + [\-\-metadata= | \-M ] + [\-\-timeout= | \-t ] [\-\-show\-command | \-s] + [\-\-dry\-run | \-d] [\-\-raw\-binary | \-b] + [\-\-prefill= | \-p ] + [\-\-latency | \-T] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -59,7 +58,7 @@ The parameter is mandatory and may be either the NVMe character device On success, the returned structure (if applicable) may be returned in one of several ways depending on the option flags; the structure may printed by the program as a hex dump, or may be returned as a raw buffer printed to stdout for another program to parse\&. .SH "OPTIONS" .PP -\-o , \-\-opcode= +\-O , \-\-opcode= .RS 4 The NVMe opcode to send to the device in the command .RE @@ -137,6 +136,20 @@ Prefill the buffer with a predetermined byte value\&. Defaults to 0\&. This may .RS 4 Print out the latency the IOCTL took (in us)\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp nvme io\-passthru /dev/nvme0n1 \-\-opcode=2 \-\-namespace\-id=1 \-\-data\-len=4096 \-\-read \-\-cdw10=0 \-\-cdw11=0 \-\-cdw12=0x70000 \-\-raw\-binary diff --git a/Documentation/nvme-io-passthru.html b/Documentation/nvme-io-passthru.html index 09c58d8..4de9587 100644 --- a/Documentation/nvme-io-passthru.html +++ b/Documentation/nvme-io-passthru.html @@ -749,23 +749,22 @@ nvme-io-passthru(1) Manual Page

SYNOPSIS

-
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>]
-                [--data-len=<data-len> | -l <data-len>]
-                [--metadata-len=<len> | -m <len>]
-                [--read | -r ] [--write | -w]
-                [--input-file=<file> | -i <file>]
-                [--metadata=<file> | -M <file>]
-                [--timeout=<to> | -t <to>]
-                [--show-command | -s]
-                [--dry-run | -d]
-                [--raw-binary | -b]
-                [--prefill=<prefill> | -p <prefill>]
-                [--latency | -T]
+
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>]
+                        [--data-len=<data-len> | -l <data-len>]
+                        [--metadata-len=<len> | -m <len>]
+                        [--read | -r] [--write | -w]
+                        [--input-file=<file> | -i <file>]
+                        [--metadata=<file> | -M <file>]
+                        [--timeout=<to> | -t <to>] [--show-command | -s]
+                        [--dry-run | -d] [--raw-binary | -b]
+                        [--prefill=<prefill> | -p <prefill>]
+                        [--latency | -T]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -790,7 +789,7 @@ printed to stdout for another program to parse.

--o <opcode> +-O <opcode>
--opcode=<opcode> @@ -973,6 +972,29 @@ printed to stdout for another program to parse.

Print out the latency the IOCTL took (in us).

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -993,7 +1015,7 @@ printed to stdout for another program to parse.

diff --git a/Documentation/nvme-io-passthru.txt b/Documentation/nvme-io-passthru.txt index ba0904c..3ad5231 100644 --- a/Documentation/nvme-io-passthru.txt +++ b/Documentation/nvme-io-passthru.txt @@ -8,23 +8,22 @@ nvme-io-passthru - Submit an arbitrary io command, return results SYNOPSIS -------- [verse] -'nvme-io-passthru' [--opcode= | -o ] - [--flags= | -f ] [-rsvd= | -R ] - [--namespace-id= | -nsid ] - [--cdw2=] [--cdw3=] [--cdw10=] - [--cdw11=] [--cdw12=] [--cdw13=] - [--cdw14=] [--cdw15=] - [--data-len= | -l ] - [--metadata-len= | -m ] - [--read | -r ] [--write | -w] - [--input-file= | -i ] - [--metadata= | -M ] - [--timeout= | -t ] - [--show-command | -s] - [--dry-run | -d] - [--raw-binary | -b] - [--prefill= | -p ] - [--latency | -T] +'nvme-io-passthru' [--opcode= | -O ] + [--flags= | -f ] [-rsvd= | -R ] + [--namespace-id= | -nsid ] + [--cdw2=] [--cdw3=] [--cdw10=] + [--cdw11=] [--cdw12=] [--cdw13=] + [--cdw14=] [--cdw15=] + [--data-len= | -l ] + [--metadata-len= | -m ] + [--read | -r] [--write | -w] + [--input-file= | -i ] + [--metadata= | -M ] + [--timeout= | -t ] [--show-command | -s] + [--dry-run | -d] [--raw-binary | -b] + [--prefill= | -p ] + [--latency | -T] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -43,7 +42,7 @@ printed to stdout for another program to parse. OPTIONS ------- --o :: +-O :: --opcode=:: The NVMe opcode to send to the device in the command @@ -120,6 +119,15 @@ OPTIONS --latency:: Print out the latency the IOCTL took (in us). +-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 -------- diff --git a/Documentation/nvme-lba-status-log.1 b/Documentation/nvme-lba-status-log.1 index 2b273f7..d083039 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LBA\-STATUS\-L" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-LBA\-STATUS\-L" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,8 @@ nvme-lba-status-log \- Send LBA Status Log Page request returns result and log .SH "SYNOPSIS" .sp .nf -\fInvme lba\-status\-log\fR [\-\-rae | \-r] [\-\-output\-format= | \-o ] +\fInvme lba\-status\-log\fR [\-\-rae | \-r] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -48,13 +49,19 @@ On success, the returned LBA Status Log Page structure may be returned in one of Retain an Asynchronous Event\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-lba-status-log.html b/Documentation/nvme-lba-status-log.html index 72274ba..1e571bf 100644 --- a/Documentation/nvme-lba-status-log.html +++ b/Documentation/nvme-lba-status-log.html @@ -749,7 +749,8 @@ nvme-lba-status-log(1) Manual Page

SYNOPSIS

-
nvme lba-status-log <device> [--rae | -r] [--output-format=<fmt> | -o <fmt>]
+
nvme lba-status-log <device> [--rae | -r]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -783,15 +784,26 @@ may be printed to stdout for another program to parse.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or binary. - Only one output format can be used at a time. + 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.

@@ -831,7 +843,7 @@ NVME diff --git a/Documentation/nvme-lba-status-log.txt b/Documentation/nvme-lba-status-log.txt index 0d888f7..7d6efbd 100644 --- a/Documentation/nvme-lba-status-log.txt +++ b/Documentation/nvme-lba-status-log.txt @@ -8,7 +8,8 @@ nvme-lba-status-log - Send LBA Status Log Page request returns result and log SYNOPSIS -------- [verse] -'nvme lba-status-log' [--rae | -r] [--output-format= | -o ] +'nvme lba-status-log' [--rae | -r] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -29,10 +30,14 @@ OPTIONS --rae:: Retain an Asynchronous Event. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or 'binary'. - Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-list-ctrl.1 b/Documentation/nvme-list-ctrl.1 index 5d10cfb..1b6134e 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LIST\-CTRL" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-LIST\-CTRL" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,25 +33,17 @@ nvme-list-ctrl \- Send NVMe Identify List Controllers, return result and structu .sp .nf \fInvme list\-ctrl\fR [\-\-cntid= | \-c ] - [\-\-namespace\-id= | \-n ] [\-o | \-\-output\-format=] -DESCRIPTION + [\-\-namespace\-id= | \-n ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi +.SH "DESCRIPTION" .sp -.nf -For the NVMe device given, sends an identify command for controller list -and provides the result and returned structure\&. This uses either mode -12h or 13h depending on the requested namespace identifier\&. - -The parameter is mandatory and may be either the NVMe character -device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&. -The starting controller in the list always begins with 0 unless the -`\*(Aq\-\-cntid\*(Aq` option is given to override\&. - -On success, the controller array is printed for each index and controller -identifier\&. - -OPTIONS -.fi +For the NVMe device given, sends an identify command for controller list and provides the result and returned structure\&. This uses either mode 12h or 13h depending on the requested namespace identifier\&. +.sp +The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&. The starting controller in the list always begins with 0 unless the \*(Aq\-\-cntid\*(Aq option is given to override\&. +.sp +On success, the controller array is printed for each index and controller identifier\&. +.SH "OPTIONS" .PP \-c , \-\-cntid= .RS 4 @@ -63,12 +55,18 @@ Retrieve the identify list structure starting with the given controller id\&. If provided, will request the controllers attached to the specified namespace\&. If no namespace is given, or set to 0, the command requests the controller list for the entire subsystem, whether or not they are attached to namespace(s)\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to -\fInormal\fR +\fInormal\fR, +\fIjson\fR or -\fIjson\fR\&. Only one output format can be used at a time\&. +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. .RE .SH "EXAMPLES" .sp diff --git a/Documentation/nvme-list-ctrl.html b/Documentation/nvme-list-ctrl.html index 68d540f..b58d5ef 100644 --- a/Documentation/nvme-list-ctrl.html +++ b/Documentation/nvme-list-ctrl.html @@ -750,26 +750,29 @@ nvme-list-ctrl(1) Manual Page
nvme list-ctrl <device> [--cntid=<cntid> | -c <cntid>]
-                        [--namespace-id=<nsid> | -n <nsid>] [-o <fmt> | --output-format=<fmt>]
-DESCRIPTION
+ [--namespace-id=<nsid> | -n <nsid>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
-
-
-
For the NVMe device given, sends an identify command for controller list
+
+
+
+

DESCRIPTION

+
+

For the NVMe device given, sends an identify command for controller list and provides the result and returned structure. This uses either mode -12h or 13h depending on the requested namespace identifier. - -The <device> parameter is mandatory and may be either the NVMe character +12h or 13h depending on the requested namespace identifier.

+

The <device> parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). The starting controller in the list always begins with 0 unless the -`'--cntid'` option is given to override. - -On success, the controller array is printed for each index and controller -identifier. - -OPTIONS -

+'--cntid' option is given to override.

+

On success, the controller array is printed for each index and controller +identifier.

+
+ +
+

OPTIONS

+
-c <cntid> @@ -797,15 +800,26 @@ OPTIONS

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal or json. Only one output - format can be used at a time. + 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.

@@ -828,7 +842,7 @@ OPTIONS diff --git a/Documentation/nvme-list-ctrl.txt b/Documentation/nvme-list-ctrl.txt index f1bb52d..6cd5c01 100644 --- a/Documentation/nvme-list-ctrl.txt +++ b/Documentation/nvme-list-ctrl.txt @@ -9,7 +9,9 @@ SYNOPSIS -------- [verse] 'nvme list-ctrl' [--cntid= | -c ] - [--namespace-id= | -n ] [-o | --output-format=] + [--namespace-id= | -n ] + [--output-format= | -o ] [--verbose | -v] + DESCRIPTION ----------- For the NVMe device given, sends an identify command for controller list @@ -37,10 +39,14 @@ OPTIONS command requests the controller list for the entire subsystem, whether or not they are attached to namespace(s). --o :: ---output-format=:: - Set the reporting format to 'normal' or 'json'. Only one output - format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-list-endgrp.1 b/Documentation/nvme-list-endgrp.1 index be623ae..1d62e03 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LIST\-ENDGRP" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-LIST\-ENDGRP" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,7 +33,7 @@ nvme-list-endgrp \- Send NVMe Identify Endurance Group List, return result and s .sp .nf \fInvme list\-endgrp\fR [\-\-endgrp\-id= | \-i ] - [\-o | \-\-output\-format=] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -47,12 +47,18 @@ The parameter is mandatory and may be either the NVMe character device Retrieve the identify endurance group list structure starting for the given endurance group id\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to -\fInormal\fR +\fInormal\fR, +\fIjson\fR or -\fIjson\fR\&. Only one output format can be used at a time\&. +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. .RE .SH "EXAMPLES" .sp diff --git a/Documentation/nvme-list-endgrp.html b/Documentation/nvme-list-endgrp.html index caa86f8..97db7ae 100644 --- a/Documentation/nvme-list-endgrp.html +++ b/Documentation/nvme-list-endgrp.html @@ -750,7 +750,7 @@ nvme-list-endgrp(1) Manual Page
nvme list-endgrp <device> [--endgrp-id=<endgrp-id> | -i <endgrp-id>]
-                        [-o <fmt> | --output-format=<fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -779,20 +779,31 @@ than or equal to the value specified in the CDW11.ENDGID field.

- Retrieve the identify endurance group list structure starting for the given - endurance group id. + Retrieve the identify endurance group list structure starting for the + given endurance group id.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal or json. Only one output - format can be used at a time. + 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.

@@ -815,7 +826,7 @@ than or equal to the value specified in the CDW11.ENDGID field.

diff --git a/Documentation/nvme-list-endgrp.txt b/Documentation/nvme-list-endgrp.txt index 157dca9..2d7724d 100644 --- a/Documentation/nvme-list-endgrp.txt +++ b/Documentation/nvme-list-endgrp.txt @@ -3,14 +3,15 @@ nvme-list-endgrp(1) NAME ---- -nvme-list-endgrp - Send NVMe Identify Endurance Group List, return result and structure +nvme-list-endgrp - Send NVMe Identify Endurance Group List, return result and +structure SYNOPSIS -------- [verse] 'nvme list-endgrp' [--endgrp-id= | -i ] - [-o | --output-format=] - + [--output-format= | -o ] [--verbose | -v] + DESCRIPTION ----------- For the NVMe device given, sends an identify command for endurance group list @@ -26,13 +27,17 @@ OPTIONS ------- -i :: --endgrp-id=:: - Retrieve the identify endurance group list structure starting for the given - endurance group id. + Retrieve the identify endurance group list structure starting for the + given endurance group id. --o :: ---output-format=:: - Set the reporting format to 'normal' or 'json'. Only one output - format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-list-ns.1 b/Documentation/nvme-list-ns.1 index da5f1cc..ebb3800 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-NS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-NS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,7 +34,8 @@ nvme-list-ns \- Send NVMe Identify List Namespaces, return result and structure .nf \fInvme list\-ns\fR [\-\-namespace\-id= | \-n ] [\-\-csi= | \-y ] - [\-\-all | \-a] [\-\-output\-format= | \-o ] + [\-\-all | \-a] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -60,11 +61,18 @@ If this value is given, retrieve the identify list structure associated with the Retrieve the identify list structure for all namespaces in the subsystem, whether attached or inactive\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to -\fInormal\fR, or -\fIjson\fR\&. Only one output format can be used at a time\&. +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. .RE .SH "EXAMPLES" .sp diff --git a/Documentation/nvme-list-ns.html b/Documentation/nvme-list-ns.html index b679420..d73ee5e 100644 --- a/Documentation/nvme-list-ns.html +++ b/Documentation/nvme-list-ns.html @@ -751,7 +751,8 @@ nvme-id-ns(1) Manual Page
nvme list-ns <device> [--namespace-id=<nsid> | -n <nsid>]
                         [--csi=<command_set_identifier> | -y <command_set_identifier>]
-                        [--all | -a] [--output-format=<fmt> | -o <fmt>]
+ [--all | -a] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -809,15 +810,26 @@ a valid nsid.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, or json. - Only one output format can be used at a time. + 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.

@@ -859,7 +871,7 @@ Print the namespaces present for NVM Command Set in normal format diff --git a/Documentation/nvme-list-ns.txt b/Documentation/nvme-list-ns.txt index 753a959..d241287 100644 --- a/Documentation/nvme-list-ns.txt +++ b/Documentation/nvme-list-ns.txt @@ -10,7 +10,8 @@ SYNOPSIS [verse] 'nvme list-ns' [--namespace-id= | -n ] [--csi= | -y ] - [--all | -a] [--output-format= | -o ] + [--all | -a] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -41,10 +42,14 @@ OPTIONS Retrieve the identify list structure for all namespaces in the subsystem, whether attached or inactive. --o :: ---output-format=:: - Set the reporting format to 'normal', or 'json'. - Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-list-secondary.txt b/Documentation/nvme-list-secondary.txt new file mode 100755 index 0000000..88fbf42 --- /dev/null +++ b/Documentation/nvme-list-secondary.txt @@ -0,0 +1,54 @@ +nvme-list-secondary(1) +====================== + +NAME +---- +nvme-list-secondary - Show secondary controller list associated with the primary +controller of the given device + +SYNOPSIS +-------- +[verse] +'nvme list-secondary' [--cntid= | -c ] + [--num-entries= | -e ] + [--output-format= | -o ] [--verbose | -v] + +DESCRIPTION +----------- +Show secondary controller list associated with the primary of the given device + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1). + +On success, the secondary controller list is printed. + +OPTIONS +------- +-c :: +--cntid=:: + Lowest controller identifier to display. + +-e :: +--num-entries=:: + Number of entries to retrieve. + +-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 +-------- +* Has the program issue a list-secondary to display list. ++ +------------ +# nvme list-secondary /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-list-subsys.1 b/Documentation/nvme-list-subsys.1 index 225740e..d81d35a 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LIST\-SUBSYS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-LIST\-SUBSYS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,19 +32,25 @@ nvme-list-subsys \- List all NVMe subsystems .SH "SYNOPSIS" .sp .nf -\fInvme list\-subsys\fR [\-o | \-\-output\-format=] +\fInvme list\-subsys\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp Scan the sysfs tree for NVM Express subsystems and return the controllers for those subsystems as well as some pertinent information about them\&. If a device is given, print out only the values for the controllers and subsystems leading to the device\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to -\fInormal\fR +\fInormal\fR, +\fIjson\fR or -\fIjson\fR\&. Only one output format can be used at a time\&. +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. .RE .SH "EXAMPLES" .sp diff --git a/Documentation/nvme-list-subsys.html b/Documentation/nvme-list-subsys.html index 9e0fbec..289e515 100644 --- a/Documentation/nvme-list-subsys.html +++ b/Documentation/nvme-list-subsys.html @@ -749,7 +749,7 @@ nvme-list-subsys(1) Manual Page

SYNOPSIS

-
nvme list-subsys [-o <fmt> | --output-format=<fmt>] <device>
+
nvme list-subsys <device> [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -768,15 +768,26 @@ and subsystems leading to the device.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal or json. Only one output - format can be used at a time. + 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.

@@ -854,7 +865,7 @@ nvme-subsys1 - NQN=nvmf-test2 diff --git a/Documentation/nvme-list-subsys.txt b/Documentation/nvme-list-subsys.txt index 6650bbe..a5d2d48 100644 --- a/Documentation/nvme-list-subsys.txt +++ b/Documentation/nvme-list-subsys.txt @@ -8,7 +8,7 @@ nvme-list-subsys - List all NVMe subsystems SYNOPSIS -------- [verse] -'nvme list-subsys' [-o | --output-format=] +'nvme list-subsys' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -19,10 +19,14 @@ and subsystems leading to the device. OPTIONS ------- --o :: ---output-format=:: - Set the reporting format to 'normal' or 'json'. Only one output - format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-list.1 b/Documentation/nvme-list.1 index 463cf78..63f2de7 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LIST" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-LIST" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,19 +32,20 @@ nvme-list \- List all recognized NVMe devices .SH "SYNOPSIS" .sp .nf -\fInvme list\fR [\-o | \-\-output\-format=] +\fInvme list\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp Scan the sysfs tree for NVM Express devices and return the /dev node for those devices as well as some pertinent information about them\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to -\fInormal\fR +\fInormal\fR, +\fIjson\fR or -\fIjson\fR\&. Only one output format can be used at a time\&. +\fIbinary\fR\&. Only one output format can be used at a time\&. .RE .PP \-v, \-\-verbose diff --git a/Documentation/nvme-list.html b/Documentation/nvme-list.html index cfa91f3..9d09113 100644 --- a/Documentation/nvme-list.html +++ b/Documentation/nvme-list.html @@ -749,7 +749,7 @@ nvme-list(1) Manual Page

SYNOPSIS

-
nvme list [-o <fmt> | --output-format=<fmt>]
+
nvme list [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -766,15 +766,15 @@ for those devices as well as some pertinent information about them.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal or json. Only one output - format can be used at a time. + Set the reporting format to normal, json or binary. Only one + output format can be used at a time.

@@ -816,7 +816,7 @@ for those devices as well as some pertinent information about them.

diff --git a/Documentation/nvme-list.txt b/Documentation/nvme-list.txt index 7cc333b..a8c5428 100644 --- a/Documentation/nvme-list.txt +++ b/Documentation/nvme-list.txt @@ -8,7 +8,7 @@ nvme-list - List all recognized NVMe devices SYNOPSIS -------- [verse] -'nvme list' [-o | --output-format=] +'nvme list' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -17,10 +17,10 @@ for those devices as well as some pertinent information about them. OPTIONS ------- --o :: ---output-format=:: - Set the reporting format to 'normal' or 'json'. Only one output - format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json' or 'binary'. Only one + output format can be used at a time. -v:: --verbose:: @@ -32,7 +32,6 @@ ENVIRONMENT ----------- PCI_IDS_PATH - Full path of pci.ids file in case nvme could not find it in common locations. - EXAMPLES -------- No examples yet. diff --git a/Documentation/nvme-lockdown.1 b/Documentation/nvme-lockdown.1 index cd38210..8779819 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-LOCKDOWN" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-LOCKDOWN" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,41 +32,56 @@ nvme-lockdown \- Send an NVMe Lockdown command to prohibit or allow the executio .SH "SYNOPSIS" .sp .nf -\fInvme\-lockdown\fR [\-\-ofi= | \-o ] +\fInvme\-lockdown\fR [\-\-ofi= | \-O ] [\-\-ifc= | \-f ] [\-\-prhbt= | \-p ] [\-\-scp= | \-s ] [\-\-uuid= | \-U ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp The Lockdown command is used to control the Command and Feature Lockdown capability which configures the prohibition or allowance of execution of the specified command or Set Features command targeting a specific Feature Identifier\&. .SH "OPTIONS" .PP -\-\-ofi=, \-o +\-O , \-\-ofi= .RS 4 Opcode or Feature Identifier(OFI) specifies the command opcode or Set Features Feature Identifier identified by the Scope field\&. .RE .PP -\-\-ifc=, \-f +\-f , \-\-ifc= .RS 4 Interface (INF) field identifies the interfaces affected by this command\&. .RE .PP -\-\-prhbt=, \-p +\-p , \-\-prhbt= .RS 4 Prohibit (PRHBT) bit specifies whether to prohibit or allow the command opcode or Set Features Feature Identifier specified by this command\&. .RE .PP -\-\-scp=, \-s +\-s , \-\-scp= .RS 4 Scope (SCP) field specifies the contents of the Opcode or Feature Identifier field\&. .RE .PP -\-\-uuid=, \-U +\-U , \-\-uuid= .RS 4 UUID Index \- If this field is set to a non\-zero value, then the value of this field is the index of a UUID in the UUID List that is used by the command\&. If this field is cleared to 0h,then no UUID index is specified\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-lockdown.html b/Documentation/nvme-lockdown.html index 7c75f20..06b7967 100644 --- a/Documentation/nvme-lockdown.html +++ b/Documentation/nvme-lockdown.html @@ -749,11 +749,12 @@ nvme-lockdown(1) Manual Page

SYNOPSIS

-
nvme-lockdown <device> [--ofi=<ofi> | -o <ofi>]
+
nvme-lockdown <device> [--ofi=<ofi> | -O <ofi>]
                         [--ifc=<ifc> | -f <ifc>]
                         [--prhbt=<prhbt> | -p <prhbt>]
                         [--scp=<scp> | -s <scp>]
-                        [--uuid=<UUID_Index> | -U <UUID_Index>]
+ [--uuid=<UUID_Index> | -U <UUID_Index>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -772,10 +773,10 @@ Identifier.

---ofi=<ofi> +-O <ofi>
--o <ofi> +--ofi=<ofi>

@@ -784,10 +785,10 @@ Identifier.

---ifc=<ifc> +-f <ifc>
--f <ifc> +--ifc=<ifc>

@@ -795,10 +796,10 @@ Identifier.

---prhbt=<prhbt> +-p <prhbt>
--p <prhbt> +--prhbt=<prhbt>

@@ -807,10 +808,10 @@ Identifier.

---scp=<scp> +-s <scp>
--s <scp> +--scp=<scp>

@@ -818,10 +819,10 @@ Identifier.

---uuid=<UUID_Index> +-U <UUID_Index>
--U <UUID_Index> +--uuid=<UUID_Index>

@@ -830,6 +831,29 @@ Identifier.

If this field is cleared to 0h,then no UUID index is specified.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -850,7 +874,7 @@ Identifier.

diff --git a/Documentation/nvme-lockdown.txt b/Documentation/nvme-lockdown.txt index cf8a48f..e17ac70 100644 --- a/Documentation/nvme-lockdown.txt +++ b/Documentation/nvme-lockdown.txt @@ -8,11 +8,12 @@ nvme-lockdown - Send an NVMe Lockdown command to prohibit or allow the execution SYNOPSIS -------- [verse] -'nvme-lockdown' [--ofi= | -o ] +'nvme-lockdown' [--ofi= | -O ] [--ifc= | -f ] [--prhbt= | -p ] [--scp= | -s ] [--uuid= | -U ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -23,34 +24,42 @@ Identifier. OPTIONS ------- +-O :: --ofi=:: --o :: Opcode or Feature Identifier(OFI) specifies the command opcode or Set Features Feature Identifier identified by the Scope field. ---ifc=:: -f :: +--ifc=:: Interface (INF) field identifies the interfaces affected by this command. ---prhbt=:: -p :: +--prhbt=:: Prohibit (PRHBT) bit specifies whether to prohibit or allow the command opcode or Set Features Feature Identifier specified by this command. ---scp=:: -s :: +--scp=:: Scope (SCP) field specifies the contents of the Opcode or Feature Identifier field. - ---uuid=:: -U :: +--uuid=:: UUID Index - If this field is set to a non-zero value, then the value of this field is the index of a UUID in the UUID List that is used by the command. If this field is cleared to 0h,then no UUID index is specified. +-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 -------- No examples yet. NVME ---- -Part of the nvme-user suite \ No newline at end of file +Part of the nvme-user suite diff --git a/Documentation/nvme-media-unit-stat-log.txt b/Documentation/nvme-media-unit-stat-log.txt index 427b77c..997a497 100644 --- a/Documentation/nvme-media-unit-stat-log.txt +++ b/Documentation/nvme-media-unit-stat-log.txt @@ -9,9 +9,8 @@ request, returns result and log. SYNOPSIS -------- [verse] -'nvme media-unit-stat-log' [--dom-id | -d ] - [--output-format= | -o ] - [--raw-binary | -b] +'nvme media-unit-stat-log' [--dom-id | -d] [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -26,17 +25,18 @@ On success, the returned Media unit status log pages log structure will be print OPTIONS ------- --o :: ---output-format=:: - This option will set the reporting format to normal, json, or binary. - Only one output format can be used at a time. +-o :: +--output-format=:: + This option will set the reporting format to normal, json, or binary. + Only one output format can be used at a time. -d:: --dom-id:: - To get the domain ID. + To get the domain ID. + -b:: --raw-binary:: - To show raw binary data. + To show raw binary data. EXAMPLES -------- diff --git a/Documentation/nvme-mi-cmd-support-effects-log.1 b/Documentation/nvme-mi-cmd-support-effects-log.1 index a47a7eb..7163a17 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MI\-CMD\-SUPPO" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-MI\-CMD\-SUPPO" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,8 +32,8 @@ nvme-mi-cmd-support-effects-log \- Send NVMe MI Command Support and Effects log, .SH "SYNOPSIS" .sp .nf -\fInvme\-mi\-cmd\-support\-effects\-log\fR [\-o | \-\-output\-format=] - [\-H | \-\-human\-readable] +\fInvme\-mi\-cmd\-support\-effects\-log\fR [\-\-human\-readable | \-H] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -44,18 +44,24 @@ The parameter is mandatory and may be either the NVMe character device On success, the structure may be returned in one of several ways depending on the option flags; the structure may be parsed by the program or the raw buffer may be printed to stdout\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= -.RS 4 -Set the reporting format to -\fInormal\fR, -\fIjson\fR, or -\fIbinary\fR\&. Only one output format can be used at a time\&. -.RE -.PP \-H, \-\-human\-readable .RS 4 This option will parse and format many of the bit fields into human\-readable formats\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp nvme mi\-cmd\-support\-effects\-log /dev/nvme0 \-H diff --git a/Documentation/nvme-mi-cmd-support-effects-log.html b/Documentation/nvme-mi-cmd-support-effects-log.html index 38ff067..f923ad0 100644 --- a/Documentation/nvme-mi-cmd-support-effects-log.html +++ b/Documentation/nvme-mi-cmd-support-effects-log.html @@ -740,7 +740,7 @@ nvme-mi-cmd-support-effects-log(1) Manual Page

NAME

nvme-mi-cmd-support-effects-log - - Send NVMe MI Command Support and Effects log, returns results and structure + Send NVMe MI Command Support and Effects log, returns results and structure

@@ -749,8 +749,8 @@ nvme-mi-cmd-support-effects-log(1) Manual Page

SYNOPSIS

-
nvme-mi-cmd-support-effects-log <device> [-o <fmt> | --output-format=<fmt>]
-                                        [-H | --human-readable]
+
nvme-mi-cmd-support-effects-log <device> [--human-readable | -H]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -772,18 +772,6 @@ raw buffer may be printed to stdout.

--o <format> -
-
---output-format=<format> -
-
-

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. -

-
-
-H
@@ -795,6 +783,29 @@ raw buffer may be printed to stdout.

into human-readable formats.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -815,7 +826,7 @@ raw buffer may be printed to stdout.

diff --git a/Documentation/nvme-mi-cmd-support-effects-log.txt b/Documentation/nvme-mi-cmd-support-effects-log.txt index 67b8355..2221804 100644 --- a/Documentation/nvme-mi-cmd-support-effects-log.txt +++ b/Documentation/nvme-mi-cmd-support-effects-log.txt @@ -4,13 +4,13 @@ nvme-mi-cmd-support-effects-log(1) NAME ---- nvme-mi-cmd-support-effects-log - Send NVMe MI Command Support and Effects log, - returns results and structure +returns results and structure SYNOPSIS -------- [verse] -'nvme-mi-cmd-support-effects-log' [-o | --output-format=] - [-H | --human-readable] +'nvme-mi-cmd-support-effects-log' [--human-readable | -H] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -26,16 +26,20 @@ raw buffer may be printed to stdout. OPTIONS ------- --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. - -H:: --human-readable:: This option will parse and format many of the bit fields into human-readable formats. +-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 -------- nvme mi-cmd-support-effects-log /dev/nvme0 -H diff --git a/Documentation/nvme-micron-clear-pcie-errors.1 b/Documentation/nvme-micron-clear-pcie-errors.1 index 326f37e..b4dc9ad 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-CLEAR\" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-CLEAR\" "1" "12/21/2023" "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 1b954df..e2218e2 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 df7d736..5d70916 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-INTERN" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-INTERN" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -36,7 +36,7 @@ nvme-micron-internal-log \- Retrieve Micron device\*(Aqs internal logs and save .fi .SH "DESCRIPTION" .sp -For the given NVMe device, sends the Micron vendor specific device commands to retrieve various logs (in binary format) and compresses them and saves into specified zip file\&. These vendor unique logs can be analyzed with Micron Technical support team for any device specific issues +For the given NVMe device, sends the Micron vendor specific device commands to retrieve various logs (in binary format) and compresses them and saves into specified zip file\&. These vendor unique logs can be analyzed with Micron Technical support team for any device specific issues\&. .sp The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&. .sp diff --git a/Documentation/nvme-micron-internal-log.html b/Documentation/nvme-micron-internal-log.html index de274c2..da3e119 100644 --- a/Documentation/nvme-micron-internal-log.html +++ b/Documentation/nvme-micron-internal-log.html @@ -757,15 +757,16 @@ nvme-micron-internal-log(1) Manual Page

DESCRIPTION

-

For the given NVMe device, sends the Micron vendor specific device commands to retrieve -various logs (in binary format) and compresses them and saves into specified zip file. -These vendor unique logs can be analyzed with Micron Technical support team for any device -specific issues

+

For the given NVMe device, sends the Micron vendor specific device commands to +retrieve various logs (in binary format) and compresses them and saves into +specified zip file. These vendor unique logs can be analyzed with Micron +Technical support team for any device specific issues.

The <device> parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

-

This will only work on Micron devices devices of model numbers 9200 and 54XX. Support -for new devices may be added subsequently. Results for any other device are undefined.

+

This will only work on Micron devices devices of model numbers 9200 and 54XX. +Support for new devices may be added subsequently. Results for any other device +are undefined.

@@ -813,7 +814,7 @@ Gets the logs from the device and saves to micron_logs.zip file diff --git a/Documentation/nvme-micron-internal-log.txt b/Documentation/nvme-micron-internal-log.txt index 37a50ad..b8e9228 100644 --- a/Documentation/nvme-micron-internal-log.txt +++ b/Documentation/nvme-micron-internal-log.txt @@ -3,7 +3,8 @@ nvme-micron-internal-log(1) NAME ---- -nvme-micron-internal-log - Retrieve Micron device's internal logs and save to given zip file. +nvme-micron-internal-log - Retrieve Micron device's internal logs and save to +given zip file. SYNOPSIS -------- @@ -12,23 +13,24 @@ SYNOPSIS DESCRIPTION ----------- -For the given NVMe device, sends the Micron vendor specific device commands to retrieve -various logs (in binary format) and compresses them and saves into specified zip file. -These vendor unique logs can be analyzed with Micron Technical support team for any device -specific issues +For the given NVMe device, sends the Micron vendor specific device commands to +retrieve various logs (in binary format) and compresses them and saves into +specified zip file. These vendor unique logs can be analyzed with Micron +Technical support team for any device specific issues. The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). -This will only work on Micron devices devices of model numbers 9200 and 54XX. Support -for new devices may be added subsequently. Results for any other device are undefined. +This will only work on Micron devices devices of model numbers 9200 and 54XX. +Support for new devices may be added subsequently. Results for any other device +are undefined. OPTIONS ------- -l :: --package=:: - name of the file (with .zip extension) to save the device logs + name of the file (with .zip extension) to save the device logs EXAMPLES -------- diff --git a/Documentation/nvme-micron-nand-stats.1 b/Documentation/nvme-micron-nand-stats.1 index 02f4764..b5e2711 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-NAND\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-NAND\-" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-micron-nand-stats.html b/Documentation/nvme-micron-nand-stats.html index c3279b8..5a0bcdd 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 f99df4a..ba2c81c 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-PCIE\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-PCIE\-" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-micron-pcie-stats.html b/Documentation/nvme-micron-pcie-stats.html index 4c64010..dfcfcfd 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 99a364d..77d8e99 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-SELECT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-SELECT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,19 +28,20 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -nvme-micron-selective-download \- Performs selective firmware download that allows user to select which firmware binary to update for 9200 devices\&. This requires power cycle once the update completes\&. +nvme-micron-selective-download \- Performs selective firmware download that allows user select which firmware binary to update for 9200 devices\&. This requires power cycle the update completes\&. .SH "SYNOPSIS" .sp .nf -\fInvme micron selective\-download\fR [\-\-fw=, \-f ] [\-\-select=, \-s ] +\fInvme micron selective\-download\fR [\-\-fw=, \-f ] + [\-\-select=, \-s ] .fi .SH "DESCRIPTION" .sp -This command uses micron vendor specific nvme commands to download given firmware image to the specified 9200 device to update selected or all portions of firmware image\&. +This command uses micron vendor specific nvme commands to download given firmware image to the 9200 device to update selected or all portions of firmware image\&. .sp The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&. .sp -This will only work on Micron devices devices of model number 9200\&. Support for new devices may be added subsequently\&. Results for any other device are undefined\&. +This will only work on Micron devices devices of model number 9200\&. Support for new devices be added subsequently\&. Results for any other device are undefined\&. .SH "OPTIONS" .PP \-f , \-\-fw= diff --git a/Documentation/nvme-micron-selective-download.html b/Documentation/nvme-micron-selective-download.html index da0910e..0ae4c13 100644 --- a/Documentation/nvme-micron-selective-download.html +++ b/Documentation/nvme-micron-selective-download.html @@ -740,7 +740,7 @@ nvme-micron-selective-download(1) Manual Page

NAME

nvme-micron-selective-download - - Performs selective firmware download that allows user to select which firmware binary to update for 9200 devices. This requires power cycle once the update completes. + Performs selective firmware download that allows user select which firmware binary to update for 9200 devices. This requires power cycle the update completes.

@@ -749,7 +749,8 @@ nvme-micron-selective-download(1) Manual Page

SYNOPSIS

-
nvme micron selective-download <device> [--fw=<FILE>, -f <FILE>] [--select=<flag>, -s <flag>]
+
nvme micron selective-download <device> [--fw=<FILE>, -f <FILE>]
+                        [--select=<flag>, -s <flag>]
@@ -757,13 +758,14 @@ nvme-micron-selective-download(1) Manual Page

DESCRIPTION

-

This command uses micron vendor specific nvme commands to download given firmware image to the -specified 9200 device to update selected or all portions of firmware image.

+

This command uses micron vendor specific nvme commands to download given +firmware image to the 9200 device to update selected or all portions of firmware +image.

The <device> parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

-

This will only work on Micron devices devices of model number 9200. Support for new devices -may be added subsequently. Results for any other device are undefined.

+

This will only work on Micron devices devices of model number 9200. Support for +new devices be added subsequently. Results for any other device are undefined.

@@ -867,7 +869,7 @@ Update eeprom, OOB and main firmware diff --git a/Documentation/nvme-micron-selective-download.txt b/Documentation/nvme-micron-selective-download.txt index 5fb11d7..c20af74 100644 --- a/Documentation/nvme-micron-selective-download.txt +++ b/Documentation/nvme-micron-selective-download.txt @@ -3,38 +3,41 @@ nvme-micron-selective-download(1) NAME ---- -nvme-micron-selective-download - Performs selective firmware download that allows user -to select which firmware binary to update for 9200 devices. This requires power cycle -once the update completes. +nvme-micron-selective-download - Performs selective firmware download that +allows user select which firmware binary to update for 9200 devices. This +requires power cycle the update completes. SYNOPSIS -------- [verse] -'nvme micron selective-download' [--fw=, -f ] [--select=, -s ] +'nvme micron selective-download' [--fw=, -f ] + [--select=, -s ] DESCRIPTION ----------- -This command uses micron vendor specific nvme commands to download given firmware image to the -specified 9200 device to update selected or all portions of firmware image. +This command uses micron vendor specific nvme commands to download given +firmware image to the 9200 device to update selected or all portions of firmware +image. The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). -This will only work on Micron devices devices of model number 9200. Support for new devices -may be added subsequently. Results for any other device are undefined. +This will only work on Micron devices devices of model number 9200. Support for +new devices be added subsequently. Results for any other device are undefined. OPTIONS ------- -f :: --fw=:: - name of the firmware image file + name of the firmware image file + -s :: --select=:: - flag that has following values - OOB:: This updates the OOB and main firmware\n" - EEP:: This updates the eeprom and main firmware\n" - ALL:: This updates the eeprom, OOB, and main firmware"; + flag that has following values + OOB:: This updates the OOB and main firmware\n" + EEP:: This updates the eeprom and main firmware\n" + ALL:: This updates the eeprom, OOB, and main firmware"; EXAMPLES -------- @@ -42,7 +45,7 @@ EXAMPLES + ------------ # nvme micron selective-download /dev/nvme0 --fw=firmware_bin --select=OOB -# nvme micron selective-download /dev/nvme0 -f firmware_bin -s OOB +# nvme micron selective-download /dev/nvme0 -f firmware_bin -s OOB ------------ * Update OOB and main firmware diff --git a/Documentation/nvme-micron-smart-add-log.1 b/Documentation/nvme-micron-smart-add-log.1 index c514bed..c388df2 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-SMART\" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-SMART\" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,7 @@ nvme-micron-smart-add-log \- Retrieves NAND statistics (2200 model drives) or Ex .SH "SYNOPSIS" .sp .nf -\fInvme micron vs\-smart\-add\-log\fR \-f +\fInvme micron vs\-smart\-add\-log\fR \-f .fi .SH "DESCRIPTION" .sp @@ -44,8 +44,11 @@ The \fI\-f\fR option controls the displayed output data format based on the opti .sp This will only work on Micron devices devices of model numbers 54XX and OCP complaint controllers\&. Support for new devices may be added subsequently\&. .SH "OPTIONS" -.sp -\-f controls the format of displayed output\&. +.PP +\-f +.RS 4 +Controls the format of displayed output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-micron-smart-add-log.html b/Documentation/nvme-micron-smart-add-log.html index b4a9025..068edce 100644 --- a/Documentation/nvme-micron-smart-add-log.html +++ b/Documentation/nvme-micron-smart-add-log.html @@ -749,7 +749,7 @@ nvme-micron-smart-add-log(1) Manual Page

SYNOPSIS

-
nvme micron vs-smart-add-log <device>  -f <json|normal>
+
nvme micron vs-smart-add-log <device> -f <json|normal>
@@ -775,7 +775,16 @@ complaint controllers. Support for new devices may be added subsequently.

OPTIONS

-

-f <json|normal> controls the format of displayed output.

+
+
+-f <json|normal> +
+
+

+ Controls the format of displayed output. +

+
+
@@ -808,7 +817,7 @@ Retrieve NAND/extended SMART data and display in json format diff --git a/Documentation/nvme-micron-smart-add-log.txt b/Documentation/nvme-micron-smart-add-log.txt index 1fd74ba..13e0d96 100644 --- a/Documentation/nvme-micron-smart-add-log.txt +++ b/Documentation/nvme-micron-smart-add-log.txt @@ -9,7 +9,7 @@ or Extended SMART information (OCP complaint models) of given micron device SYNOPSIS -------- [verse] -'nvme micron vs-smart-add-log' -f +'nvme micron vs-smart-add-log' -f DESCRIPTION ----------- @@ -32,8 +32,8 @@ complaint controllers. Support for new devices may be added subsequently. OPTIONS ------- --f controls the format of displayed output. - +-f :: + Controls the format of displayed output. EXAMPLES -------- diff --git a/Documentation/nvme-micron-temperature-stats.1 b/Documentation/nvme-micron-temperature-stats.1 index 419f619..21eb5cf 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-MICRON\-TEMPER" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-MICRON\-TEMPER" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-micron-temperature-stats.html b/Documentation/nvme-micron-temperature-stats.html index 68f9f61..66d3149 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 233e183..507a554 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NETAPP\-ONTAPD" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-NETAPP\-ONTAPD" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,7 @@ nvme-netapp-ontapdevices \- Display information about ONTAP devices .SH "SYNOPSIS" .sp .nf -\fInvme netapp ontapdevices\fR [\-o | \-\-output\-format=] +\fInvme netapp ontapdevices\fR [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp diff --git a/Documentation/nvme-netapp-ontapdevices.html b/Documentation/nvme-netapp-ontapdevices.html index be92dc2..02d30ca 100644 --- a/Documentation/nvme-netapp-ontapdevices.html +++ b/Documentation/nvme-netapp-ontapdevices.html @@ -749,7 +749,7 @@ nvme-netapp-ontapdevices(1) Manual Page

SYNOPSIS

-
nvme netapp ontapdevices [-o <fmt> | --output-format=<fmt>]
+
nvme netapp ontapdevices [--output-format=<fmt> | -o <fmt>]
@@ -773,8 +773,8 @@ identified using the Identify Controller data.

- Set the reporting format to normal (default), column, or - json. Only one output format can be used at a time. + Set the reporting format to normal (default), column, or + json. Only one output format can be used at a time.

@@ -807,7 +807,7 @@ Display information, in a column-based format, for ONTAP devices. diff --git a/Documentation/nvme-netapp-ontapdevices.txt b/Documentation/nvme-netapp-ontapdevices.txt index c292758..fc28947 100644 --- a/Documentation/nvme-netapp-ontapdevices.txt +++ b/Documentation/nvme-netapp-ontapdevices.txt @@ -8,7 +8,7 @@ nvme-netapp-ontapdevices - Display information about ONTAP devices SYNOPSIS -------- [verse] -'nvme netapp ontapdevices' [-o | --output-format=] +'nvme netapp ontapdevices' [--output-format= | -o ] DESCRIPTION ----------- @@ -19,8 +19,8 @@ OPTIONS ------- -o :: --output-format=:: - Set the reporting format to 'normal' (default), 'column', or - 'json'. Only one output format can be used at a time. + Set the reporting format to 'normal' (default), 'column', or + 'json'. Only one output format can be used at a time. EXAMPLES -------- diff --git a/Documentation/nvme-netapp-smdevices.1 b/Documentation/nvme-netapp-smdevices.1 index a86c54d..017489e 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NETAPP\-SMDEVI" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-NETAPP\-SMDEVI" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,7 @@ nvme-netapp-smdevices \- Display information for each NVMe path to an E\-Series .SH "SYNOPSIS" .sp .nf -\fInvme netapp smdevices\fR [\-o | \-\-output\-format=] +\fInvme netapp smdevices\fR [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp diff --git a/Documentation/nvme-netapp-smdevices.html b/Documentation/nvme-netapp-smdevices.html index 8546e9d..39aac53 100644 --- a/Documentation/nvme-netapp-smdevices.html +++ b/Documentation/nvme-netapp-smdevices.html @@ -749,7 +749,7 @@ nvme-netapp-smdevices(1) Manual Page

SYNOPSIS

-
nvme netapp smdevices [-o <fmt> | --output-format=<fmt>]
+
nvme netapp smdevices [--output-format=<fmt> | -o <fmt>]
@@ -809,7 +809,7 @@ namespace. diff --git a/Documentation/nvme-netapp-smdevices.txt b/Documentation/nvme-netapp-smdevices.txt index b66b98d..cb68acf 100644 --- a/Documentation/nvme-netapp-smdevices.txt +++ b/Documentation/nvme-netapp-smdevices.txt @@ -8,7 +8,7 @@ nvme-netapp-smdevices - Display information for each NVMe path to an E-Series vo SYNOPSIS -------- [verse] -'nvme netapp smdevices' [-o | --output-format=] +'nvme netapp smdevices' [--output-format= | -o ] DESCRIPTION ----------- diff --git a/Documentation/nvme-ns-descs.1 b/Documentation/nvme-ns-descs.1 index 034669f..8a18840 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NS\-DESCS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-NS\-DESCS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,8 @@ nvme-ns-descs \- Send NVMe Identify for a list of Namespace Identification Descr .SH "SYNOPSIS" .sp .nf -\fInvme ns\-descs\fR [\-\-namespace\-id= | \-n ] - [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] +\fInvme ns\-descs\fR [\-\-namespace\-id= | \-n ] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -55,13 +54,19 @@ Retrieve the identify namespace identification descriptor structure for the give Print the raw buffer to stdout\&. Structure is not parsed by program\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-ns-descs.html b/Documentation/nvme-ns-descs.html index 8388846..19a5a29 100644 --- a/Documentation/nvme-ns-descs.html +++ b/Documentation/nvme-ns-descs.html @@ -749,9 +749,8 @@ nvme-ns-descs(1) Manual Page

SYNOPSIS

-
nvme ns-descs <device> [--namespace-id=<nsid> | -n <nsid>]
-                        [--raw-binary | -b]
-                        [--output-format=<fmt> | -o <fmt>]
+
nvme ns-descs <device> [--namespace-id=<nsid> | -n <nsid>] [--raw-binary | -b]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -803,15 +802,26 @@ raw buffer may be printed to stdout.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or binary. - Only one output format can be used at a time. + 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.

@@ -857,7 +867,7 @@ Have the program return the raw structure in binary: diff --git a/Documentation/nvme-ns-descs.txt b/Documentation/nvme-ns-descs.txt index 8afeba5..04c6e51 100644 --- a/Documentation/nvme-ns-descs.txt +++ b/Documentation/nvme-ns-descs.txt @@ -9,9 +9,8 @@ nvme-ns-descs - Send NVMe Identify for a list of Namespace Identification SYNOPSIS -------- [verse] -'nvme ns-descs' [--namespace-id= | -n ] - [--raw-binary | -b] - [--output-format= | -o ] +'nvme ns-descs' [--namespace-id= | -n ] [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -43,11 +42,14 @@ OPTIONS Print the raw buffer to stdout. Structure is not parsed by program. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or 'binary'. - Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-ns-rescan.1 b/Documentation/nvme-ns-rescan.1 index 35b5285..866fe49 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NS\-RESCAN" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-NS\-RESCAN" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,14 +32,26 @@ nvme-ns-rescan \- Rescans the nvme namespaces\&. .SH "SYNOPSIS" .sp .nf -\fInvme ns\-rescan\fR +\fInvme ns\-rescan\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp Requests NVMe controller rescans the namespaces\&. The param is mandatory and must be an NVMe character device (ex: /dev/nvme0)\&. .SH "OPTIONS" -.sp -None +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-ns-rescan.html b/Documentation/nvme-ns-rescan.html index 0386119..a640801 100644 --- a/Documentation/nvme-ns-rescan.html +++ b/Documentation/nvme-ns-rescan.html @@ -749,7 +749,7 @@ nvme-ns-rescan(1) Manual Page

SYNOPSIS

-
nvme ns-rescan <device>
+
nvme ns-rescan <device> [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -764,7 +764,31 @@ be an NVMe character device (ex: /dev/nvme0).

OPTIONS

-

None

+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
+
@@ -794,7 +818,7 @@ Rescans the nvme namespaces. diff --git a/Documentation/nvme-ns-rescan.txt b/Documentation/nvme-ns-rescan.txt index cd41870..5681eab 100644 --- a/Documentation/nvme-ns-rescan.txt +++ b/Documentation/nvme-ns-rescan.txt @@ -8,7 +8,7 @@ nvme-ns-rescan - Rescans the nvme namespaces. SYNOPSIS -------- [verse] -'nvme ns-rescan' +'nvme ns-rescan' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -17,7 +17,14 @@ be an NVMe character device (ex: /dev/nvme0). OPTIONS ------- -None +-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 -------- diff --git a/Documentation/nvme-nvm-id-ctrl.1 b/Documentation/nvme-nvm-id-ctrl.1 index 83cc4fe..e168328 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NVM\-ID\-CTRL" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-NVM\-ID\-CTRL" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,7 @@ nvme-nvm-id-ctrl \- Send NVMe Identify Controller, return NVM command set struct .SH "SYNOPSIS" .sp .nf -\fInvme nvm\-id\-ctrl\fR [\-o | \-\-output\-format=] +\fInvme nvm\-id\-ctrl\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -43,13 +43,19 @@ The parameter is mandatory and may be either the NVMe character device On success, the data structure returned by the device will be decoded and displayed in one of several ways\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-nvm-id-ctrl.html b/Documentation/nvme-nvm-id-ctrl.html index 8acedc2..04438bd 100644 --- a/Documentation/nvme-nvm-id-ctrl.html +++ b/Documentation/nvme-nvm-id-ctrl.html @@ -749,7 +749,7 @@ nvme-nvm-id-ctrl(1) Manual Page

SYNOPSIS

-
nvme nvm-id-ctrl <device> [-o <fmt> | --output-format=<fmt>]
+
nvme nvm-id-ctrl <device> [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -770,15 +770,26 @@ displayed in one of several ways.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -821,7 +832,7 @@ Show the output in json format diff --git a/Documentation/nvme-nvm-id-ctrl.txt b/Documentation/nvme-nvm-id-ctrl.txt index fb4a237..eabc4b1 100644 --- a/Documentation/nvme-nvm-id-ctrl.txt +++ b/Documentation/nvme-nvm-id-ctrl.txt @@ -8,7 +8,7 @@ nvme-nvm-id-ctrl - Send NVMe Identify Controller, return NVM command set structu SYNOPSIS -------- [verse] -'nvme nvm-id-ctrl' [-o | --output-format=] +'nvme nvm-id-ctrl' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -23,10 +23,14 @@ displayed in one of several ways. OPTIONS ------- --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-nvm-id-ns-lba-format.txt b/Documentation/nvme-nvm-id-ns-lba-format.txt index 638e2fb..1048995 100644 --- a/Documentation/nvme-nvm-id-ns-lba-format.txt +++ b/Documentation/nvme-nvm-id-ns-lba-format.txt @@ -11,8 +11,7 @@ SYNOPSIS [verse] 'nvme nvm-id-ns-lba-format' [--uuid-index= | -U ] [--lba-format-index= | -i ] - [-v | --verbose] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -37,15 +36,15 @@ OPTIONS This field specifies the index into the LBA Format list identifying the LBA Format capabilities that are to be returned +-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. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. - EXAMPLES -------- * Has the program interpret the returned buffer and display the known diff --git a/Documentation/nvme-nvm-id-ns.txt b/Documentation/nvme-nvm-id-ns.txt index dfbbfaa..5a8cb09 100644 --- a/Documentation/nvme-nvm-id-ns.txt +++ b/Documentation/nvme-nvm-id-ns.txt @@ -10,8 +10,7 @@ SYNOPSIS [verse] 'nvme nvm-id-ns' [--uuid-index= | -U ] [--namespace-id= | -n ] - [-v | --verbose] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -37,15 +36,15 @@ OPTIONS --uuid-index=:: UUID Index of the feature +-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. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. - EXAMPLES -------- * Has the program interpret the returned buffer and display the known diff --git a/Documentation/nvme-nvme-mi-recv.1 b/Documentation/nvme-nvme-mi-recv.1 index ffa43c7..0926527 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NVME\-MI\-RECV" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-NVME\-MI\-RECV" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,13 +32,13 @@ nvme-nvme-mi-recv \- Send a NVMe\-MI Receive command to the specified device .SH "SYNOPSIS" .sp .nf -\fInvme nvme\-mi\-recv\fR [\-\-opcode= | \-o ] - [\-\-namespace\-id=] - [\-\-data\-len= | \-l ] - [\-\-nmimt= | \-m ] - [\-\-nmd0= | \-0 ] - [\-\-nmd1= | \-1 ] - [\-\-input\-file= | \-i ] +\fInvme nvme\-mi\-recv\fR [\-\-opcode= | \-O ] + [\-\-namespace\-id= | \-n ] + [\-\-data\-len= | \-l ] + [\-\-nmimt= | \-m ] + [\-\-nmd0= | \-0 ] [\-\-nmd1= | \-1 ] + [\-\-input\-file= | \-i ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -49,7 +49,7 @@ The parameter is mandatory and may be either the NVMe character device On success it returns 0, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-opcode= +\-O , \-\-opcode= .RS 4 The NVMe\-MI opcode to send to the device in the command .RE @@ -83,6 +83,20 @@ The value for the NVMe management request dword 1 in the command\&. .RS 4 If the command is a data\-out (write) command, use this file to fill the buffer sent to the device\&. If no file is given, assumed to use STDIN\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 @@ -99,7 +113,7 @@ Has the program issue a nvme\-mi\-recv to execute the VPD read\&. .RS 4 .\} .nf -# nvme nvme\-mi\-recv /dev/nvme0n1 \-o 5 \-m 1 \-0 0 \-1 0x100 \-l 256 +# nvme nvme\-mi\-recv /dev/nvme0n1 \-O 5 \-m 1 \-0 0 \-1 0x100 \-l 256 .fi .if n \{\ .RE diff --git a/Documentation/nvme-nvme-mi-recv.html b/Documentation/nvme-nvme-mi-recv.html index 800d716..b3e44f9 100644 --- a/Documentation/nvme-nvme-mi-recv.html +++ b/Documentation/nvme-nvme-mi-recv.html @@ -749,13 +749,13 @@ nvme-nvme-mi-recv(1) Manual Page

SYNOPSIS

-
nvme nvme-mi-recv <device> [--opcode=<opcode> | -o <opcode>]
-                             [--namespace-id=<nsid>]
-                             [--data-len=<data-len> | -l <data-len>]
-                             [--nmimt=<nmimt> | -m <nmimt>]
-                             [--nmd0=<nmd0> | -0 <nmd0>]
-                             [--nmd1=<nmd1> | -1 <nmd1>]
-                             [--input-file=<file> | -i <file>]
+
nvme nvme-mi-recv <device> [--opcode=<opcode> | -O <opcode>]
+                        [--namespace-id=<nsid> | -n <nsid>]
+                        [--data-len=<data-len> | -l <data-len>]
+                        [--nmimt=<nmimt> | -m <nmimt>]
+                        [--nmd0=<nmd0> | -0 <nmd0>] [--nmd1=<nmd1> | -1 <nmd1>]
+                        [--input-file=<file> | -i <file>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -774,7 +774,7 @@ device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1).

--o <opcode> +-O <opcode>
--opcode=<opcode> @@ -852,6 +852,29 @@ device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1).

assumed to use STDIN.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -865,7 +888,7 @@ Has the program issue a nvme-mi-recv to execute the VPD read.

-
# nvme nvme-mi-recv /dev/nvme0n1 -o 5 -m 1 -0 0 -1 0x100 -l 256
+
# nvme nvme-mi-recv /dev/nvme0n1 -O 5 -m 1 -0 0 -1 0x100 -l 256
@@ -882,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 100644 new mode 100755 index e5130ed..152bbe6 --- a/Documentation/nvme-nvme-mi-recv.txt +++ b/Documentation/nvme-nvme-mi-recv.txt @@ -8,13 +8,13 @@ nvme-nvme-mi-recv - Send a NVMe-MI Receive command to the specified device SYNOPSIS -------- [verse] -'nvme nvme-mi-recv' [--opcode= | -o ] - [--namespace-id=] - [--data-len= | -l ] - [--nmimt= | -m ] - [--nmd0= | -0 ] - [--nmd1= | -1 ] - [--input-file= | -i ] +'nvme nvme-mi-recv' [--opcode= | -O ] + [--namespace-id= | -n ] + [--data-len= | -l ] + [--nmimt= | -m ] + [--nmd0= | -0 ] [--nmd1= | -1 ] + [--input-file= | -i ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -27,7 +27,7 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: +-O :: --opcode=:: The NVMe-MI opcode to send to the device in the command @@ -57,12 +57,21 @@ OPTIONS to fill the buffer sent to the device. If no file is given, assumed to use STDIN. +-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 -------- * Has the program issue a nvme-mi-recv to execute the VPD read. + ------------ -# nvme nvme-mi-recv /dev/nvme0n1 -o 5 -m 1 -0 0 -1 0x100 -l 256 +# nvme nvme-mi-recv /dev/nvme0n1 -O 5 -m 1 -0 0 -1 0x100 -l 256 ------------ NVME diff --git a/Documentation/nvme-nvme-mi-send.1 b/Documentation/nvme-nvme-mi-send.1 index 9a7df99..7608df8 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-NVME\-MI\-SEND" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-NVME\-MI\-SEND" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,13 +32,13 @@ nvme-nvme-mi-send \- Send a NVMe\-MI Send command to the specified device .SH "SYNOPSIS" .sp .nf -\fInvme nvme\-mi\-send\fR [\-\-opcode= | \-o ] - [\-\-namespace\-id=] - [\-\-data\-len= | \-l ] - [\-\-nmimt= | \-m ] - [\-\-nmd0= | \-0 ] - [\-\-nmd1= | \-1 ] - [\-\-input\-file= | \-i ] +\fInvme nvme\-mi\-send\fR [\-\-opcode= | \-O ] + [\-\-namespace\-id= | \-n ] + [\-\-data\-len= | \-l ] + [\-\-nmimt= | \-m ] + [\-\-nmd0= | \-0 ] [\-\-nmd1= | \-1 ] + [\-\-input\-file= | \-i ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -49,7 +49,7 @@ The parameter is mandatory and may be either the NVMe character device On success it returns 0, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-opcode= +\-O , \-\-opcode= .RS 4 The NVMe\-MI opcode to send to the device in the command .RE @@ -83,6 +83,20 @@ The value for the NVMe management request dword 1 in the command\&. .RS 4 If the command is a data\-out (write) command, use this file to fill the buffer sent to the device\&. If no file is given, assumed to use STDIN\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 @@ -99,7 +113,7 @@ Has the program issue a nvme\-mi\-send to execute the VPD write\&. .RS 4 .\} .nf -# nvme nvme\-mi\-send /dev/nvme0n1 \-o 6 \-m 1 \-0 0 \-1 0x100 \-l 256 \-i vpd\&.bin +# nvme nvme\-mi\-send /dev/nvme0n1 \-O 6 \-m 1 \-0 0 \-1 0x100 \-l 256 \-i vpd\&.bin .fi .if n \{\ .RE diff --git a/Documentation/nvme-nvme-mi-send.html b/Documentation/nvme-nvme-mi-send.html index 09fb05e..203d938 100644 --- a/Documentation/nvme-nvme-mi-send.html +++ b/Documentation/nvme-nvme-mi-send.html @@ -749,13 +749,13 @@ nvme-nvme-mi-send(1) Manual Page

SYNOPSIS

-
nvme nvme-mi-send <device> [--opcode=<opcode> | -o <opcode>]
-                             [--namespace-id=<nsid>]
-                             [--data-len=<data-len> | -l <data-len>]
-                             [--nmimt=<nmimt> | -m <nmimt>]
-                             [--nmd0=<nmd0> | -0 <nmd0>]
-                             [--nmd1=<nmd1> | -1 <nmd1>]
-                             [--input-file=<file> | -i <file>]
+
nvme nvme-mi-send <device> [--opcode=<opcode> | -O <opcode>]
+                        [--namespace-id=<nsid> | -n <nsid>]
+                        [--data-len=<data-len> | -l <data-len>]
+                        [--nmimt=<nmimt> | -m <nmimt>]
+                        [--nmd0=<nmd0> | -0 <nmd0>] [--nmd1=<nmd1> | -1 <nmd1>]
+                        [--input-file=<file> | -i <file>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -774,7 +774,7 @@ device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1).

--o <opcode> +-O <opcode>
--opcode=<opcode> @@ -852,6 +852,29 @@ device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1).

assumed to use STDIN.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -865,7 +888,7 @@ Has the program issue a nvme-mi-send to execute the VPD write.

-
# nvme nvme-mi-send /dev/nvme0n1 -o 6 -m 1 -0 0 -1 0x100 -l 256 -i vpd.bin
+
# nvme nvme-mi-send /dev/nvme0n1 -O 6 -m 1 -0 0 -1 0x100 -l 256 -i vpd.bin
@@ -882,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 100644 new mode 100755 index 5139a86..0e80fe7 --- a/Documentation/nvme-nvme-mi-send.txt +++ b/Documentation/nvme-nvme-mi-send.txt @@ -8,13 +8,13 @@ nvme-nvme-mi-send - Send a NVMe-MI Send command to the specified device SYNOPSIS -------- [verse] -'nvme nvme-mi-send' [--opcode= | -o ] - [--namespace-id=] - [--data-len= | -l ] - [--nmimt= | -m ] - [--nmd0= | -0 ] - [--nmd1= | -1 ] - [--input-file= | -i ] +'nvme nvme-mi-send' [--opcode= | -O ] + [--namespace-id= | -n ] + [--data-len= | -l ] + [--nmimt= | -m ] + [--nmd0= | -0 ] [--nmd1= | -1 ] + [--input-file= | -i ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -27,7 +27,7 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: +-O :: --opcode=:: The NVMe-MI opcode to send to the device in the command @@ -57,12 +57,21 @@ OPTIONS to fill the buffer sent to the device. If no file is given, assumed to use STDIN. +-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 -------- * Has the program issue a nvme-mi-send to execute the VPD write. + ------------ -# nvme nvme-mi-send /dev/nvme0n1 -o 6 -m 1 -0 0 -1 0x100 -l 256 -i vpd.bin +# nvme nvme-mi-send /dev/nvme0n1 -O 6 -m 1 -0 0 -1 0x100 -l 256 -i vpd.bin ------------ NVME diff --git a/Documentation/nvme-ocp-clear-fw-activate-history.1 b/Documentation/nvme-ocp-clear-fw-activate-history.1 index 9d794bf..f0da3cd 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-OCP\-CLEAR\-FW" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-OCP\-CLEAR\-FW" "1" "12/21/2023" "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 8894de2..8eeea64 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-fw-activate-history.txt b/Documentation/nvme-ocp-clear-fw-activate-history.txt index 20ec724..335a228 100644 --- a/Documentation/nvme-ocp-clear-fw-activate-history.txt +++ b/Documentation/nvme-ocp-clear-fw-activate-history.txt @@ -34,7 +34,7 @@ OPTIONS -n:: --no-uuid:: Do not try to automatically detect UUID index for this command (required - for old OCP 1.0 support) + for old OCP 1.0 support) EXAMPLES -------- diff --git a/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.1 b/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.1 index 090fec2..749f58c 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-OCP\-CLEAR\-PC" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-OCP\-CLEAR\-PC" "1" "12/21/2023" "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 60a98dc..adec4fa 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-clear-pcie-correctable-error-counters.txt b/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.txt index 92cd148..3d5706d 100644 --- a/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.txt +++ b/Documentation/nvme-ocp-clear-pcie-correctable-error-counters.txt @@ -34,7 +34,7 @@ OPTIONS -n:: --no-uuid:: Do not try to automatically detect UUID index for this command (required - for old OCP 1.0 support) + for old OCP 1.0 support) EXAMPLES -------- diff --git a/Documentation/nvme-ocp-device-capability-log.txt b/Documentation/nvme-ocp-device-capability-log.txt index 7789531..d2f0761 100644 --- a/Documentation/nvme-ocp-device-capability-log.txt +++ b/Documentation/nvme-ocp-device-capability-log.txt @@ -24,8 +24,8 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal' or 'json' or 'binary'. Only one output format can be used at a time. The default is normal. diff --git a/Documentation/nvme-ocp-eol-plp-failure-mode.1 b/Documentation/nvme-ocp-eol-plp-failure-mode.1 index 87effa5..be65967 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-OCP\-EOL\-PLP\" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-OCP\-EOL\-PLP\" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,8 +32,9 @@ nvme-ocp-eol-plp-failure-mode \- Define and print EOL or PLP circuitry failure m .SH "SYNOPSIS" .sp .nf -\fInvme ocp eol\-plp\-failure\-mode\fR [\-\-mode= | \-m ] [\-\-no\-uuid | \-n] [\-\-save | \-s] - [\-\-sel=] +\fInvme ocp eol\-plp\-failure\-mode\fR [\-\-mode= | \-m ] + [\-\-no\-uuid | \-n] [\-\-save | \-s] + [\-\-sel=] .fi .SH "DESCRIPTION" .sp diff --git a/Documentation/nvme-ocp-eol-plp-failure-mode.html b/Documentation/nvme-ocp-eol-plp-failure-mode.html index ebc4436..8618b20 100644 --- a/Documentation/nvme-ocp-eol-plp-failure-mode.html +++ b/Documentation/nvme-ocp-eol-plp-failure-mode.html @@ -749,8 +749,9 @@ nvme-ocp-eol-plp-failure-mode(1) Manual Page

SYNOPSIS

-
nvme ocp eol-plp-failure-mode <device> [--mode=<mode> | -m <mode>] [--no-uuid | -n] [--save | -s]
-                                         [--sel=<select> | -s <select>]
+
nvme ocp eol-plp-failure-mode <device> [--mode=<mode> | -m <mode>]
+                        [--no-uuid | -n] [--save | -s]
+                        [--sel=<select> | -s <select>]
@@ -804,7 +805,8 @@ Results for any other device are undefined.

- Save the attribute so that it persists through all power states and resets. + Save the attribute so that it persists through all power states and + resets.

@@ -884,7 +886,7 @@ Has the program issue a eol-plp-failure-mode to retrieve the 0xC2 get features. diff --git a/Documentation/nvme-ocp-eol-plp-failure-mode.txt b/Documentation/nvme-ocp-eol-plp-failure-mode.txt index 9a47375..0ebc4ab 100644 --- a/Documentation/nvme-ocp-eol-plp-failure-mode.txt +++ b/Documentation/nvme-ocp-eol-plp-failure-mode.txt @@ -3,13 +3,15 @@ nvme-ocp-eol-plp-failure-mode(1) NAME ---- -nvme-ocp-eol-plp-failure-mode - Define and print EOL or PLP circuitry failure mode +nvme-ocp-eol-plp-failure-mode - Define and print EOL or PLP circuitry failure +mode SYNOPSIS -------- [verse] -'nvme ocp eol-plp-failure-mode' [--mode= | -m ] [--no-uuid | -n] [--save | -s] - [--sel=] +'nvme ocp eol-plp-failure-mode' [--mode= | -m ] + [--no-uuid | -n] [--save | -s] + [--sel=] DESCRIPTION ----------- @@ -29,17 +31,18 @@ OPTIONS -m :: --mode=:: Set the EOL or PLP circuitry failure mode to [0-3] ('0: default', - '1: rom', '2: wtm' or '3: normal'). Only one mode + '1: rom', '2: wtm' or '3: normal'). Only one mode can be used at a time. The default is rom. -n:: --no-uuid:: Do not try to automatically detect UUID index for this command (required - for old OCP 1.0 support) + for old OCP 1.0 support) -s:: --save:: - Save the attribute so that it persists through all power states and resets. + Save the attribute so that it persists through all power states and + resets. -s :: diff --git a/Documentation/nvme-ocp-error-recovery-log.txt b/Documentation/nvme-ocp-error-recovery-log.txt index 1ce9dd1..7a26150 100644 --- a/Documentation/nvme-ocp-error-recovery-log.txt +++ b/Documentation/nvme-ocp-error-recovery-log.txt @@ -24,8 +24,8 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal' or 'json' or 'binary'. Only one output format can be used at a time. The default is normal. diff --git a/Documentation/nvme-ocp-get-plp-health-check-interval.txt b/Documentation/nvme-ocp-get-plp-health-check-interval.txt new file mode 100644 index 0000000..7ecd5d5 --- /dev/null +++ b/Documentation/nvme-ocp-get-plp-health-check-interval.txt @@ -0,0 +1,54 @@ +nvme-ocp-get-plp-health-check-interval(1) +================================ + +NAME +---- +nvme-ocp-get-plp-health-check-interval - Define and print plp-health-check-interval value + +SYNOPSIS +-------- +[verse] +'nvme ocp get-plp-health-check-interval' [--sel=] + +DESCRIPTION +----------- +Define plp-health-check-interval. +No argument prints current mode. + +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-plp-health-check-interval to retrieve the 0xC6 get features. ++ +------------ +# nvme ocp get-plp-health-check-interval /dev/nvme0 +------------ + +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 3fc507d..10b9743 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-OCP\-LATENCY\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-OCP\-LATENCY\-" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -45,7 +45,7 @@ This will only work on OCP compliant devices supporting this log page\&. Results On success it returns 0, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR diff --git a/Documentation/nvme-ocp-latency-monitor-log.html b/Documentation/nvme-ocp-latency-monitor-log.html index 420a35f..a49acdb 100644 --- a/Documentation/nvme-ocp-latency-monitor-log.html +++ b/Documentation/nvme-ocp-latency-monitor-log.html @@ -770,10 +770,10 @@ Results for any other device are undefined.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -811,7 +811,7 @@ Displays the get latency monitor log for the device:

diff --git a/Documentation/nvme-ocp-latency-monitor-log.txt b/Documentation/nvme-ocp-latency-monitor-log.txt index 66f760c..a67c523 100644 --- a/Documentation/nvme-ocp-latency-monitor-log.txt +++ b/Documentation/nvme-ocp-latency-monitor-log.txt @@ -26,8 +26,8 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal' or 'json'. Only one output format can be used at a time. The default is normal. diff --git a/Documentation/nvme-ocp-set-dssd-power-state-feature.txt b/Documentation/nvme-ocp-set-dssd-power-state-feature.txt index 7dfe9ea..c9ae578 100644 --- a/Documentation/nvme-ocp-set-dssd-power-state-feature.txt +++ b/Documentation/nvme-ocp-set-dssd-power-state-feature.txt @@ -8,8 +8,9 @@ nvme-ocp-set-dssd-power-state-feature - Set DSSD Power State SYNOPSIS -------- [verse] -'nvme ocp set-dssd-power-state-feature' [--power-state= | -p ] [--no-uuid | -n] - [--save | -s] +'nvme ocp set-dssd-power-state-feature' + [--power-state= | -p ] [--no-uuid | -n] + [--save | -s] DESCRIPTION ----------- @@ -25,8 +26,8 @@ On success it returns 0, error code otherwise. OPTIONS ------- --p :: ---power-state=:: +-p :: +--power-state=:: DSSD Power State to set in watts. EXAMPLES diff --git a/Documentation/nvme-ocp-set-plp-health-check-interval.txt b/Documentation/nvme-ocp-set-plp-health-check-interval.txt new file mode 100644 index 0000000..ac3acb3 --- /dev/null +++ b/Documentation/nvme-ocp-set-plp-health-check-interval.txt @@ -0,0 +1,53 @@ +nvme-ocp-set-plp-health-check-interval(1) +================================ + +NAME +---- +nvme-ocp-set-plp-health-check-interval - Define and set PLP health check interval + +SYNOPSIS +-------- +[verse] +'nvme ocp set-plp-health-check-interval' [--plp_health_interval= | -p ] [--save | -s] [--no-uuid | -n] + + +DESCRIPTION +----------- +Define Set PLP health check interval. +No argument prints current mode. + +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 +------- +-p :: +--plp_health_interval=:: + Set the plp health check interval [31:16] + +-n:: +--no-uuid:: + Do not try to automatically detect UUID index for this command (required + for old OCP 1.0 support) + +-s:: +--save:: + Save the attribute so that it persists through all power states and resets. + + +EXAMPLES +-------- +* Has the program issue a set-plp-health-check-interval to retrieve the 0xC6 set features. ++ +------------ +# nvme ocp eol-plp-failure-mode /dev/nvme0 +------------ + +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 1cbdfb7..d433d84 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-OCP\-SMART\-AD" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-OCP\-SMART\-AD" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -45,7 +45,7 @@ This will only work on OCP compliant devices supporting this feature\&. Results On success it returns 0, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR diff --git a/Documentation/nvme-ocp-smart-add-log.html b/Documentation/nvme-ocp-smart-add-log.html index b41fd2c..4333149 100644 --- a/Documentation/nvme-ocp-smart-add-log.html +++ b/Documentation/nvme-ocp-smart-add-log.html @@ -771,10 +771,10 @@ Results for any other device are undefined.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -812,7 +812,7 @@ Has the program issue a smart-add-log command to retrieve the 0xC0 log page.

diff --git a/Documentation/nvme-ocp-smart-add-log.txt b/Documentation/nvme-ocp-smart-add-log.txt index 3a25822..66a55a9 100644 --- a/Documentation/nvme-ocp-smart-add-log.txt +++ b/Documentation/nvme-ocp-smart-add-log.txt @@ -26,8 +26,8 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal' or 'json'. Only one output format can be used at a time. The default is normal. diff --git a/Documentation/nvme-ocp-unsupported-reqs-log-pages.txt b/Documentation/nvme-ocp-telemetry-string-log-page.txt similarity index 51% copy from Documentation/nvme-ocp-unsupported-reqs-log-pages.txt copy to Documentation/nvme-ocp-telemetry-string-log-page.txt index 65818d3..76349ed 100644 --- a/Documentation/nvme-ocp-unsupported-reqs-log-pages.txt +++ b/Documentation/nvme-ocp-telemetry-string-log-page.txt @@ -1,20 +1,18 @@ -unsupported-reqs-log -==================== +nvme-ocp-telemetry-string-log-page(1) +===================================== NAME ---- -unsupported-reqs-log - Retrieves unsupported requirements log page of given OCP -compliant device +nvme-ocp-telemetry-string-log-page - Retrieve OCP Telemetry String Log page SYNOPSIS -------- [verse] -'nvme ocp unsupported-reqs-log' [--output-format= | -o ] +'nvme ocp telemetry-str-log' [--output-format= | -o ] DESCRIPTION ----------- -For the NVMe device given, send a unsupported-reqs-log command and -provide the unsupported requirements log page. +For the NVMe device given, Retrieve OCP Telemetry String Log page The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1). @@ -26,20 +24,20 @@ On success it returns 0, error code otherwise. OPTIONS ------- - --o :: ---output-format=:: +-o :: +--output-format=:: This option will set the reporting format to normal, json, or binary. Only one output format can be used at a time. + EXAMPLES -------- -* Has the program issue a unsupported-reqs-log command to retrieve the 0xC5 log page. +* Has the program issue a telemetry-string-log command to get the log page data from bin file. + ------------ -# nvme ocp unsupported-reqs-log /dev/nvme0 +# nvme ocp telemetry-string-log /dev/nvme0n1 ------------ NVME ---- -Part of the nvme-user suite \ No newline at end of file +Part of the nvme-user suite. diff --git a/Documentation/nvme-ocp-unsupported-reqs-log-pages.txt b/Documentation/nvme-ocp-unsupported-reqs-log-pages.txt index 65818d3..1657f6a 100644 --- a/Documentation/nvme-ocp-unsupported-reqs-log-pages.txt +++ b/Documentation/nvme-ocp-unsupported-reqs-log-pages.txt @@ -27,8 +27,8 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: This option will set the reporting format to normal, json, or binary. Only one output format can be used at a time. diff --git a/Documentation/nvme-persistent-event-log.1 b/Documentation/nvme-persistent-event-log.1 index bb5cbda..a8ca1df 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "PERSISTENT\-EVENT\-L" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "PERSISTENT\-EVENT\-L" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,9 +33,8 @@ nvme-persistent-event-log \- Send NVMe persistent event log page request, return .sp .nf \fInvme persistent\-event\-log\fR [\-\-action= | \-a ] - [\-\-log\-len= | \-l ] - [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] + [\-\-log\-len= | \-l ] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -61,13 +60,19 @@ Allocates a buffer of bytes size and requests this many bytes be retu Print the raw persistent event log buffer to stdout\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-persistent-event-log.html b/Documentation/nvme-persistent-event-log.html index d64081d..618a192 100644 --- a/Documentation/nvme-persistent-event-log.html +++ b/Documentation/nvme-persistent-event-log.html @@ -750,9 +750,8 @@ persistent-event-log(1) Manual Page
nvme persistent-event-log <device> [--action=<action> | -a <action>]
-            [--log-len=<log-len> | -l <log-len>]
-            [--raw-binary | -b]
-            [--output-format=<fmt> | -o <fmt>]
+ [--log-len=<log-len> | -l <log-len>] [--raw-binary | -b] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -782,12 +781,12 @@ may be printed to stdout for another program to parse.

- While try to retrieve this log action the controller shall take - during processing this persistent log page command. This mandatory - field, based on the value issued it may Read Log Data, Establish - Context and Read Log Data or Release Context can occur. For More - details see NVM Express 1.4 Spec. Section 5.14.1.13 Persistent - Event Log (Log Identifier 0Dh) + While try to retrieve this log action the controller shall take + during processing this persistent log page command. This mandatory + field, based on the value issued it may Read Log Data, Establish + Context and Read Log Data or Release Context can occur. For More + details see NVM Express 1.4 Spec. Section 5.14.1.13 Persistent + Event Log (Log Identifier 0Dh)

@@ -798,10 +797,10 @@ may be printed to stdout for another program to parse.

- Allocates a buffer of <log-len> bytes size and requests this - many bytes be returned in the constructed NVMe command. This - param is mandatory. If <log-len> given is 0 and action is 0, - it will read the Total Log Length(TLL) of the page. + Allocates a buffer of <log-len> bytes size and requests this + many bytes be returned in the constructed NVMe command. This + param is mandatory. If <log-len> given is 0 and action is 0, + it will read the Total Log Length(TLL) of the page.

@@ -812,19 +811,30 @@ may be printed to stdout for another program to parse.

- Print the raw persistent event log buffer to stdout. + Print the raw persistent event log buffer to stdout.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or binary. - Only one output format can be used at a time. + 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.

@@ -867,7 +877,7 @@ Print the raw persistent event log to a file: diff --git a/Documentation/nvme-persistent-event-log.txt b/Documentation/nvme-persistent-event-log.txt index 833491f..cf1cbad 100644 --- a/Documentation/nvme-persistent-event-log.txt +++ b/Documentation/nvme-persistent-event-log.txt @@ -10,9 +10,8 @@ SYNOPSIS -------- [verse] 'nvme persistent-event-log' [--action= | -a ] - [--log-len= | -l ] - [--raw-binary | -b] - [--output-format= | -o ] + [--log-len= | -l ] [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -31,28 +30,32 @@ OPTIONS ------- -a :: --action=:: - While try to retrieve this log action the controller shall take - during processing this persistent log page command. This mandatory - field, based on the value issued it may Read Log Data, Establish - Context and Read Log Data or Release Context can occur. For More - details see NVM Express 1.4 Spec. Section 5.14.1.13 Persistent - Event Log (Log Identifier 0Dh) + While try to retrieve this log action the controller shall take + during processing this persistent log page command. This mandatory + field, based on the value issued it may Read Log Data, Establish + Context and Read Log Data or Release Context can occur. For More + details see NVM Express 1.4 Spec. Section 5.14.1.13 Persistent + Event Log (Log Identifier 0Dh) -l :: --log-len=:: - Allocates a buffer of bytes size and requests this - many bytes be returned in the constructed NVMe command. This - param is mandatory. If given is 0 and action is 0, - it will read the Total Log Length(TLL) of the page. + Allocates a buffer of bytes size and requests this + many bytes be returned in the constructed NVMe command. This + param is mandatory. If given is 0 and action is 0, + it will read the Total Log Length(TLL) of the page. -b:: --raw-binary:: - Print the raw persistent event log buffer to stdout. + Print the raw persistent event log buffer to stdout. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or 'binary'. - Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-phy-rx-eom-log.txt b/Documentation/nvme-phy-rx-eom-log.txt index 015c851..8a31131 100644 --- a/Documentation/nvme-phy-rx-eom-log.txt +++ b/Documentation/nvme-phy-rx-eom-log.txt @@ -3,14 +3,15 @@ nvme-phy-rx-eom-log(1) NAME ---- -nvme-phy-rx-eom-log - Retrieves a Physical Interface Receiver Eye Opening Measurement log page from an NVMe device +nvme-phy-rx-eom-log - Retrieves a Physical Interface Receiver Eye Opening +Measurement log page from an NVMe device SYNOPSIS -------- [verse] 'nvme phy-rx-eom-log' [--lsp= | -s ] - [--controller= | -c ] - [--output-format= | -o ] + [--controller= | -c ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -31,13 +32,22 @@ OPTIONS -c :: --controller=:: - Controller ID of the controller associated wit the PCIe port to be + Controller ID of the controller associated with the PCIe port to be measured. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json', or + 'binary'. Only one output format can be used at a time. + +-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 -------- @@ -53,7 +63,6 @@ EXAMPLES # nvme phy-rx-eom-log /dev/nvme0 --lsp=2 --controller=3 ------------ - NVME ---- Part of the nvme-user suite diff --git a/Documentation/nvme-pred-lat-event-agg-log.1 b/Documentation/nvme-pred-lat-event-agg-log.1 index 8636904..b3416bf 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-PRED\-LAT\-EVE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-PRED\-LAT\-EVE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,10 @@ nvme-pred-lat-event-agg-log \- Send Predictable Latency Event Aggregate Log Page .SH "SYNOPSIS" .sp .nf -\fInvme pred\-lat\-event\-agg\-log\fR [\-\-log\-entries= | \-e ] +\fInvme pred\-lat\-event\-agg\-log\fR + [\-\-log\-entries= | \-e ] [\-\-rae | \-r] [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -60,7 +61,7 @@ Retain an Asynchronous Event\&. Print the raw Predictable Latency Event Aggregate log buffer to stdout\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-pred-lat-event-agg-log.html b/Documentation/nvme-pred-lat-event-agg-log.html index c2ea7fe..9acd37a 100644 --- a/Documentation/nvme-pred-lat-event-agg-log.html +++ b/Documentation/nvme-pred-lat-event-agg-log.html @@ -749,9 +749,10 @@ nvme-pred-lat-event-agg-log(1) Manual Page

SYNOPSIS

-
nvme pred-lat-event-agg-log <device> [--log-entries=<log_entries> | -e <log_entries>]
+
nvme pred-lat-event-agg-log <device>
+                        [--log-entries=<log_entries> | -e <log_entries>]
                         [--rae | -r] [--raw-binary | -b]
-                        [--output-format=<fmt> | -o <fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -782,11 +783,11 @@ another program to parse.

- Retrieve the Predictable Latency Event Aggregate Log pending entries. - This argument is mandatory and its success may depend on the device’s - statistics to provide this log For More details see NVM Express 1.4 Spec. - Section 5.14.1.11. The maximum number of log entries supported is 2044 - for the device. + Retrieve the Predictable Latency Event Aggregate Log pending entries. + This argument is mandatory and its success may depend on the device’s + statistics to provide this log For More details see NVM Express 1.4 Spec. + Section 5.14.1.11. The maximum number of log entries supported is 2044 + for the device.

@@ -812,15 +813,15 @@ another program to parse.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or binary. - Only one output format can be used at a time. + Set the reporting format to normal, json, or binary. + Only one output format can be used at a time.

@@ -863,7 +864,7 @@ Print the raw Predictable Latency Event Aggregate log to a file: diff --git a/Documentation/nvme-pred-lat-event-agg-log.txt b/Documentation/nvme-pred-lat-event-agg-log.txt index b01c9bb..6fb8acc 100644 --- a/Documentation/nvme-pred-lat-event-agg-log.txt +++ b/Documentation/nvme-pred-lat-event-agg-log.txt @@ -9,9 +9,10 @@ Page request, returns result and log SYNOPSIS -------- [verse] -'nvme pred-lat-event-agg-log' [--log-entries= | -e ] +'nvme pred-lat-event-agg-log' + [--log-entries= | -e ] [--rae | -r] [--raw-binary | -b] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -31,11 +32,11 @@ OPTIONS ------- -e :: --log-entries=:: - Retrieve the Predictable Latency Event Aggregate Log pending entries. - This argument is mandatory and its success may depend on the device's - statistics to provide this log For More details see NVM Express 1.4 Spec. - Section 5.14.1.11. The maximum number of log entries supported is 2044 - for the device. + Retrieve the Predictable Latency Event Aggregate Log pending entries. + This argument is mandatory and its success may depend on the device's + statistics to provide this log For More details see NVM Express 1.4 Spec. + Section 5.14.1.11. The maximum number of log entries supported is 2044 + for the device. -r:: --rae:: @@ -45,10 +46,10 @@ OPTIONS --raw-binary:: Print the raw Predictable Latency Event Aggregate log buffer to stdout. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or 'binary'. - Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json', or 'binary'. + Only one output format can be used at a time. EXAMPLES -------- diff --git a/Documentation/nvme-predictable-lat-log.1 b/Documentation/nvme-predictable-lat-log.1 index e96b0e6..932646a 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-PREDICTABLE\-L" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-PREDICTABLE\-L" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,7 +34,7 @@ nvme-predictable-lat-log \- Send Predictable latency per NVM set log page reques .nf \fInvme predictable\-lat\-log\fR [\-\-nvmset\-id= | \-i ] [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -55,13 +55,19 @@ Retrieve the Predictable latency per NVM set log for the given nvmset id\&. This Print the raw Predictable latency per NVM set log buffer to stdout\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-predictable-lat-log.html b/Documentation/nvme-predictable-lat-log.html index b74dbbf..4a8fec3 100644 --- a/Documentation/nvme-predictable-lat-log.html +++ b/Documentation/nvme-predictable-lat-log.html @@ -751,7 +751,7 @@ nvme-predictable-lat-log(1) Manual Page
nvme predictable-lat-log <device> [--nvmset-id=<nvmset_id> | -i <nvmset_id>]
                         [--raw-binary | -b]
-                        [--output-format=<fmt> | -o <fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -781,10 +781,10 @@ the raw buffer may be printed to stdout for another program to parse.

- Retrieve the Predictable latency per NVM set log for the given nvmset id. - This argument is mandatory and its success may depend on the device’s - statistics to provide this log For More details see NVM Express 1.4 Spec. - Section 5.14.1.10. The default nvmset id to use is 1 for the device. + Retrieve the Predictable latency per NVM set log for the given nvmset id. + This argument is mandatory and its success may depend on the device’s + statistics to provide this log For More details see NVM Express 1.4 Spec. + Section 5.14.1.10. The default nvmset id to use is 1 for the device.

@@ -799,15 +799,26 @@ the raw buffer may be printed to stdout for another program to parse.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -850,7 +861,7 @@ Print the raw Predictable latency per NVM set log to a file: diff --git a/Documentation/nvme-predictable-lat-log.txt b/Documentation/nvme-predictable-lat-log.txt index d1dde80..f0b2ad3 100644 --- a/Documentation/nvme-predictable-lat-log.txt +++ b/Documentation/nvme-predictable-lat-log.txt @@ -11,7 +11,7 @@ SYNOPSIS [verse] 'nvme predictable-lat-log' [--nvmset-id= | -i ] [--raw-binary | -b] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -30,19 +30,23 @@ OPTIONS ------- -i :: --nvmset-id=:: - Retrieve the Predictable latency per NVM set log for the given nvmset id. - This argument is mandatory and its success may depend on the device's - statistics to provide this log For More details see NVM Express 1.4 Spec. - Section 5.14.1.10. The default nvmset id to use is 1 for the device. + Retrieve the Predictable latency per NVM set log for the given nvmset id. + This argument is mandatory and its success may depend on the device's + statistics to provide this log For More details see NVM Express 1.4 Spec. + Section 5.14.1.10. The default nvmset id to use is 1 for the device. -b:: --raw-binary:: Print the raw Predictable latency per NVM set log buffer to stdout. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-primary-ctrl-caps.1 b/Documentation/nvme-primary-ctrl-caps.1 index 74c9884..238716b 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-PRIMARY\-CTRL\" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-PRIMARY\-CTRL\" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,7 @@ nvme-primary-ctrl-caps \- Send identify Primary Controller Caps, return result a .SH "SYNOPSIS" .sp .nf -\fInvme primary\-ctrl\-caps\fR [\-o | \-\-output\-format=] +\fInvme primary\-ctrl\-caps\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -43,18 +43,24 @@ The parameter is mandatory and may be either the NVMe character device On success, the structure may be returned in one of several ways depending on the option flags; the structure may be parsed by the program or the raw buffer may be printed to stdout\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= -.RS 4 -Set the reporting format to -\fInormal\fR, -\fIjson\fR, or -\fIbinary\fR\&. Only one output format can be used at a time\&. -.RE -.PP \-H, \-\-human\-readable .RS 4 This option will parse and format many of the bit fields into human\-readable formats\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-primary-ctrl-caps.html b/Documentation/nvme-primary-ctrl-caps.html index 8af0344..91f1ae2 100644 --- a/Documentation/nvme-primary-ctrl-caps.html +++ b/Documentation/nvme-primary-ctrl-caps.html @@ -749,7 +749,7 @@ nvme-primary-ctrl-caps(1) Manual Page

SYNOPSIS

-
nvme primary-ctrl-caps <device> [-o <format> | --output-format=<format>]
+
nvme primary-ctrl-caps <device> [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -771,18 +771,6 @@ raw buffer may be printed to stdout.

--o <format> -
-
---output-format=<format> -
-
-

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. -

-
-
-H
@@ -794,6 +782,29 @@ raw buffer may be printed to stdout.

into human-readable formats.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -835,7 +846,7 @@ fields in a human readable format: diff --git a/Documentation/nvme-primary-ctrl-caps.txt b/Documentation/nvme-primary-ctrl-caps.txt index 3edf5c1..0300383 100644 --- a/Documentation/nvme-primary-ctrl-caps.txt +++ b/Documentation/nvme-primary-ctrl-caps.txt @@ -8,7 +8,7 @@ nvme-primary-ctrl-caps - Send identify Primary Controller Caps, return result an SYNOPSIS -------- [verse] -'nvme primary-ctrl-caps' [-o | --output-format=] +'nvme primary-ctrl-caps' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -24,16 +24,20 @@ raw buffer may be printed to stdout. OPTIONS ------- --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. - -H:: --human-readable:: This option will parse and format many of the bit fields into human-readable formats. +-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 -------- * Get Primary Ctrl Caps of the device in default format diff --git a/Documentation/nvme-read.1 b/Documentation/nvme-read.1 index 4d9d9f7..338c904 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-READ" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-READ" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -42,54 +42,50 @@ nvme-read \- Send an NVMe Read command, provide results [\-\-prinfo= | \-p ] [\-\-app\-tag\-mask= | \-m ] [\-\-app\-tag= | \-a ] - [\-\-limited\-retry | \-l] - [\-\-force\-unit\-access | \-f] + [\-\-limited\-retry | \-l] [\-\-force\-unit\-access | \-f] [\-\-dir\-type= | \-T ] - [\-\-dir\-spec= | \-S ] - [\-\-dsm= | \-D ] - [\-\-show\-command | \-v] - [\-\-dry\-run | \-w] - [\-\-latency | \-t] + [\-\-dir\-spec= | \-S ] [\-\-dsm= | \-D ] + [\-\-show\-command | \-V] [\-\-dry\-run | \-w] [\-\-latency | \-t] [\-\-storage\-tag | \-g ] - [\-\-storage\-tag\-check | \-C ] - [\-\-force] + [\-\-storage\-tag\-check | \-C] [\-\-force] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp The Read command reads the logical blocks specified by the command from the medium and copies to the data data buffer provided\&. Will use stdout by default if you don\(cqt provide a file\&. .SH "OPTIONS" .PP -\-\-start\-block=, \-s +\-s , \-\-start\-block= .RS 4 Start block\&. .RE .PP -\-\-block\-count, \-c +\-c, \-\-block\-count .RS 4 The number of blocks to transfer\&. This is a zeroes based value to align with the kernel\(cqs use of this field\&. (ie\&. 0 means transfer 1 block)\&. .RE .PP -\-\-data\-size=, \-z +\-z , \-\-data\-size= .RS 4 Size of data, in bytes\&. .RE .PP -\-\-metadata\-size=, \-y +\-y , \-\-metadata\-size= .RS 4 Size of metadata in bytes\&. .RE .PP -\-\-data=, \-d +\-d , \-\-data= .RS 4 Data file\&. If none provided, contents are sent to STDOUT\&. .RE .PP -\-\-metadata=, \-M +\-M , \-\-metadata= .RS 4 Metadata file, if necessary\&. .RE .PP -\-\-prinfo=, \-p +\-p , \-\-prinfo= .RS 4 Protection Information field definition\&. .TS @@ -134,17 +130,17 @@ T} .sp 1 .RE .PP -\-\-ref\-tag=, \-r +\-r , \-\-ref\-tag= .RS 4 Optional reftag when used with protection information\&. .RE .PP -\-\-app\-tag\-mask=, \-m +\-m , \-\-app\-tag\-mask= .RS 4 Optional application tag mask when used with protection information\&. .RE .PP -\-\-force\-unit\-access, \-f +\-f, \-\-force\-unit\-access .RS 4 Set the force\-unit access flag\&. .RE @@ -164,7 +160,7 @@ Optional field for directive specifics\&. When used with write streams, this val The optional data set management attributes for this command\&. The argument for this is the least significant 8 bits of the DSM field in a write command; the most significant 16 bits of the field come from the directive specific field, if used\&. This may be used to set attributes for the LBAs being written, like access frequency, type, latency, among other things, as well as yet to be defined types\&. Please consult the NVMe specification for detailed breakdown of how to use this field\&. .RE .PP -\-v, \-\-show\-cmd +\-V, \-\-show\-cmd .RS 4 Print out the command to be sent\&. .RE @@ -196,6 +192,20 @@ This flag enables Storage Tag field checking as part of end\-to\-end data protec .RS 4 Ignore namespace is currently busy and performed the operation even though\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-read.html b/Documentation/nvme-read.html index 2904f3d..74b1c64 100644 --- a/Documentation/nvme-read.html +++ b/Documentation/nvme-read.html @@ -759,17 +759,13 @@ nvme-read(1) Manual Page [--prinfo=<prinfo> | -p <prinfo>] [--app-tag-mask=<appmask> | -m <appmask>] [--app-tag=<apptag> | -a <apptag>] - [--limited-retry | -l] - [--force-unit-access | -f] + [--limited-retry | -l] [--force-unit-access | -f] [--dir-type=<type> | -T <type>] - [--dir-spec=<spec> | -S <spec>] - [--dsm=<dsm> | -D <dsm>] - [--show-command | -v] - [--dry-run | -w] - [--latency | -t] + [--dir-spec=<spec> | -S <spec>] [--dsm=<dsm> | -D <dsm>] + [--show-command | -V] [--dry-run | -w] [--latency | -t] [--storage-tag<storage-tag> | -g <storage-tag>] - [--storage-tag-check | -C ] - [--force] + [--storage-tag-check | -C] [--force] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -787,10 +783,10 @@ by default if you don’t provide a file.

---start-block=<slba> +-s <slba>
--s <slba> +--start-block=<slba>

@@ -798,10 +794,10 @@ by default if you don’t provide a file.

---block-count +-c
--c +--block-count

@@ -811,10 +807,10 @@ by default if you don’t provide a file.

---data-size=<size> +-z <size>
--z <size> +--data-size=<size>

@@ -822,10 +818,10 @@ by default if you don’t provide a file.

---metadata-size=<size> +-y <size>
--y <size> +--metadata-size=<size>

@@ -833,10 +829,10 @@ by default if you don’t provide a file.

---data=<data-file> +-d <data-file>
--d <data-file> +--data=<data-file>

@@ -844,10 +840,10 @@ by default if you don’t provide a file.

---metadata=<metadata-file> +-M <metadata-file>
--M <metadata-file> +--metadata=<metadata-file>

@@ -855,10 +851,10 @@ by default if you don’t provide a file.

---prinfo=<prinfo> +-p <prinfo>
--p <prinfo> +--prinfo=<prinfo>

@@ -903,10 +899,10 @@ metadata is passes.

---ref-tag=<reftag> +-r <reftag>
--r <reftag> +--ref-tag=<reftag>

@@ -914,10 +910,10 @@ metadata is passes.

---app-tag-mask=<appmask> +-m <appmask>
--m <appmask> +--app-tag-mask=<appmask>

@@ -925,10 +921,10 @@ metadata is passes.

---force-unit-access +-f
--f +--force-unit-access

@@ -982,7 +978,7 @@ metadata is passes.

--v +-V
--show-cmd @@ -1048,6 +1044,29 @@ metadata is passes.

even though.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -1068,7 +1087,7 @@ metadata is passes.

diff --git a/Documentation/nvme-read.txt b/Documentation/nvme-read.txt index 3ceeba1..cecaa71 100644 --- a/Documentation/nvme-read.txt +++ b/Documentation/nvme-read.txt @@ -18,17 +18,13 @@ SYNOPSIS [--prinfo= | -p ] [--app-tag-mask= | -m ] [--app-tag= | -a ] - [--limited-retry | -l] - [--force-unit-access | -f] + [--limited-retry | -l] [--force-unit-access | -f] [--dir-type= | -T ] - [--dir-spec= | -S ] - [--dsm= | -D ] - [--show-command | -v] - [--dry-run | -w] - [--latency | -t] + [--dir-spec= | -S ] [--dsm= | -D ] + [--show-command | -V] [--dry-run | -w] [--latency | -t] [--storage-tag | -g ] - [--storage-tag-check | -C ] - [--force] + [--storage-tag-check | -C] [--force] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -38,34 +34,34 @@ by default if you don't provide a file. OPTIONS ------- ---start-block=:: -s :: +--start-block=:: Start block. ---block-count:: -c:: +--block-count:: The number of blocks to transfer. This is a zeroes based value to align with the kernel's use of this field. (ie. 0 means transfer 1 block). ---data-size=:: -z :: +--data-size=:: Size of data, in bytes. ---metadata-size=:: -y :: +--metadata-size=:: Size of metadata in bytes. ---data=:: -d :: +--data=:: Data file. If none provided, contents are sent to STDOUT. ---metadata=:: -M :: +--metadata=:: Metadata file, if necessary. ---prinfo=:: -p :: +--prinfo=:: Protection Information field definition. + [] @@ -80,16 +76,16 @@ metadata is passes. |0|Set to 1 enables checking the reference tag |================= ---ref-tag=:: -r :: +--ref-tag=:: Optional reftag when used with protection information. ---app-tag-mask=:: -m :: +--app-tag-mask=:: Optional application tag mask when used with protection information. ---force-unit-access:: -f:: +--force-unit-access:: Set the force-unit access flag. -T :: @@ -117,7 +113,7 @@ metadata is passes. consult the NVMe specification for detailed breakdown of how to use this field. --v:: +-V:: --show-cmd:: Print out the command to be sent. @@ -144,6 +140,15 @@ metadata is passes. Ignore namespace is currently busy and performed the operation even though. +-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 -------- No examples yet. diff --git a/Documentation/nvme-reset.1 b/Documentation/nvme-reset.1 index 0ef0b7e..506cbea 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESET" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-RESET" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,14 +32,26 @@ nvme-reset \- Reset the nvme controller\&. .SH "SYNOPSIS" .sp .nf -\fInvme reset\fR +\fInvme reset\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp Requests NVMe controller reset\&. The param is mandatory and must be an NVMe character device (ex: /dev/nvme0)\&. .SH "OPTIONS" -.sp -None +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-reset.html b/Documentation/nvme-reset.html index 74f963a..0bac21c 100644 --- a/Documentation/nvme-reset.html +++ b/Documentation/nvme-reset.html @@ -749,7 +749,7 @@ nvme-reset(1) Manual Page

SYNOPSIS

-
nvme reset <device>
+
nvme reset <device> [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -764,7 +764,31 @@ be an NVMe character device (ex: /dev/nvme0).

OPTIONS

-

None

+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
+
@@ -794,7 +818,7 @@ Resets the controller. diff --git a/Documentation/nvme-reset.txt b/Documentation/nvme-reset.txt index d1a282b..20fcbb1 100644 --- a/Documentation/nvme-reset.txt +++ b/Documentation/nvme-reset.txt @@ -8,7 +8,7 @@ nvme-reset - Reset the nvme controller. SYNOPSIS -------- [verse] -'nvme reset' +'nvme reset' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -17,7 +17,14 @@ be an NVMe character device (ex: /dev/nvme0). OPTIONS ------- -None +-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 -------- diff --git a/Documentation/nvme-resv-acquire.1 b/Documentation/nvme-resv-acquire.1 index 14dfff4..2066508 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESV\-ACQUIRE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-RESV\-ACQUIRE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,11 +33,11 @@ nvme-resv-acquire \- Acquire an nvme reservation .sp .nf \fInvme resv\-acquire\fR [\-\-namespace\-id= | \-n ] - [\-\-crkey= | \-c ] - [\-\-prkey= | \-p ] - [\-\-rtype= | \-t ] - [\-\-racqa= | \-a ] - [\-\-iekey | \-i] + [\-\-crkey= | \-c ] + [\-\-prkey= | \-p ] + [\-\-rtype= | \-t ] + [\-\-racqa= | \-a ] [\-\-iekey | \-i] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -169,6 +169,20 @@ Ignore Existing Key: If this bit is set to a Indicator option, defaults to \fI0\fR\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet diff --git a/Documentation/nvme-resv-acquire.html b/Documentation/nvme-resv-acquire.html index 12a3526..3d8e876 100644 --- a/Documentation/nvme-resv-acquire.html +++ b/Documentation/nvme-resv-acquire.html @@ -750,11 +750,11 @@ nvme-resv-acquire(1) Manual Page
nvme resv-acquire <device> [--namespace-id=<nsid> | -n <nsid>]
-                             [--crkey=<crkey> | -c <crkey>]
-                             [--prkey=<prkey> | -p <prkey>]
-                             [--rtype=<rtype> | -t <rtype>]
-                             [--racqa=<racqa> | -a <racqa>]
-                             [--iekey | -i]
+ [--crkey=<crkey> | -c <crkey>] + [--prkey=<prkey> | -p <prkey>] + [--rtype=<rtype> | -t <rtype>] + [--racqa=<racqa> | -a <racqa>] [--iekey | -i] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -924,10 +924,33 @@ cellspacing="0" cellpadding="4">

Ignore Existing Key: If this bit is set to a 1, then the Current Reservation Key (CRKEY) check is disabled and the command - shall succeed regardless of the CRKEY field value. + shall succeed regardless of the CRKEY field value.

Indicator option, defaults to 0.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -948,7 +971,7 @@ cellspacing="0" cellpadding="4"> diff --git a/Documentation/nvme-resv-acquire.txt b/Documentation/nvme-resv-acquire.txt index 1b6e110..19282c6 100644 --- a/Documentation/nvme-resv-acquire.txt +++ b/Documentation/nvme-resv-acquire.txt @@ -9,11 +9,11 @@ SYNOPSIS -------- [verse] 'nvme resv-acquire' [--namespace-id= | -n ] - [--crkey= | -c ] - [--prkey= | -p ] - [--rtype= | -t ] - [--racqa= | -a ] - [--iekey | -i] + [--crkey= | -c ] + [--prkey= | -p ] + [--rtype= | -t ] + [--racqa= | -a ] [--iekey | -i] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -79,10 +79,19 @@ OPTIONS --iekey:: Ignore Existing Key: If this bit is set to a '1', then the Current Reservation Key (CRKEY) check is disabled and the command - shall succeed regardless of the CRKEY field value. + shall succeed regardless of the CRKEY field value. + Indicator option, defaults to '0'. +-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 -------- No examples yet diff --git a/Documentation/nvme-resv-notif-log.1 b/Documentation/nvme-resv-notif-log.1 index 3daff9e..1f0a6d4 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESV\-NOTIF\-L" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-RESV\-NOTIF\-L" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,7 @@ nvme-resv-notif-log \- Send NVMe Reservation Notification log page request, retu .SH "SYNOPSIS" .sp .nf -\fInvme resv\-notif\-log\fR [\-\-output\-format= | \-o ] +\fInvme resv\-notif\-log\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -43,13 +43,19 @@ The parameter is mandatory and may be either the NVMe character device On success, the returned Reservation Notification log structure may be returned in one of several ways depending on the option flags; the structure may parsed by the program and printed in a readable format or the raw buffer may be printed to stdout for another program to parse\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-resv-notif-log.html b/Documentation/nvme-resv-notif-log.html index ef5cfea..6809559 100644 --- a/Documentation/nvme-resv-notif-log.html +++ b/Documentation/nvme-resv-notif-log.html @@ -740,7 +740,7 @@ nvme-resv-notif-log(1) Manual Page

NAME

nvme-resv-notif-log - - Send NVMe Reservation Notification log page request, return result and log + Send NVMe Reservation Notification log page request, return result and log

@@ -749,7 +749,7 @@ nvme-resv-notif-log(1) Manual Page

SYNOPSIS

-
nvme resv-notif-log <device> [--output-format=<fmt> | -o <fmt>]
+
nvme resv-notif-log <device> [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -772,15 +772,26 @@ may be printed to stdout for another program to parse.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -822,7 +833,7 @@ Print the output in json format: diff --git a/Documentation/nvme-resv-notif-log.txt b/Documentation/nvme-resv-notif-log.txt index a9c5cdd..f8d828b 100644 --- a/Documentation/nvme-resv-notif-log.txt +++ b/Documentation/nvme-resv-notif-log.txt @@ -4,12 +4,12 @@ nvme-resv-notif-log(1) NAME ---- nvme-resv-notif-log - Send NVMe Reservation Notification log page request, - return result and log +return result and log SYNOPSIS -------- [verse] -'nvme resv-notif-log' [--output-format= | -o ] +'nvme resv-notif-log' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -26,10 +26,14 @@ may be printed to stdout for another program to parse. OPTIONS ------- --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-resv-register.1 b/Documentation/nvme-resv-register.1 index 05029fa..383cad0 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESV\-REGISTER" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-RESV\-REGISTER" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,11 +33,11 @@ nvme-resv-register \- Register an nvme reservation .sp .nf \fInvme resv\-register\fR [\-\-namespace\-id= | \-n ] - [\-\-crkey= | \-c ] - [\-\-nrkey= | \-k ] - [\-\-rrega= | \-r ] - [\-\-cptpl= | \-p ] - [\-\-iekey | \-i] + [\-\-crkey= | \-c ] + [\-\-nrkey= | \-k ] + [\-\-rrega= | \-r ] + [\-\-cptpl= | \-p ] [\-\-iekey | \-i] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -145,6 +145,20 @@ Ignore Existing Key: If this bit is set to a Indicator option, defaults to \fI0\fR\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet diff --git a/Documentation/nvme-resv-register.html b/Documentation/nvme-resv-register.html index 072acf2..c4875dc 100644 --- a/Documentation/nvme-resv-register.html +++ b/Documentation/nvme-resv-register.html @@ -750,11 +750,11 @@ nvme-resv-register(1) Manual Page
nvme resv-register <device> [--namespace-id=<nsid> | -n <nsid>]
-                              [--crkey=<crkey> | -c <crkey>]
-                              [--nrkey=<nrkey> | -k <nrkey>]
-                              [--rrega=<rrega> | -r <rrega>]
-                              [--cptpl=<cptpl> | -p <cptpl>]
-                              [--iekey | -i]
+ [--crkey=<crkey> | -c <crkey>] + [--nrkey=<nrkey> | -k <nrkey>] + [--rrega=<rrega> | -r <rrega>] + [--cptpl=<cptpl> | -p <cptpl>] [--iekey | -i] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -917,6 +917,29 @@ cellspacing="0" cellpadding="4">

Indicator option, defaults to 0.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -937,7 +960,7 @@ cellspacing="0" cellpadding="4"> diff --git a/Documentation/nvme-resv-register.txt b/Documentation/nvme-resv-register.txt index e0553f4..4a83050 100644 --- a/Documentation/nvme-resv-register.txt +++ b/Documentation/nvme-resv-register.txt @@ -9,11 +9,11 @@ SYNOPSIS -------- [verse] 'nvme resv-register' [--namespace-id= | -n ] - [--crkey= | -c ] - [--nrkey= | -k ] - [--rrega= | -r ] - [--cptpl= | -p ] - [--iekey | -i] + [--crkey= | -c ] + [--nrkey= | -k ] + [--rrega= | -r ] + [--cptpl= | -p ] [--iekey | -i] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -84,6 +84,15 @@ a power loss. + Indicator option, defaults to '0'. +-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 -------- No examples yet diff --git a/Documentation/nvme-resv-release.1 b/Documentation/nvme-resv-release.1 index 8f1e158..f10293e 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESV\-RELEASE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-RESV\-RELEASE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,10 +33,10 @@ nvme-resv-release \- Release an nvme reservation .sp .nf \fInvme resv\-release\fR [\-\-namespace\-id= | \-n ] - [\-\-crkey= | \-c ] - [\-\-rtype= | \-t ] - [\-\-rrela= | \-a ] - [\-\-iekey | \-i] + [\-\-crkey= | \-c ] + [\-\-rtype= | \-t ] + [\-\-rrela= | \-a ] [\-\-iekey | \-i] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -157,6 +157,20 @@ Ignore Existing Key: If this bit is set to a Indicator option, defaults to \fI0\fR\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet diff --git a/Documentation/nvme-resv-release.html b/Documentation/nvme-resv-release.html index 1504945..496f8e8 100644 --- a/Documentation/nvme-resv-release.html +++ b/Documentation/nvme-resv-release.html @@ -750,10 +750,10 @@ nvme-resv-release(1) Manual Page
nvme resv-release <device> [--namespace-id=<nsid> | -n <nsid>]
-                             [--crkey=<crkey> | -c <crkey>]
-                             [--rtype=<rtype> | -t <rtype>]
-                             [--rrela=<rrela> | -a <rrela>]
-                             [--iekey | -i]
+ [--crkey=<crkey> | -c <crkey>] + [--rtype=<rtype> | -t <rtype>] + [--rrela=<rrela> | -a <rrela>] [--iekey | -i] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -910,6 +910,29 @@ cellspacing="0" cellpadding="4">

Indicator option, defaults to 0.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -930,7 +953,7 @@ cellspacing="0" cellpadding="4"> diff --git a/Documentation/nvme-resv-release.txt b/Documentation/nvme-resv-release.txt index 6eb0b43..c3dc90d 100644 --- a/Documentation/nvme-resv-release.txt +++ b/Documentation/nvme-resv-release.txt @@ -9,10 +9,10 @@ SYNOPSIS -------- [verse] 'nvme resv-release' [--namespace-id= | -n ] - [--crkey= | -c ] - [--rtype= | -t ] - [--rrela= | -a ] - [--iekey | -i] + [--crkey= | -c ] + [--rtype= | -t ] + [--rrela= | -a ] [--iekey | -i] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -75,6 +75,15 @@ OPTIONS + Indicator option, defaults to '0'. +-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 -------- No examples yet diff --git a/Documentation/nvme-resv-report.1 b/Documentation/nvme-resv-report.1 index aee6c8a..c38280b 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RESV\-REPORT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-RESV\-REPORT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,10 +33,9 @@ nvme-resv-report \- Send NVMe Reservation Report, parse the result .sp .nf \fInvme resv\-report\fR [\-\-namespace\-id= | \-n ] - [\-\-numd= | \-d ] - [\-\-eds | \-e] + [\-\-numd= | \-d ] [\-\-eds | \-e] [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -66,13 +65,19 @@ Request extended Data Structure: If this bit is set to a Print the raw buffer to stdout\&. Structure is not parsed by program\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-resv-report.html b/Documentation/nvme-resv-report.html index 0f085f9..fc96975 100644 --- a/Documentation/nvme-resv-report.html +++ b/Documentation/nvme-resv-report.html @@ -750,10 +750,9 @@ nvme-resv-report(1) Manual Page
nvme resv-report <device> [--namespace-id=<nsid> | -n <nsid>]
-                        [--numd=<num-dwords> | -d <num-dwords>]
-                        [--eds | -e]
+                        [--numd=<num-dwords> | -d <num-dwords>] [--eds | -e]
                         [--raw-binary | -b]
-                        [--output-format=<fmt> | -o <fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -824,15 +823,26 @@ Controller data structure for each such controller).

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -855,7 +865,7 @@ Controller data structure for each such controller).

diff --git a/Documentation/nvme-resv-report.txt b/Documentation/nvme-resv-report.txt index 32012fe..2e12826 100644 --- a/Documentation/nvme-resv-report.txt +++ b/Documentation/nvme-resv-report.txt @@ -9,10 +9,9 @@ SYNOPSIS -------- [verse] 'nvme resv-report' [--namespace-id= | -n ] - [--numd= | -d ] - [--eds | -e] + [--numd= | -d ] [--eds | -e] [--raw-binary | -b] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -48,11 +47,14 @@ OPTIONS Print the raw buffer to stdout. Structure is not parsed by program. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-rpmb.1 b/Documentation/nvme-rpmb.1 index 52aed1c..5c6325e 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-RPMB" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-RPMB" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,13 +33,13 @@ nvme-rpmb \- Send RPMB commands to an NVMe device .sp .nf \fInvme rpmb\fR [\-\-cmd= | \-c ] - [\-\-msgfile= | \-f ] - [\-\-keyfile= | \-g ] - [\-\-key= | \-k ] - [\-\-msg= | \-d ] - [\-\-address= | \-o ] - [\-\-blocks=<512 byte sectors> | \-b ] - [\-\-target= | \-t ] + [\-\-msgfile= | \-f ] + [\-\-keyfile= | \-g ] + [\-\-key= | \-k ] [\-\-msg= | \-d ] + [\-\-address= | \-o ] + [\-\-blocks=<512 byte sectors> | \-b ] + [\-\-target= | \-t ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -181,6 +181,20 @@ The address (in 512 byte sector offset from 0) to be used for data transfer comm .RS 4 The size in 512 byte sectors to be used for data transfer commands (read or write) for a specified RPMB target\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-rpmb.html b/Documentation/nvme-rpmb.html index 97d80a1..76addf4 100644 --- a/Documentation/nvme-rpmb.html +++ b/Documentation/nvme-rpmb.html @@ -750,13 +750,13 @@ nvme-rpmb(1) Manual Page
nvme rpmb <device> [--cmd=<command> | -c <command>]
-                    [--msgfile=<data-file> | -f <data-file>]
-                    [--keyfile=<key-file> | -g <key-file>]
-                    [--key=<key> | -k <key>]
-                    [--msg=<data> | -d <data>]
-                    [--address=<offset> | -o <offset>]
-                    [--blocks=<512 byte sectors> | -b <sectors> ]
-                    [--target=<target-id> | -t <id> ]
+ [--msgfile=<data-file> | -f <data-file>] + [--keyfile=<key-file> | -g <key-file>] + [--key=<key> | -k <key>] [--msg=<data> | -d <data>] + [--address=<offset> | -o <offset>] + [--blocks=<512 byte sectors> | -b <sectors>] + [--target=<target-id> | -t <id>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -921,6 +921,29 @@ default address if no -address or -o option is specified, (read or write) for a specified RPMB target.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -1001,7 +1024,7 @@ data onto output.bin diff --git a/Documentation/nvme-rpmb.txt b/Documentation/nvme-rpmb.txt index c30c83d..9dc954d 100644 --- a/Documentation/nvme-rpmb.txt +++ b/Documentation/nvme-rpmb.txt @@ -9,13 +9,13 @@ SYNOPSIS -------- [verse] 'nvme rpmb' [--cmd= | -c ] - [--msgfile= | -f ] - [--keyfile= | -g ] - [--key= | -k ] - [--msg= | -d ] - [--address= | -o ] - [--blocks=<512 byte sectors> | -b ] - [--target= | -t ] + [--msgfile= | -f ] + [--keyfile= | -g ] + [--key= | -k ] [--msg= | -d ] + [--address= | -o ] + [--blocks=<512 byte sectors> | -b ] + [--target= | -t ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -71,7 +71,7 @@ OPTIONS nvme-rpmb without sending it to device. RPMB target 0 is used as the default target if --target or -t is not specified. 0x0 is used as the default address if no -address or -o option is specified, - + -t :: --target=:: RPMB target id. This should be one of the supported RPMB targets as @@ -105,6 +105,15 @@ OPTIONS The size in 512 byte sectors to be used for data transfer commands (read or write) for a specified RPMB target. +-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 -------- * Print RPMB support information of an NVMe device @@ -147,4 +156,3 @@ EXAMPLES NVME ---- Part of the nvme-user suite - diff --git a/Documentation/nvme-sanitize-log.1 b/Documentation/nvme-sanitize-log.1 index 143a1aa..7bf1cfb 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SANITIZE\-LOG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SANITIZE\-LOG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,9 @@ nvme-sanitize-log \- Send NVMe sanitize\-log Command, return result .SH "SYNOPSIS" .sp .nf -\fInvme sanitize\-log\fR [\-\-rae | \-r] [\-\-output\-format= | \-o ] - [\-\-human\-readable | \-H] - [\-\-raw\-binary | \-b] +\fInvme sanitize\-log\fR [\-\-rae | \-r] [\-\-human\-readable | \-H] + [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -105,14 +105,6 @@ On success it returns 0, error code otherwise\&. Retain an Asynchronous Event\&. .RE .PP -\-o , \-\-output\-format= -.RS 4 -Set the reporting format to -\fInormal\fR, -\fIjson\fR, or -\fIbinary\fR\&. Only one output format can be used at a time\&. -.RE -.PP \-H, \-\-human\-readable .RS 4 This option will parse and format many of the bit fields into human\-readable formats\&. @@ -122,6 +114,20 @@ This option will parse and format many of the bit fields into human\-readable fo .RS 4 Print the raw buffer to stdout\&. Structure is not parsed by program\&. This overrides the vendor specific and human readable options\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-sanitize-log.html b/Documentation/nvme-sanitize-log.html index 4ed2e90..f6e0c2a 100644 --- a/Documentation/nvme-sanitize-log.html +++ b/Documentation/nvme-sanitize-log.html @@ -749,9 +749,9 @@ nvme-sanitize-log(1) Manual Page

SYNOPSIS

-
nvme sanitize-log <device> [--rae | -r] [--output-format=<fmt> | -o <fmt>]
-                             [--human-readable | -H]
-                             [--raw-binary | -b]
+
nvme sanitize-log <device> [--rae | -r] [--human-readable | -H]
+                        [--raw-binary | -b]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -798,11 +798,11 @@ cellspacing="0" cellpadding="4">
+ a) since being manufactured and the NVM subsystem has never been sanitized; or + b) since the most recent successful sanitize operation of the NVM subsystem.

Global Data Erased bit If set to 1 then non-volatile storage in the NVM subsystem has not been written to: - a) since being manufactured and the NVM subsystem has never been sanitized; or - b) since the most recent successful sanitize operation. + a) since being manufactured and the NVM subsystem has never been sanitized; or + b) since the most recent successful sanitize operation. If cleared to 0, then non-volatile storage in the NVM subsystem has been written to: - a) since being manufactured and the NVM subsystem has never been sanitized; or - b) since the most recent successful sanitize operation of the NVM subsystem.

@@ -827,18 +827,6 @@ If cleared to 0, then non-volatile storage in the NVM subsystem has been written

--o <format> -
-
---output-format=<format> -
-
-

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. -

-
-
-H
@@ -862,6 +850,29 @@ If cleared to 0, then non-volatile storage in the NVM subsystem has been written program. This overrides the vendor specific and human readable options.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -892,7 +903,7 @@ Has the program issue Sanitize-log Command : diff --git a/Documentation/nvme-sanitize-log.txt b/Documentation/nvme-sanitize-log.txt index 3c2d43e..af45e9f 100644 --- a/Documentation/nvme-sanitize-log.txt +++ b/Documentation/nvme-sanitize-log.txt @@ -8,9 +8,9 @@ nvme-sanitize-log - Send NVMe sanitize-log Command, return result SYNOPSIS -------- [verse] -'nvme sanitize-log' [--rae | -r] [--output-format= | -o ] - [--human-readable | -H] - [--raw-binary | -b] +'nvme sanitize-log' [--rae | -r] [--human-readable | -H] + [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -41,11 +41,11 @@ Expected status and description :- |Global Data Erased bit If set to 1 then non-volatile storage in the NVM subsystem has not been written to: - a) since being manufactured and the NVM subsystem has never been sanitized; or - b) since the most recent successful sanitize operation. + a) since being manufactured and the NVM subsystem has never been sanitized; or + b) since the most recent successful sanitize operation. If cleared to 0, then non-volatile storage in the NVM subsystem has been written to: - a) since being manufactured and the NVM subsystem has never been sanitized; or - b) since the most recent successful sanitize operation of the NVM subsystem. + a) since being manufactured and the NVM subsystem has never been sanitized; or + b) since the most recent successful sanitize operation of the NVM subsystem. |=== Sanitize Progress - percentage complete @@ -58,11 +58,6 @@ OPTIONS --rae:: Retain an Asynchronous Event. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. - -H:: --human-readable:: This option will parse and format many of the bit fields @@ -73,6 +68,15 @@ OPTIONS Print the raw buffer to stdout. Structure is not parsed by program. This overrides the vendor specific and human readable options. +-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 -------- * Has the program issue Sanitize-log Command : diff --git a/Documentation/nvme-sanitize.1 b/Documentation/nvme-sanitize.1 index 7a71f4f..793f2d1 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SANITIZE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SANITIZE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,13 +32,12 @@ nvme-sanitize \- Send NVMe Sanitize Command, return result .SH "SYNOPSIS" .sp .nf -\fInvme sanitize\fR [\-\-no\-dealloc | \-d] - [\-\-oipbp | \-i] - [\-\-owpass= | \-n ] - [\-\-ause | \-u] - [\-\-sanact= | \-a ] - [\-\-ovrpat= | \-p ] - [\-\-force] +\fInvme sanitize\fR [\-\-no\-dealloc | \-d] [\-\-oipbp | \-i] + [\-\-owpass= | \-n ] + [\-\-ause | \-u] [\-\-sanact= | \-a ] + [\-\-ovrpat= | \-p ] + [\-\-force] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -127,6 +126,20 @@ Overwrite Pattern: This field is ignored unless the Sanitize Action field in Com .RS 4 Ignore namespace is currently busy and performed the operation even though\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-sanitize.html b/Documentation/nvme-sanitize.html index 32b0e04..de92545 100644 --- a/Documentation/nvme-sanitize.html +++ b/Documentation/nvme-sanitize.html @@ -749,13 +749,12 @@ nvme-sanitize(1) Manual Page

SYNOPSIS

-
nvme sanitize <device> [--no-dealloc | -d]
-              [--oipbp | -i]
-              [--owpass=<overwrite-pass-count> | -n <overwrite-pass-count>]
-              [--ause | -u]
-              [--sanact=<action> | -a <action>]
-              [--ovrpat=<overwrite-pattern> | -p <overwrite-pattern>]
-              [--force]
+
nvme sanitize <device> [--no-dealloc | -d] [--oipbp | -i]
+                        [--owpass=<overwrite-pass-count> | -n <overwrite-pass-count>]
+                        [--ause | -u] [--sanact=<action> | -a <action>]
+                        [--ovrpat=<overwrite-pattern> | -p <overwrite-pattern>]
+                        [--force]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -781,13 +780,13 @@ provides the result.

- No Deallocate After Sanitize: - If set, then the controller shall not deallocate any logical - blocks as a result of successfully completing the sanitize - operation. If cleared, then the controller should deallocate - logical blocks as a result of successfully completing the - sanitize operation. This bit shall be ignored if the Sanitize - Action field is set to 001b (i.e., Exit Failure Mode). + No Deallocate After Sanitize: + If set, then the controller shall not deallocate any logical + blocks as a result of successfully completing the sanitize + operation. If cleared, then the controller should deallocate + logical blocks as a result of successfully completing the + sanitize operation. This bit shall be ignored if the Sanitize + Action field is set to 001b (i.e., Exit Failure Mode).

@@ -798,11 +797,11 @@ provides the result.

- Overwrite Invert Pattern Between Passes: - If set, then the Overwrite Pattern shall be inverted between - passes. If cleared, then the overwrite pattern shall not be - inverted between passes. This bit shall be ignored unless the - Sanitize Action field is set to 011b (i.e., Overwrite). + Overwrite Invert Pattern Between Passes: + If set, then the Overwrite Pattern shall be inverted between + passes. If cleared, then the overwrite pattern shall not be + inverted between passes. This bit shall be ignored unless the + Sanitize Action field is set to 011b (i.e., Overwrite).

@@ -813,12 +812,12 @@ provides the result.

- Overwrite Pass Count: - This field specifies the number of overwrite passes (i.e., - how many times the media is to be overwritten) using the data - from the Overwrite Pattern field of this command. A value of 0 - specifies 16 overwrite passes. This field shall be ignored - unless the Sanitize Action field is set to 011b (i.e., Overwrite). + Overwrite Pass Count: + This field specifies the number of overwrite passes (i.e., + how many times the media is to be overwritten) using the data + from the Overwrite Pattern field of this command. A value of 0 + specifies 16 overwrite passes. This field shall be ignored + unless the Sanitize Action field is set to 011b (i.e., Overwrite).

@@ -829,11 +828,11 @@ provides the result.

- Allow Unrestricted Sanitize Exit: - If set, then the sanitize operation is performed in unrestricted - completion mode. If cleared then the sanitize operation is - performed in restricted completion mode. This bit shall be ignored - if the Sanitize Action field is set to 001b (i.e., Exit Failure Mode). + Allow Unrestricted Sanitize Exit: + If set, then the sanitize operation is performed in unrestricted + completion mode. If cleared then the sanitize operation is + performed in restricted completion mode. This bit shall be ignored + if the Sanitize Action field is set to 001b (i.e., Exit Failure Mode).

@@ -844,7 +843,7 @@ provides the result.

- Sanitize Action: + Sanitize Action:

- Overwrite Pattern: - This field is ignored unless the Sanitize Action field in - Command Dword 10 is set to 011b (i.e., Overwrite). This field - specifies a 32-bit pattern that is used for the Overwrite - sanitize operation. + Overwrite Pattern: + This field is ignored unless the Sanitize Action field in + Command Dword 10 is set to 011b (i.e., Overwrite). This field + specifies a 32-bit pattern that is used for the Overwrite + sanitize operation.

@@ -902,8 +901,31 @@ cellspacing="0" cellpadding="4">

- Ignore namespace is currently busy and performed the operation - even though. + Ignore namespace is currently busy and performed the operation + even though. +

+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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.

@@ -938,7 +960,7 @@ Has the program issue Sanitize Command : diff --git a/Documentation/nvme-sanitize.txt b/Documentation/nvme-sanitize.txt index c3b9af2..1e43463 100644 --- a/Documentation/nvme-sanitize.txt +++ b/Documentation/nvme-sanitize.txt @@ -8,13 +8,12 @@ nvme-sanitize - Send NVMe Sanitize Command, return result SYNOPSIS -------- [verse] -'nvme sanitize' [--no-dealloc | -d] - [--oipbp | -i] - [--owpass= | -n ] - [--ause | -u] - [--sanact= | -a ] - [--ovrpat= | -p ] - [--force] +'nvme sanitize' [--no-dealloc | -d] [--oipbp | -i] + [--owpass= | -n ] + [--ause | -u] [--sanact= | -a ] + [--ovrpat= | -p ] + [--force] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -29,42 +28,42 @@ OPTIONS ------- -d:: --no-dealloc:: - No Deallocate After Sanitize: - If set, then the controller shall not deallocate any logical - blocks as a result of successfully completing the sanitize - operation. If cleared, then the controller should deallocate - logical blocks as a result of successfully completing the - sanitize operation. This bit shall be ignored if the Sanitize - Action field is set to 001b (i.e., Exit Failure Mode). + No Deallocate After Sanitize: + If set, then the controller shall not deallocate any logical + blocks as a result of successfully completing the sanitize + operation. If cleared, then the controller should deallocate + logical blocks as a result of successfully completing the + sanitize operation. This bit shall be ignored if the Sanitize + Action field is set to 001b (i.e., Exit Failure Mode). -i:: --oipbp:: - Overwrite Invert Pattern Between Passes: - If set, then the Overwrite Pattern shall be inverted between - passes. If cleared, then the overwrite pattern shall not be - inverted between passes. This bit shall be ignored unless the - Sanitize Action field is set to 011b (i.e., Overwrite). + Overwrite Invert Pattern Between Passes: + If set, then the Overwrite Pattern shall be inverted between + passes. If cleared, then the overwrite pattern shall not be + inverted between passes. This bit shall be ignored unless the + Sanitize Action field is set to 011b (i.e., Overwrite). -n :: --owpass=:: - Overwrite Pass Count: - This field specifies the number of overwrite passes (i.e., - how many times the media is to be overwritten) using the data - from the Overwrite Pattern field of this command. A value of 0 - specifies 16 overwrite passes. This field shall be ignored - unless the Sanitize Action field is set to 011b (i.e., Overwrite). + Overwrite Pass Count: + This field specifies the number of overwrite passes (i.e., + how many times the media is to be overwritten) using the data + from the Overwrite Pattern field of this command. A value of 0 + specifies 16 overwrite passes. This field shall be ignored + unless the Sanitize Action field is set to 011b (i.e., Overwrite). -u:: --ause:: - Allow Unrestricted Sanitize Exit: - If set, then the sanitize operation is performed in unrestricted - completion mode. If cleared then the sanitize operation is - performed in restricted completion mode. This bit shall be ignored - if the Sanitize Action field is set to 001b (i.e., Exit Failure Mode). + Allow Unrestricted Sanitize Exit: + If set, then the sanitize operation is performed in unrestricted + completion mode. If cleared then the sanitize operation is + performed in restricted completion mode. This bit shall be ignored + if the Sanitize Action field is set to 001b (i.e., Exit Failure Mode). -a :: --sanact=:: - Sanitize Action: + Sanitize Action: + [] |================= @@ -78,15 +77,24 @@ OPTIONS -p :: --ovrpat=:: - Overwrite Pattern: - This field is ignored unless the Sanitize Action field in - Command Dword 10 is set to 011b (i.e., Overwrite). This field - specifies a 32-bit pattern that is used for the Overwrite - sanitize operation. + Overwrite Pattern: + This field is ignored unless the Sanitize Action field in + Command Dword 10 is set to 011b (i.e., Overwrite). This field + specifies a 32-bit pattern that is used for the Overwrite + sanitize operation. --force:: - Ignore namespace is currently busy and performed the operation - even though. + Ignore namespace is currently busy and performed the operation + even though. + +-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 -------- diff --git a/Documentation/nvme-seagate-clear-fw-activate-history.1 b/Documentation/nvme-seagate-clear-fw-activate-history.1 index cb605ba..68a943d 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-CLEAR" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-CLEAR" "1" "12/21/2023" "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 6dc0d10..a395267 100644 --- a/Documentation/nvme-seagate-clear-fw-activate-history.html +++ b/Documentation/nvme-seagate-clear-fw-activate-history.html @@ -757,7 +757,7 @@ nvme-seagate-clear-fw-activate-history (1) Manual Page

DESCRIPTION

-

This command will only work on Seagate devices supporting this feature. Not +

This command will only work on Seagate devices supporting this feature. Not all commands work across all product families.

The <device> may be either an NVMe character device (ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1).

@@ -792,7 +792,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-clear-fw-activate-history.txt b/Documentation/nvme-seagate-clear-fw-activate-history.txt index 2b17222..01f018b 100644 --- a/Documentation/nvme-seagate-clear-fw-activate-history.txt +++ b/Documentation/nvme-seagate-clear-fw-activate-history.txt @@ -12,7 +12,7 @@ SYNOPSIS DESCRIPTION ----------- -This command will only work on Seagate devices supporting this feature. Not +This command will only work on Seagate devices supporting this feature. Not all commands work across all product families. The '' may be either an NVMe character device (ex: /dev/nvme0) or an @@ -22,7 +22,7 @@ OPTIONS ------- -s --save:: - specifies that the controller shall save the attribute. + specifies that the controller shall save the attribute. EXAMPLES -------- diff --git a/Documentation/nvme-seagate-clear-pcie-correctable-errors.1 b/Documentation/nvme-seagate-clear-pcie-correctable-errors.1 index d8c9a90..beebd42 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-CLEAR" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-CLEAR" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,7 @@ nvme-seagate-clear-pcie-correctable-errors \- Clear Seagate PCIe error statistic .SH "SYNOPSIS" .sp .nf -\fInvme seagate clear\-pcie\-correctable\-errors [] [OPTIONS]\fR +\fInvme seagate clear\-pcie\-correctable\-errors [] [OPTIONS]\fR .fi .SH "DESCRIPTION" .sp diff --git a/Documentation/nvme-seagate-clear-pcie-correctable-errors.html b/Documentation/nvme-seagate-clear-pcie-correctable-errors.html index feb6ad6..cd71dc5 100644 --- a/Documentation/nvme-seagate-clear-pcie-correctable-errors.html +++ b/Documentation/nvme-seagate-clear-pcie-correctable-errors.html @@ -749,7 +749,7 @@ nvme-seagate-clear-pcie-correctable-errors(1) Manual Page

SYNOPSIS

-
nvme seagate clear-pcie-correctable-errors [<device>]  [OPTIONS]
+
nvme seagate clear-pcie-correctable-errors [<device>] [OPTIONS]
@@ -757,7 +757,7 @@ nvme-seagate-clear-pcie-correctable-errors(1) Manual Page

DESCRIPTION

-

This command will only work on Seagate devices supporting this feature. Not +

This command will only work on Seagate devices supporting this feature. Not all commands work across all product families.

The <device> parameter is mandatory and may be either an NVMe character device (ex: /dev/nvme0), or an nvme block device (ex: /dev/nvme0n1).

@@ -802,7 +802,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-clear-pcie-correctable-errors.txt b/Documentation/nvme-seagate-clear-pcie-correctable-errors.txt index 33952d3..1239f83 100644 --- a/Documentation/nvme-seagate-clear-pcie-correctable-errors.txt +++ b/Documentation/nvme-seagate-clear-pcie-correctable-errors.txt @@ -8,12 +8,12 @@ nvme-seagate-clear-pcie-correctable-errors - Clear Seagate PCIe error statistics SYNOPSIS -------- [verse] -'nvme seagate clear-pcie-correctable-errors [] [OPTIONS]' +'nvme seagate clear-pcie-correctable-errors [] [OPTIONS]' DESCRIPTION ----------- -This command will only work on Seagate devices supporting this feature. Not +This command will only work on Seagate devices supporting this feature. Not all commands work across all product families. The '' parameter is mandatory and may be either an NVMe character device (ex: /dev/nvme0), or an @@ -23,7 +23,7 @@ OPTIONS ------- -s:: --save:: - Specifies that the controller shall save the attribute + Specifies that the controller shall save the attribute EXAMPLES -------- diff --git a/Documentation/nvme-seagate-cloud-SSD-plugin-version.1 b/Documentation/nvme-seagate-cloud-SSD-plugin-version.1 index 1989f20..24dddf5 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-CLOUD" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-CLOUD" "1" "12/21/2023" "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 bc93aad..ac4ab82 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 60f20be..c7dce50 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-GET\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-GET\-" "1" "12/21/2023" "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 4374c55..980b051 100644 --- a/Documentation/nvme-seagate-get-ctrl-tele.html +++ b/Documentation/nvme-seagate-get-ctrl-tele.html @@ -757,7 +757,7 @@ nvme-seagate-get-ctrl-tele(1) Manual Page

DESCRIPTION

-

This command will only work on Seagate devices supporting this feature. Not +

This command will only work on Seagate devices supporting this feature. Not all commands work across all product families.

The '<device>'parameter is mandatory and may be either an NVMe character device (ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1).

@@ -813,7 +813,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-get-ctrl-tele.txt b/Documentation/nvme-seagate-get-ctrl-tele.txt index e170548..4bb7362 100644 --- a/Documentation/nvme-seagate-get-ctrl-tele.txt +++ b/Documentation/nvme-seagate-get-ctrl-tele.txt @@ -13,7 +13,7 @@ SYNOPSIS DESCRIPTION ----------- -This command will only work on Seagate devices supporting this feature. Not +This command will only work on Seagate devices supporting this feature. Not all commands work across all product families. The ''parameter is mandatory and may be either an NVMe character device (ex: /dev/nvme0) or an @@ -23,11 +23,11 @@ OPTIONS ------- -n :: --namespace-id=:: - Desired namespace + Desired namespace -b:: --raw-binary:: - Output in raw format + Output in raw format EXAMPLES -------- diff --git a/Documentation/nvme-seagate-get-host-tele.1 b/Documentation/nvme-seagate-get-host-tele.1 index 2090581..0ff7d52 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-GET\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-GET\-" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -38,7 +38,7 @@ nvme-seagate-get-host-tele \- Retrieve Seagate Host\-Initiated Telemetry in eith .sp This will only work on Seagate devices supporting this feature\&. Not all commands work across all product families\&. .sp -The \fI\fR parameter is mandatory and may be either an NVMe character device (ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1)\&. +The \fI\fR parameter is mandatory and may be either an NVMe character device (ex: /dev/nvme0) or an block device (ex: /dev/nvme0n1)\&. .SH "OPTIONS" .PP \-n , \-\-namespace\-id= diff --git a/Documentation/nvme-seagate-get-host-tele.html b/Documentation/nvme-seagate-get-host-tele.html index da3b81b..7882d91 100644 --- a/Documentation/nvme-seagate-get-host-tele.html +++ b/Documentation/nvme-seagate-get-host-tele.html @@ -757,10 +757,10 @@ nvme-seagate-get-host-tele(1) Manual Page

DESCRIPTION

-

This will only work on Seagate devices supporting this feature. Not all +

This will only work on Seagate devices supporting this feature. Not all commands work across all product families.

-

The <device> parameter is mandatory and may be either an NVMe character device (ex: /dev/nvme0) or an -nvme block device (ex: /dev/nvme0n1).

+

The <device> parameter is mandatory and may be either an NVMe character device +(ex: /dev/nvme0) or an block device (ex: /dev/nvme0n1).

@@ -786,7 +786,8 @@ nvme block device (ex: /dev/nvme0n1).

- 1 - controller shall capture Data representing the internal state of the controller at the time the command is processed. + 1 - controller shall capture Data representing the internal state of the + controller at the time the command is processed. 0 - controller shall not update the Telemetry Host Initiated Data.

@@ -825,7 +826,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-get-host-tele.txt b/Documentation/nvme-seagate-get-host-tele.txt index 2863c12..83cdefc 100644 --- a/Documentation/nvme-seagate-get-host-tele.txt +++ b/Documentation/nvme-seagate-get-host-tele.txt @@ -13,26 +13,27 @@ SYNOPSIS DESCRIPTION ----------- -This will only work on Seagate devices supporting this feature. Not all +This will only work on Seagate devices supporting this feature. Not all commands work across all product families. -The '' parameter is mandatory and may be either an NVMe character device (ex: /dev/nvme0) or an -nvme block device (ex: /dev/nvme0n1). +The '' parameter is mandatory and may be either an NVMe character device +(ex: /dev/nvme0) or an block device (ex: /dev/nvme0n1). OPTIONS ------- -n :: --namespace-id=:: - desired namespace + desired namespace -i :: --log_specific=:: - 1 - controller shall capture Data representing the internal state of the controller at the time the command is processed. - 0 - controller shall not update the Telemetry Host Initiated Data. + 1 - controller shall capture Data representing the internal state of the + controller at the time the command is processed. + 0 - controller shall not update the Telemetry Host Initiated Data. -b:: --raw-binary:: - output in raw format + output in raw format EXAMPLES -------- diff --git a/Documentation/nvme-seagate-help.1 b/Documentation/nvme-seagate-help.1 index bdfcfb2..003fd21 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-HELP" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-HELP" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-help.html b/Documentation/nvme-seagate-help.html index 304d08b..91791da 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 94d3985..b0c24da 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-PLUGI" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-PLUGI" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-plugin-version.html b/Documentation/nvme-seagate-plugin-version.html index 5a65c48..110efe8 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 abf2b34..b1faf83 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VERSI" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VERSI" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-seagate-version.html b/Documentation/nvme-seagate-version.html index 62b9af0..dbeb82a 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 260c947..6d7be65 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-F" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-F" "1" "12/21/2023" "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 0f45465..47934c7 100644 --- a/Documentation/nvme-seagate-vs-fw-activate-history.html +++ b/Documentation/nvme-seagate-vs-fw-activate-history.html @@ -757,7 +757,7 @@ nvme-seagate-vs-fw-activate-history (1) Manual Page

DESCRIPTION

-

This command will only work on Seagate devices supporting this feature. Not +

This command will only work on Seagate devices supporting this feature. Not all commands work across all product families.

The <device> may be either an NVMe character device (ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1).

@@ -813,7 +813,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-vs-fw-activate-history.txt b/Documentation/nvme-seagate-vs-fw-activate-history.txt index e6b030d..8df58b4 100644 --- a/Documentation/nvme-seagate-vs-fw-activate-history.txt +++ b/Documentation/nvme-seagate-vs-fw-activate-history.txt @@ -13,7 +13,7 @@ SYNOPSIS DESCRIPTION ----------- -This command will only work on Seagate devices supporting this feature. Not +This command will only work on Seagate devices supporting this feature. Not all commands work across all product families. The '' may be either an NVMe character device (ex: /dev/nvme0) or an @@ -23,11 +23,11 @@ OPTIONS ------- -n :: --namespace-id=:: - Desired namespace + Desired namespace -f :: --dump-file=:: - Dump file + Dump file EXAMPLES -------- diff --git a/Documentation/nvme-seagate-vs-internal-log.1 b/Documentation/nvme-seagate-vs-internal-log.1 index e39f348..2d16e16 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-I" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-I" "1" "12/21/2023" "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 35e42bb..a78d5b2 100644 --- a/Documentation/nvme-seagate-vs-internal-log.html +++ b/Documentation/nvme-seagate-vs-internal-log.html @@ -757,10 +757,10 @@ nvme-seagate-vs-internal-log(1) Manual Page

DESCRIPTION

-

This command will only work on Seagate devices supporting this feature. Not +

This command will only work on Seagate devices supporting this feature. Not all commands work across all product families.

-

The <device> parameter is mandatory and may be either an NVMe character device (ex: /dev/nvme0) or an -nvme block device (ex: /dev/nvme0n1).

+

The <device> parameter is mandatory and may be either an NVMe character device +(ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1).

@@ -795,7 +795,8 @@ nvme block device (ex: /dev/nvme0n1).

EXAMPLES

-

Get the Seagate vendor specific Controller-Initiated telemetry log for the specified device.

+

Get the Seagate vendor specific Controller-Initiated telemetry log for the +specified device.

# nvme seagate vs-internal-log /dev/nvme0
@@ -813,7 +814,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-vs-internal-log.txt b/Documentation/nvme-seagate-vs-internal-log.txt index 3284020..4a895bc 100644 --- a/Documentation/nvme-seagate-vs-internal-log.txt +++ b/Documentation/nvme-seagate-vs-internal-log.txt @@ -13,25 +13,26 @@ SYNOPSIS DESCRIPTION ----------- -This command will only work on Seagate devices supporting this feature. Not +This command will only work on Seagate devices supporting this feature. Not all commands work across all product families. -The '' parameter is mandatory and may be either an NVMe character device (ex: /dev/nvme0) or an -nvme block device (ex: /dev/nvme0n1). +The '' parameter is mandatory and may be either an NVMe character device +(ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1). OPTIONS ------- -n :: --namespace-id=:: - Desired namespace + Desired namespace -f :: --dump-file=:: - Dump file + Dump file EXAMPLES -------- -Get the Seagate vendor specific Controller-Initiated telemetry log for the specified device. +Get the Seagate vendor specific Controller-Initiated telemetry log for the +specified device. ------------ # nvme seagate vs-internal-log /dev/nvme0 diff --git a/Documentation/nvme-seagate-vs-log-page-sup.1 b/Documentation/nvme-seagate-vs-log-page-sup.1 index 6b7bac1..59d1436 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-L" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-L" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,7 +41,7 @@ This command will only work on Seagate devices supporting this feature\&. Not al The \fI\fR may be either an NVMe character device (ex: /dev/nvme0) or an NVMe block device (ex: /dev/nvme0n1)\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Output in binary format .RE diff --git a/Documentation/nvme-seagate-vs-log-page-sup.html b/Documentation/nvme-seagate-vs-log-page-sup.html index 44765aa..055665d 100644 --- a/Documentation/nvme-seagate-vs-log-page-sup.html +++ b/Documentation/nvme-seagate-vs-log-page-sup.html @@ -757,7 +757,7 @@ nvme-seagate-vs-log-page-sup(1) Manual Page

DESCRIPTION

-

This command will only work on Seagate devices supporting this feature. Not +

This command will only work on Seagate devices supporting this feature. Not all commands work across all product families.

The <device> may be either an NVMe character device (ex: /dev/nvme0) or an NVMe block device (ex: /dev/nvme0n1).

@@ -768,10 +768,10 @@ NVMe block device (ex: /dev/nvme0n1).

--o <FMT> +-o <fmt>
---output-format=<FMT> +--output-format=<fmt>

@@ -814,7 +814,7 @@ LogPage-Id LogPage-Name

diff --git a/Documentation/nvme-seagate-vs-log-page-sup.txt b/Documentation/nvme-seagate-vs-log-page-sup.txt index a5d1488..55c65fd 100644 --- a/Documentation/nvme-seagate-vs-log-page-sup.txt +++ b/Documentation/nvme-seagate-vs-log-page-sup.txt @@ -13,7 +13,7 @@ SYNOPSIS DESCRIPTION ----------- -This command will only work on Seagate devices supporting this feature. Not +This command will only work on Seagate devices supporting this feature. Not all commands work across all product families. The '' may be either an NVMe character device (ex: /dev/nvme0) or an @@ -21,9 +21,9 @@ NVMe block device (ex: /dev/nvme0n1). OPTIONS ------- --o :: ---output-format=:: - Output in binary format +-o :: +--output-format=:: + Output in binary format EXAMPLES -------- diff --git a/Documentation/nvme-seagate-vs-pcie-stats.1 b/Documentation/nvme-seagate-vs-pcie-stats.1 index afe83e5..9722029 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-P" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-P" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,7 +41,7 @@ This command will only work on Seagate devices supporting this feature\&. Not al The \fI\fR parameter is mandatory and it may be either an NVMe character device (ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1)\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Output in binary format .RE diff --git a/Documentation/nvme-seagate-vs-pcie-stats.html b/Documentation/nvme-seagate-vs-pcie-stats.html index b43cba0..d0b935e 100644 --- a/Documentation/nvme-seagate-vs-pcie-stats.html +++ b/Documentation/nvme-seagate-vs-pcie-stats.html @@ -757,7 +757,7 @@ nvme-seagate-vs-pcie-stats(1) Manual Page

DESCRIPTION

-

This command will only work on Seagate devices supporting this feature. Not +

This command will only work on Seagate devices supporting this feature. Not all commands work across all product families.

The <device> parameter is mandatory and it may be either an NVMe character device (ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1).

@@ -768,10 +768,10 @@ nvme block device (ex: /dev/nvme0n1).

--o <FMT> +-o <fmt>
---output-format=<FMT> +--output-format=<fmt>

@@ -802,7 +802,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-vs-pcie-stats.txt b/Documentation/nvme-seagate-vs-pcie-stats.txt index 74599bf..86f87a3 100644 --- a/Documentation/nvme-seagate-vs-pcie-stats.txt +++ b/Documentation/nvme-seagate-vs-pcie-stats.txt @@ -13,7 +13,7 @@ SYNOPSIS DESCRIPTION ----------- -This command will only work on Seagate devices supporting this feature. Not +This command will only work on Seagate devices supporting this feature. Not all commands work across all product families. The '' parameter is mandatory and it may be either an NVMe character device (ex: /dev/nvme0) or an @@ -21,9 +21,9 @@ nvme block device (ex: /dev/nvme0n1). OPTIONS ------- --o :: ---output-format=:: - Output in binary format +-o :: +--output-format=:: + Output in binary format EXAMPLES -------- diff --git a/Documentation/nvme-seagate-vs-smart-add-log.1 b/Documentation/nvme-seagate-vs-smart-add-log.1 index 799c101..19730ff 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-S" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-S" "1" "12/21/2023" "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 ddd4cd6..5d189cb 100644 --- a/Documentation/nvme-seagate-vs-smart-add-log.html +++ b/Documentation/nvme-seagate-vs-smart-add-log.html @@ -764,7 +764,7 @@ character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

The log contents may be associated with the controller, in which case the namespace parameter is ignored.

Two logs exist, page 0xC4 (Extended SMART log page) and page 0xCF (DRAM Supercap SMART log page)

-

This command will only work on Seagate devices supporting this feature. Not +

This command will only work on Seagate devices supporting this feature. Not all commands work across all product families.

@@ -830,7 +830,7 @@ all commands work across all product families.

diff --git a/Documentation/nvme-seagate-vs-smart-add-log.txt b/Documentation/nvme-seagate-vs-smart-add-log.txt index 962a109..836220a 100644 --- a/Documentation/nvme-seagate-vs-smart-add-log.txt +++ b/Documentation/nvme-seagate-vs-smart-add-log.txt @@ -24,23 +24,23 @@ The log contents may be associated with the controller, in which case the namesp Two logs exist, page 0xC4 (Extended SMART log page) and page 0xCF (DRAM Supercap SMART log page) -This command will only work on Seagate devices supporting this feature. Not +This command will only work on Seagate devices supporting this feature. Not all commands work across all product families. OPTIONS ------- -l :: --log=:: - Log number, page 0xC4 (Extended SMART log page) and page 0xCF (DRAM - Supercap SMART log page) + Log number, page 0xC4 (Extended SMART log page) and page 0xCF (DRAM + Supercap SMART log page) -n :: --namespace-id=:: - Namespace number + Namespace number -o :: --output-file=:: - Output in binary format. Defaults to text-formatted dump to stdout + Output in binary format. Defaults to text-formatted dump to stdout EXAMPLES -------- diff --git a/Documentation/nvme-seagate-vs-temperature-stats.1 b/Documentation/nvme-seagate-vs-temperature-stats.1 index d933def..075dd28 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SEAGATE\-VS\-T" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SEAGATE\-VS\-T" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,7 +41,7 @@ This command will only work on Seagate devices supporting this feature\&. Not al The \*(Aq\*(Aqparameter is mandatory and it may be either an NVMe character device (ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1)\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Output in binary format .RE diff --git a/Documentation/nvme-seagate-vs-temperature-stats.html b/Documentation/nvme-seagate-vs-temperature-stats.html index 75e7c65..2046e49 100644 --- a/Documentation/nvme-seagate-vs-temperature-stats.html +++ b/Documentation/nvme-seagate-vs-temperature-stats.html @@ -757,7 +757,7 @@ nvme-seagate-vs-temperature-stats(1) Manual Page

DESCRIPTION

-

This command will only work on Seagate devices supporting this feature. Not +

This command will only work on Seagate devices supporting this feature. Not all commands work across all product families.

The '<device>'parameter is mandatory and it may be either an NVMe character device (ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1).

@@ -768,10 +768,10 @@ nvme block device (ex: /dev/nvme0n1).

--o <FMT> +-o <fmt>
---output-format=<FMT> +--output-format=<fmt>

@@ -802,7 +802,7 @@ nvme block device (ex: /dev/nvme0n1).

diff --git a/Documentation/nvme-seagate-vs-temperature-stats.txt b/Documentation/nvme-seagate-vs-temperature-stats.txt index 2691e30..58a9f11 100644 --- a/Documentation/nvme-seagate-vs-temperature-stats.txt +++ b/Documentation/nvme-seagate-vs-temperature-stats.txt @@ -13,7 +13,7 @@ SYNOPSIS DESCRIPTION ----------- -This command will only work on Seagate devices supporting this feature. Not +This command will only work on Seagate devices supporting this feature. Not all commands work across all product families. The ''parameter is mandatory and it may be either an NVMe character device (ex: /dev/nvme0) or an @@ -21,9 +21,9 @@ nvme block device (ex: /dev/nvme0n1). OPTIONS ------- --o :: ---output-format=:: - Output in binary format +-o :: +--output-format=:: + Output in binary format EXAMPLES -------- diff --git a/Documentation/nvme-security-recv.1 b/Documentation/nvme-security-recv.1 index 262720f..1dcf782 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SECURITY\-RECV" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SECURITY\-RECV" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,12 +33,12 @@ nvme-security-recv \- Security Recv command .sp .nf \fInvme security\-recv\fR [\-\-size= | \-x ] - [\-\-secp= | \-p ] - [\-\-spsp= | \-s ] - [\-\-nssf= | \-N ] - [\-\-al= | \-t ] - [\-\-namespace\-id= | \-n ] - [\-\-raw\-binary | \-b] + [\-\-secp= | \-p ] + [\-\-spsp= | \-s ] + [\-\-nssf= | \-N ] + [\-\-al= | \-t ] + [\-\-namespace\-id= | \-n ] [\-\-raw\-binary | \-b] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -83,6 +83,20 @@ Allocation Length: The value of this field is specific to the Security Protocol .RS 4 Print the raw buffer to stdout\&. Defaults to print in hex\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No Examples diff --git a/Documentation/nvme-security-recv.html b/Documentation/nvme-security-recv.html index 3eacdff..f2d0074 100644 --- a/Documentation/nvme-security-recv.html +++ b/Documentation/nvme-security-recv.html @@ -750,12 +750,12 @@ nvme-security-recv(1) Manual Page
nvme security-recv <device> [--size=<size> | -x <size>]
-                    [--secp=<security-protocol> | -p <security-protocol>]
-                    [--spsp=<protocol-specific> | -s <protocol-specific>]
-                    [--nssf=<nvme-specific> | -N <nvme-specific>]
-                    [--al=<allocation-length> | -t <allocation-length>]
-                    [--namespace-id=<nsid> | -n <nsid>]
-                    [--raw-binary | -b]
+ [--secp=<security-protocol> | -p <security-protocol>] + [--spsp=<protocol-specific> | -s <protocol-specific>] + [--nssf=<nvme-specific> | -N <nvme-specific>] + [--al=<allocation-length> | -t <allocation-length>] + [--namespace-id=<nsid> | -n <nsid>] [--raw-binary | -b] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -866,6 +866,29 @@ controller reset occurs.

Print the raw buffer to stdout. Defaults to print in hex.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -886,7 +909,7 @@ controller reset occurs.

diff --git a/Documentation/nvme-security-recv.txt b/Documentation/nvme-security-recv.txt index 0b9fe99..ef77531 100644 --- a/Documentation/nvme-security-recv.txt +++ b/Documentation/nvme-security-recv.txt @@ -9,12 +9,12 @@ SYNOPSIS -------- [verse] 'nvme security-recv' [--size= | -x ] - [--secp= | -p ] - [--spsp= | -s ] - [--nssf= | -N ] - [--al= | -t ] - [--namespace-id= | -n ] - [--raw-binary | -b] + [--secp= | -p ] + [--spsp= | -s ] + [--nssf= | -N ] + [--al= | -t ] + [--namespace-id= | -n ] [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -71,6 +71,15 @@ OPTIONS --raw-binary:: Print the raw buffer to stdout. Defaults to print in hex. +-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 -------- No Examples diff --git a/Documentation/nvme-security-send.1 b/Documentation/nvme-security-send.1 index 187b7fa..236348a 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SECURITY\-SEND" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SECURITY\-SEND" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,11 +33,12 @@ nvme-security-send \- Security Send command .sp .nf \fInvme security\-send\fR [\-\-file= | \-f ] - [\-\-secp= | \-p ] - [\-\-spsp= | \-s ] - [\-\-tl= | \-t ] - [\-\-nssf= | \-N ] - [\-\-namespace\-id= | \-n ] + [\-\-secp= | \-p ] + [\-\-spsp= | \-s ] + [\-\-tl= | \-t ] + [\-\-nssf= | \-N ] + [\-\-namespace\-id= | \-n ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -75,6 +76,20 @@ SP Specific: The value of this field is specific to the Security Protocol as def .RS 4 Transfer Length: The value of this field is specific to the Security Protocol as defined in SPC\-4\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No Examples diff --git a/Documentation/nvme-security-send.html b/Documentation/nvme-security-send.html index b2ee749..8058ba3 100644 --- a/Documentation/nvme-security-send.html +++ b/Documentation/nvme-security-send.html @@ -750,11 +750,12 @@ nvme-security-send(1) Manual Page
nvme security-send <device> [--file=<file> | -f <file>]
-                    [--secp=<security-protocol> | -p <security-protocol>]
-                    [--spsp=<protocol-specific> | -s <protocol-specific>]
-                    [--tl=<transfer-length> | -t <transfer-length>]
-                    [--nssf=<nvme-specific> | -N <nvme-specific>]
-                    [--namespace-id=<nsid> | -n <nsid>]
+ [--secp=<security-protocol> | -p <security-protocol>] + [--spsp=<protocol-specific> | -s <protocol-specific>] + [--tl=<transfer-length> | -t <transfer-length>] + [--nssf=<nvme-specific> | -N <nvme-specific>] + [--namespace-id=<nsid> | -n <nsid>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -852,6 +853,29 @@ Receive command is Security Protocol field dependent as defined in SPC-4.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -872,7 +896,7 @@ Receive command is Security Protocol field dependent as defined in SPC-4.

diff --git a/Documentation/nvme-security-send.txt b/Documentation/nvme-security-send.txt index ae22628..347b970 100644 --- a/Documentation/nvme-security-send.txt +++ b/Documentation/nvme-security-send.txt @@ -9,11 +9,12 @@ SYNOPSIS -------- [verse] 'nvme security-send' [--file= | -f ] - [--secp= | -p ] - [--spsp= | -s ] - [--tl= | -t ] - [--nssf= | -N ] - [--namespace-id= | -n ] + [--secp= | -p ] + [--spsp= | -s ] + [--tl= | -t ] + [--nssf= | -N ] + [--namespace-id= | -n ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -63,6 +64,15 @@ OPTIONS Transfer Length: The value of this field is specific to the Security Protocol as defined in SPC-4. +-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 -------- No Examples diff --git a/Documentation/nvme-self-test-log.1 b/Documentation/nvme-self-test-log.1 index 9be513d..395cf51 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SELF\-TEST\-LO" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SELF\-TEST\-LO" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,7 +33,7 @@ nvme-self-test-log \- Retrieve the log information initiated by device\-self\-te .sp .nf \fInvme self\-test\fR\-log [\-\-log\-entries= | \-e ] - [\-\-output\-format= | \-o ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -51,13 +51,19 @@ By default the log is printed out in the normal readable format\&. Specifies how many DST log entries the program should request from the device\&. This must be at least one, and shouldn\(cqt exceed the 20 entries\&. Defaults to 20 DST log entries\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-self-test-log.html b/Documentation/nvme-self-test-log.html index 8490729..a58677b 100644 --- a/Documentation/nvme-self-test-log.html +++ b/Documentation/nvme-self-test-log.html @@ -750,7 +750,7 @@ nvme-self-test-log(1) Manual Page
nvme self-test-log <device> [--log-entries=<entries> | -e <entries>]
-                    [--output-format=<FMT> | -o <FMT>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -788,15 +788,26 @@ json format.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -847,7 +858,7 @@ Get the self-test-log and print it in a json format: diff --git a/Documentation/nvme-self-test-log.txt b/Documentation/nvme-self-test-log.txt index 56a3c4a..d4600e8 100644 --- a/Documentation/nvme-self-test-log.txt +++ b/Documentation/nvme-self-test-log.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'nvme self-test'-log [--log-entries= | -e ] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -35,11 +35,14 @@ OPTION the device. This must be at least one, and shouldn't exceed the 20 entries. Defaults to 20 DST log entries. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-set-feature.1 b/Documentation/nvme-set-feature.1 index 0ab78b9..40e8a07 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SET\-FEATURE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SET\-FEATURE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,11 +33,11 @@ nvme-set-feature \- Sets an NVMe feature, returns applicable results .sp .nf \fInvme set\-feature\fR [\-\-namespace\-id= | \-n ] - [\-\-feature\-id= | \-f ] [\-\-value= | \-v ] - [\-\-uuid\-index= | \-U ] - [\-\-data\-len= | \-l ] - [\-\-data= | \-d ] - [\-\-save | \-s] + [\-\-feature\-id= | \-f ] [\-\-value= | \-V ] + [\-\-uuid\-index= | \-U ] + [\-\-data\-len= | \-l ] + [\-\-data= | \-d ] [\-\-save | \-s] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -68,7 +68,7 @@ The data length for the buffer submitted for this feature\&. Most known features The data file for the buffer submitted for this feature\&. Most known features do not use this value\&. The exceptions is LBA Range Type and host identifier\&. This defaults to STDIN so files and echo can be piped\&. .RE .PP -\-v , \-\-value= +\-V , \-\-value= .RS 4 The value for command dword 11, the value you want to set the feature to\&. .RE @@ -82,6 +82,20 @@ Save the attribute so that it persists through all power states and resets\&. .RS 4 UUID Index of the feature .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 @@ -98,7 +112,7 @@ Sets the Power State (PS) to 1 in feature id 2: .RS 4 .\} .nf -# nvme set\-feature /dev/nvme0 \-f 2 /dev/nvme0n1 \-v 0x1 +# nvme set\-feature /dev/nvme0 \-f 2 /dev/nvme0n1 \-V 0x1 .fi .if n \{\ .RE diff --git a/Documentation/nvme-set-feature.html b/Documentation/nvme-set-feature.html index 7fcb060..912a97f 100644 --- a/Documentation/nvme-set-feature.html +++ b/Documentation/nvme-set-feature.html @@ -750,11 +750,11 @@ nvme-set-feature(1) Manual Page
nvme set-feature <device> [--namespace-id=<nsid> | -n <nsid>]
-                          [--feature-id=<fid> | -f <fid>] [--value=<value> | -v <value>]
-                          [--uuid-index=<uuid-index> | -U <uuid_index>]
-                          [--data-len=<data-len> | -l <data-len>]
-                          [--data=<data-file> | -d <data-file>]
-                          [--save | -s]
+ [--feature-id=<fid> | -f <fid>] [--value=<value> | -V <value>] + [--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]
@@ -826,7 +826,7 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

--v <value> +-V <value>
--value=<value> @@ -859,6 +859,29 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -868,11 +891,11 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

  • -Sets the Power State (PS) to 1 in feature id 2: +Sets the Power State (PS) to 1 in feature id 2:

    -
    # nvme set-feature /dev/nvme0 -f 2 /dev/nvme0n1 -v 0x1
    +
    # nvme set-feature /dev/nvme0 -f 2 /dev/nvme0n1 -V 0x1
  • @@ -899,7 +922,7 @@ Sets the host id to the ascii string. diff --git a/Documentation/nvme-set-feature.txt b/Documentation/nvme-set-feature.txt index 08b38f4..05c2210 100644 --- a/Documentation/nvme-set-feature.txt +++ b/Documentation/nvme-set-feature.txt @@ -9,11 +9,11 @@ SYNOPSIS -------- [verse] 'nvme set-feature' [--namespace-id= | -n ] - [--feature-id= | -f ] [--value= | -v ] - [--uuid-index= | -U ] - [--data-len= | -l ] - [--data= | -d ] - [--save | -s] + [--feature-id= | -f ] [--value= | -V ] + [--uuid-index= | -U ] + [--data-len= | -l ] + [--data= | -d ] [--save | -s] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -51,7 +51,7 @@ OPTIONS Range Type and host identifier. This defaults to STDIN so files and echo can be piped. --v :: +-V :: --value=:: The value for command dword 11, the value you want to set the feature to. @@ -64,12 +64,21 @@ OPTIONS --uuid-index=:: UUID Index of the feature +-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 -------- -* Sets the Power State (PS) to 1 in feature id 2: +* Sets the Power State (PS) to 1 in feature id 2: + ------------ -# nvme set-feature /dev/nvme0 -f 2 /dev/nvme0n1 -v 0x1 +# nvme set-feature /dev/nvme0 -f 2 /dev/nvme0n1 -V 0x1 ------------ + diff --git a/Documentation/nvme-set-property.1 b/Documentation/nvme-set-property.1 index ef5d1f4..a18ac85 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SET\-PROPERTY" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SET\-PROPERTY" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,23 +32,38 @@ nvme-set-property \- Writes and shows the defined NVMe controller property for N .SH "SYNOPSIS" .sp .nf -\fInvme set\-property\fR [\-\-offset= | \-o ] - [\-\-value= | \-v ] +\fInvme set\-property\fR [\-\-offset= | \-O ] + [\-\-value= | \-V ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp 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 .RS 4 \-\-value: The value of the property to be set\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples (yet)\&. diff --git a/Documentation/nvme-set-property.html b/Documentation/nvme-set-property.html index ff25412..c35b4ff 100644 --- a/Documentation/nvme-set-property.html +++ b/Documentation/nvme-set-property.html @@ -749,8 +749,9 @@ nvme-set-property(1) Manual Page

    SYNOPSIS

    -
    nvme set-property <device> [--offset=<offset> | -o <offset>]
    -                                [--value=<val> | -v <val>]
    +
    nvme set-property <device> [--offset=<offset> | -O <offset>]
    +                        [--value=<val> | -V <val>]
    +                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
    @@ -766,18 +767,18 @@ nvme-set-property(1) Manual Page
    --o +-O
    --offset

    - The offset of the property. + The offset of the property.

    --v +-V

    @@ -785,6 +786,29 @@ nvme-set-property(1) Manual Page The value of the property to be set.

    +
    +-o <fmt> +
    +
    +--output-format=<fmt> +
    +
    +

    + 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. +

    +
@@ -805,7 +829,7 @@ nvme-set-property(1) Manual Page diff --git a/Documentation/nvme-set-property.txt b/Documentation/nvme-set-property.txt index ba90fd3..22a513c 100644 --- a/Documentation/nvme-set-property.txt +++ b/Documentation/nvme-set-property.txt @@ -9,9 +9,9 @@ for NVMe over Fabric SYNOPSIS -------- [verse] -'nvme set-property' [--offset= | -o ] - [--value= | -v ] - +'nvme set-property' [--offset= | -O ] + [--value= | -V ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -19,14 +19,23 @@ Writes and shows the defined NVMe controller property for NVMe over Fabric. OPTIONS ------- --o:: +-O:: --offset:: - The offset of the property. + The offset of the property. --v:: +-V:: --value: The value of the property to be set. +-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 -------- No examples (yet). diff --git a/Documentation/nvme-show-hostnqn.1 b/Documentation/nvme-show-hostnqn.1 index 0411ebd..7ecddf5 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SHOW\-HOSTNQN" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SHOW\-HOSTNQN" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,14 +32,26 @@ nvme-show-hostnqn \- Show the host NQN configured for the system .SH "SYNOPSIS" .sp .nf -\fInvme show\-hostnqn\fR +\fInvme show\-hostnqn\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp Show the host NQN configured for the system\&. If /usr/local/etc/nvme/hostnqn is not present and systemd application\-specific machine IDs are available, this will show the systemd\-generated host NQN for the system\&. .SH "OPTIONS" -.sp -No options needed +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp nvme show\-hostnqn diff --git a/Documentation/nvme-show-hostnqn.html b/Documentation/nvme-show-hostnqn.html index e31b27d..e395b37 100644 --- a/Documentation/nvme-show-hostnqn.html +++ b/Documentation/nvme-show-hostnqn.html @@ -749,7 +749,7 @@ nvme-show-hostnqn(1) Manual Page

SYNOPSIS

-
nvme show-hostnqn
+
nvme show-hostnqn [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -757,7 +757,7 @@ nvme-show-hostnqn(1) Manual Page

DESCRIPTION

-

Show the host NQN configured for the system. If /usr/local/etc/nvme/hostnqn is +

Show the host NQN configured for the system. If /usr/local/etc/nvme/hostnqn is not present and systemd application-specific machine IDs are available, this will show the systemd-generated host NQN for the system.

@@ -765,7 +765,31 @@ this will show the systemd-generated host NQN for the system.

OPTIONS

-

No options needed

+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
+
@@ -785,7 +809,7 @@ this will show the systemd-generated host NQN for the system.

diff --git a/Documentation/nvme-show-hostnqn.txt b/Documentation/nvme-show-hostnqn.txt index 047e291..5074e2c 100644 --- a/Documentation/nvme-show-hostnqn.txt +++ b/Documentation/nvme-show-hostnqn.txt @@ -8,17 +8,24 @@ nvme-show-hostnqn - Show the host NQN configured for the system SYNOPSIS -------- [verse] -'nvme show-hostnqn' +'nvme show-hostnqn' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- -Show the host NQN configured for the system. If @SYSCONFDIR@/nvme/hostnqn is +Show the host NQN configured for the system. If @SYSCONFDIR@/nvme/hostnqn is not present and systemd application-specific machine IDs are available, this will show the systemd-generated host NQN for the system. OPTIONS ------- -No options needed +-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 -------- diff --git a/Documentation/nvme-show-regs.1 b/Documentation/nvme-show-regs.1 index a7ea5ac..e47d913 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ID\-NS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ID\-NS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,8 +32,8 @@ nvme-show-regs \- Reads and shows the defined NVMe controller registers for NVMe .SH "SYNOPSIS" .sp .nf -\fInvme show\-regs\fR [\-\-human\-readable | \-H] - [\-\-output\-format= | \-o ] +\fInvme show\-regs\fR [\-\-human\-readable | \-H] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -47,13 +47,19 @@ The parameter is mandatory and must be the nvme admin character device Display registers or supported properties in human readable format\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-show-regs.html b/Documentation/nvme-show-regs.html index 194b73c..96941b9 100644 --- a/Documentation/nvme-show-regs.html +++ b/Documentation/nvme-show-regs.html @@ -749,8 +749,8 @@ nvme-id-ns(1) Manual Page

SYNOPSIS

-
nvme show-regs <device>       [--human-readable | -H]
-                                [--output-format=<FMT> | -o <FMT>]
+
nvme show-regs <device> [--human-readable | -H]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -782,19 +782,30 @@ Only the supported properties are displayed.

- Display registers or supported properties in human readable format. + Display registers or supported properties in human readable format.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -848,7 +859,7 @@ in a json format: diff --git a/Documentation/nvme-show-regs.txt b/Documentation/nvme-show-regs.txt index 892b394..0460365 100644 --- a/Documentation/nvme-show-regs.txt +++ b/Documentation/nvme-show-regs.txt @@ -9,8 +9,8 @@ NVMe over PCIe or the controller properties for NVMe over Fabrics. SYNOPSIS -------- [verse] -'nvme show-regs' [--human-readable | -H] - [--output-format= | -o ] +'nvme show-regs' [--human-readable | -H] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -30,12 +30,16 @@ OPTIONS ------- -H:: --human-readable:: - Display registers or supported properties in human readable format. + Display registers or supported properties in human readable format. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-show-topology.1 b/Documentation/nvme-show-topology.1 index 1f56e19..4885936 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SHOW\-TOPOLOGY" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SHOW\-TOPOLOGY" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,14 +32,14 @@ nvme-show-topology \- Show topology of all NVMe subsystems .SH "SYNOPSIS" .sp .nf -\fInvme show\-topology\fR +\fInvme show\-topology\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp Show the topology of all NVMe subsystems\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR @@ -62,6 +62,20 @@ Set the ranking orer to \fInamespace\fR ordered\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp nvme show\-topology diff --git a/Documentation/nvme-show-topology.html b/Documentation/nvme-show-topology.html index 27556a3..ca90b74 100644 --- a/Documentation/nvme-show-topology.html +++ b/Documentation/nvme-show-topology.html @@ -749,7 +749,7 @@ nvme-show-topology(1) Manual Page

SYNOPSIS

-
nvme show-topology
+
nvme show-topology [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -765,10 +765,10 @@ nvme-show-topology(1) Manual Page
--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -802,6 +802,29 @@ nvme-show-topology(1) Manual Page always namespace ordered.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -822,7 +845,7 @@ nvme-show-topology(1) Manual Page diff --git a/Documentation/nvme-show-topology.txt b/Documentation/nvme-show-topology.txt index f0583fb..32ffad1 100644 --- a/Documentation/nvme-show-topology.txt +++ b/Documentation/nvme-show-topology.txt @@ -8,7 +8,7 @@ nvme-show-topology - Show topology of all NVMe subsystems SYNOPSIS -------- [verse] -'nvme show-topology' +'nvme show-topology' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -16,8 +16,8 @@ Show the topology of all NVMe subsystems. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal' or 'json'. Only one output format can be used at a time. @@ -33,6 +33,15 @@ OPTIONS has only an effect for output format 'normal'. The JSON output is always 'namespace' ordered. +-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 -------- nvme show-topology diff --git a/Documentation/nvme-smart-log.1 b/Documentation/nvme-smart-log.1 index 6c95ab5..2fa623b 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SMART\-LOG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SMART\-LOG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,7 +34,7 @@ nvme-smart-log \- Send NVMe SMART log page request, returns result and log .nf \fInvme smart\-log\fR [\-\-namespace\-id= | \-n ] [\-\-raw\-binary | \-b] - [\-\-output\-format= | \-o ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -55,13 +55,19 @@ Retrieve the SMART log for the given nsid\&. This is optional and its success ma Print the raw SMART log buffer to stdout\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, -\fIjson\fR, or +\fIjson\fR +or \fIbinary\fR\&. Only one output format can be used at a time\&. .RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-smart-log.html b/Documentation/nvme-smart-log.html index ba0605f..31e7615 100644 --- a/Documentation/nvme-smart-log.html +++ b/Documentation/nvme-smart-log.html @@ -751,7 +751,7 @@ nvme-smart-log(1) Manual Page
nvme smart-log <device> [--namespace-id=<nsid> | -n <nsid>]
                         [--raw-binary | -b]
-                        [--output-format=<fmt> | -o <fmt>]
+ [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -799,15 +799,26 @@ printed to stdout for another program to parse.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + 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.

@@ -850,7 +861,7 @@ Print the raw SMART log to a file: diff --git a/Documentation/nvme-smart-log.txt b/Documentation/nvme-smart-log.txt index 77d0015..c08f523 100644 --- a/Documentation/nvme-smart-log.txt +++ b/Documentation/nvme-smart-log.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'nvme smart-log' [--namespace-id= | -n ] [--raw-binary | -b] - [--output-format= | -o ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -38,10 +38,14 @@ OPTIONS --raw-binary:: Print the raw SMART log buffer to stdout. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-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 -------- diff --git a/Documentation/nvme-subsystem-reset.1 b/Documentation/nvme-subsystem-reset.1 index 6a7ee6b..a5c3cd6 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SUBSYSTEM\-RES" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SUBSYSTEM\-RES" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,13 +33,26 @@ nvme-subsystem-reset \- Reset the nvme subsystem\&. .sp .nf \fInvme subsystem\-reset\fR + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp Requests NVMe subsystem reset\&. The param is mandatory and must be an NVMe character device (ex: /dev/nvme0)\&. .SH "OPTIONS" -.sp -None +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-subsystem-reset.html b/Documentation/nvme-subsystem-reset.html index d888938..c4f769c 100644 --- a/Documentation/nvme-subsystem-reset.html +++ b/Documentation/nvme-subsystem-reset.html @@ -749,7 +749,8 @@ nvme-subsystem-reset(1) Manual Page

SYNOPSIS

-
nvme subsystem-reset <device>
+
nvme subsystem-reset <device>
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -764,7 +765,31 @@ be an NVMe character device (ex: /dev/nvme0).

OPTIONS

-

None

+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
+
@@ -794,7 +819,7 @@ Resets the subsystem. diff --git a/Documentation/nvme-subsystem-reset.txt b/Documentation/nvme-subsystem-reset.txt index 2267acd..cc3a139 100644 --- a/Documentation/nvme-subsystem-reset.txt +++ b/Documentation/nvme-subsystem-reset.txt @@ -9,6 +9,7 @@ SYNOPSIS -------- [verse] 'nvme subsystem-reset' + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -17,7 +18,14 @@ be an NVMe character device (ex: /dev/nvme0). OPTIONS ------- -None +-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 -------- diff --git a/Documentation/nvme-supported-cap-config-log.txt b/Documentation/nvme-supported-cap-config-log.txt index 0050634..b60303b 100644 --- a/Documentation/nvme-supported-cap-config-log.txt +++ b/Documentation/nvme-supported-cap-config-log.txt @@ -9,9 +9,8 @@ Configuration List Log pages request, returns result and log. SYNOPSIS -------- [verse] -'nvme supported-cap-config-log' [--dom-id | -d ] - [--output-format= | -o ] - [--raw-binary | -b] +'nvme supported-cap-config-log' [--dom-id | -d] [--raw-binary | -b] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -27,19 +26,23 @@ pages log structure will be printed. OPTIONS ------- - --o :: ---output-format=:: - This option will set the reporting format to normal, json, or binary. - Only one output format can be used at a time. - -d:: --dom-id:: - To get the domain ID. + To get the domain ID. + -b:: --raw-binary:: To show raw binary data. +-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 -------- No examples provided yet. diff --git a/Documentation/nvme-supported-log-pages.1 b/Documentation/nvme-supported-log-pages.1 index 5a41133..1b84d03 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-SUPPORTED\-LOG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-SUPPORTED\-LOG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,8 +32,7 @@ nvme-supported-log-pages \- Send NVMe Supported Log pages request, returns resul .SH "SYNOPSIS" .sp .nf -\fInvme supported\-log\-pages\fR [\-\-output\-format= | \-o ] - [\-\-verbose | \-v] +\fInvme supported\-log\-pages\fR [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -44,14 +43,18 @@ The parameter is mandatory and should be the NVMe character device (ex: On success, the returned supported log pages log structure will be printed for each command that is supported\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 -This option will set the reporting format to normal, json, or binary\&. Only one output format can be used at a time\&. +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. .RE .PP \-v, \-\-verbose .RS 4 -Show more information including LID Supported (LSUPP) and Index Offset Supported (IOP) details\&. +Increase the information detail in the output\&. Show more information including LID Supported (LSUPP) and Index Offset Supported (IOP) details\&. .RE .SH "EXAMPLES" .sp diff --git a/Documentation/nvme-supported-log-pages.html b/Documentation/nvme-supported-log-pages.html index 2fe7126..3f811d7 100644 --- a/Documentation/nvme-supported-log-pages.html +++ b/Documentation/nvme-supported-log-pages.html @@ -749,8 +749,7 @@ nvme-supported-log-pages(1) Manual Page

SYNOPSIS

-
nvme supported-log-pages <device> [--output-format=<fmt> | -o <fmt>]
-                            [--verbose | -v]
+
nvme supported-log-pages <device> [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -771,15 +770,15 @@ for each command that is supported.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- This option will set the reporting format to normal, json, or binary. - Only one output format can be used at a time. + Set the reporting format to normal, json or binary. Only one + output format can be used at a time.

@@ -790,7 +789,8 @@ for each command that is supported.

- Show more information including LID Supported (LSUPP) and Index Offset Supported (IOP) details. + Increase the information detail in the output. Show more information + including LID Supported (LSUPP) and Index Offset Supported (IOP) details.

@@ -813,7 +813,7 @@ for each command that is supported.

diff --git a/Documentation/nvme-supported-log-pages.txt b/Documentation/nvme-supported-log-pages.txt index f80aa5f..bd17fdf 100644 --- a/Documentation/nvme-supported-log-pages.txt +++ b/Documentation/nvme-supported-log-pages.txt @@ -8,8 +8,7 @@ nvme-supported-log-pages - Send NVMe Supported Log pages request, returns result SYNOPSIS -------- [verse] -'nvme supported-log-pages' [--output-format= | -o ] - [--verbose | -v] +'nvme supported-log-pages' [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -25,14 +24,15 @@ for each command that is supported. OPTIONS ------- --o :: ---output-format=:: - This option will set the reporting format to normal, json, or binary. - Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json' or 'binary'. Only one + output format can be used at a time. -v:: --verbose:: - Show more information including LID Supported (LSUPP) and Index Offset Supported (IOP) details. + Increase the information detail in the output. Show more information + including LID Supported (LSUPP) and Index Offset Supported (IOP) details. EXAMPLES -------- diff --git a/Documentation/nvme-telemetry-log.1 b/Documentation/nvme-telemetry-log.1 index 9f68cd9..16be54c 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TELEMETRY\-LOG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-TELEMETRY\-LOG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,8 +32,9 @@ nvme-telemetry-log \- Retrieves a Telemetry Host\-Initiated log page from an NVM .SH "SYNOPSIS" .sp .nf -\fInvme telemetry\-log\fR [\-\-output\-file= | \-o ] - [\-\-host\-generate= | \-g ] +\fInvme telemetry\-log\fR [\-\-output\-file= | \-O ] + [\-\-host\-generate= | \-g ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -44,7 +45,7 @@ The parameter is mandatory and may be either the NVMe character device On success, the returned log structure will be in raw binary format \fIonly\fR with \-\-output\-file option which is mandatory\&. .SH "OPTIONS" .PP -\-o , \-\-output\-file= +\-O , \-\-output\-file= .RS 4 File name to which raw binary data will be saved to\&. .RE @@ -60,6 +61,20 @@ update this data\&. .RS 4 Retrieves the specific data area requested\&. Valid inputs are 1,2,3,4\&. If this option is not specified, the default value is 3, since data area 4 may not be supported\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/Documentation/nvme-telemetry-log.html b/Documentation/nvme-telemetry-log.html index 5cc5978..9dd19a6 100644 --- a/Documentation/nvme-telemetry-log.html +++ b/Documentation/nvme-telemetry-log.html @@ -749,8 +749,9 @@ nvme-telemetry-log(1) Manual Page

SYNOPSIS

-
nvme telemetry-log <device> [--output-file=<file> | -o <file>]
-                      [--host-generate=<gen> | -g <gen>]
+
nvme telemetry-log <device> [--output-file=<file> | -O <file>]
+                        [--host-generate=<gen> | -g <gen>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -771,7 +772,7 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

--o <file> +-O <file>
--output-file=<file> @@ -808,6 +809,29 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -838,7 +862,7 @@ Retrieve Telemetry Host-Initiated data to telemetry_log.bin diff --git a/Documentation/nvme-telemetry-log.txt b/Documentation/nvme-telemetry-log.txt index cf126d9..4d2a494 100644 --- a/Documentation/nvme-telemetry-log.txt +++ b/Documentation/nvme-telemetry-log.txt @@ -8,8 +8,9 @@ nvme-telemetry-log - Retrieves a Telemetry Host-Initiated log page from an NVMe SYNOPSIS -------- [verse] -'nvme telemetry-log' [--output-file= | -o ] - [--host-generate= | -g ] +'nvme telemetry-log' [--output-file= | -O ] + [--host-generate= | -g ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -24,7 +25,7 @@ On success, the returned log structure will be in raw binary format _only_ with OPTIONS ------- --o :: +-O :: --output-file=:: File name to which raw binary data will be saved to. @@ -41,6 +42,15 @@ OPTIONS this option is not specified, the default value is 3, since data area 4 may not be supported. +-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 -------- * Retrieve Telemetry Host-Initiated data to telemetry_log.bin diff --git a/Documentation/nvme-toshiba-clear-pcie-correctable-errors.1 b/Documentation/nvme-toshiba-clear-pcie-correctable-errors.1 index ad49454..55d427d 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TOSHIBA\-CLEAR" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-TOSHIBA\-CLEAR" "1" "12/21/2023" "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 ad20764..0446e41 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-clear-pcie-correctable-errors.txt b/Documentation/nvme-toshiba-clear-pcie-correctable-errors.txt index 5871900..862c860 100644 --- a/Documentation/nvme-toshiba-clear-pcie-correctable-errors.txt +++ b/Documentation/nvme-toshiba-clear-pcie-correctable-errors.txt @@ -10,7 +10,6 @@ SYNOPSIS [verse] 'nvme toshiba clear-pcie-correctable-errors ' - DESCRIPTION ----------- For the NVMe device given, sends the Toshiba clear PCIe correctable errors @@ -20,7 +19,6 @@ The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). - EXAMPLES -------- * 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 08ee01b..a229fd9 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TOSHIBA\-VS\-I" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-TOSHIBA\-VS\-I" "1" "12/21/2023" "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 32641bb..9ef7959 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-internal-log.txt b/Documentation/nvme-toshiba-vs-internal-log.txt index d3c0104..3cfb917 100644 --- a/Documentation/nvme-toshiba-vs-internal-log.txt +++ b/Documentation/nvme-toshiba-vs-internal-log.txt @@ -34,12 +34,10 @@ A progress runner is included when data is written to file and a page count is i OPTIONS ------- - -o :: --output-file=:: Output binary file. Defaults to text-formatted dump to stdout - -p:: --prev-log:: Use previous log contents. Defaults to the current log contents. diff --git a/Documentation/nvme-toshiba-vs-smart-add-log.1 b/Documentation/nvme-toshiba-vs-smart-add-log.1 index 1703e52..2a43f9f 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TOSHIBA\-VS\-S" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-TOSHIBA\-VS\-S" "1" "12/21/2023" "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 25dffa5..1ef222f 100644 --- a/Documentation/nvme-toshiba-vs-smart-add-log.html +++ b/Documentation/nvme-toshiba-vs-smart-add-log.html @@ -764,7 +764,8 @@ request and either saves the result to a file or dumps the content to stdout.

The <device> parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

-

The log contents may be associated with the controller, in which case the namespace parameter is ignored.

+

The log contents may be associated with the controller, in which case the +namespace parameter is ignored.

Two logs exist, page 0xC0 (log page directory) and page 0xCA (vendor log page)

This will only work on Toshiba devices supporting this feature.

@@ -781,7 +782,7 @@ character device (ex: /dev/nvme0), or a namespace block device (ex:

- Log page: 0xC0 or 0xCA (defaults to 0xCA) + Log page: 0xC0 or 0xCA (defaults to 0xCA)

@@ -840,7 +841,7 @@ Get the contents of log page 0xC0 from the device and save to a binary file: diff --git a/Documentation/nvme-toshiba-vs-smart-add-log.txt b/Documentation/nvme-toshiba-vs-smart-add-log.txt index 8ea4d3e..96a13ca 100644 --- a/Documentation/nvme-toshiba-vs-smart-add-log.txt +++ b/Documentation/nvme-toshiba-vs-smart-add-log.txt @@ -3,7 +3,8 @@ nvme-toshiba-vs-smart-add-log(1) NAME ---- -nvme-toshiba-vs-smart-add-log - Retrieve a Toshiba device's vendor specific extended SMART log page contents and either save to file or dump the contents. +nvme-toshiba-vs-smart-add-log - Retrieve a Toshiba device's vendor specific +extended SMART log page contents and either save to file or dump the contents. SYNOPSIS -------- @@ -12,7 +13,6 @@ SYNOPSIS [--namespace-id=, -n ] [--output-file=, -o ] - DESCRIPTION ----------- For the NVMe device given, sends the Toshiba vendor log @@ -22,7 +22,8 @@ The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). -The log contents may be associated with the controller, in which case the namespace parameter is ignored. +The log contents may be associated with the controller, in which case the +namespace parameter is ignored. Two logs exist, page 0xC0 (log page directory) and page 0xCA (vendor log page) @@ -33,7 +34,7 @@ OPTIONS -l :: --log=:: - Log page: 0xC0 or 0xCA (defaults to 0xCA) + Log page: 0xC0 or 0xCA (defaults to 0xCA) -n :: --namespace-id=:: @@ -42,8 +43,6 @@ OPTIONS --output-file=:: Output binary file. Defaults to text-formatted dump to stdout - - EXAMPLES -------- * Get the current log from the device and dumps it to stdout: diff --git a/Documentation/nvme-transcend-badblock.1 b/Documentation/nvme-transcend-badblock.1 index 4daf67d..affdaa3 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TRANSCEND\-BAD" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-TRANSCEND\-BAD" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-transcend-badblock.html b/Documentation/nvme-transcend-badblock.html index 002c564..276080f 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-badblock.txt b/Documentation/nvme-transcend-badblock.txt index 888076c..9b6f671 100644 --- a/Documentation/nvme-transcend-badblock.txt +++ b/Documentation/nvme-transcend-badblock.txt @@ -23,7 +23,6 @@ OPTIONS ------- none - EXAMPLES -------- * 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 9da212c..e69b1c8 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-TRANSCEND\-HEA" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-TRANSCEND\-HEA" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-transcend-healthvalue.html b/Documentation/nvme-transcend-healthvalue.html index 2bd62ee..5c1e541 100644 --- a/Documentation/nvme-transcend-healthvalue.html +++ b/Documentation/nvme-transcend-healthvalue.html @@ -757,7 +757,8 @@ nvme-transcend-healthvalue(1) Manual Page

DESCRIPTION

-

Retrieves the NVMe Device SMART log page from the Transcend device and evaluate health status of Transcend device.

+

Retrieves the NVMe Device SMART log page from the Transcend device and evaluate +health status of Transcend device.

The <device> parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

On success, the returned value would print health percentage value.

@@ -796,7 +797,7 @@ Print the Transcend Device health value in a human readable format: diff --git a/Documentation/nvme-transcend-healthvalue.txt b/Documentation/nvme-transcend-healthvalue.txt index 4a7d52f..90340ce 100644 --- a/Documentation/nvme-transcend-healthvalue.txt +++ b/Documentation/nvme-transcend-healthvalue.txt @@ -3,7 +3,8 @@ nvme-transcend-healthvalue(1) NAME ---- -nvme-transcend-healthvalue - Use NVMe SMART table to analyze the health value of Transcend device. +nvme-transcend-healthvalue - Use NVMe SMART table to analyze the health value of +Transcend device. SYNOPSIS -------- @@ -12,7 +13,8 @@ SYNOPSIS DESCRIPTION ----------- -Retrieves the NVMe Device SMART log page from the Transcend device and evaluate health status of Transcend device. +Retrieves the NVMe Device SMART log page from the Transcend device and evaluate +health status of Transcend device. The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). @@ -23,7 +25,6 @@ OPTIONS ------- none - EXAMPLES -------- * Print the Transcend Device health value in a human readable format: diff --git a/Documentation/nvme-verify.1 b/Documentation/nvme-verify.1 index 1fbdd36..858e432 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-VERIFY" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-VERIFY" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,48 +33,48 @@ nvme-verify \- Send an NVMe Verify command, return results .sp .nf \fInvme\-verify\fR [\-\-namespace\-id= | \-n ] - [\-\-start\-block= | \-s ] - [\-\-block\-count= | \-c ] - [\-\-limited\-retry | \-l] - [\-\-force\-unit\-access | \-f] - [\-\-prinfo= | \-p ] - [\-\-ref\-tag= | \-r ] - [\-\-app\-tag\-mask= | \-m ] - [\-\-app\-tag= | \-a ] - [\-\-storage\-tag | \-S ] - [\-\-storage\-tag\-check | \-C] + [\-\-start\-block= | \-s ] + [\-\-block\-count= | \-c ] [\-\-limited\-retry | \-l] + [\-\-force\-unit\-access | \-f] + [\-\-prinfo= | \-p ] + [\-\-ref\-tag= | \-r ] + [\-\-app\-tag\-mask= | \-m ] + [\-\-app\-tag= | \-a ] + [\-\-storage\-tag | \-S ] + [\-\-storage\-tag\-check | \-C] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp The Verify command verifies the integrity of the stored information by reading data and metadata\&. .SH "OPTIONS" .PP -\-\-namespace\-id=, \-n +\-n , \-\-namespace\-id= .RS 4 Namespace ID use in the command\&. .RE .PP -\-\-start\-block=, \-s +\-s , \-\-start\-block= .RS 4 Start block address\&. .RE .PP -\-\-block\-count=, \-c +\-c , \-\-block\-count= .RS 4 Number of logical blocks to Verify\&. .RE .PP -\-\-limited\-retry, \-l +\-l, \-\-limited\-retry .RS 4 Sets the limited retry flag\&. .RE .PP -\-\-force\-unit\-access, \-f +\-f, \-\-force\-unit\-access .RS 4 Set the force\-unit access flag\&. .RE .PP -\-\-prinfo=, \-p +\-p , \-\-prinfo= .RS 4 Protection Information field definition\&. .TS @@ -119,17 +119,17 @@ T} .sp 1 .RE .PP -\-\-ref\-tag=, \-r +\-r , \-\-ref\-tag= .RS 4 Optional reftag when used with protection information\&. .RE .PP -\-\-app\-tag\-mask=, \-m +\-m , \-\-app\-tag\-mask= .RS 4 Optional application tag mask when used with protection information\&. .RE .PP -\-\-app\-tag=, \-a +\-a , \-\-app\-tag= .RS 4 Optional application tag when used with protection information\&. .RE @@ -143,6 +143,20 @@ Variable Sized Expected Logical Block Storage Tag(ELBST)\&. .RS 4 This flag enables Storage Tag field checking as part of Verify operation\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-verify.html b/Documentation/nvme-verify.html index 2873604..a21984e 100644 --- a/Documentation/nvme-verify.html +++ b/Documentation/nvme-verify.html @@ -750,16 +750,16 @@ nvme-verify(1) Manual Page
nvme-verify <device> [--namespace-id=<nsid> | -n <nsid>]
-            [--start-block=<slba> | -s <slba>]
-            [--block-count=<nlb> | -c <nlb>]
-            [--limited-retry | -l]
-            [--force-unit-access | -f]
-            [--prinfo=<prinfo> | -p <prinfo>]
-            [--ref-tag=<reftag> | -r <reftag>]
-            [--app-tag-mask=<appmask> | -m <appmask>]
-            [--app-tag=<apptag> | -a <apptag>]
-            [--storage-tag<storage-tag> | -S <storage-tag>]
-            [--storage-tag-check | -C]
+ [--start-block=<slba> | -s <slba>] + [--block-count=<nlb> | -c <nlb>] [--limited-retry | -l] + [--force-unit-access | -f] + [--prinfo=<prinfo> | -p <prinfo>] + [--ref-tag=<reftag> | -r <reftag>] + [--app-tag-mask=<appmask> | -m <appmask>] + [--app-tag=<apptag> | -a <apptag>] + [--storage-tag<storage-tag> | -S <storage-tag>] + [--storage-tag-check | -C] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -776,10 +776,10 @@ reading data and metadata.

---namespace-id=<nsid> +-n <nsid>
--n <nsid> +--namespace-id=<nsid>

@@ -787,10 +787,10 @@ reading data and metadata.

---start-block=<slba> +-s <slba>
--s <slba> +--start-block=<slba>

@@ -798,10 +798,10 @@ reading data and metadata.

---block-count=<nlb> +-c <nlb>
--c <nlb> +--block-count=<nlb>

@@ -809,10 +809,10 @@ reading data and metadata.

---limited-retry +-l
--l +--limited-retry

@@ -820,10 +820,10 @@ reading data and metadata.

---force-unit-access +-f
--f +--force-unit-access

@@ -831,10 +831,10 @@ reading data and metadata.

---prinfo=<prinfo> +-p <prinfo>
--p <prinfo> +--prinfo=<prinfo>

@@ -879,10 +879,10 @@ metadata is passes.

---ref-tag=<reftag> +-r <reftag>
--r <reftag> +--ref-tag=<reftag>

@@ -890,10 +890,10 @@ metadata is passes.

---app-tag-mask=<appmask> +-m <appmask>
--m <appmask> +--app-tag-mask=<appmask>

@@ -901,10 +901,10 @@ metadata is passes.

---app-tag=<apptag> +-a <apptag>
--a <apptag> +--app-tag=<apptag>

@@ -933,6 +933,29 @@ metadata is passes.

This flag enables Storage Tag field checking as part of Verify operation.

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -953,7 +976,7 @@ metadata is passes.

diff --git a/Documentation/nvme-verify.txt b/Documentation/nvme-verify.txt index 3c8039a..01dabbf 100644 --- a/Documentation/nvme-verify.txt +++ b/Documentation/nvme-verify.txt @@ -9,16 +9,16 @@ SYNOPSIS -------- [verse] 'nvme-verify' [--namespace-id= | -n ] - [--start-block= | -s ] - [--block-count= | -c ] - [--limited-retry | -l] - [--force-unit-access | -f] - [--prinfo= | -p ] - [--ref-tag= | -r ] - [--app-tag-mask= | -m ] - [--app-tag= | -a ] - [--storage-tag | -S ] - [--storage-tag-check | -C] + [--start-block= | -s ] + [--block-count= | -c ] [--limited-retry | -l] + [--force-unit-access | -f] + [--prinfo= | -p ] + [--ref-tag= | -r ] + [--app-tag-mask= | -m ] + [--app-tag= | -a ] + [--storage-tag | -S ] + [--storage-tag-check | -C] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -27,28 +27,28 @@ reading data and metadata. OPTIONS ------- ---namespace-id=:: -n :: +--namespace-id=:: Namespace ID use in the command. ---start-block=:: -s :: +--start-block=:: Start block address. ---block-count=:: -c :: +--block-count=:: Number of logical blocks to Verify. ---limited-retry:: -l:: +--limited-retry:: Sets the limited retry flag. ---force-unit-access:: -f:: +--force-unit-access:: Set the force-unit access flag. ---prinfo=:: -p :: +--prinfo=:: Protection Information field definition. + [] @@ -63,16 +63,16 @@ metadata is passes. |0|Set to 1 enables checking the reference tag |================= ---ref-tag=:: -r :: +--ref-tag=:: Optional reftag when used with protection information. ---app-tag-mask=:: -m :: +--app-tag-mask=:: Optional application tag mask when used with protection information. ---app-tag=:: -a :: +--app-tag=:: Optional application tag when used with protection information. -S :: @@ -83,6 +83,15 @@ metadata is passes. --storage-tag-check:: This flag enables Storage Tag field checking as part of Verify operation. +-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 -------- No examples yet. diff --git a/Documentation/nvme-virt-mgmt.txt b/Documentation/nvme-virt-mgmt.txt new file mode 100755 index 0000000..5eede14 --- /dev/null +++ b/Documentation/nvme-virt-mgmt.txt @@ -0,0 +1,70 @@ +nvme-virt-mgmt(1) +================= + +NAME +---- +nvme-virt-mgmt - Manage flexible resources between primary and secondary +controller + +SYNOPSIS +-------- +[verse] +'nvme virt-mgmt' [--cntlid= | -c ] + [--rt= | -r ] [--act= | -a ] + [--nr= | -n ] + [--output-format= | -o ] [--verbose | -v] + +DESCRIPTION +----------- +Manage flexible resources between primary and secondary controller, return +results. + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1). + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-c :: +--cntlid=:: + Controller identifier (CNTLID) + +-r :: +--rt=:: + Resource Type (RT): [0,1] + 0h: VQ Resources + 1h: VI Resources + +-a :: +--act=:: + Action(ACT): [1,7,8,9] + 1h: Primary Flexible + 7h: Secondary Offline + 8h: Secondary Assign + 9h: Secondary Online + +-n :: +--nr=:: + Number of controller resources (NR) + +-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 +-------- +* Has the program issue a virt-mgmt to manage flexible resources. ++ +------------ +# nvme virt-mgmt /dev/nvme0 -c 0 -r 1 -a 1 -n 0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-virtium-save-smart-to-vtview-log.1 b/Documentation/nvme-virtium-save-smart-to-vtview-log.1 index 292c91b..b21beba 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-VIRTIUM\-SAVE\" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-VIRTIUM\-SAVE\" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -39,7 +39,7 @@ nvme-virtium-save-smart-to-vtview-log \- Periodically save smart attributes into .fi .SH "DESCRIPTION" .sp -This command automates the process of collecting SMART data periodically and saving the data in a ready\-to\-analyze format\&. Each entry is saved with timestamp and in csv format\&. Users can use excel to analyze the data\&. Some examples of use cases are collecting SMART data for temperature characterization, collecting data to calculate endurance, or collecting SMART data during a test or during normal operation\&. +This command automates the process of collecting SMART data periodically and saving the data in a ready\-to\-analyze format\&. Each entry is saved with timestamp and in csv format\&. Users can use excel to analyze the data\&. Some examples of use cases are collecting SMART data for temperature characterization, data to calculate endurance, or collecting SMART data during a test or during normal operation\&. .sp The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&. .sp @@ -57,7 +57,7 @@ If the test\-name option is specified, it will be recorded in the log file and b .PP \-f , \-\-freq= .RS 4 -(optional) How often you want to log SMART data (0\&.25 = 15\*(Aq , 0\&.5 = 30\*(Aq , 1 = 1 hour, 2 = 2 hours, etc\&.)\&. Default = 10 hours\&. +(optional) How often you want to log SMART data (0\&.25 = 15\*(Aq, 0\&.5 = 30\*(Aq, 1 = 1 hour, 2 = 2 hours, etc\&.)\&. Default = 10 hours\&. .RE .PP \-o , \-\-output\-file= diff --git a/Documentation/nvme-virtium-save-smart-to-vtview-log.html b/Documentation/nvme-virtium-save-smart-to-vtview-log.html index b8d3d70..4f84716 100644 --- a/Documentation/nvme-virtium-save-smart-to-vtview-log.html +++ b/Documentation/nvme-virtium-save-smart-to-vtview-log.html @@ -763,18 +763,19 @@ nvme-virtium-save-smart-to-vtview-log(1) Manual Page

This command automates the process of collecting SMART data periodically and saving the data in a ready-to-analyze format. Each entry is saved with timestamp and in csv format. Users can use excel to analyze the data. -Some examples of use cases are collecting SMART data for temperature characterization, -collecting data to calculate endurance, or collecting SMART data during a test -or during normal operation.

+Some examples of use cases are collecting SMART data for temperature +characterization, data to calculate endurance, or collecting SMART data during a +test or during normal operation.

The <device> parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

-

On success, the command generates a log file, which contains an entry for identify device -(current features & settings) and periodic entries of SMART data.

-

This command runs for the time specified by the option <run-time>, and collects SMART data -at the frequency specified by the option <freq>. If the output file name is not specified, -this command will generate a file name that include model string and serial number of the device.

-

If the test-name option is specified, it will be recorded in the log file and be used as part -of the log file name.

+

On success, the command generates a log file, which contains an entry for +identify device (current features & settings) and periodic entries of SMART data.

+

This command runs for the time specified by the option <run-time>, and collects +SMART data at the frequency specified by the option <freq>. If the output file +name is not specified, this command will generate a file name that include model +string and serial number of the device.

+

If the test-name option is specified, it will be recorded in the log file and be +used as part of the log file name.

@@ -800,8 +801,8 @@ of the log file name.

- (optional) How often you want to log SMART data - (0.25 = 15' , 0.5 = 30' , 1 = 1 hour, 2 = 2 hours, etc.). Default = 10 hours. + (optional) How often you want to log SMART data (0.25 = 15', 0.5 = 30', + 1 = 1 hour, 2 = 2 hours, etc.). Default = 10 hours.

@@ -812,9 +813,9 @@ of the log file name.

- (optional) Name of the log file (give it a name that easy for you to remember - what the test is). You can leave it blank too, the file name will be generated - as <model string>-<serial number>-<test name>.txt. + (optional) Name of the log file (give it a name that easy for you to + remember what the test is). You can leave it blank too, the file name + will be generated as <model string>-<serial number>-<test name>.txt.

@@ -825,7 +826,8 @@ of the log file name.

- (optional) Name of the test you are doing. We use this string as part of the name of the log file. + (optional) Name of the test you are doing. We use this string as part of + the name of the log file.

@@ -876,7 +878,7 @@ Just logging: Default logging is run for 20 hours and log every 10 hours. diff --git a/Documentation/nvme-virtium-save-smart-to-vtview-log.txt b/Documentation/nvme-virtium-save-smart-to-vtview-log.txt index 313ac35..72090c0 100644 --- a/Documentation/nvme-virtium-save-smart-to-vtview-log.txt +++ b/Documentation/nvme-virtium-save-smart-to-vtview-log.txt @@ -3,7 +3,8 @@ nvme-virtium-save-smart-to-vtview-log(1) NAME ---- -nvme-virtium-save-smart-to-vtview-log - Periodically save smart attributes into a log file (csv format). +nvme-virtium-save-smart-to-vtview-log - Periodically save smart attributes into +a log file (csv format). SYNOPSIS -------- @@ -12,28 +13,29 @@ SYNOPSIS [--freq= | -f ] [--output-file= | -o ] [--test-name= | -n ] - + DESCRIPTION ----------- This command automates the process of collecting SMART data periodically and saving the data in a ready-to-analyze format. Each entry is saved with timestamp and in csv format. Users can use excel to analyze the data. -Some examples of use cases are collecting SMART data for temperature characterization, -collecting data to calculate endurance, or collecting SMART data during a test -or during normal operation. +Some examples of use cases are collecting SMART data for temperature +characterization, data to calculate endurance, or collecting SMART data during a +test or during normal operation. The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). -On success, the command generates a log file, which contains an entry for identify device -(current features & settings) and periodic entries of SMART data. +On success, the command generates a log file, which contains an entry for +identify device (current features & settings) and periodic entries of SMART data. -This command runs for the time specified by the option , and collects SMART data -at the frequency specified by the option . If the output file name is not specified, -this command will generate a file name that include model string and serial number of the device. +This command runs for the time specified by the option , and collects +SMART data at the frequency specified by the option . If the output file +name is not specified, this command will generate a file name that include model +string and serial number of the device. -If the test-name option is specified, it will be recorded in the log file and be used as part -of the log file name. +If the test-name option is specified, it will be recorded in the log file and be +used as part of the log file name. OPTIONS ------- @@ -43,20 +45,20 @@ OPTIONS -f :: --freq=:: - (optional) How often you want to log SMART data - (0.25 = 15' , 0.5 = 30' , 1 = 1 hour, 2 = 2 hours, etc.). Default = 10 hours. + (optional) How often you want to log SMART data (0.25 = 15', 0.5 = 30', + 1 = 1 hour, 2 = 2 hours, etc.). Default = 10 hours. -o :: --output-file=:: - (optional) Name of the log file (give it a name that easy for you to remember - what the test is). You can leave it blank too, the file name will be generated - as --.txt. + (optional) Name of the log file (give it a name that easy for you to + remember what the test is). You can leave it blank too, the file name + will be generated as --.txt. -n :: --test-name=:: - (optional) Name of the test you are doing. We use this string as part of the name of the log file. - - + (optional) Name of the test you are doing. We use this string as part of + the name of the log file. + EXAMPLES -------- * Temperature characterization: diff --git a/Documentation/nvme-virtium-show-identify.1 b/Documentation/nvme-virtium-show-identify.1 index 8b445cb..6e4192a 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-VIRTIUM\-SHOW\" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-VIRTIUM\-SHOW\" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-virtium-show-identify.html b/Documentation/nvme-virtium-show-identify.html index 31b9112..ae82003 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-virtium-show-identify.txt b/Documentation/nvme-virtium-show-identify.txt index 5ce1933..881824c 100644 --- a/Documentation/nvme-virtium-show-identify.txt +++ b/Documentation/nvme-virtium-show-identify.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'nvme virtium show-identify' - + DESCRIPTION ----------- This command prints complete detail of the identify device information. The @@ -24,8 +24,7 @@ On success, the command prints identify device in human readable format. OPTIONS ------- none - - + EXAMPLES -------- * Show Identify Device: diff --git a/Documentation/nvme-wdc-cap-diag.1 b/Documentation/nvme-wdc-cap-diag.1 index edb93b2..6ce52a3 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CAP\-DIAG" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CAP\-DIAG" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-cap-diag.html b/Documentation/nvme-wdc-cap-diag.html index b3d496c..1df78bc 100644 --- a/Documentation/nvme-wdc-cap-diag.html +++ b/Documentation/nvme-wdc-cap-diag.html @@ -787,7 +787,7 @@ Results for any other device are undefined.

- Transfer size; defaults to 0x10000 (65536 decimal) bytes + Transfer size; defaults to 0x10000 (65536 decimal) bytes

@@ -856,7 +856,7 @@ Gets the capture diagnostics log from the device transferring the data in 16k ch diff --git a/Documentation/nvme-wdc-cap-diag.txt b/Documentation/nvme-wdc-cap-diag.txt index 9439eaa..bfcde9a 100644 --- a/Documentation/nvme-wdc-cap-diag.txt +++ b/Documentation/nvme-wdc-cap-diag.txt @@ -29,7 +29,7 @@ OPTIONS -s :: --transfer-size=:: - Transfer size; defaults to 0x10000 (65536 decimal) bytes + Transfer size; defaults to 0x10000 (65536 decimal) bytes EXAMPLES -------- diff --git a/Documentation/nvme-wdc-capabilities.1 b/Documentation/nvme-wdc-capabilities.1 index 348702a..c0c2a69 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CAPABILIT" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CAPABILIT" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-capabilities.html b/Documentation/nvme-wdc-capabilities.html index f43e981..d89304e 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 6b4c887..6176d1f 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CLEAR\-AS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CLEAR\-AS" "1" "12/21/2023" "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 922bc67..0a3c3c9 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-assert-dump.txt b/Documentation/nvme-wdc-clear-assert-dump.txt index a575089..60493df 100644 --- a/Documentation/nvme-wdc-clear-assert-dump.txt +++ b/Documentation/nvme-wdc-clear-assert-dump.txt @@ -33,7 +33,6 @@ EXAMPLES # nvme wdc clear-assert-dump /dev/nvme0 ------------ - NVME ---- Part of the nvme-user suite diff --git a/Documentation/nvme-wdc-clear-fw-activate-history.1 b/Documentation/nvme-wdc-clear-fw-activate-history.1 index 92998b9..f8f4e39 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CLEAR\-FW" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CLEAR\-FW" "1" "12/21/2023" "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 c23cddb..99ab9a5 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-fw-activate-history.txt b/Documentation/nvme-wdc-clear-fw-activate-history.txt index 50be1e9..ddb6c26 100644 --- a/Documentation/nvme-wdc-clear-fw-activate-history.txt +++ b/Documentation/nvme-wdc-clear-fw-activate-history.txt @@ -32,7 +32,6 @@ EXAMPLES # nvme wdc clear-fw-activate-history /dev/nvme0 ------------ - NVME ---- Part of the nvme-user suite diff --git a/Documentation/nvme-wdc-clear-pcie-correctable-errors.1 b/Documentation/nvme-wdc-clear-pcie-correctable-errors.1 index e979185..5f9e7e5 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CLEAR\-PC" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CLEAR\-PC" "1" "12/21/2023" "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 a795771..cbe996f 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-clear-pcie-correctable-errors.txt b/Documentation/nvme-wdc-clear-pcie-correctable-errors.txt index 4788f1f..cecc52e 100644 --- a/Documentation/nvme-wdc-clear-pcie-correctable-errors.txt +++ b/Documentation/nvme-wdc-clear-pcie-correctable-errors.txt @@ -34,7 +34,6 @@ EXAMPLES # nvme wdc clear-pcie-correctable-errors /dev/nvme0 ------------ - NVME ---- Part of the nvme-user suite diff --git a/Documentation/nvme-wdc-cloud-SSD-plugin-version.1 b/Documentation/nvme-wdc-cloud-SSD-plugin-version.1 index c714776..5c5e541 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CLOUD\-SS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CLOUD\-SS" "1" "12/21/2023" "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 4272148..b6cc4c8 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 34b6289..7be90e1 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-CLOUD\-BO" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-CLOUD\-BO" "1" "12/21/2023" "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 29c0058..d781c18 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 9c5d70f..4783608 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-DRIVE\-ES" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-DRIVE\-ES" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-drive-essentials.html b/Documentation/nvme-wdc-drive-essentials.html index 618ccbf..a9bbc3c 100644 --- a/Documentation/nvme-wdc-drive-essentials.html +++ b/Documentation/nvme-wdc-drive-essentials.html @@ -757,9 +757,10 @@ nvme-wdc-drive-essentials(1) Manual Page

DESCRIPTION

-

For the NVMe device given, captures the drive essential bin files and saves them into a tar file. -The tar file will be in the following format: DRIVE_ESSENTIALS_<Serial Num>_<FW Revision>_<Date>_<Time>.tar.gz - e.g. DRIVE_ESSENTIALS_A00FD8CA_1048_20170713_091731.tar.gz

+

For the NVMe device given, captures the drive essential bin files and saves them +into a tar file. The tar file will be in the following format: +DRIVE_ESSENTIALS_<Serial Num>_<FW Revision>_<Date>_<Time>.tar.gz + e.g. DRIVE_ESSENTIALS_A00FD8CA_1048_20170713_091731.tar.gz

The <device> parameter is mandatory; NVMe character device (ex: /dev/nvme0).

This will only work on WDC devices supporting this feature. Results for any other device are undefined.

@@ -821,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-essentials.txt b/Documentation/nvme-wdc-drive-essentials.txt index 59b2787..7f06040 100644 --- a/Documentation/nvme-wdc-drive-essentials.txt +++ b/Documentation/nvme-wdc-drive-essentials.txt @@ -3,7 +3,8 @@ nvme-wdc-drive-essentials(1) NAME ---- -nvme-wdc-drive-essentials - Retrieve WDC device's drive essentials bin files and save to a tar file. +nvme-wdc-drive-essentials - Retrieve WDC device's drive essentials bin files and +save to a tar file. SYNOPSIS -------- @@ -13,9 +14,10 @@ SYNOPSIS DESCRIPTION ----------- -For the NVMe device given, captures the drive essential bin files and saves them into a tar file. -The tar file will be in the following format: DRIVE_ESSENTIALS____

The <device> parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0).

-

The --log-id=<NUM>, -l <NUM> parameter is mandatory and may be either 0xd1, 0xd2, 0xd3, 0xd4, 0xe2 and 0xe4.

+

The --log-id=<NUM>, -l <NUM> parameter is mandatory and may be either 0xd1, 0xd2, +0xd3, 0xd4, 0xe2 and 0xe4.

This will only work on WDC devices supporting this feature. Results for any other device are undefined.

On success it returns the enclosure log data, error code otherwise.

@@ -779,7 +782,7 @@ Results for any other device are undefined.

- Output file pathname + Output file pathname

@@ -790,7 +793,8 @@ Results for any other device are undefined.

- Data retrieval transfer size, maximum transfer size should be 0x2000 (decimal 8192) + Data retrieval transfer size, maximum transfer size should be 0x2000 + (decimal 8192)

@@ -802,7 +806,8 @@ Results for any other device are undefined.

  • -Gets the enclosure log from the device based on the log id(0xd1) with transfer size(0x2000) and saves to defined file in current directory: +Gets the enclosure log from the device based on the log id(0xd1) with transfer + size(0x2000) and saves to defined file in current directory:

    @@ -832,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-enc-get-log.txt b/Documentation/nvme-wdc-enc-get-log.txt index ae93a7a..bcff83f 100644 --- a/Documentation/nvme-wdc-enc-get-log.txt +++ b/Documentation/nvme-wdc-enc-get-log.txt @@ -3,12 +3,15 @@ nvme-wdc-enc-get-log(1) NAME ---- -nvme-wdc-enc-get-log - Send NVMe WDC enc-get-log Vendor Unique Command, return result. +nvme-wdc-enc-get-log - Send NVMe WDC enc-get-log Vendor Unique Command, return +result. SYNOPSIS -------- [verse] -'nvme wdc enc-get-log' [--log-id=, -l ] [--output-file=, -o ] [--transfer-size=, -s ] +'nvme wdc enc-get-log' [--log-id=, -l ] + [--output-file=, -o ] + [--transfer-size=, -s ] DESCRIPTION ----------- @@ -19,7 +22,8 @@ output the Enclosure logs. The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0). -The --log-id=, -l parameter is mandatory and may be either 0xd1, 0xd2, 0xd3, 0xd4, 0xe2 and 0xe4. +The --log-id=, -l parameter is mandatory and may be either 0xd1, 0xd2, +0xd3, 0xd4, 0xe2 and 0xe4. This will only work on WDC devices supporting this feature. Results for any other device are undefined. @@ -30,15 +34,17 @@ OPTIONS ------- -o :: --output-file=:: - Output file pathname + Output file pathname -s :: --transfer-size=:: - Data retrieval transfer size, maximum transfer size should be 0x2000 (decimal 8192) + Data retrieval transfer size, maximum transfer size should be 0x2000 + (decimal 8192) EXAMPLES -------- -* Gets the enclosure log from the device based on the log id(0xd1) with transfer size(0x2000) and saves to defined file in current directory: +* Gets the enclosure log from the device based on the log id(0xd1) with transfer + size(0x2000) and saves to defined file in current directory: + ------------ # nvme wdc enc-get-log /dev/nvme0 -l 0xd1 -o d1_log.bin -s 0x2000 diff --git a/Documentation/nvme-wdc-get-crash-dump.1 b/Documentation/nvme-wdc-get-crash-dump.1 index 6959dc1..7313533 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-CRAS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-CRAS" "1" "12/21/2023" "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 f900b25..f3ded31 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 3ad7d99..38c5373 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-DEV\" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-DEV\" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,8 +32,7 @@ nvme-wdc-get-dev-capabilities-log \- Send NVMe WDC get\-dev\-capabilities\-log p .SH "SYNOPSIS" .sp .nf -\fInvme wdc get\-dev\-capabilities\-log\fR [\-\-output\-format= -\-o ] +\fInvme wdc get\-dev\-capabilities\-log\fR [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -46,7 +45,7 @@ This will only work on WDC devices supporting this log page\&. Results for any o On success it returns the parsed device capabilities log page data, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, or diff --git a/Documentation/nvme-wdc-get-dev-capabilities-log.html b/Documentation/nvme-wdc-get-dev-capabilities-log.html index 6ee46c0..424d77d 100644 --- a/Documentation/nvme-wdc-get-dev-capabilities-log.html +++ b/Documentation/nvme-wdc-get-dev-capabilities-log.html @@ -740,7 +740,7 @@ nvme-wdc-get-dev-capabilities-log(1) Manual Page

    NAME

    nvme-wdc-get-dev-capabilities-log - - Send NVMe WDC get-dev-capabilities-log plugin command, return parsed log output + Send NVMe WDC get-dev-capabilities-log plugin command, return parsed log output

    @@ -749,8 +749,7 @@ nvme-wdc-get-dev-capabilities-log(1) Manual Page

    SYNOPSIS

    -
    nvme wdc get-dev-capabilities-log <device> [--output-format=<normal|json>
    --o <normal|json>]
    +
    nvme wdc get-dev-capabilities-log <device> [--output-format=<fmt> | -o <fmt>]
    @@ -774,10 +773,10 @@ code otherwise.

    --o <format> +-o <fmt>
    ---output-format=<format> +--output-format=<fmt>

    @@ -816,7 +815,7 @@ Has the program issue WDC get-dev-capabilities-log plugin command :

    diff --git a/Documentation/nvme-wdc-get-dev-capabilities-log.txt b/Documentation/nvme-wdc-get-dev-capabilities-log.txt index 0621881..cf8606a 100644 --- a/Documentation/nvme-wdc-get-dev-capabilities-log.txt +++ b/Documentation/nvme-wdc-get-dev-capabilities-log.txt @@ -4,13 +4,12 @@ nvme-wdc-get-dev-capabilities-log(1) NAME ---- nvme-wdc-get-dev-capabilities-log - Send NVMe WDC get-dev-capabilities-log - plugin command, return parsed log output +plugin command, return parsed log output SYNOPSIS -------- [verse] -'nvme wdc get-dev-capabilities-log' [--output-format= --o ] +'nvme wdc get-dev-capabilities-log' [--output-format= | -o ] DESCRIPTION ----------- @@ -29,8 +28,8 @@ code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', or 'json'. Only one output format can be used at a time. Default is normal. diff --git a/Documentation/nvme-wdc-get-drive-status.1 b/Documentation/nvme-wdc-get-drive-status.1 index 3119b40..c397041 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-DRIV" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-DRIV" "1" "12/21/2023" "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 4376b59..b9377c0 100644 --- a/Documentation/nvme-wdc-get-drive-status.html +++ b/Documentation/nvme-wdc-get-drive-status.html @@ -790,19 +790,19 @@ cellspacing="0" cellpadding="4">
- + - + - + - +

EOL (End of Life) Status

The 3 possible states are : Normal, Read Only, or End of Life.

The 3 possible states are : Normal, Read Only, or End of Life.

Assert Dump Status

The 2 possible states are : Present or Not Present.

The 2 possible states are : Present or Not Present.

Thermal Throttling Status

The 3 possible states are : Off, On, or Unavailable.

The 3 possible states are : Off, On, or Unavailable.

Format Corrupt Reason

The 3 possible states are : Not Corrupted, Corrupt due to FW Assert, or Corrupt for Unknown Reason.

The 3 possible states are : Not Corrupted, Corrupt due to FW Assert, or Corrupt for Unknown Reason.

@@ -836,7 +836,7 @@ Has the program issue WDC get-drive-status command : diff --git a/Documentation/nvme-wdc-get-drive-status.txt b/Documentation/nvme-wdc-get-drive-status.txt index 10e212b..b1b4de4 100644 --- a/Documentation/nvme-wdc-get-drive-status.txt +++ b/Documentation/nvme-wdc-get-drive-status.txt @@ -3,7 +3,8 @@ nvme-wdc-get-drive-status(1) NAME ---- -nvme-wdc-get-drive-status - Send the NVMe WDC get-drive-status command, return result +nvme-wdc-get-drive-status - Send the NVMe WDC get-drive-status command, return +result SYNOPSIS -------- @@ -33,20 +34,19 @@ Output Explanation |The percentage of drive function used. |*EOL (End of Life) Status* -|The 3 possible states are : Normal, Read Only, or End of Life. +|The 3 possible states are : Normal, Read Only, or End of Life. |*Assert Dump Status* -|The 2 possible states are : Present or Not Present. +|The 2 possible states are : Present or Not Present. |*Thermal Throttling Status* -|The 3 possible states are : Off, On, or Unavailable. +|The 3 possible states are : Off, On, or Unavailable. |*Format Corrupt Reason* -|The 3 possible states are : Not Corrupted, Corrupt due to FW Assert, or Corrupt for Unknown Reason. +|The 3 possible states are : Not Corrupted, Corrupt due to FW Assert, or Corrupt for Unknown Reason. |=== - EXAMPLES -------- * 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 1d00fae..ced322f 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-ERRO" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-ERRO" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -46,7 +46,7 @@ This will only work on WDC devices supporting this log page\&. Results for any o On success it returns the parsed error recovery log page data, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, or diff --git a/Documentation/nvme-wdc-get-error-recovery-log.html b/Documentation/nvme-wdc-get-error-recovery-log.html index 156396b..c7c20d8 100644 --- a/Documentation/nvme-wdc-get-error-recovery-log.html +++ b/Documentation/nvme-wdc-get-error-recovery-log.html @@ -740,7 +740,7 @@ nvme-wdc-get-error-recovery-log(1) Manual Page

NAME

nvme-wdc-get-error-recovery-log - - Send NVMe WDC get-error-recovery-log plugin command, return parsed log output + Send NVMe WDC get-error-recovery-log plugin command, return parsed log output

@@ -774,10 +774,10 @@ code otherwise.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -816,7 +816,7 @@ Has the program issue WDC get-error-recovery-log plugin command :

diff --git a/Documentation/nvme-wdc-get-error-recovery-log.txt b/Documentation/nvme-wdc-get-error-recovery-log.txt index 2ad3605..4998390 100644 --- a/Documentation/nvme-wdc-get-error-recovery-log.txt +++ b/Documentation/nvme-wdc-get-error-recovery-log.txt @@ -4,7 +4,7 @@ nvme-wdc-get-error-recovery-log(1) NAME ---- nvme-wdc-get-error-recovery-log - Send NVMe WDC get-error-recovery-log plugin - command, return parsed log output +command, return parsed log output SYNOPSIS -------- @@ -29,8 +29,8 @@ code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', or 'json'. Only one output format can be used at a time. Default is normal. diff --git a/Documentation/nvme-wdc-get-latency-monitor-log.1 b/Documentation/nvme-wdc-get-latency-monitor-log.1 index c6425b6..72cd24b 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-LATE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-LATE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -45,7 +45,7 @@ This will only work on WDC devices supporting this log page\&. Results for any o On success it returns 0, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR diff --git a/Documentation/nvme-wdc-get-latency-monitor-log.html b/Documentation/nvme-wdc-get-latency-monitor-log.html index 2019853..12fab08 100644 --- a/Documentation/nvme-wdc-get-latency-monitor-log.html +++ b/Documentation/nvme-wdc-get-latency-monitor-log.html @@ -769,10 +769,10 @@ Results for any other device are undefined.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -810,7 +810,7 @@ Displays the get latency monitor log for the device:

diff --git a/Documentation/nvme-wdc-get-latency-monitor-log.txt b/Documentation/nvme-wdc-get-latency-monitor-log.txt index 19fda4a..abab8e8 100644 --- a/Documentation/nvme-wdc-get-latency-monitor-log.txt +++ b/Documentation/nvme-wdc-get-latency-monitor-log.txt @@ -24,8 +24,8 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal' or 'json'. Only one output format can be used at a time. The default is normal. diff --git a/Documentation/nvme-wdc-get-pfail-dump.1 b/Documentation/nvme-wdc-get-pfail-dump.1 index 054a0c5..177a4a7 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-PFAI" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-PFAI" "1" "12/21/2023" "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 4a9010e..b000c32 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 c9dfaef..0e71282 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-GET\-UNSU" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-GET\-UNSU" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -46,7 +46,7 @@ This will only work on WDC devices supporting this log page\&. Results for any o On success it returns the parsed unsupported requirements log page data, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, or diff --git a/Documentation/nvme-wdc-get-unsupported-reqs-log.html b/Documentation/nvme-wdc-get-unsupported-reqs-log.html index cd63df1..7610f60 100644 --- a/Documentation/nvme-wdc-get-unsupported-reqs-log.html +++ b/Documentation/nvme-wdc-get-unsupported-reqs-log.html @@ -774,10 +774,10 @@ code otherwise.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -816,7 +816,7 @@ Has the program issue WDC get-unsupported-reqs-log plugin command :

diff --git a/Documentation/nvme-wdc-get-unsupported-reqs-log.txt b/Documentation/nvme-wdc-get-unsupported-reqs-log.txt index f028665..61f09aa 100644 --- a/Documentation/nvme-wdc-get-unsupported-reqs-log.txt +++ b/Documentation/nvme-wdc-get-unsupported-reqs-log.txt @@ -29,8 +29,8 @@ code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', or 'json'. Only one output format can be used at a time. Default is normal. diff --git a/Documentation/nvme-wdc-id-ctrl.1 b/Documentation/nvme-wdc-id-ctrl.1 index 17ecc42..94a9f3c 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-ID\-CTRL" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-ID\-CTRL" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,9 @@ nvme-wdc-id-ctrl \- Send NVMe Identify Controller, return result and structure .SH "SYNOPSIS" .sp .nf -\fInvme wdc id\-ctrl\fR [\-v | \-\-vendor\-specific] [\-b | \-\-raw\-binary] - [\-H | \-\-human\-readable] - [\-o | \-\-output\-format=] +\fInvme wdc id\-ctrl\fR [\-\-vendor\-specific | \-v] [\-\-raw\-binary | \-b] + [\-\-human\-readable | \-H] + [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -64,7 +64,7 @@ In addition to parsing known fields, this option will dump the vendor specific r This option will parse and format many of the bit fields into human\-readable formats\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-wdc-id-ctrl.html b/Documentation/nvme-wdc-id-ctrl.html index c423221..ae00b92 100644 --- a/Documentation/nvme-wdc-id-ctrl.html +++ b/Documentation/nvme-wdc-id-ctrl.html @@ -749,9 +749,9 @@ nvme-wdc-id-ctrl(1) Manual Page

SYNOPSIS

-
nvme wdc id-ctrl <device> [-v | --vendor-specific] [-b | --raw-binary]
-                        [-H | --human-readable]
-                        [-o <fmt> | --output-format=<fmt>]
+
nvme wdc id-ctrl <device> [--vendor-specific | -v] [--raw-binary | -b]
+                        [--human-readable | -H]
+                        [--output-format=<fmt> | -o <fmt>]
@@ -814,15 +814,15 @@ will decode WDC vendor unique portions of the structure.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + Set the reporting format to normal, json, or + binary. Only one output format can be used at a time.

@@ -856,7 +856,7 @@ fields in a human readable format: diff --git a/Documentation/nvme-wdc-id-ctrl.txt b/Documentation/nvme-wdc-id-ctrl.txt index a9c6afe..b62eb60 100644 --- a/Documentation/nvme-wdc-id-ctrl.txt +++ b/Documentation/nvme-wdc-id-ctrl.txt @@ -8,9 +8,9 @@ nvme-wdc-id-ctrl - Send NVMe Identify Controller, return result and structure SYNOPSIS -------- [verse] -'nvme wdc id-ctrl' [-v | --vendor-specific] [-b | --raw-binary] - [-H | --human-readable] - [-o | --output-format=] +'nvme wdc id-ctrl' [--vendor-specific | -v] [--raw-binary | -b] + [--human-readable | -H] + [--output-format= | -o ] DESCRIPTION ----------- @@ -48,10 +48,10 @@ OPTIONS This option will parse and format many of the bit fields into human-readable formats. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json', or + 'binary'. Only one output format can be used at a time. EXAMPLES -------- diff --git a/Documentation/nvme-wdc-log-page-directory.1 b/Documentation/nvme-wdc-log-page-directory.1 index a81fd04..6b468fe 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-LOG\-PAGE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-LOG\-PAGE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -45,7 +45,7 @@ This will only work on WDC devices supporting this feature\&. Results for any ot On success it returns the log page directory information, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-wdc-log-page-directory.html b/Documentation/nvme-wdc-log-page-directory.html index 3f416de..011087d 100644 --- a/Documentation/nvme-wdc-log-page-directory.html +++ b/Documentation/nvme-wdc-log-page-directory.html @@ -758,7 +758,7 @@ nvme-wdc-log-page-directory(1) Manual Page

DESCRIPTION

For the NVMe device given, retrieves the log page directory which contains the list of -log page IDs supported by the drive. The --output-format option will format the output as +log page IDs supported by the drive. The --output-format option will format the output as specified.

The <device> parameter is mandatory and must be the NVMe character device (ex: /dev/nvme0).

This will only work on WDC devices supporting this feature. @@ -771,10 +771,10 @@ Results for any other device are undefined.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -812,7 +812,7 @@ WDC log-page-directory example command :

diff --git a/Documentation/nvme-wdc-log-page-directory.txt b/Documentation/nvme-wdc-log-page-directory.txt index 4d6192f..27b5d9e 100644 --- a/Documentation/nvme-wdc-log-page-directory.txt +++ b/Documentation/nvme-wdc-log-page-directory.txt @@ -13,7 +13,7 @@ SYNOPSIS DESCRIPTION ----------- For the NVMe device given, retrieves the log page directory which contains the list of -log page IDs supported by the drive. The --output-format option will format the output as +log page IDs supported by the drive. The --output-format option will format the output as specified. The parameter is mandatory and must be the NVMe character device (ex: /dev/nvme0). @@ -25,8 +25,8 @@ On success it returns the log page directory information, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', 'json', or 'binary'. Only one output format can be used at a time. The default is normal. diff --git a/Documentation/nvme-wdc-namespace-resize.1 b/Documentation/nvme-wdc-namespace-resize.1 index 02468ee..501112d 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-NAMESPACE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-NAMESPACE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,40 +32,26 @@ nvme-wdc-namespace-resize \- Resizes the device\*(Aqs namespace\&. .SH "SYNOPSIS" .sp .nf -\fInvme wdc namespace\-resize\fR [\-\-nsid=, \-n ] [\-\-op_option=, \-o ] +\fInvme wdc namespace\-resize\fR [\-\-nsid=, \-n ] + [\-\-op_option=, \-o ] .fi .SH "DESCRIPTION" .sp -For the NVMe device given, sends the WDC Vendor Specific Command that modifies the namespace size reported by the device\&. +For the NVMe device given, sends the WDC Vendor Specific Command that modifies the namespace size reported the device\&. .sp The parameter is mandatory NVMe character device (ex: /dev/nvme0)\&. .sp This will only work on WDC devices supporting this feature\&. Results for any other device are undefined\&. .SH "OPTIONS" .PP -\-n , \-\-namespace\-id= +\-n , \-\-namespace\-id= .RS 4 Namespace ID; ID of the namespace to resize .RE .PP \-o , \-\-op\-option= .RS 4 -Overprovisioning Option; defaults to 0xF -.sp -.if n \{\ -.RS 4 -.\} -.nf -Valid Values: -0x1 \- 7% of Original TNVMCAP reported value -0x2 \- 28% of Original TNVMCAP reported value -0x3 \- 50% of Original TNVMCAP reported value -0xF \- 0% of Original TNVMCAP reported value (original config) -All other values \- reserved -.fi -.if n \{\ -.RE -.\} +Overprovisioning Option; defaults to 0xF Valid Values: 0x1 \- 7% of Original TNVMCAP reported value 0x2 \- 28% of Original TNVMCAP reported value 0x3 \- 50% of Original TNVMCAP reported value 0xF \- 0% of Original TNVMCAP reported value (original config) All other values \- reserved .RE .SH "EXAMPLES" .sp diff --git a/Documentation/nvme-wdc-namespace-resize.html b/Documentation/nvme-wdc-namespace-resize.html index 1eb751f..d8088b8 100644 --- a/Documentation/nvme-wdc-namespace-resize.html +++ b/Documentation/nvme-wdc-namespace-resize.html @@ -749,7 +749,8 @@ nvme-wdc-namespace-resize(1) Manual Page

SYNOPSIS

-
nvme wdc namespace-resize <device> [--nsid=<NAMSPACE ID>, -n <NAMSPACE ID>] [--op_option=<OP OPTION>, -o <OP OPTION>]
+
nvme wdc namespace-resize <device> [--nsid=<NAMESPACE ID>, -n <NAMSPACE ID>]
+                        [--op_option=<OP OPTION>, -o <OP OPTION>]
@@ -757,8 +758,8 @@ nvme-wdc-namespace-resize(1) Manual Page

DESCRIPTION

-

For the NVMe device given, sends the WDC Vendor Specific Command that modifies the namespace size reported -by the device.

+

For the NVMe device given, sends the WDC Vendor Specific Command that modifies +the namespace size reported the device.

The <device> parameter is mandatory NVMe character device (ex: /dev/nvme0).

This will only work on WDC devices supporting this feature. Results for any other device are undefined.

@@ -769,10 +770,10 @@ Results for any other device are undefined.

--n <NAMSPACE ID> +-n <NAMESPACE ID>
---namespace-id=<NAMSPACE_ID> +--namespace-id=<NAMESPACE_ID>

@@ -787,17 +788,14 @@ Results for any other device are undefined.

- Overprovisioning Option; defaults to 0xF + Overprovisioning Option; defaults to 0xF + Valid Values: + 0x1 - 7% of Original TNVMCAP reported value + 0x2 - 28% of Original TNVMCAP reported value + 0x3 - 50% of Original TNVMCAP reported value + 0xF - 0% of Original TNVMCAP reported value (original config) + All other values - reserved

-
-
-
Valid Values:
-0x1 - 7% of Original TNVMCAP reported value
-0x2 - 28% of Original TNVMCAP reported value
-0x3 - 50% of Original TNVMCAP reported value
-0xF - 0% of Original TNVMCAP reported value (original config)
-All other values - reserved
-
@@ -838,7 +836,7 @@ Resizes namespace 2 to 7% of the original TNVMCAP reported value: diff --git a/Documentation/nvme-wdc-namespace-resize.txt b/Documentation/nvme-wdc-namespace-resize.txt index 71fc781..42994ad 100644 --- a/Documentation/nvme-wdc-namespace-resize.txt +++ b/Documentation/nvme-wdc-namespace-resize.txt @@ -8,13 +8,14 @@ nvme-wdc-namespace-resize - Resizes the device's namespace. SYNOPSIS -------- [verse] -'nvme wdc namespace-resize' [--nsid=, -n ] [--op_option=, -o ] +'nvme wdc namespace-resize' [--nsid=, -n ] + [--op_option=, -o ] DESCRIPTION ----------- -For the NVMe device given, sends the WDC Vendor Specific Command that modifies the namespace size reported -by the device. +For the NVMe device given, sends the WDC Vendor Specific Command that modifies +the namespace size reported the device. The parameter is mandatory NVMe character device (ex: /dev/nvme0). @@ -23,20 +24,19 @@ Results for any other device are undefined. OPTIONS ------- --n :: ---namespace-id=:: +-n :: +--namespace-id=:: Namespace ID; ID of the namespace to resize -o :: --op-option=:: - Overprovisioning Option; defaults to 0xF - - Valid Values: - 0x1 - 7% of Original TNVMCAP reported value - 0x2 - 28% of Original TNVMCAP reported value - 0x3 - 50% of Original TNVMCAP reported value - 0xF - 0% of Original TNVMCAP reported value (original config) - All other values - reserved + Overprovisioning Option; defaults to 0xF + Valid Values: + 0x1 - 7% of Original TNVMCAP reported value + 0x2 - 28% of Original TNVMCAP reported value + 0x3 - 50% of Original TNVMCAP reported value + 0xF - 0% of Original TNVMCAP reported value (original config) + All other values - reserved EXAMPLES -------- diff --git a/Documentation/nvme-wdc-purge-monitor.1 b/Documentation/nvme-wdc-purge-monitor.1 index dc8612b..2a4bafe 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-PURGE\-MO" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-PURGE\-MO" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-purge-monitor.html b/Documentation/nvme-wdc-purge-monitor.html index c3fb22e..94e0f1d 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-monitor.txt b/Documentation/nvme-wdc-purge-monitor.txt index 313c8db..5d44183 100644 --- a/Documentation/nvme-wdc-purge-monitor.txt +++ b/Documentation/nvme-wdc-purge-monitor.txt @@ -37,7 +37,6 @@ Expected status and description :- |Purge State Error : Purge operation interrupted by power cycle or reset. |=== - The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). diff --git a/Documentation/nvme-wdc-purge.1 b/Documentation/nvme-wdc-purge.1 index 5a79047..5806ea8 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-PURGE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-PURGE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-wdc-purge.html b/Documentation/nvme-wdc-purge.html index 9597d3d..1d9bb9f 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-set-latency-monitor-feature.txt b/Documentation/nvme-wdc-set-latency-monitor-feature.txt new file mode 100644 index 0000000..60b3e26 --- /dev/null +++ b/Documentation/nvme-wdc-set-latency-monitor-feature.txt @@ -0,0 +1,118 @@ +nvme-wdc-set-latency-monitor-feature(1) +======================================= + +NAME +---- +nvme-wdc-set-latency-monitor-feature - Set NVMe WDC latency monitor feature options + +SYNOPSIS +-------- +[verse] +'nvme wdc set-latency-monitor-feature' + [--active_bucket_timer_threshold= | -t ] + [--active_threshold_a= | -a ] + [--active_threshold_b= | -b ] + [--active_threshold_c= | -c ] + [--active_threshold_d= | -d ] + [--active_latency_config= | -f ] + [--active_latency_minimum_window= | -w ] + [--debug_log_trigger_enable= | -r ] + [--discard_debug_log= | -l ] + [--latency_monitor_feature_enable= | -e ] + +DESCRIPTION +----------- +For the NVMe device given, this command set the +latency monitor feature options (if supported by the device). + +The parameter is mandatory NVMe character device (ex: /dev/nvme0). + +Setting results can be checked with 'get-latency-monitor-log' command. + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-t :: +--active_bucket_timer_threshold=:: + The value that loads the Active Bucket Timer Threshold; default value is 07E0h. + +-a :: +--active_threshold_a=:: + The value that loads into the Active Threshold A; default value is 05h. + +-b :: +--active_threshold_b=:: + The value that loads into the Active Threshold B; default value is 13h. + +-c :: +--active_threshold_c=:: + The value that loads into the Active Threshold C; default value is 1Eh. + +-d :: +--active_threshold_d=:: + The value that loads into the Active Threshold D; default value is 2Eh. + +-f :: +--active_latency_config=:: + The value that loads into the Active Latency Configuration. This + configures how both the Active Latency Stamp, and the Active Measured + Latency Fields are updated on a per I/O command (Read, Write, Deallocate) + counter basis; default value is 0FFFh. + +-w :: +--active_latency_minimum_window=:: + The value that loads into the Active Latency Minimum Window; default value is 0Ah. + +-r :: +--debug_log_trigger_enable=:: + The value that loads into the Debug Log Trigger Enable; When set to 1b + the first time the bucket/counter combination is incremented a debug log + is triggered. When cleared to 0b a debug log will not be triggered when + the bucket/counter combination is incremented. + +-l :: +--discard_debug_log=:: + Discard Debug Log. When cleared to 00h the debug log, if it exists, will + not be cleared. When set to 01h the debug log will be discarded so + another log can be triggered. All the fields in the Set Features Data + structure are valid. When set to 02h the debug log will be discarded so + another log can be triggered. None of the other fields of the Set + Features Data structure are valid. + +-e :: +--latency_monitor_feature_enable=:: + Latency Monitor Feature Enable; When set to 01h the Latency Monitor + Feature is enabled. When cleared to 00h the Latency Monitor Feature is + disabled. + +EXAMPLES +-------- +* Set NVMe WDC latency monitor feature options enabled with default value values: ++ +------------ +# nvme wdc set-latency-monitor-feature /dev/nvme0 -e 1 +------------ +* Set NVMe WDC latency monitor feature options disabled with default value values: ++ +------------ +# nvme wdc set-latency-monitor-feature /dev/nvme0 -e 0 +------------ +* Set NVMe WDC latency monitor feature options enabled with specific values: ++ +------------ +# nvme wdc set-latency-monitor-feature /dev/nvme0 --active_bucket_timer_threshold=1 \ + --active_threshold_a=0x0 \ + --active_threshold_b=0x1 \ + --active_threshold_c=0x2 \ + --active_threshold_d=0x3 \ + --active_latency_config=0xfff \ + --active_latency_minimum_window=0 \ + --debug_log_trigger_enable=0 \ + --discard_debug_log=0 \ + --latency_monitor_feature_enable=0x1 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-wdc-vs-cloud-log.1 b/Documentation/nvme-wdc-vs-cloud-log.1 index df71f00..c12f92e 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-CLOUD" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-CLOUD" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -46,7 +46,7 @@ This will only work on WDC devices supporting this feature\&. Results for any ot On success it returns 0, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, or diff --git a/Documentation/nvme-wdc-vs-cloud-log.html b/Documentation/nvme-wdc-vs-cloud-log.html index 7eae4da..55b5ac4 100644 --- a/Documentation/nvme-wdc-vs-cloud-log.html +++ b/Documentation/nvme-wdc-vs-cloud-log.html @@ -772,10 +772,10 @@ Results for any other device are undefined.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -828,7 +828,7 @@ Has the program issue WDC vs-cloud-log Vendor Unique Command :

diff --git a/Documentation/nvme-wdc-vs-cloud-log.txt b/Documentation/nvme-wdc-vs-cloud-log.txt index 9eeee42..9739295 100644 --- a/Documentation/nvme-wdc-vs-cloud-log.txt +++ b/Documentation/nvme-wdc-vs-cloud-log.txt @@ -26,8 +26,8 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', or 'json'. Only one output format can be used at a time. Default is normal. diff --git a/Documentation/nvme-wdc-vs-device-waf.1 b/Documentation/nvme-wdc-vs-device-waf.1 index 4e898a2..6e9e184 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-DEVIC" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-DEVIC" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -46,7 +46,7 @@ This will only work on WDC devices supporting this feature\&. Results for any ot On success it returns 0, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, or diff --git a/Documentation/nvme-wdc-vs-device-waf.html b/Documentation/nvme-wdc-vs-device-waf.html index 73baeae..00689b9 100644 --- a/Documentation/nvme-wdc-vs-device-waf.html +++ b/Documentation/nvme-wdc-vs-device-waf.html @@ -772,10 +772,10 @@ Results for any other device are undefined.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -828,7 +828,7 @@ Has the program issue WDC vs-device-waf plugin Command :

diff --git a/Documentation/nvme-wdc-vs-device-waf.txt b/Documentation/nvme-wdc-vs-device-waf.txt index 55095a4..f25618d 100644 --- a/Documentation/nvme-wdc-vs-device-waf.txt +++ b/Documentation/nvme-wdc-vs-device-waf.txt @@ -27,8 +27,8 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', or 'json'. Only one output format can be used at a time. Default is normal. diff --git a/Documentation/nvme-wdc-vs-drive-info.1 b/Documentation/nvme-wdc-vs-drive-info.1 index 08ae9c7..3c53fd6 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-DRIVE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-DRIVE" "1" "12/21/2023" "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 ed6e1fe..e8f8412 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-drive-info.txt b/Documentation/nvme-wdc-vs-drive-info.txt index 0cfdd7a..bc18b17 100644 --- a/Documentation/nvme-wdc-vs-drive-info.txt +++ b/Documentation/nvme-wdc-vs-drive-info.txt @@ -38,12 +38,10 @@ HyperScale Boot Version TCG Device Ownership - EXAMPLE -------- # nvme wdc vs-drive-info /dev/nvme0 - NVME ---- Part of the nvme-user suite. diff --git a/Documentation/nvme-wdc-vs-error-reason-identifier.1 b/Documentation/nvme-wdc-vs-error-reason-identifier.1 index 33ed0ae..785fe76 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-ERROR" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-ERROR" "1" "12/21/2023" "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 56f64e6..8f13214 100644 --- a/Documentation/nvme-wdc-vs-error-reason-identifier.html +++ b/Documentation/nvme-wdc-vs-error-reason-identifier.html @@ -758,7 +758,7 @@ nvme-wdc-vs-error-reason-identifier(1) Manual Page

DESCRIPTION

For the NVMe device given, retrieve the telemetry log error reason id field for either the host generated or -controller initiated log. The controller initiated telemetry log page option must be enabled to retrieve the +controller initiated log. The controller initiated telemetry log page option must be enabled to retrieve the error reason id for that log page id.

The <device> parameter is mandatory and must be the NVMe character device (ex: /dev/nvme0).

This will only work on WDC devices supporting this feature. @@ -836,7 +836,7 @@ Retrieves the controller initiated error reason identifier field and save it in

diff --git a/Documentation/nvme-wdc-vs-error-reason-identifier.txt b/Documentation/nvme-wdc-vs-error-reason-identifier.txt index 054d675..0c7f397 100644 --- a/Documentation/nvme-wdc-vs-error-reason-identifier.txt +++ b/Documentation/nvme-wdc-vs-error-reason-identifier.txt @@ -13,8 +13,8 @@ SYNOPSIS DESCRIPTION ----------- For the NVMe device given, retrieve the telemetry log error reason id field for either the host generated or -controller initiated log. The controller initiated telemetry log page option must be enabled to retrieve the -error reason id for that log page id. +controller initiated log. The controller initiated telemetry log page option must be enabled to retrieve the +error reason id for that log page id. The parameter is mandatory and must be the NVMe character device (ex: /dev/nvme0). @@ -27,7 +27,7 @@ OPTIONS ------- -i :: --log-id=:: - Specifies the telemetry log id of the error reason identifier to retrieve. + Specifies the telemetry log id of the error reason identifier to retrieve. Use id 7 for the host generated log page. Use id 8 for the controller initiated log page. The default is 7/host generated diff --git a/Documentation/nvme-wdc-vs-fw-activate-history.1 b/Documentation/nvme-wdc-vs-fw-activate-history.1 index 305f5ba..28a1952 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-FW\-A" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-FW\-A" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -45,7 +45,7 @@ This will only work on WDC devices supporting this feature\&. Results for any ot On success it returns 0, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, or diff --git a/Documentation/nvme-wdc-vs-fw-activate-history.html b/Documentation/nvme-wdc-vs-fw-activate-history.html index b9d997a..f1842a8 100644 --- a/Documentation/nvme-wdc-vs-fw-activate-history.html +++ b/Documentation/nvme-wdc-vs-fw-activate-history.html @@ -770,10 +770,10 @@ Results for any other device are undefined.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -805,7 +805,7 @@ cellspacing="0" cellpadding="4">

Entry Number

-

The number of fw activate entry. The most recent 20 entries will be displayed.

+

The number of fw activate entry. The most recent 20 entries will be displayed.

Power on Hour

@@ -833,7 +833,7 @@ cellspacing="0" cellpadding="4">

Result

-

The result of the firmware activation event. The output shall be in the format: +

The result of the firmware activation event. The output shall be in the format: Pass or Failed + error code

@@ -868,7 +868,7 @@ Has the program issue WDC vs-fw-activate-history Vendor Unique Command : diff --git a/Documentation/nvme-wdc-vs-fw-activate-history.txt b/Documentation/nvme-wdc-vs-fw-activate-history.txt index 30c6ede..923ff0a 100644 --- a/Documentation/nvme-wdc-vs-fw-activate-history.txt +++ b/Documentation/nvme-wdc-vs-fw-activate-history.txt @@ -24,13 +24,12 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', or 'json'. Only one output format can be used at a time. Default is normal. - Firmware Activate History Log Page Data Output Explanation ----------------------------------------------------------- [cols="2*", frame="topbot", align="center", options="header"] @@ -38,7 +37,7 @@ Firmware Activate History Log Page Data Output Explanation |Field |Description |*Entry Number* -|The number of fw activate entry. The most recent 20 entries will be displayed. +|The number of fw activate entry. The most recent 20 entries will be displayed. |*Power on Hour* |The time since the power on in hours:minutes:seconds. @@ -59,7 +58,7 @@ Firmware Activate History Log Page Data Output Explanation |The commit action type associated with the firmware activation event |*Result* -|The result of the firmware activation event. The output shall be in the format: +|The result of the firmware activation event. The output shall be in the format: Pass or Failed + error code |=== diff --git a/Documentation/nvme-wdc-vs-hw-rev-log.1 b/Documentation/nvme-wdc-vs-hw-rev-log.1 index 1ea7cbd..0b9bab0 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-HW\-R" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-HW\-R" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -46,7 +46,7 @@ This will only work on WDC devices supporting this feature\&. Results for any ot On success it returns 0, error code otherwise\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, or diff --git a/Documentation/nvme-wdc-vs-hw-rev-log.html b/Documentation/nvme-wdc-vs-hw-rev-log.html index 7bcd303..3fd4b56 100644 --- a/Documentation/nvme-wdc-vs-hw-rev-log.html +++ b/Documentation/nvme-wdc-vs-hw-rev-log.html @@ -771,10 +771,10 @@ Results for any other device are undefined.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -827,7 +827,7 @@ Has the program issue WDC vs-hw-rev-log plugin Command :

diff --git a/Documentation/nvme-wdc-vs-hw-rev-log.txt b/Documentation/nvme-wdc-vs-hw-rev-log.txt index c5335d9..b4eb4dd 100644 --- a/Documentation/nvme-wdc-vs-hw-rev-log.txt +++ b/Documentation/nvme-wdc-vs-hw-rev-log.txt @@ -25,8 +25,8 @@ On success it returns 0, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', or 'json'. Only one output format can be used at a time. Default is normal. diff --git a/Documentation/nvme-wdc-vs-internal-log.1 b/Documentation/nvme-wdc-vs-internal-log.1 index 138064d..45e8466 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-INTER" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-INTER" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,12 @@ nvme-wdc-vs-internal-log \- Retrieve WDC device\*(Aqs internal firmware log and .SH "SYNOPSIS" .sp .nf -\fInvme wdc vs\-internal\-log\fR [\-\-output\-file=, \-o ] [\-\-transfer\-size=, \-s ] - [\-\-data\-area=, \-d ] [\-\-file\-size=, \-f ] [\-\-offset=, \-e ] - [\-\-type=, \-t ] [\-\-verbose, \-v] +\fInvme wdc vs\-internal\-log\fR [\-\-output\-file=, \-o ] + [\-\-transfer\-size=, \-s ] + [\-\-data\-area=, \-d ] + [\-\-file\-size=, \-f ] + [\-\-offset=, \-e ] + [\-\-type=, \-t ] [\-\-verbose, \-v] .fi .SH "DESCRIPTION" .sp diff --git a/Documentation/nvme-wdc-vs-internal-log.html b/Documentation/nvme-wdc-vs-internal-log.html index f7c0e0a..b8bc8fd 100644 --- a/Documentation/nvme-wdc-vs-internal-log.html +++ b/Documentation/nvme-wdc-vs-internal-log.html @@ -749,9 +749,12 @@ nvme-wdc-vs-internal-log(1) Manual Page

SYNOPSIS

-
nvme wdc vs-internal-log <device> [--output-file=<FILE>, -o <FILE>] [--transfer-size=<SIZE>, -s <SIZE>]
-    [--data-area=<DATA AREA>, -d <DATA_AREA>] [--file-size=<FILE SIZE>, -f <FILE SIZE>] [--offset=<OFFSET>, -e <OFFSET>]
-    [--type=<TYPE>, -t <type>] [--verbose, -v]
+
nvme wdc vs-internal-log <device> [--output-file=<FILE>, -o <FILE>]
+                        [--transfer-size=<SIZE>, -s <SIZE>]
+                        [--data-area=<DATA AREA>, -d <DATA_AREA>]
+                        [--file-size=<FILE SIZE>, -f <FILE SIZE>]
+                        [--offset=<OFFSET>, -e <OFFSET>]
+                        [--type=<TYPE>, -t <type>] [--verbose, -v]
@@ -759,8 +762,8 @@ nvme-wdc-vs-internal-log(1) Manual Page

DESCRIPTION

-

For the NVMe device given, sends the WDC Vendor Specific Internal Log request and saves -the result to a file.

+

For the NVMe device given, sends the WDC Vendor Specific Internal Log request +and saves the result to a file.

The <device> parameter is mandatory NVMe character device (ex: /dev/nvme0).

This will only work on WDC devices supporting this feature. Results for any other device are undefined.

@@ -778,7 +781,8 @@ Results for any other device are undefined.

- Output file; defaults to device serial number followed by "internal_fw_log<date>_<time>.bin" suffix + Output file; defaults to device serial number followed by + "internal_fw_log<date>_<time>.bin" suffix

@@ -789,7 +793,7 @@ Results for any other device are undefined.

- Transfer size; defaults to 0x10000 (65536 decimal) bytes + Transfer size; defaults to 0x10000 (65536 decimal) bytes

@@ -800,8 +804,9 @@ Results for any other device are undefined.

- DUI data area to retrieve. The DUI data areas from 1 to <DATA AREA> will be retrieved. This parameter - is currently only supported on the SN340, SN640, SN730, and SN840 devices. + DUI data area to retrieve. The DUI data areas from 1 to <DATA AREA> will + be retrieved. This parameter is currently only supported on the SN340, + SN640, SN730, and SN840 devices.

@@ -812,9 +817,10 @@ Results for any other device are undefined.

- Specifies the desired size of the data file starting at the passed in offset. This allows the user to - retrieve the data in several smaller files of the passed in size. This parameter is currently only - supported on the SN340 device. + Specifies the desired size of the data file starting at the passed in + offset. This allows the user to retrieve the data in several smaller + files of the passed in size. This parameter is currently only supported + on the SN340 device.

@@ -825,9 +831,10 @@ Results for any other device are undefined.

- Specifies the data offset at which to start retrieving the data. This parameter is used in combination - with the file size parameter to retrieve the data in several smaller files. This parameter is currently - only supported on the SN340 device. + Specifies the data offset at which to start retrieving the data. This + parameter is used in combination with the file size parameter to + retrieve the data in several smaller files. This parameter is currently + only supported on the SN340 device.

@@ -838,10 +845,11 @@ Results for any other device are undefined.

- Specifies the telemetry type - NONE, HOST, or CONTROLLER. This parameter is used to get either the host - generated or controller initiated telemetry log page. If not specified or none is specified, the command - will return the default E6 log data. This parameter is currently only supported on the SN640 and SN840 - devices. + Specifies the telemetry type - NONE, HOST, or CONTROLLER. This parameter + is used to get either the host generated or controller initiated + telemetry log page. If not specified or none is specified, the command + will return the default E6 log data. This parameter is currently only + supported on the SN640 and SN840 devices.

@@ -950,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-internal-log.txt b/Documentation/nvme-wdc-vs-internal-log.txt index 4fbde38..08f585b 100644 --- a/Documentation/nvme-wdc-vs-internal-log.txt +++ b/Documentation/nvme-wdc-vs-internal-log.txt @@ -8,15 +8,18 @@ nvme-wdc-vs-internal-log - Retrieve WDC device's internal firmware log and save SYNOPSIS -------- [verse] -'nvme wdc vs-internal-log' [--output-file=, -o ] [--transfer-size=, -s ] - [--data-area=, -d ] [--file-size=, -f ] [--offset=, -e ] - [--type=, -t ] [--verbose, -v] +'nvme wdc vs-internal-log' [--output-file=, -o ] + [--transfer-size=, -s ] + [--data-area=, -d ] + [--file-size=, -f ] + [--offset=, -e ] + [--type=, -t ] [--verbose, -v] DESCRIPTION ----------- -For the NVMe device given, sends the WDC Vendor Specific Internal Log request and saves -the result to a file. +For the NVMe device given, sends the WDC Vendor Specific Internal Log request +and saves the result to a file. The parameter is mandatory NVMe character device (ex: /dev/nvme0). @@ -27,35 +30,40 @@ OPTIONS ------- -o :: --output-file=:: - Output file; defaults to device serial number followed by "_internal_fw_log__
--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -814,7 +814,7 @@ Has the program issue WDC vs-nand-stats Vendor Unique Command :

diff --git a/Documentation/nvme-wdc-vs-nand-stats.txt b/Documentation/nvme-wdc-vs-nand-stats.txt index cc1f422..1b16daa 100644 --- a/Documentation/nvme-wdc-vs-nand-stats.txt +++ b/Documentation/nvme-wdc-vs-nand-stats.txt @@ -26,8 +26,8 @@ On success it returns the NAND statistics, error code otherwise. OPTIONS ------- --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', or 'json'. Only one output format can be used at a time. Default is normal. diff --git a/Documentation/nvme-wdc-vs-smart-add-log.1 b/Documentation/nvme-wdc-vs-smart-add-log.1 index e955162..7fe4900 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-SMART" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-SMART" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -54,7 +54,7 @@ On success it returns 0, error code otherwise\&. Return the statistics from specific interval, defaults to 14\&. This parameter is only valid for the 0xC1 log page and ignored for all other log pages\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, or diff --git a/Documentation/nvme-wdc-vs-smart-add-log.html b/Documentation/nvme-wdc-vs-smart-add-log.html index 1c204dd..00d6ce7 100644 --- a/Documentation/nvme-wdc-vs-smart-add-log.html +++ b/Documentation/nvme-wdc-vs-smart-add-log.html @@ -782,15 +782,16 @@ Results for any other device are undefined.

- Return the statistics from specific interval, defaults to 14. This parameter is only valid for the 0xC1 log page - and ignored for all other log pages. + Return the statistics from specific interval, defaults to 14. This + parameter is only valid for the 0xC1 log page and ignored for all other + log pages.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

@@ -807,8 +808,8 @@ Results for any other device are undefined.

- Log Page Version: 0 = vendor, 1 = WDC. This parameter is only valid for the 0xC0 log page and ignored for all - other log pages. + Log Page Version: 0 = vendor, 1 = WDC. This parameter is only valid for + the 0xC0 log page and ignored for all other log pages.

@@ -819,10 +820,10 @@ Results for any other device are undefined.

- Supply a comma separated list of desired log pages to display. - The possible values are 0xc0, 0xc1, 0xca, 0xd0. - Note: Not all pages are supported on all drives. - The default is to display all supported log pages. + Supply a comma separated list of desired log pages to display. + The possible values are 0xc0, 0xc1, 0xca, 0xd0. + Note: Not all pages are supported on all drives. + The default is to display all supported log pages.

@@ -927,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-smart-add-log.txt b/Documentation/nvme-wdc-vs-smart-add-log.txt index 7de1ac8..925287f 100644 --- a/Documentation/nvme-wdc-vs-smart-add-log.txt +++ b/Documentation/nvme-wdc-vs-smart-add-log.txt @@ -3,7 +3,8 @@ nvme-wdc-vs-smart-add-log(1) NAME ---- -nvme-wdc-vs-smart-add-log - Send NVMe WDC vs-smart-add-log Vendor Unique Command, return result +nvme-wdc-vs-smart-add-log - Send NVMe WDC vs-smart-add-log Vendor Unique Command, +return result SYNOPSIS -------- @@ -31,26 +32,27 @@ OPTIONS ------- -i :: --interval=:: - Return the statistics from specific interval, defaults to 14. This parameter is only valid for the 0xC1 log page - and ignored for all other log pages. + Return the statistics from specific interval, defaults to 14. This + parameter is only valid for the 0xC1 log page and ignored for all other + log pages. --o :: ---output-format=:: +-o :: +--output-format=:: Set the reporting format to 'normal', or 'json'. Only one output format can be used at a time. Default is normal. -l :: --log-page-version=:: - Log Page Version: 0 = vendor, 1 = WDC. This parameter is only valid for the 0xC0 log page and ignored for all - other log pages. + Log Page Version: 0 = vendor, 1 = WDC. This parameter is only valid for + the 0xC0 log page and ignored for all other log pages. -p :: --log-page-mask=:: - Supply a comma separated list of desired log pages to display. - The possible values are 0xc0, 0xc1, 0xca, 0xd0. - Note: Not all pages are supported on all drives. - The default is to display all supported log pages. + Supply a comma separated list of desired log pages to display. + The possible values are 0xc0, 0xc1, 0xca, 0xd0. + Note: Not all pages are supported on all drives. + The default is to display all supported log pages. -n :: --namespace-id=:: @@ -82,7 +84,6 @@ accumulated statistics. |The statistical set accumulated during the entire lifetime of the device. |=== - EXAMPLES -------- * Has the program issue WDC vs-smart-add-log Vendor Unique Command with default interval (14) : diff --git a/Documentation/nvme-wdc-vs-telemetry-controller-option.1 b/Documentation/nvme-wdc-vs-telemetry-controller-option.1 index e5f4dcc..5176f93 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-TELEM" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-TELEM" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,12 +32,12 @@ nvme-wdc-vs-telemetry-controller-option \- Disable/Enable the controller initiat .SH "SYNOPSIS" .sp .nf -\fInvme wdc vs\-telemetry\-controller\-option\fR [\-\-disable, \-d] [\-\-enable, \-e] - [\-\-status, \-s] +\fInvme wdc vs\-telemetry\-controller\-option\fR + [\-\-disable, \-d] [\-\-enable, \-e] [\-\-status, \-s] .fi .SH "DESCRIPTION" .sp -For the NVMe device given, sends the WDC Vendor Specific set feature command to disable, enable or get current status of the controller initiated option of the telemetry log page\&. +For the NVMe device given, sends the WDC Vendor Specific set feature command to disable, enable or get current status the controller initiated option of the telemetry log page\&. .sp The parameter is mandatory NVMe character device (ex: /dev/nvme0)\&. .sp diff --git a/Documentation/nvme-wdc-vs-telemetry-controller-option.html b/Documentation/nvme-wdc-vs-telemetry-controller-option.html index 2593a94..4b8b0c8 100644 --- a/Documentation/nvme-wdc-vs-telemetry-controller-option.html +++ b/Documentation/nvme-wdc-vs-telemetry-controller-option.html @@ -749,8 +749,8 @@ nvme-wdc-vs-telemetry-controller-option(1) Manual Page

SYNOPSIS

-
nvme wdc vs-telemetry-controller-option <device> [--disable, -d] [--enable, -e]
-    [--status, -s]
+
nvme wdc vs-telemetry-controller-option <device>
+                        [--disable, -d] [--enable, -e] [--status, -s]
@@ -758,8 +758,9 @@ nvme-wdc-vs-telemetry-controller-option(1) Manual Page

DESCRIPTION

-

For the NVMe device given, sends the WDC Vendor Specific set feature command to disable, enable or get current status -of the controller initiated option of the telemetry log page.

+

For the NVMe device given, sends the WDC Vendor Specific set feature command to +disable, enable or get current status the controller initiated option of the +telemetry log page.

The <device> parameter is mandatory NVMe character device (ex: /dev/nvme0).

This will only work on WDC devices supporting this feature. Results for any other device are undefined.

@@ -799,7 +800,8 @@ Results for any other device are undefined.

- Returns the current status (enabled or disabled) of the controller initiated option of the telemetry log page. + Returns the current status (enabled or disabled) of the controller + initiated option of the telemetry log page.

@@ -853,7 +855,7 @@ Gets the current status (enabled or disabled) of the controller initiated option diff --git a/Documentation/nvme-wdc-vs-telemetry-controller-option.txt b/Documentation/nvme-wdc-vs-telemetry-controller-option.txt index 8c1a7e7..2353e7c 100644 --- a/Documentation/nvme-wdc-vs-telemetry-controller-option.txt +++ b/Documentation/nvme-wdc-vs-telemetry-controller-option.txt @@ -3,19 +3,21 @@ nvme-wdc-vs-telemetry-controller-option(1) NAME ---- -nvme-wdc-vs-telemetry-controller-option - Disable/Enable the controller initiated option of the telemetry log page. +nvme-wdc-vs-telemetry-controller-option - Disable/Enable the controller +initiated option of the telemetry log page. SYNOPSIS -------- [verse] -'nvme wdc vs-telemetry-controller-option' [--disable, -d] [--enable, -e] - [--status, -s] +'nvme wdc vs-telemetry-controller-option' + [--disable, -d] [--enable, -e] [--status, -s] DESCRIPTION ----------- -For the NVMe device given, sends the WDC Vendor Specific set feature command to disable, enable or get current status -of the controller initiated option of the telemetry log page. +For the NVMe device given, sends the WDC Vendor Specific set feature command to +disable, enable or get current status the controller initiated option of the +telemetry log page. The parameter is mandatory NVMe character device (ex: /dev/nvme0). @@ -34,8 +36,8 @@ OPTIONS -s:: --status:: - Returns the current status (enabled or disabled) of the controller initiated option of the telemetry log page. - + Returns the current status (enabled or disabled) of the controller + initiated option of the telemetry log page. EXAMPLES -------- diff --git a/Documentation/nvme-wdc-vs-temperature-stats.1 b/Documentation/nvme-wdc-vs-temperature-stats.1 index 4a3ffc3..b5c2370 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-TEMPE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-TEMPE" "1" "12/21/2023" "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 775305e..f76c0e3 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 b7e0efe..148e7c8 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-UNCOR" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-UNCOR" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -37,23 +37,24 @@ nvme-write-uncor \- Send an NVMe write uncorrectable command, return results [\-\-namespace\-id= | \-n ] [\-\-dir\-type= | \-T ] [\-\-dir\-spec= | \-S ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp The Write Uncorrectable command is used to invalidate a range of logical blocks\&. .SH "OPTIONS" .PP -\-\-start\-block=, \-s +\-s , \-\-start\-block= .RS 4 Start block\&. .RE .PP -\-\-block\-count=, \-c +\-c, \-\-block\-count= .RS 4 Number of logical blocks to write uncorrectable\&. .RE .PP -\-\-namespace\-id=, \-n +\-n , \-\-namespace\-id= .RS 4 Namespace ID use in the command\&. .RE @@ -67,6 +68,20 @@ Directive type .RS 4 Directive specific .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-write-uncor.html b/Documentation/nvme-write-uncor.html index dd6d6e0..6f9c038 100644 --- a/Documentation/nvme-write-uncor.html +++ b/Documentation/nvme-write-uncor.html @@ -753,7 +753,8 @@ nvme-uncor(1) Manual Page [--block-count=<nlb> | -c <nlb>] [--namespace-id=<nsid> | -n <nsid>] [--dir-type=<dtype> | -T <dtype>] - [--dir-spec=<dspec> | -S <dspec>] + [--dir-spec=<dspec> | -S <dspec>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -770,10 +771,10 @@ blocks.

---start-block=<slba> +-s <slba>
--s <slba> +--start-block=<slba>

@@ -781,10 +782,10 @@ blocks.

---block-count=<nlb> +-c
--c +--block-count=<nlb>

@@ -792,10 +793,10 @@ blocks.

---namespace-id=<nsid> +-n <nsid>
--n <nsid> +--namespace-id=<nsid>

@@ -824,6 +825,29 @@ blocks.

Directive specific

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -844,7 +868,7 @@ blocks.

diff --git a/Documentation/nvme-write-uncor.txt b/Documentation/nvme-write-uncor.txt index 19415c2..6e49c61 100644 --- a/Documentation/nvme-write-uncor.txt +++ b/Documentation/nvme-write-uncor.txt @@ -13,6 +13,7 @@ SYNOPSIS [--namespace-id= | -n ] [--dir-type= | -T ] [--dir-spec= | -S ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -21,16 +22,16 @@ blocks. OPTIONS ------- ---start-block=:: -s :: +--start-block=:: Start block. ---block-count=:: -c:: +--block-count=:: Number of logical blocks to write uncorrectable. ---namespace-id=:: -n :: +--namespace-id=:: Namespace ID use in the command. -T :: @@ -41,6 +42,15 @@ OPTIONS --dir-spec=:: Directive specific +-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 -------- No examples yet. diff --git a/Documentation/nvme-write-zeroes.1 b/Documentation/nvme-write-zeroes.1 index 0ec2964..6c8f5c4 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WRITE\-ZEROES" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WRITE\-ZEROES" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -37,32 +37,31 @@ nvme-write-zeroes \- Send an NVMe write zeroes command, return results [\-\-ref\-tag= | \-r ] [\-\-prinfo= | \-p ] [\-\-app\-tag\-mask= | \-m ] - [\-\-app\-tag= | \-a ] - [\-\-deac | \-d] - [\-\-limited\-retry | \-l] - [\-\-force\-unit\-access | \-f] + [\-\-app\-tag= | \-a ] [\-\-deac | \-d] + [\-\-limited\-retry | \-l] [\-\-force\-unit\-access | \-f] [\-\-namespace\-id= | \-n ] [\-\-storage\-tag | \-S ] [\-\-storage\-tag\-check | \-C ] [\-\-dir\-type= | \-T ] [\-\-dir\-spec= | \-D ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp The Write Zeroes command is used to set a range of logical blocks to 0\&. .SH "OPTIONS" .PP -\-\-start\-block=, \-s +\-s , \-\-start\-block= .RS 4 Start block\&. .RE .PP -\-\-block\-count=, \-c +\-c , \-\-block\-count= .RS 4 Number of logical blocks to write zeroes\&. .RE .PP -\-\-prinfo=, \-p +\-p , \-\-prinfo= .RS 4 Protection Information field definition\&. .TS @@ -107,47 +106,47 @@ T} .sp 1 .RE .PP -\-\-ref\-tag=, \-r +\-r , \-\-ref\-tag= .RS 4 Optional reftag when used with protection information\&. .RE .PP -\-\-app\-tag\-mask=, \-m +\-m , \-\-app\-tag\-mask= .RS 4 Optional application tag mask when used with protection information\&. .RE .PP -\-\-app\-tag=, \-a +\-a , \-\-app\-tag= .RS 4 Optional application tag when used with protection information\&. .RE .PP -\-\-limited\-retry, \-l +\-l, \-\-limited\-retry .RS 4 Sets the limited retry flag\&. .RE .PP -\-\-deac, \-d +\-d, \-\-deac .RS 4 Sets the DEAC bit, requesting controller deallocate the logical blocks\&. .RE .PP -\-\-force\-unit\-access, \-f +\-f, \-\-force\-unit\-access .RS 4 Set the force\-unit access flag\&. .RE .PP -\-\-namespace\-id=, \-n +\-n , \-\-namespace\-id= .RS 4 Namespace ID use in the command\&. .RE .PP -\-\-storage\-tag=, \-S +\-S , \-\-storage\-tag= .RS 4 Variable Sized Logical Block Storage Tag(LBST)\&. .RE .PP -\-\-storage\-tag\-check=, \-C +\-C , \-\-storage\-tag\-check= .RS 4 This bit specifies the Storage Tag field shall be checked as part of end\-to\-end data protection processing\&. .RE @@ -161,6 +160,20 @@ Directive type .RS 4 Directive specific .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-write-zeroes.html b/Documentation/nvme-write-zeroes.html index 65293cb..ac0cf70 100644 --- a/Documentation/nvme-write-zeroes.html +++ b/Documentation/nvme-write-zeroes.html @@ -754,15 +754,14 @@ nvme-write-zeroes(1) Manual Page [--ref-tag=<reftag> | -r <reftag>] [--prinfo=<prinfo> | -p <prinfo>] [--app-tag-mask=<appmask> | -m <appmask>] - [--app-tag=<apptag> | -a <apptag>] - [--deac | -d] - [--limited-retry | -l] - [--force-unit-access | -f] + [--app-tag=<apptag> | -a <apptag>] [--deac | -d] + [--limited-retry | -l] [--force-unit-access | -f] [--namespace-id=<nsid> | -n <nsid>] [--storage-tag<storage-tag> | -S <storage-tag>] [--storage-tag-check<storage-tag-check> | -C <storage-tag-check>] [--dir-type=<dtype> | -T <dtype>] - [--dir-spec=<dspec> | -D <dspec>] + [--dir-spec=<dspec> | -D <dspec>] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -778,10 +777,10 @@ nvme-write-zeroes(1) Manual Page
---start-block=<slba> +-s <slba>
--s <slba> +--start-block=<slba>

@@ -789,10 +788,10 @@ nvme-write-zeroes(1) Manual Page

---block-count=<nlb> +-c <nlb>
--c <nlb> +--block-count=<nlb>

@@ -800,10 +799,10 @@ nvme-write-zeroes(1) Manual Page

---prinfo=<prinfo> +-p <prinfo>
--p <prinfo> +--prinfo=<prinfo>

@@ -848,10 +847,10 @@ metadata is passes.

---ref-tag=<reftag> +-r <reftag>
--r <reftag> +--ref-tag=<reftag>

@@ -859,10 +858,10 @@ metadata is passes.

---app-tag-mask=<appmask> +-m <appmask>
--m <appmask> +--app-tag-mask=<appmask>

@@ -870,10 +869,10 @@ metadata is passes.

---app-tag=<apptag> +-a <apptag>
--a <apptag> +--app-tag=<apptag>

@@ -881,10 +880,10 @@ metadata is passes.

---limited-retry +-l
--l +--limited-retry

@@ -892,10 +891,10 @@ metadata is passes.

---deac +-d
--d +--deac

@@ -903,10 +902,10 @@ metadata is passes.

---force-unit-access +-f
--f +--force-unit-access

@@ -914,10 +913,10 @@ metadata is passes.

---namespace-id=<nsid> +-n <nsid>
--n <nsid> +--namespace-id=<nsid>

@@ -925,10 +924,10 @@ metadata is passes.

---storage-tag=<storage-tag> +-S <storage-tag>
--S <storage-tag> +--storage-tag=<storage-tag>

@@ -936,10 +935,10 @@ metadata is passes.

---storage-tag-check=<storage-tag-check> +-C <storage-tag-check>
--C <storage-tag-check> +--storage-tag-check=<storage-tag-check>

@@ -969,6 +968,29 @@ metadata is passes.

Directive specific

+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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. +

+
@@ -989,7 +1011,7 @@ metadata is passes.

diff --git a/Documentation/nvme-write-zeroes.txt b/Documentation/nvme-write-zeroes.txt index 7e936e5..0daf320 100644 --- a/Documentation/nvme-write-zeroes.txt +++ b/Documentation/nvme-write-zeroes.txt @@ -13,15 +13,14 @@ SYNOPSIS [--ref-tag= | -r ] [--prinfo= | -p ] [--app-tag-mask= | -m ] - [--app-tag= | -a ] - [--deac | -d] - [--limited-retry | -l] - [--force-unit-access | -f] + [--app-tag= | -a ] [--deac | -d] + [--limited-retry | -l] [--force-unit-access | -f] [--namespace-id= | -n ] [--storage-tag | -S ] [--storage-tag-check | -C ] [--dir-type= | -T ] [--dir-spec= | -D ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -29,16 +28,16 @@ The Write Zeroes command is used to set a range of logical blocks to 0. OPTIONS ------- ---start-block=:: -s :: +--start-block=:: Start block. ---block-count=:: -c :: +--block-count=:: Number of logical blocks to write zeroes. ---prinfo=:: -p :: +--prinfo=:: Protection Information field definition. + [] @@ -53,40 +52,40 @@ metadata is passes. |0|Set to 1 enables checking the reference tag |================= ---ref-tag=:: -r :: +--ref-tag=:: Optional reftag when used with protection information. ---app-tag-mask=:: -m :: +--app-tag-mask=:: Optional application tag mask when used with protection information. ---app-tag=:: -a :: +--app-tag=:: Optional application tag when used with protection information. ---limited-retry:: -l:: +--limited-retry:: Sets the limited retry flag. ---deac:: -d:: +--deac:: Sets the DEAC bit, requesting controller deallocate the logical blocks. ---force-unit-access:: -f:: +--force-unit-access:: Set the force-unit access flag. ---namespace-id=:: -n :: +--namespace-id=:: Namespace ID use in the command. ---storage-tag=:: -S :: +--storage-tag=:: Variable Sized Logical Block Storage Tag(LBST). ---storage-tag-check=:: -C :: +--storage-tag-check=:: This bit specifies the Storage Tag field shall be checked as part of end-to-end data protection processing. @@ -98,6 +97,15 @@ metadata is passes. --dir-spec=:: Directive specific +-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 -------- No examples yet. diff --git a/Documentation/nvme-write.1 b/Documentation/nvme-write.1 index 867524e..66b6994 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WRITE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-WRITE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -42,54 +42,50 @@ nvme-write \- Send an NVMe write command, provide results [\-\-prinfo= | \-p ] [\-\-app\-tag\-mask= | \-m ] [\-\-app\-tag= | \-a ] - [\-\-limited\-retry | \-l] - [\-\-force\-unit\-access | \-f] + [\-\-limited\-retry | \-l] [\-\-force\-unit\-access | \-f] [\-\-dir\-type= | \-T ] - [\-\-dir\-spec= | \-S ] - [\-\-dsm= | \-D ] - [\-\-show\-command | \-v] - [\-\-dry\-run | \-w] - [\-\-latency | \-t] + [\-\-dir\-spec= | \-S ] [\-\-dsm= | \-D ] + [\-\-show\-command | \-V] [\-\-dry\-run | \-w] [\-\-latency | \-t] [\-\-storage\-tag | \-g ] - [\-\-storage\-tag\-check | \-C] - [\-\-force] + [\-\-storage\-tag\-check | \-C] [\-\-force] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp The Write command writes the logical blocks specified by the command to the medium from the data data buffer provided\&. Will use stdin by default if you don\(cqt provide a file\&. .SH "OPTIONS" .PP -\-\-start\-block=, \-s +\-s , \-\-start\-block= .RS 4 Start block\&. .RE .PP -\-\-block\-count, \-c +\-c, \-\-block\-count .RS 4 The number of blocks to transfer\&. This is a zeroes based value to align with the kernel\(cqs use of this field\&. (ie\&. 0 means transfer 1 block)\&. .RE .PP -\-\-data\-size=, \-z +\-z , \-\-data\-size= .RS 4 Size of data, in bytes\&. .RE .PP -\-\-metadata\-size=, \-y +\-y , \-\-metadata\-size= .RS 4 Size of metadata in bytes\&. .RE .PP -\-\-data=, \-d +\-d , \-\-data= .RS 4 Data file\&. If none provided, contents are sent from STDIN\&. .RE .PP -\-\-metadata=, \-M +\-M , \-\-metadata= .RS 4 Metadata file, if necessary\&. .RE .PP -\-\-prinfo=, \-p +\-p , \-\-prinfo= .RS 4 Protection Information field definition\&. .TS @@ -134,27 +130,27 @@ T} .sp 1 .RE .PP -\-\-ref\-tag=, \-r +\-r , \-\-ref\-tag= .RS 4 Optional reftag when used with protection information\&. .RE .PP -\-\-app\-tag\-mask=, \-m +\-m , \-\-app\-tag\-mask= .RS 4 Optional application tag mask when used with protection information\&. .RE .PP -\-\-app\-tag=, \-a +\-a , \-\-app\-tag= .RS 4 Optional application tag when used with protection information\&. .RE .PP -\-\-limited\-retry, \-l +\-l, \-\-limited\-retry .RS 4 Sets the limited retry flag\&. .RE .PP -\-\-force\-unit\-access, \-f +\-f, \-\-force\-unit\-access .RS 4 Set the force\-unit access flag\&. .RE @@ -174,7 +170,7 @@ Optional field for directive specifics\&. When used with write streams, this val The optional data set management attributes for this command\&. The argument for this is the least significant 8 bits of the DSM field in a write command; the most significant 16 bits of the field come from the directive specific field, if used\&. This may be used to set attributes for the LBAs being written, like access frequency, type, latency, among other things, as well as yet to be defined types\&. Please consult the NVMe specification for detailed breakdown of how to use this field\&. .RE .PP -\-v, \-\-show\-cmd +\-V, \-\-show\-cmd .RS 4 Print out the command to be sent\&. .RE @@ -206,6 +202,20 @@ This flag enables Storage Tag field checking as part of end\-to\-end data protec .RS 4 Ignore namespace is currently busy and performed the operation even though\&. .RE +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR +or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.PP +\-v, \-\-verbose +.RS 4 +Increase the information detail in the output\&. +.RE .SH "EXAMPLES" .sp No examples yet\&. diff --git a/Documentation/nvme-write.html b/Documentation/nvme-write.html index ed44f0d..9fe4df9 100644 --- a/Documentation/nvme-write.html +++ b/Documentation/nvme-write.html @@ -759,17 +759,13 @@ nvme-write(1) Manual Page [--prinfo=<prinfo> | -p <prinfo>] [--app-tag-mask=<appmask> | -m <appmask>] [--app-tag=<apptag> | -a <apptag>] - [--limited-retry | -l] - [--force-unit-access | -f] + [--limited-retry | -l] [--force-unit-access | -f] [--dir-type=<type> | -T <type>] - [--dir-spec=<spec> | -S <spec>] - [--dsm=<dsm> | -D <dsm>] - [--show-command | -v] - [--dry-run | -w] - [--latency | -t] + [--dir-spec=<spec> | -S <spec>] [--dsm=<dsm> | -D <dsm>] + [--show-command | -V] [--dry-run | -w] [--latency | -t] [--storage-tag<storage-tag> | -g <storage-tag>] - [--storage-tag-check | -C] - [--force] + [--storage-tag-check | -C] [--force] + [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -787,10 +783,10 @@ if you don’t provide a file.

---start-block=<slba> +-s <slba>
--s <slba> +--start-block=<slba>

@@ -798,10 +794,10 @@ if you don’t provide a file.

---block-count +-c
--c +--block-count

@@ -811,10 +807,10 @@ if you don’t provide a file.

---data-size=<size> +-z <size>
--z <size> +--data-size=<size>

@@ -822,10 +818,10 @@ if you don’t provide a file.

---metadata-size=<size> +-y <size>
--y <size> +--metadata-size=<size>

@@ -833,10 +829,10 @@ if you don’t provide a file.

---data=<data-file> +-d <data-file>
--d <data-file> +--data=<data-file>

@@ -844,10 +840,10 @@ if you don’t provide a file.

---metadata=<metadata-file> +-M <metadata-file>
--M <metadata-file> +--metadata=<metadata-file>

@@ -855,10 +851,10 @@ if you don’t provide a file.

---prinfo=<prinfo> +-p <prinfo>
--p <prinfo> +--prinfo=<prinfo>

@@ -903,10 +899,10 @@ metadata is passes.

---ref-tag=<reftag> +-r <reftag>
--r <reftag> +--ref-tag=<reftag>

@@ -914,10 +910,10 @@ metadata is passes.

---app-tag-mask=<appmask> +-m <appmask>
--m <appmask> +--app-tag-mask=<appmask>

@@ -925,10 +921,10 @@ metadata is passes.

---app-tag=<apptag> +-a <apptag>
--a <apptag> +--app-tag=<apptag>

@@ -936,10 +932,10 @@ metadata is passes.

---limited-retry +-l
--l +--limited-retry

@@ -947,10 +943,10 @@ metadata is passes.

---force-unit-access +-f
--f +--force-unit-access

@@ -1004,7 +1000,7 @@ metadata is passes.

--v +-V
--show-cmd @@ -1066,8 +1062,31 @@ metadata is passes.

- Ignore namespace is currently busy and performed the operation - even though. + Ignore namespace is currently busy and performed the operation + even though. +

+
+
+-o <fmt> +
+
+--output-format=<fmt> +
+
+

+ 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.

@@ -1090,7 +1109,7 @@ metadata is passes.

diff --git a/Documentation/nvme-write.txt b/Documentation/nvme-write.txt index 76cbd7a..af5340e 100644 --- a/Documentation/nvme-write.txt +++ b/Documentation/nvme-write.txt @@ -18,17 +18,13 @@ SYNOPSIS [--prinfo= | -p ] [--app-tag-mask= | -m ] [--app-tag= | -a ] - [--limited-retry | -l] - [--force-unit-access | -f] + [--limited-retry | -l] [--force-unit-access | -f] [--dir-type= | -T ] - [--dir-spec= | -S ] - [--dsm= | -D ] - [--show-command | -v] - [--dry-run | -w] - [--latency | -t] + [--dir-spec= | -S ] [--dsm= | -D ] + [--show-command | -V] [--dry-run | -w] [--latency | -t] [--storage-tag | -g ] - [--storage-tag-check | -C] - [--force] + [--storage-tag-check | -C] [--force] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -38,34 +34,34 @@ if you don't provide a file. OPTIONS ------- ---start-block=:: -s :: +--start-block=:: Start block. ---block-count:: -c:: +--block-count:: The number of blocks to transfer. This is a zeroes based value to align with the kernel's use of this field. (ie. 0 means transfer 1 block). ---data-size=:: -z :: +--data-size=:: Size of data, in bytes. ---metadata-size=:: -y :: +--metadata-size=:: Size of metadata in bytes. ---data=:: -d :: +--data=:: Data file. If none provided, contents are sent from STDIN. ---metadata=:: -M :: +--metadata=:: Metadata file, if necessary. ---prinfo=:: -p :: +--prinfo=:: Protection Information field definition. + [] @@ -80,24 +76,24 @@ metadata is passes. |0|Set to 1 enables checking the reference tag |================= ---ref-tag=:: -r :: +--ref-tag=:: Optional reftag when used with protection information. ---app-tag-mask=:: -m :: +--app-tag-mask=:: Optional application tag mask when used with protection information. ---app-tag=:: -a :: +--app-tag=:: Optional application tag when used with protection information. ---limited-retry:: -l:: +--limited-retry:: Sets the limited retry flag. ---force-unit-access:: -f:: +--force-unit-access:: Set the force-unit access flag. -T :: @@ -125,7 +121,7 @@ metadata is passes. consult the NVMe specification for detailed breakdown of how to use this field. --v:: +-V:: --show-cmd:: Print out the command to be sent. @@ -149,8 +145,17 @@ metadata is passes. data protection processing. --force:: - Ignore namespace is currently busy and performed the operation - even though. + Ignore namespace is currently busy and performed the operation + even though. + +-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 -------- diff --git a/Documentation/nvme-zns-changed-zone-list.1 b/Documentation/nvme-zns-changed-zone-list.1 index 1aaec89..183c4d5 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-CHANGED\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-CHANGED\-" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,8 @@ nvme-zns-changed-zone-list \- Retrieve Changed Zone log for the given device .SH "SYNOPSIS" .sp .nf -\fInvme zns changed\-zone\-list\fR [\-o | \-\-output\-format=] - [\-\-namespace\-id= | \-n ] - [\-\-rae | \-r] +\fInvme zns changed\-zone\-list\fR [\-\-output\-format= | \-o ] + [\-\-namespace\-id= | \-n ] [\-\-rae | \-r] .fi .SH "DESCRIPTION" .sp @@ -45,7 +44,7 @@ The parameter is mandatory and may be either the NVMe character device On success, the returned list may be decoded and displayed in one of several ways\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-zns-changed-zone-list.html b/Documentation/nvme-zns-changed-zone-list.html index befb331..d97df21 100644 --- a/Documentation/nvme-zns-changed-zone-list.html +++ b/Documentation/nvme-zns-changed-zone-list.html @@ -749,9 +749,8 @@ nvme-zns-changed-zone-list(1) Manual Page

SYNOPSIS

-
nvme zns changed-zone-list <device> [-o <fmt> | --output-format=<fmt>]
-                                      [--namespace-id=<NUM> | -n <NUM>]
-                                      [--rae | -r]
+
nvme zns changed-zone-list <device> [--output-format=<fmt> | -o <fmt>]
+                        [--namespace-id=<NUM> | -n <NUM>] [--rae | -r]
@@ -772,15 +771,15 @@ ways.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + Set the reporting format to normal, json, or + binary. Only one output format can be used at a time.

@@ -833,7 +832,7 @@ Show the output in json format diff --git a/Documentation/nvme-zns-changed-zone-list.txt b/Documentation/nvme-zns-changed-zone-list.txt index 9626c05..ad447ce 100644 --- a/Documentation/nvme-zns-changed-zone-list.txt +++ b/Documentation/nvme-zns-changed-zone-list.txt @@ -8,9 +8,8 @@ nvme-zns-changed-zone-list - Retrieve Changed Zone log for the given device SYNOPSIS -------- [verse] -'nvme zns changed-zone-list' [-o | --output-format=] - [--namespace-id= | -n ] - [--rae | -r] +'nvme zns changed-zone-list' [--output-format= | -o ] + [--namespace-id= | -n ] [--rae | -r] DESCRIPTION ----------- @@ -25,10 +24,10 @@ ways. OPTIONS ------- --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json', or + 'binary'. Only one output format can be used at a time. -r:: --rae:: diff --git a/Documentation/nvme-zns-close-zone.1 b/Documentation/nvme-zns-close-zone.1 index 9b939d9..cba967f 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-CLOSE\-ZO" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-CLOSE\-ZO" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-close-zone.html b/Documentation/nvme-zns-close-zone.html index 67c0178..503e3b7 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 82e631f..dafb761 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-FINISH\-Z" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-FINISH\-Z" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-finish-zone.html b/Documentation/nvme-zns-finish-zone.html index be00fcd..c0a1fac 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 6c230e2..1495993 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-ID\-CTRL" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-ID\-CTRL" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,7 @@ nvme-zns-id-ctrl \- Send NVMe Zoned Command Set Identify Controller, return resu .SH "SYNOPSIS" .sp .nf -\fInvme zns id\-ctrl\fR [\-o | \-\-output\-format=] +\fInvme zns id\-ctrl\fR [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -43,7 +43,7 @@ The parameter is mandatory and may be either the NVMe character device On success, the data structure returned by the device will be decoded and displayed in one of several ways\&. .SH "OPTIONS" .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-zns-id-ctrl.html b/Documentation/nvme-zns-id-ctrl.html index 8e0c56e..0e06efe 100644 --- a/Documentation/nvme-zns-id-ctrl.html +++ b/Documentation/nvme-zns-id-ctrl.html @@ -740,7 +740,7 @@ nvme-zns-id-ctrl(1) Manual Page

NAME

nvme-zns-id-ctrl - - Send NVMe Zoned Command Set Identify Controller, return result and structure + Send NVMe Zoned Command Set Identify Controller, return result and structure

@@ -749,7 +749,7 @@ nvme-zns-id-ctrl(1) Manual Page

SYNOPSIS

-
nvme zns id-ctrl <device> [-o <fmt> | --output-format=<fmt>]
+
nvme zns id-ctrl <device> [--output-format=<fmt> | -o <fmt>]
@@ -770,15 +770,15 @@ displayed in one of several ways.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + Set the reporting format to normal, json, or + binary. Only one output format can be used at a time.

@@ -821,7 +821,7 @@ Show the output in json format diff --git a/Documentation/nvme-zns-id-ctrl.txt b/Documentation/nvme-zns-id-ctrl.txt index e7bd5ba..0057159 100644 --- a/Documentation/nvme-zns-id-ctrl.txt +++ b/Documentation/nvme-zns-id-ctrl.txt @@ -4,12 +4,12 @@ nvme-zns-id-ctrl(1) NAME ---- nvme-zns-id-ctrl - Send NVMe Zoned Command Set Identify Controller, return - result and structure +result and structure SYNOPSIS -------- [verse] -'nvme zns id-ctrl' [-o | --output-format=] +'nvme zns id-ctrl' [--output-format= | -o ] DESCRIPTION ----------- @@ -24,10 +24,10 @@ displayed in one of several ways. OPTIONS ------- --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json', or + 'binary'. Only one output format can be used at a time. EXAMPLES -------- diff --git a/Documentation/nvme-zns-id-ns.1 b/Documentation/nvme-zns-id-ns.1 index d7829bb..89f44e8 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-ID\-NS" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-ID\-NS" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,9 +32,8 @@ nvme-zns-id-ns \- Send NVMe Zoned Command Set Identify namespace, return result .SH "SYNOPSIS" .sp .nf -\fInvme zns id\-ns\fR [\-\-namespace\-id= | \-n ] - [\-o | \-\-output\-format=] - [\-v | \-\-verbose] +\fInvme zns id\-ns\fR [\-\-namespace\-id= | \-n ] + [\-\-output\-format= | \-o ] [\-\-verbose | \-v] .fi .SH "DESCRIPTION" .sp @@ -55,7 +54,7 @@ Use the provided namespace id for the command\&. If not provided, the namespace Increase the information detail in the output\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-zns-id-ns.html b/Documentation/nvme-zns-id-ns.html index 1b72104..38d6f8c 100644 --- a/Documentation/nvme-zns-id-ns.html +++ b/Documentation/nvme-zns-id-ns.html @@ -740,7 +740,7 @@ nvme-zns-id-ns(1) Manual Page

NAME

nvme-zns-id-ns - - Send NVMe Zoned Command Set Identify namespace, return result and structure + Send NVMe Zoned Command Set Identify namespace, return result and structure

@@ -749,9 +749,8 @@ nvme-zns-id-ns(1) Manual Page

SYNOPSIS

-
nvme zns id-ns <device>  [--namespace-id=<NUM> | -n <NUM>]
-                             [-o <fmt> | --output-format=<fmt>]
-                             [-v | --verbose]
+
nvme zns id-ns <device> [--namespace-id=<NUM> | -n <NUM>]
+                        [--output-format=<fmt> | -o <fmt>] [--verbose | -v]
@@ -796,15 +795,15 @@ displayed in one of several ways.

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + Set the reporting format to normal, json, or + binary. Only one output format can be used at a time.

@@ -847,7 +846,7 @@ Show the output in json format with extra details diff --git a/Documentation/nvme-zns-id-ns.txt b/Documentation/nvme-zns-id-ns.txt index 799e3b6..c22b5c7 100644 --- a/Documentation/nvme-zns-id-ns.txt +++ b/Documentation/nvme-zns-id-ns.txt @@ -3,15 +3,14 @@ nvme-zns-id-ns(1) NAME ---- -nvme-zns-id-ns - Send NVMe Zoned Command Set Identify namespace, return - result and structure +nvme-zns-id-ns - Send NVMe Zoned Command Set Identify namespace, return result +and structure SYNOPSIS -------- [verse] -'nvme zns id-ns' [--namespace-id= | -n ] - [-o | --output-format=] - [-v | --verbose] +'nvme zns id-ns' [--namespace-id= | -n ] + [--output-format= | -o ] [--verbose | -v] DESCRIPTION ----------- @@ -36,10 +35,10 @@ OPTIONS --verbose:: Increase the information detail in the output. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json', or + 'binary'. Only one output format can be used at a time. EXAMPLES -------- diff --git a/Documentation/nvme-zns-offline-zone.1 b/Documentation/nvme-zns-offline-zone.1 index 116817d..18a7638 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-OFFLINE\-" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-OFFLINE\-" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-offline-zone.html b/Documentation/nvme-zns-offline-zone.html index 5e2e126..c459366 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 40b0ec9..2f84543 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-OPEN\-ZON" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-OPEN\-ZON" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,10 +33,8 @@ nvme-zns-open-zone \- Opens one or all zones .sp .nf \fInvme zns open\-zone\fR [\-\-namespace\-id= | \-n ] - [\-\-start\-lba= | \-s ] - [\-\-zrwaa | \-r] - [\-\-select\-all | \-a] - [\-\-timeout= | \-t ] + [\-\-start\-lba= | \-s ] [\-\-zrwaa | \-r] + [\-\-select\-all | \-a] [\-\-timeout= | \-t ] .fi .SH "DESCRIPTION" .sp diff --git a/Documentation/nvme-zns-open-zone.html b/Documentation/nvme-zns-open-zone.html index 31ab991..0a18862 100644 --- a/Documentation/nvme-zns-open-zone.html +++ b/Documentation/nvme-zns-open-zone.html @@ -750,10 +750,8 @@ nvme-zns-open-zone(1) Manual Page
nvme zns open-zone <device> [--namespace-id=<NUM> | -n <NUM>]
-                              [--start-lba=<LBA> | -s <LBA>]
-                              [--zrwaa | -r]
-                              [--select-all | -a]
-                              [--timeout=<timeout> | -t <timeout>]
+ [--start-lba=<LBA> | -s <LBA>] [--zrwaa | -r] + [--select-all | -a] [--timeout=<timeout> | -t <timeout>]
@@ -858,7 +856,7 @@ Open the first zone on namespace 1: diff --git a/Documentation/nvme-zns-open-zone.txt b/Documentation/nvme-zns-open-zone.txt index 0f2cb35..4639bcc 100644 --- a/Documentation/nvme-zns-open-zone.txt +++ b/Documentation/nvme-zns-open-zone.txt @@ -9,10 +9,8 @@ SYNOPSIS -------- [verse] 'nvme zns open-zone' [--namespace-id= | -n ] - [--start-lba= | -s ] - [--zrwaa | -r] - [--select-all | -a] - [--timeout= | -t ] + [--start-lba= | -s ] [--zrwaa | -r] + [--select-all | -a] [--timeout= | -t ] DESCRIPTION ----------- diff --git a/Documentation/nvme-zns-report-zones.1 b/Documentation/nvme-zns-report-zones.1 index dea48f4..ba89e50 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-REPORT\-Z" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-REPORT\-Z" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -39,7 +39,7 @@ nvme-zns-report-zones \- Retrieve and display the Report Zones data structure [\-\-extended | \-e] [\-\-partial | \-p] [\-\-verbose | \-v] - [\-\-output\-format= | \-o ] + [\-\-output\-format= | \-o ] .fi .SH "DESCRIPTION" .sp @@ -143,7 +143,7 @@ If set, the device will return the number of zones that match the state rather t Increase the information detail in the output\&. .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Set the reporting format to \fInormal\fR, diff --git a/Documentation/nvme-zns-report-zones.html b/Documentation/nvme-zns-report-zones.html index d3107e8..582b8dd 100644 --- a/Documentation/nvme-zns-report-zones.html +++ b/Documentation/nvme-zns-report-zones.html @@ -756,7 +756,7 @@ nvme-zns-report-zones(1) Manual Page [--extended | -e] [--partial | -p] [--verbose | -v] - [--output-format=<FMT> | -o <FMT>] + [--output-format=<fmt> | -o <fmt>]
@@ -906,15 +906,15 @@ cellspacing="0" cellpadding="4">

--o <format> +-o <fmt>
---output-format=<format> +--output-format=<fmt>

- Set the reporting format to normal, json, or - binary. Only one output format can be used at a time. + Set the reporting format to normal, json, or + binary. Only one output format can be used at a time.

@@ -957,7 +957,7 @@ Show the output in json format with extra details diff --git a/Documentation/nvme-zns-report-zones.txt b/Documentation/nvme-zns-report-zones.txt index 35d5eda..23dd6b4 100644 --- a/Documentation/nvme-zns-report-zones.txt +++ b/Documentation/nvme-zns-report-zones.txt @@ -15,7 +15,7 @@ SYNOPSIS [--extended | -e] [--partial | -p] [--verbose | -v] - [--output-format= | -o ] + [--output-format= | -o ] DESCRIPTION ----------- @@ -76,10 +76,10 @@ OPTIONS --verbose:: Increase the information detail in the output. --o :: ---output-format=:: - Set the reporting format to 'normal', 'json', or - 'binary'. Only one output format can be used at a time. +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json', or + 'binary'. Only one output format can be used at a time. EXAMPLES -------- diff --git a/Documentation/nvme-zns-reset-zone.1 b/Documentation/nvme-zns-reset-zone.1 index a834aee..a1cd0b4 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-RESET\-ZO" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-RESET\-ZO" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,9 +33,9 @@ nvme-zns-reset-zone \- Resets one or all zones .sp .nf \fInvme zns reset\-zone\fR [\-\-namespace\-id= | \-n ] - [\-\-start\-lba= | \-s ] - [\-\-select\-all | \-a] - [\-\-timeout= | \-t ] + [\-\-start\-lba= | \-s ] + [\-\-select\-all | \-a] + [\-\-timeout= | \-t ] .fi .SH "DESCRIPTION" .sp diff --git a/Documentation/nvme-zns-reset-zone.html b/Documentation/nvme-zns-reset-zone.html index 8f57ec9..ec4b484 100644 --- a/Documentation/nvme-zns-reset-zone.html +++ b/Documentation/nvme-zns-reset-zone.html @@ -750,9 +750,9 @@ nvme-zns-reset-zone(1) Manual Page
nvme zns reset-zone <device> [--namespace-id=<NUM> | -n <NUM>]
-                                    [--start-lba=<LBA> | -s <LBA>]
-                                    [--select-all | -a]
-                                    [--timeout=<timeout> | -t <timeout>]
+ [--start-lba=<LBA> | -s <LBA>] + [--select-all | -a] + [--timeout=<timeout> | -t <timeout>]
@@ -847,7 +847,7 @@ Reset the first zone on namespace 1: diff --git a/Documentation/nvme-zns-reset-zone.txt b/Documentation/nvme-zns-reset-zone.txt index 25d01a1..b58f276 100644 --- a/Documentation/nvme-zns-reset-zone.txt +++ b/Documentation/nvme-zns-reset-zone.txt @@ -9,9 +9,9 @@ SYNOPSIS -------- [verse] 'nvme zns reset-zone' [--namespace-id= | -n ] - [--start-lba= | -s ] - [--select-all | -a] - [--timeout= | -t ] + [--start-lba= | -s ] + [--select-all | -a] + [--timeout= | -t ] DESCRIPTION ----------- diff --git a/Documentation/nvme-zns-set-zone-desc.1 b/Documentation/nvme-zns-set-zone-desc.1 index 0721cb5..934b7ff 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-SET\-ZONE" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-SET\-ZONE" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,10 +33,10 @@ nvme-zns-set-zone-desc \- Set extended descriptor data for a zone .sp .nf \fInvme zns set\-zone\-desc\fR [\-\-namespace\-id= | \-n ] - [\-\-start\-lba=, \-s ] - [\-\-zrwaa | \-r] - [\-data=, \-d ] - [\-\-timeout= | \-t ] + [\-\-start\-lba=, \-s ] + [\-\-zrwaa | \-r] + [\-\-data=, \-d ] + [\-\-timeout= | \-t ] .fi .SH "DESCRIPTION" .sp @@ -58,7 +58,7 @@ The starting LBA of the zone to manage send\&. Allocate Zone Random Write Area to zone\&. .RE .PP -\-d +\-d , \-\-data= .RS 4 Optional file for data (default stdin) .RE diff --git a/Documentation/nvme-zns-set-zone-desc.html b/Documentation/nvme-zns-set-zone-desc.html index 06c0c3e..181809a 100644 --- a/Documentation/nvme-zns-set-zone-desc.html +++ b/Documentation/nvme-zns-set-zone-desc.html @@ -750,10 +750,10 @@ nvme-zns-set-zone-desc(1) Manual Page
nvme zns set-zone-desc <device> [--namespace-id=<NUM> | -n <NUM>]
-                                 [--start-lba=<IONUM>, -s <IONUM>]
-                                 [--zrwaa | -r]
-                                 [-data=<FILE>, -d <FILE>]
-                                 [--timeout=<timeout> | -t <timeout>]
+ [--start-lba=<IONUM>, -s <IONUM>] + [--zrwaa | -r] + [--data=<FILE>, -d <FILE>] + [--timeout=<timeout> | -t <timeout>]
@@ -807,10 +807,10 @@ length will automatically be calculated from the zns identify namespace.

--d <FILE +-d <FILE>
--data=<FILE> +--data=<FILE>

@@ -859,7 +859,7 @@ Write "hello world" into the zone descriptor for namespace 1’s first zone

diff --git a/Documentation/nvme-zns-set-zone-desc.txt b/Documentation/nvme-zns-set-zone-desc.txt index dd759a2..3df8c4b 100644 --- a/Documentation/nvme-zns-set-zone-desc.txt +++ b/Documentation/nvme-zns-set-zone-desc.txt @@ -9,10 +9,10 @@ SYNOPSIS -------- [verse] 'nvme zns set-zone-desc' [--namespace-id= | -n ] - [--start-lba=, -s ] - [--zrwaa | -r] - [-data=, -d ] - [--timeout= | -t ] + [--start-lba=, -s ] + [--zrwaa | -r] + [--data=, -d ] + [--timeout= | -t ] DESCRIPTION ----------- @@ -37,8 +37,8 @@ OPTIONS --zrwaa:: Allocate Zone Random Write Area to zone. --d :: +-d :: +--data=:: Optional file for data (default stdin) -t :: diff --git a/Documentation/nvme-zns-zone-append.1 b/Documentation/nvme-zns-zone-append.1 index 8f1a80f..0981fea 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-ZONE\-APP" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-ZONE\-APP" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme-zns-zone-append.html b/Documentation/nvme-zns-zone-append.html index e9c6c96..1661f6a 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 fcf0b65..b4682a0 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-ZONE\-MGM" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-ZONE\-MGM" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,12 +33,10 @@ nvme-zns-zone-mgmt-recv \- Zone Management Receive command .sp .nf \fInvme zns zone\-mgmt\-recv\fR [\-\-namespace\-id= | \-n ] - [\-\-start\-lba= | \-s ] - [\-\-data\-len=, \-l ] - [\-\-zra=, \-z ] - [\-\-zrasf=, \-a ] - [\-\-zra\-spec\-feat, \-f] - [\-\-output\-format=, \-o ] + [\-\-start\-lba= | \-s ] + [\-\-data\-len=, \-l ] + [\-\-zra=, \-z ] [\-\-zrasf=, \-a ] + [\-\-zra\-spec\-feat, \-f] [\-\-output\-format=, \-o ] .fi .SH "DESCRIPTION" .sp @@ -55,7 +53,7 @@ Use the provided namespace id for the command\&. If not provided, the namespace The starting LBA of the zone to manage receive\&. .RE .sp -\-\-data\-len= \-l Received data buffer length +\-l \-\-data\-len= Received data buffer length .PP \-z , \-\-zra= .RS 4 @@ -69,7 +67,7 @@ Zone Receive Action Enable Zone Receive Action Specific features .RE .PP -\-o , \-\-output\-format= +\-o , \-\-output\-format= .RS 4 Output format: normal|json|binary .RE diff --git a/Documentation/nvme-zns-zone-mgmt-recv.html b/Documentation/nvme-zns-zone-mgmt-recv.html index 1427d89..e0a8675 100644 --- a/Documentation/nvme-zns-zone-mgmt-recv.html +++ b/Documentation/nvme-zns-zone-mgmt-recv.html @@ -750,12 +750,10 @@ nvme-zns-zone-mgmt-recv(1) Manual Page
nvme zns zone-mgmt-recv <device> [--namespace-id=<NUM> | -n <NUM>]
-                                   [--start-lba=<LBA> | -s <LBA>]
-                                   [--data-len=<IONUM>, -l <IONUM>]
-                                   [--zra=<NUM>, -z <NUM>]
-                                   [--zrasf=<NUM>, -a <NUM>]
-                                   [--zra-spec-feat, -f]
-                                   [--output-format=<FMT>, -o <FMT>]
+ [--start-lba=<LBA> | -s <LBA>] + [--data-len=<IONUM>, -l <IONUM>] + [--zra=<NUM>, -z <NUM>] [--zrasf=<NUM>, -a <NUM>] + [--zra-spec-feat, -f] [--output-format=<fmt>, -o <fmt>]
@@ -801,8 +799,8 @@ binary.

-

--data-len=<NUM> --l <NUM> +

-l <NUM> +--data-len=<NUM> Received data buffer length

@@ -833,10 +831,10 @@ binary.

--o <FMT> +-o <fmt>
---output-format=<FMT> +--output-format=<fmt>

@@ -882,7 +880,7 @@ Binary dump of a report all zones

diff --git a/Documentation/nvme-zns-zone-mgmt-recv.txt b/Documentation/nvme-zns-zone-mgmt-recv.txt index 07cd98e..5a3e2a3 100644 --- a/Documentation/nvme-zns-zone-mgmt-recv.txt +++ b/Documentation/nvme-zns-zone-mgmt-recv.txt @@ -9,12 +9,10 @@ SYNOPSIS -------- [verse] 'nvme zns zone-mgmt-recv' [--namespace-id= | -n ] - [--start-lba= | -s ] - [--data-len=, -l ] - [--zra=, -z ] - [--zrasf=, -a ] - [--zra-spec-feat, -f] - [--output-format=, -o ] + [--start-lba= | -s ] + [--data-len=, -l ] + [--zra=, -z ] [--zrasf=, -a ] + [--zra-spec-feat, -f] [--output-format=, -o ] DESCRIPTION ----------- @@ -38,8 +36,8 @@ OPTIONS --start-lba=:: The starting LBA of the zone to manage receive. ---data-len= -l +--data-len= Received data buffer length -z :: @@ -54,8 +52,8 @@ OPTIONS --zra-spec-feat:: Enable Zone Receive Action Specific features --o :: ---output-format=:: +-o :: +--output-format=:: Output format: normal|json|binary EXAMPLES diff --git a/Documentation/nvme-zns-zone-mgmt-send.1 b/Documentation/nvme-zns-zone-mgmt-send.1 index d67fb06..b152f47 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-ZNS\-ZONE\-MGM" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME\-ZNS\-ZONE\-MGM" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,13 +33,11 @@ nvme-zns-zone-mgmt-send \- Zone Management Send command .sp .nf \fInvme zns zone\-mgmt\-send\fR [\-\-namespace\-id= | \-n ] - [\-\-start\-lba=, \-s ] - [\-\-zsaso, \-o] - [\-\-select\-all, \-a] - [\-\-zsa=, \-z ] - [\-\-data\-len=, \-l ] - [\-\-data=, \-d ] - [\-\-timeout= | \-t ] + [\-\-start\-lba=, \-s ] [\-\-zsaso, \-o] + [\-\-select\-all, \-a] [\-\-zsa=, \-z ] + [\-\-data\-len=, \-l ] + [\-\-data=, \-d ] + [\-\-timeout= | \-t ] .fi .SH "DESCRIPTION" .sp @@ -66,7 +64,7 @@ Send data buffer length Zone Send Action Specific Option .RE .PP -\-\-select\-all, \-a +\-a, \-\-select\-all .RS 4 Send command to all zones .RE @@ -81,7 +79,7 @@ Zone send action\&. Buffer length if data required .RE .PP -\-d +\-d , \-\-data= .RS 4 Optional file for data (default stdin) .RE diff --git a/Documentation/nvme-zns-zone-mgmt-send.html b/Documentation/nvme-zns-zone-mgmt-send.html index c35410f..9b92844 100644 --- a/Documentation/nvme-zns-zone-mgmt-send.html +++ b/Documentation/nvme-zns-zone-mgmt-send.html @@ -750,13 +750,11 @@ nvme-zns-zone-mgmt-send(1) Manual Page
nvme zns zone-mgmt-send <device> [--namespace-id=<NUM> | -n <NUM>]
-                                   [--start-lba=<IONUM>, -s <IONUM>]
-                                   [--zsaso, -o]
-                                   [--select-all, -a]
-                                   [--zsa=<NUM>, -z <NUM>]
-                                   [--data-len=<IONUM>, -l <IONUM>]
-                                   [--data=<FILE>, -d <FILE>]
-                                   [--timeout=<timeout> | -t <timeout>]
+ [--start-lba=<IONUM>, -s <IONUM>] [--zsaso, -o] + [--select-all, -a] [--zsa=<NUM>, -z <NUM>] + [--data-len=<IONUM>, -l <IONUM>] + [--data=<FILE>, -d <FILE>] + [--timeout=<timeout> | -t <timeout>]
@@ -821,10 +819,10 @@ Alternatively, the data may come from a file that can be specified.

---select-all +-a
--a +--select-all

@@ -854,7 +852,7 @@ Alternatively, the data may come from a file that can be specified.

--d <FILE +-d <FILE>
--data=<FILE> @@ -916,7 +914,7 @@ Write "hello world" into the zone descriptor for namespace 1’s first zone diff --git a/Documentation/nvme-zns-zone-mgmt-send.txt b/Documentation/nvme-zns-zone-mgmt-send.txt index 8cbb5c0..3803d27 100644 --- a/Documentation/nvme-zns-zone-mgmt-send.txt +++ b/Documentation/nvme-zns-zone-mgmt-send.txt @@ -9,13 +9,11 @@ SYNOPSIS -------- [verse] 'nvme zns zone-mgmt-send' [--namespace-id= | -n ] - [--start-lba=, -s ] - [--zsaso, -o] - [--select-all, -a] - [--zsa=, -z ] - [--data-len=, -l ] - [--data=, -d ] - [--timeout= | -t ] + [--start-lba=, -s ] [--zsaso, -o] + [--select-all, -a] [--zsa=, -z ] + [--data-len=, -l ] + [--data=, -d ] + [--timeout= | -t ] DESCRIPTION ----------- @@ -44,8 +42,8 @@ OPTIONS --zsaso:: Zone Send Action Specific Option ---select-all:: -a:: +--select-all:: Send command to all zones -z :: @@ -56,7 +54,7 @@ OPTIONS --data-len=:: Buffer length if data required --d :: --data=:: Optional file for data (default stdin) diff --git a/Documentation/nvme-zns-zrwa-flush-zone.txt b/Documentation/nvme-zns-zrwa-flush-zone.txt index 4f3e72c..e8f61ed 100644 --- a/Documentation/nvme-zns-zrwa-flush-zone.txt +++ b/Documentation/nvme-zns-zrwa-flush-zone.txt @@ -9,8 +9,8 @@ SYNOPSIS -------- [verse] 'nvme zns zrwa-flush-zone' [--namespace-id= | -n ] - [--lba= | -l ] - [--timeout= | -t ] + [--lba= | -l ] + [--timeout= | -t ] DESCRIPTION ----------- diff --git a/Documentation/nvme.1 b/Documentation/nvme.1 index 3e0043c..b114bf1 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: 06/30/2023 +.\" Date: 12/21/2023 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME" "1" "06/30/2023" "NVMe" "NVMe Manual" +.TH "NVME" "1" "12/21/2023" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Documentation/nvme.html b/Documentation/nvme.html index 3881c50..eaedf0e 100644 --- a/Documentation/nvme.html +++ b/Documentation/nvme.html @@ -2114,7 +2114,7 @@ NVM-Express Site.

diff --git a/Makefile b/Makefile index 10d16f0..7f44364 100644 --- a/Makefile +++ b/Makefile @@ -54,3 +54,11 @@ rpm: debug: meson ${BUILD-DIR} --buildtype=debug ninja -C ${BUILD-DIR} + +.PHONY: static +static: + meson ${BUILD-DIR} --buildtype=release \ + --default-library=static -Dc_link_args="-static" \ + --wrap-mode=forcefallback \ + -Dlibnvme:tests=false -Dlibnvme:keyutils=disabled + ninja -C ${BUILD-DIR} diff --git a/README.md b/README.md index 04781e7..1113b1e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,18 @@ NVM-Express user space tooling for Linux. ## Build from source -nvme-cli uses meson as build system. +nvme-cli uses meson as build system. There is more than one way to configure and +build the project in order to mitigate meson dependency on the build +environment. + +If you build on a relative modern system, either use meson directly or the +Makefile wrapper. + +Older distros might ship a too old version of meson, in this case it's possible +to build the project using [samurai](https://github.com/michaelforney/samurai) +and [muon](https://github.com/annacrombie/muon). Both build tools have only a +minimal dependency on the build environment. Too easy this step there is a build +script which helps to setup a build environment. ### nvme-cli dependencies: @@ -15,10 +26,11 @@ nvme-cli uses meson as build system. |---------|------------|-------| | libnvme, libnvme-mi| yes | be either installed or included into the build via meson fallback feature | | json-c | optional | recommended, without all plugins are disabled and json-c output format is disabled | - | libhugetlbfs | optional | adds support for hugetlbfs | -### Configuring +### Build with meson + +#### Configuring In case libnvme is not installed on the system, it possible to use meson's fallback feature to resolve the dependency. @@ -37,15 +49,42 @@ dependencies should also resolved or not. The options are Note for nvme-cli the 'default' is set to nofallback. -### Building +#### Building $ meson compile -C .build -### Installing +#### Installing # meson install -C .build + +### Build with build.sh wrapper -### Makefile wrapper +The `scripts/build.sh` is used for the CI build but can also be used for +configuring and building the project. + +Running `scripts/build.sh` without any argument builds the project in the +default configuration (meson, gcc and defaults) + +It's possible to change the compiler to clang + +`scripts/builds.sh -c clang` + +or enabling all the fallbacks + +`scripts/build.sh fallback` + +### Minimal static build with muon + +`scripts/build.sh -m muon` will download and build `samurai` and `muon` instead +using `meson` to build the project. This reduces the dependency on the build +environment to: +- gcc +- make +- git + +Furthermore, this configuration will produce a static binary. + +### Build with Makefile wrapper There is a Makefile wrapper for meson for backwards compatibility @@ -58,6 +97,10 @@ RPM build support via Makefile that uses meson $ make rpm +Static binary(no dependency) build support via Makefile that uses meson + + $ make static + If not sure how to use, find the top-level documentation with: $ man nvme @@ -65,7 +108,7 @@ If not sure how to use, find the top-level documentation with: Or find a short summary with: $ nvme help - + ## Distro Support Many popular distributions (Alpine, Arch, Debian, Fedora, FreeBSD, Gentoo, @@ -251,7 +294,7 @@ global resources among various components. For example, when executing `blktests` for the FC transport, the `nvme-cli` udev rules can be triggered. To prevent interference with a test, `blktests` can create a JSON configuration file in `/run/nvme` to inform `nvme-cli` that it should not perform any actions -trigged from the udev context. This behavior can be controlled using the +triggered from the udev context. This behavior can be controlled using the `--context` argument. For example a `blktests` volatile configuration could look like: @@ -283,3 +326,10 @@ a an atomic way. For example create a temporary file without the `.json` file extension in `/run/nvme` and write the contents to this file. When finished use `rename` to add the `'.json'` file name extension. This ensures nvme-cli only sees the complete file. + +## Testing + +For testing purposes a x86_64 AppImage is build from the current HEAD and is +available here: + +https://monom.org/linux-nvme/upload/AppImage/nvme-cli-latest-x86_64.AppImage diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..b63481a --- /dev/null +++ b/codecov.yml @@ -0,0 +1,6 @@ +--- +ignore: + - 'subprojects' + - 'ccan' + - 'tests' + - 'unit' diff --git a/completions/_nvme b/completions/_nvme index 5d07bc5..0d28788 100644 --- a/completions/_nvme +++ b/completions/_nvme @@ -36,7 +36,7 @@ _nvme () { 'get-log:retrieve any log in raw format' 'predictable-lat-log:retrieve predictable latency per nvmset log' 'pred-lat-event-agg-log:retrieve predictable latency event aggregate log' - 'persistent-event-log:retrieve presistent event log' + 'persistent-event-log:retrieve persistent event log' 'telemetry-log:retrieve telemetry log' 'fw-log:retrieve fw log' 'changed-ns-list-log:retrieve changed namespaces log' @@ -102,6 +102,8 @@ _nvme () { 'virt-mgmt:submit a Virtualization Management command' 'rpmb:submit an NVMe RPMB command' 'show-topology:show subsystem topology' + 'nvme-mi-recv:send a NVMe-MI receive command' + 'nvme-mi-send:send a NVMe-MI send command' 'version:show the program version' 'ocp:OCP cloud SSD extensions' 'help:print brief descriptions of all nvme commands' @@ -251,6 +253,16 @@ _nvme () { _arguments '*:: :->subcmds' _describe -t commands "nvme ocp set-dssd-power-state-feature options" _set_dssd_power_state_feature ;; + (telemetry-string-log) + local _telemetry_string_log + _telemetry_string_log=( + /dev/nvme':supply a device to use (required)' + --output-file=':Output file name with path' + -o':alias for --output-file' + ) + _arguments '*:: :->subcmds' + _describe -t commands "nvme ocp internal-log options" _internal_log + ;; (*) _files ;; @@ -304,7 +316,7 @@ _nvme () { --human-readable':show infos in readable format' -H':alias of --human-readable' --vendor-specific':also dump binary vendor infos' - -v':alias of --vendor-specific' + -V':alias of --vendor-specific' ) _arguments '*:: :->subcmds' _describe -t commands "nvme id-ctrl options" _idctrl @@ -320,7 +332,7 @@ _nvme () { --human-readable':show infos in readable format' -H':alias of --human-readable' --vendor-specific':also dump binary vendor infos' - -v':alias of --vendor-specific' + -V':alias of --vendor-specific' ) _arguments '*:: :->subcmds' _describe -t commands "nvme id-ns options" _idns @@ -553,6 +565,16 @@ _nvme () { -S':alias of --nsze-si' --ncap-si=':capacity of ns (NCAP) in standard SI units' -C':alias of --ncap-si' + --azr=':Allocate ZRWA Resources (AZR) for Zoned Namespace Command Set' + -z':alias of --azr' + --rar=':Requested Active Resources (RAR) for Zoned Namespace Command Set' + -r':alias of --rar' + --ror=':Requested Open Resources (ROR) for Zoned Namespace Command Set' + -O':alias of --ror' + --rnumzrwa=':Requested Number of ZRWA Resources (RNUMZRWA) for Zoned Namespace Command Set' + -u':alias of --rnumzrwa' + --phndls=':Comma separated list of Placement Handle Associated RUH' + -p':alias of --phndls' ) _arguments '*:: :->subcmds' _describe -t commands "nvme create-ns options" _createns @@ -628,7 +650,7 @@ _nvme () { --aen=':result of the aen, use to override log id' -a':alias of --aen' --lpo=':log page offset specifies the location within a log page from where to start returning data' - -o':alias of --lpo' + -L':alias of --lpo' --lsi=':log specific identifier specifies an identifier that is required for a particular log page' -S':alias of --lsi' --rae':Retain an Asynchronous Event' @@ -664,7 +686,7 @@ _nvme () { _telemetry_log=( /dev/nvme':supply a device to use (required)' --output-file=':telemetry data output write' - -o':alias for --output-file' + -O':alias for --output-file' --host-generate=':Have the host tell the controller to generate the report' -g':alias to --host-generate' --controller-init':Gather report generated by the controller' @@ -903,7 +925,7 @@ _nvme () { _lockdown=( /dev/nvme':supply a device to use (required)' --ofi=':Opcode or Feature Identifier(OFI) (required)' - -o':alias of --ofi' + -O':alias of --ofi' --ifc=':Interface (INF) field Information (required)' -f':alias of --ifc' --prhbt=':Prohibit(PRHBT) bit field (required)' @@ -929,7 +951,7 @@ _nvme () { --data=':data file for LBA Type Range or host identifier buffer (defaults to stdin)' -d':alias to --data' --value=':new value of feature (required)' - -v'alias to --value' + -V'alias to --value' --uuid-index=':uuid index' -U':alias for --uuid-index' ) @@ -941,9 +963,9 @@ _nvme () { _set_property=( /dev/nvme':supply a device to use (required)' --offset=':the offset of the property' - -o':alias to --offset' + -O':alias to --offset' --value=':the value of the property to be set' - -v':alias to --value' + -V':alias to --value' ) _arguments '*:: :->subcmds' _describe -t commands "nvme set-property options" _set_property @@ -953,7 +975,7 @@ _nvme () { _get_property=( /dev/nvme':supply a device to use (required)' --offset=':the offset of the property' - -o':alias to --offset' + -O':alias to --offset' --human-readable':show infos in readable format' -H':alias of --human-readable' ) @@ -1003,7 +1025,7 @@ _nvme () { --xfer=':limit on chunk-size of transfer (if device has download size limit)' -x':alias of --xfer' --offset=':starting offset, in dwords (defaults to 0, only useful if download is split across multiple files)' - -o':alias of --offset' + -O':alias of --offset' ) _arguments '*:: :->subcmds' _describe -t commands "nvme fw-download options" _fwd @@ -1013,7 +1035,7 @@ _nvme () { _fwd=( /dev/nvme':supply a device to use (required)' --operation=':Operation to be performed by the controller' - -o':alias of --operation' + -O':alias of --operation' --element-id=':specific to the value of the Operation field' -i':alias of --element-id' --cap-lower=':Least significant 32 bits of the capacity in bytes' @@ -1207,7 +1229,7 @@ _nvme () { _admin=( /dev/nvme':supply a device to use (required)' --opcode=':hexadecimal opcode to send (required)' - -o':alias of --opcode' + -O':alias of --opcode' --flags=':command flags' -f':alias of --flags' --rsvd=':value for reserved field' @@ -1257,7 +1279,7 @@ _nvme () { _io=( /dev/nvme':supply a device to use (required)' --opcode=':hexadecimal opcode to send (required)' - -o':alias of --opcode' + -O':alias of --opcode' --flags=':command flags' -f':alias of --flags' --rsvd=':value for reserved field' @@ -1529,7 +1551,7 @@ _nvme () { --force-unit-access':if included, the data shall be read from non-volatile media' -f':alias of --force-unit access' --show-command':show command instead of sending to device' - -v':alias of --show-command' + -V':alias of --show-command' --dry-run':show command instead of sending to device' -w':alias of --show-command' ) @@ -1565,7 +1587,7 @@ _nvme () { --force-unit-access':data read shall be returned from nonvolatile media before command completion is indicated' -f':alias of --force-unit-access' --show-command':show command instead of sending to device' - -v':alias of --show-command' + -V':alias of --show-command' --dry-run':show command instead of sending to device' -w':alias of --show-command' ) @@ -1601,7 +1623,7 @@ _nvme () { --force-unit-access':data shall be written to nonvolatile media before command completion is indicated' -f':alias of --force-unit-access' --show-command':show command instead of sending to device' - -v':alias of --show-command' + -V':alias of --show-command' --dry-run':show command instead of sending to device' -w':alias of --show-command' ) @@ -1988,6 +2010,48 @@ _nvme () { _arguments '*:: :->subcmds' _describe -t commands "nvme show-topology options" _showtopology ;; + (nvme-mi-recv) + local _nvme_mi_recv + _nvme_mi_recv=( + --opcode=':NVMe-MI opcode to send' + -O':alias of --opcode' + --namespace-id=':value for nsid' + -n':alias of --namespace-id' + --data-len=':length for data buffer' + -l':alias of --data-len' + --nmimt':value for NVMe-MI message type' + -m':alias of --nmimt' + --nmd0':value for NVMe management request dword 0' + -0':alias of --nmd0' + --nmd1':value for NVMe management request dword 1' + -1':alias of --nmd1' + --input-file=':defaults to stdin; input for write (send direction)' + -i':alias for --input-file' + ) + _arguments '*:: :->subcmds' + _describe -t commands "nvme nvme-mi-recv options" _nvme_mi_recv + ;; + (nvme-mi-send) + local _nvme_mi_send + _nvme_mi_send=( + --opcode=':NVMe-MI opcode to send' + -O':alias of --opcode' + --namespace-id=':value for nsid' + -n':alias of --namespace-id' + --data-len=':length for data buffer' + -l':alias of --data-len' + --nmimt':value for NVMe-MI message type' + -m':alias of --nmimt' + --nmd0':value for NVMe management request dword 0' + -0':alias of --nmd0' + --nmd1':value for NVMe management request dword 1' + -1':alias of --nmd1' + --input-file=':defaults to stdin; input for write (send direction)' + -i':alias for --input-file' + ) + _arguments '*:: :->subcmds' + _describe -t commands "nvme nvme-mi-send options" _nvme_mi_send + ;; (version) local _version _version=( @@ -2008,6 +2072,7 @@ _nvme () { vs-fw-activate-history':Get firmware activation history log' device-capability-log':Get Device capability log' set-dssd-power-state-feature':Set DSSD Power State' + telemetry-string-log':Retrieve Telemetry string Log Page' ) _arguments '*:: :->subcmds' _describe -t commands "nvme ocp options" _ocp diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh index fc3b49e..5d62427 100644 --- a/completions/bash-nvme-completion.sh +++ b/completions/bash-nvme-completion.sh @@ -47,11 +47,11 @@ nvme_list_opts () { ;; "id-ctrl") opts+=" --raw-binary -b --human-readable -H \ - --vendor-specific -v --output-format= -o" + --vendor-specific -V --output-format= -o" ;; "id-ns") opts+=" --namespace-id= -n --raw-binary -b \ - --human-readable -H --vendor-specific -v \ + --human-readable -H --vendor-specific -V \ --force -f --output-format= -o" ;; "id-ns-granularity") @@ -114,7 +114,7 @@ nvme_list_opts () { --dps= -d --nmic= -m --anagrp-id= -a --nvmset-id= -i \ --block-size= -b --timeout= -t --csi= -y --lbstm= -l \ --nphndls= -n --nsze-si= -S --ncap-si= -C --azr -z --rar= -r \ - --ror= -o --rnumzrwa= -u --phndls= -p --endg-id= -e" + --ror= -O --rnumzrwa= -u --phndls= -p --endg-id= -e" ;; "delete-ns") opts+=" -namespace-id= -n --timeout= -t" @@ -130,7 +130,7 @@ nvme_list_opts () { ;; "get-log") opts+=" --log-id= -i --log-len= -l --namespace-id= -n \ - --aen= -a --lpo= -o --lsp= -s --lsi= -S \ + --aen= -a --lpo= -O --lsp= -s --lsi= -S \ --rae -r --uuid-index= -U --csi= -y --ot -O \ --raw-binary -b" ;; @@ -138,7 +138,7 @@ nvme_list_opts () { opts+=" --output-format= -o --human-readable -H" ;; "telemetry-log") - opts+=" --output-file= -o --host-generate= -g \ + opts+=" --output-file= -O --host-generate= -g \ --controller-init -c --data-area= -d" ;; "fw-log") @@ -220,10 +220,10 @@ nvme_list_opts () { --cdw12= -c" ;; "set-property") - opts+=" --offset= -o --value= -v" + opts+=" --offset= -O --value= -V" ;; "get-property") - opts=+" --offset= -o --human-readable -H" + opts=+" --offset= -O --human-readable -H" ;; "format") opts+=" --namespace-id= -n --timeout= -t --lbaf= -l \ @@ -233,18 +233,17 @@ nvme_list_opts () { opts+=" --slot= -s --action= -a --bpid= -b" ;; "fw-download") - opts+=" --fw= -f --xfer= -x --offset= -o" + opts+=" --fw= -f --xfer= -x --offset= -O" ;; "capacity-mgmt") - opts+=" --operation= -f --element-id= -i --cap-lower= -l \ - --cap-upper= -u" + opts+=" --operation= -O --element-id= -i --cap-lower= -l \ + --cap-upper= -u" ;; "lockdown") - opts+=" --ofi= -O --ifc= -F --prhbt= -P \ - -scp= -S --uuid -U" + opts+=" --ofi= -O --ifc= -f --prhbt= -p --scp= -s --uuid -U" ;; "admin-passthru") - opts+=" --opcode= -o --flags= -f --prefil= -p --rsvd= -R \ + opts+=" --opcode= -O --flags= -f --prefil= -p --rsvd= -R \ --namespace-id= -n --data-len= -l --metadata-len= -m \ --timeout= -t --cdw2= -2 --cdw3= -3 --cdw10= -4 \ --cdw11= -5 --cdw12= -6 --cdw13= -7 --cdw14= -8 \ @@ -253,7 +252,7 @@ nvme_list_opts () { --latency -T" ;; "io-passthru") - opts+=" --opcode= -o --flags= -f --prefill= -p --rsvd= -R \ + opts+=" --opcode= -O --flags= -f --prefill= -p --rsvd= -R \ --namespace-id= -n --data-len= -l --metadata-len= -m \ --timeout= -t --cdw2= -2 --cdw3= -3 --cdw10= -4 \ --cdw11= -5 --cdw12= -6 --cdw13= -7 --cdw14= -8 \ @@ -312,7 +311,7 @@ nvme_list_opts () { --metadata= -M --prinfo= -p --app-tag-mask= -m \ --app-tag= -a --limited-retry -l \ --force-unit-access -f --storage-tag-check -C \ - --dir-type= -T --dir-spec= -S --dsm= -D --show-command -v \ + --dir-type= -T --dir-spec= -S --dsm= -D --show-command -V \ --dry-run -w --latency -t" ;; "read") @@ -321,7 +320,7 @@ nvme_list_opts () { --metadata= -M --prinfo= -p --app-tag-mask= -m \ --app-tag= -a --limited-retry -l \ --force-unit-access -f --storage-tag-check -C \ - --dir-type= -T --dir-spec= -S --dsm= -D --show-command -v \ + --dir-type= -T --dir-spec= -S --dsm= -D --show-command -V \ --dry-run -w --latency -t" ;; "write") @@ -330,7 +329,7 @@ nvme_list_opts () { --metadata= -M --prinfo= -p --app-tag-mask= -m \ --app-tag= -a --limited-retry -l \ --force-unit-access -f --storage-tag-check -C \ - --dir-type= -T --dir-spec= -S --dsm= -D --show-command -v \ + --dir-type= -T --dir-spec= -S --dsm= -D --show-command -V \ --dry-run -w --latency -t" ;; "write-zeroes") @@ -446,6 +445,14 @@ nvme_list_opts () { "show-topology") opts+=" --output-format= -o --verbose -v --ranking= -r" ;; + "nvme-mi-recv") + opts+=" --opcode= -O --namespace-id= -n --data-len= -l \ + --nmimt= -m --nmd0= -0 --nmd1= -1 --input-file= -i" + ;; + "nvme-mi-send") + opts+=" --opcode= -O --namespace-id= -n --data-len= -l \ + --nmimt= -m --nmd0= -0 --nmd1= -1 --input-file= -i" + ;; "version") opts+=$NO_OPTS ;; @@ -983,7 +990,7 @@ plugin_shannon_opts () { --data-len= -l --raw-binary -b --cdw11= -c --human-readable -H" ;; "set-feature-add") - opts+=" --namespace-id= -n --feature-id= -f --value= -v \ + opts+=" --namespace-id= -n --feature-id= -f --value= -V \ --data-len= -l --data= -d --save -s" ;; "id-ctrl") @@ -1351,6 +1358,9 @@ plugin_ocp_opts () { "set-dssd-power-state-feature") opts+=" --power-state= -p --no-uuid -n --save -s" ;; + "telemetry-string-log") + opts+=" --output-file= -o" + ;; "help") opts+=$NO_OPTS ;; @@ -1420,10 +1430,10 @@ _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" + set-dssd-power-state-feature telemetry-string-log" ) - # Associative array mapping plugins to coresponding option completions + # Associative array mapping plugins to corresponding option completions typeset -Ar _plugin_funcs=( [intel]="plugin_intel_opts" [amzn]="plugin_amzn_opts" @@ -1470,7 +1480,8 @@ _nvme_subcmds () { show-hostnqn dir-receive dir-send virt-mgmt \ 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" + supported-cap-config-log dim show-topology list-endgrp \ + nvme-mi-recv nvme-mi-send" # Add plugins: for plugin in "${!_plugin_subcmds[@]}"; do diff --git a/fabrics.c b/fabrics.c index 57ca927..2a0ad70 100644 --- a/fabrics.c +++ b/fabrics.c @@ -414,9 +414,11 @@ static int discover_from_conf_file(nvme_root_t r, nvme_host_t h, nvmf_default_config(&cfg); - ret = flags = validate_output_format(format); - if (ret < 0) + ret = validate_output_format(format, &flags); + if (ret < 0) { + nvme_show_error("Invalid output format"); return ret; + } f = fopen(PATH_NVMF_DISC, "r"); if (f == NULL) { @@ -697,9 +699,11 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) if (ret) return ret; - ret = flags = validate_output_format(format); - if (ret < 0) + ret = validate_output_format(format, &flags); + if (ret < 0) { + nvme_show_error("Invalid output format"); return ret; + } if (!strcmp(config_file, "none")) config_file = NULL; @@ -735,6 +739,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) } if (!hostid) hostid = hid = nvmf_hostid_from_file(); + if (!hostid && hostnqn) + hostid = hid = nvmf_hostid_from_hostnqn(hostnqn); nvmf_check_hostid_and_hostnqn(hostid, hostnqn); h = nvme_lookup_host(r, hostnqn, hostid); if (!h) { @@ -883,7 +889,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) int ret; enum nvme_print_flags flags; struct nvme_fabrics_config cfg = { 0 }; - char *format = ""; + char *format = "normal"; NVMF_ARGS(opts, cfg, @@ -900,7 +906,11 @@ int nvmf_connect(const char *desc, int argc, char **argv) if (ret) return ret; - flags = validate_output_format(format); + ret = validate_output_format(format, &flags); + if (ret < 0) { + nvme_show_error("Invalid output format"); + return ret; + } if (!subsysnqn) { fprintf(stderr, @@ -952,6 +962,8 @@ int nvmf_connect(const char *desc, int argc, char **argv) } if (!hostid) hostid = hid = nvmf_hostid_from_file(); + if (!hostid && hostnqn) + hostid = hid = nvmf_hostid_from_hostnqn(hostnqn); nvmf_check_hostid_and_hostnqn(hostid, hostnqn); h = nvme_lookup_host(r, hostnqn, hostid); if (!h) { diff --git a/libnvme-wrap.c b/libnvme-wrap.c index 354e7f7..b5b4838 100644 --- a/libnvme-wrap.c +++ b/libnvme-wrap.c @@ -7,19 +7,24 @@ #include #include +#include #include +#include "nvme-print.h" #define PROTO(args...) args #define ARGS(args...) args -#define VOID_FN(name, proto, args) \ -void __attribute__((weak)) name(proto) \ -{ \ - void (*fn)(proto); \ - fn = dlsym(RTLD_NEXT, #name); \ - if (fn) \ - fn(args); \ +#define VOID_FN(name, proto, args) \ +void __attribute__((weak)) name(proto) \ +{ \ + void (*fn)(proto); \ + fn = dlsym(RTLD_NEXT, #name); \ + if (!fn) { \ + nvme_show_error("libnvme function " #name " not found");\ + exit(EXIT_FAILURE); \ + } \ + fn(args); \ } #define FN(name, rtype, proto, args, defret) \ @@ -42,6 +47,18 @@ VOID_FN(nvme_init_copy_range_f1, __u32 *elbats, __u16 nr), ARGS(copy, nlbs, slbas, eilbrts, elbatms, elbats, nr)) +VOID_FN(nvme_init_copy_range_f2, + PROTO(struct nvme_copy_range_f2 *copy, __u32 *snsids, + __u16 *nlbs, __u64 *slbas, __u16 *sopts, __u32 *eilbrts, + __u32 *elbatms, __u32 *elbats, __u16 nr), + ARGS(copy, snsids, nlbs, slbas, sopts, eilbrts, elbatms, elbats, nr)) + +VOID_FN(nvme_init_copy_range_f3, + PROTO(struct nvme_copy_range_f3 *copy, __u32 *snsids, + __u16 *nlbs, __u64 *slbas, __u16 *sopts, __u64 *eilbrts, + __u32 *elbatms, __u32 *elbats, __u16 nr), + ARGS(copy, snsids, nlbs, slbas, sopts, eilbrts, elbatms, elbats, nr)) + FN(nvme_get_feature_length2, int, PROTO(int fid, __u32 cdw11, enum nvme_data_tfr dir, diff --git a/meson.build b/meson.build index 3d3fb08..0961c26 100644 --- a/meson.build +++ b/meson.build @@ -4,7 +4,7 @@ project( 'nvme-cli', ['c'], meson_version: '>= 0.50.0', license: 'GPL-2.0-only', - version: '2.6', + version: '2.7.1', default_options: [ 'c_std=gnu99', 'buildtype=debug', @@ -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.6', required: true, +libnvme_dep = dependency('libnvme', version: '>=1.7', required: true, fallback : ['libnvme', 'libnvme_dep']) libnvme_mi_dep = dependency('libnvme-mi', required: true, fallback : ['libnvme', 'libnvme_mi_dep']) @@ -68,15 +68,6 @@ else endif conf.set('CONFIG_JSONC', json_c_dep.found(), description: 'Is json-c available?') -# Check for libhugetlbfs availability (optional) -if cc.has_header('hugetlbfs.h') - libhugetlbfs_dep = cc.find_library('hugetlbfs', - required : false) -else - libhugetlbfs_dep = dependency('', required: false) -endif -conf.set('CONFIG_LIBHUGETLBFS', libhugetlbfs_dep.found(), description: 'Is libhugetlbfs available?') - # Set the nvme-cli version conf.set('NVME_VERSION', '"' + meson.project_version() + '"') @@ -222,6 +213,7 @@ endforeach systemd_files = [ 'nvmefc-boot-connections.service', 'nvmf-autoconnect.service', + 'nvmf-connect-nbft.service', 'nvmf-connect.target', 'nvmf-connect@.service', ] @@ -235,8 +227,9 @@ foreach file : systemd_files endforeach udev_files = [ + '65-persistent-net-nbft.rules', '70-nvmf-autoconnect.rules', - '71-nvmf-iopolicy-netapp.rules', + '71-nvmf-netapp.rules', ] foreach file : udev_files @@ -284,8 +277,7 @@ subdir('Documentation') executable( 'nvme', sources, - dependencies: [ libnvme_dep, libnvme_mi_dep, json_c_dep, - libhugetlbfs_dep ], + dependencies: [ libnvme_dep, libnvme_mi_dep, json_c_dep ], link_args: '-ldl', include_directories: incdir, install: true, @@ -334,7 +326,6 @@ if meson.version().version_compare('>=0.53.0') summary(path_dict, section: 'Paths') dep_dict = { 'json-c': json_c_dep.found(), - 'libhugetlbfs': libhugetlbfs_dep.found(), } summary(dep_dict, section: 'Dependencies') conf_dict = { diff --git a/nvme-builtin.h b/nvme-builtin.h index 9b9a145..2d2bead 100644 --- a/nvme-builtin.h +++ b/nvme-builtin.h @@ -44,7 +44,7 @@ COMMAND_LIST( ENTRY("endurance-log", "Retrieve Endurance Group Log, show it", get_endurance_log) ENTRY("predictable-lat-log", "Retrieve Predictable Latency per Nvmset Log, show it", get_pred_lat_per_nvmset_log) ENTRY("pred-lat-event-agg-log", "Retrieve Predictable Latency Event Aggregate Log, show it", get_pred_lat_event_agg_log) - ENTRY("persistent-event-log", "Retrieve Presistent Event Log, show it", get_persistent_event_log) + ENTRY("persistent-event-log", "Retrieve Persistent Event Log, show it", get_persistent_event_log) ENTRY("endurance-event-agg-log", "Retrieve Endurance Group Event Aggregate Log, show it", get_endurance_event_agg_log) ENTRY("lba-status-log", "Retrieve LBA Status Information Log, show it", get_lba_status_log) ENTRY("resv-notif-log", "Retrieve Reservation Notification Log, show it", get_resv_notif_log) @@ -103,7 +103,7 @@ COMMAND_LIST( ENTRY("check-tls-key", "Validate NVMeoF TLS PSK", check_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) + ENTRY("virt-mgmt", "Manage Flexible Resources between Primary and Secondary Controller", virtual_mgmt) ENTRY("rpmb", "Replay Protection Memory Block commands", rpmb_cmd) ENTRY("lockdown", "Submit a Lockdown command,return result", lockdown_cmd) ENTRY("dim", "Send Discovery Information Management command to a Discovery Controller", dim_cmd) \ diff --git a/nvme-print-binary.c b/nvme-print-binary.c index 45d86d3..e9371e5 100644 --- a/nvme-print-binary.c +++ b/nvme-print-binary.c @@ -298,6 +298,7 @@ static void binary_discovery_log(struct nvmf_discovery_log *log, int numrec) } static struct print_ops binary_print_ops = { + /* libnvme types.h print functions */ .ana_log = binary_ana_log, .boot_part_log = binary_boot_part_log, .phy_rx_eom_log = binary_phy_rx_eom_log, @@ -305,7 +306,9 @@ static struct print_ops binary_print_ops = { .ctrl_registers = binary_ctrl_registers, .directive = binary_directive, .discovery_log = binary_discovery_log, + .effects_log_list = NULL, .endurance_group_event_agg_log = binary_endurance_group_event_agg_log, + .endurance_group_list = NULL, .endurance_log = binary_endurance_log, .error_log = binary_error_log, .fdp_config_log = binary_fdp_configs, @@ -319,6 +322,7 @@ static struct print_ops binary_print_ops = { .id_ctrl_nvm = binary_id_ctrl_nvm, .id_domain_list = binary_id_domain_list, .id_independent_id_ns = binary_cmd_set_independent_id_ns, + .id_iocs = NULL, .id_ns = binary_id_ns, .id_ns_descs = binary_id_ns_descs, .id_ns_granularity_list = binary_id_ns_granularity_list, @@ -328,6 +332,7 @@ static struct print_ops binary_print_ops = { .lba_status_log = binary_lba_status_log, .media_unit_stat_log = binary_media_unit_stat_log, .mi_cmd_support_effects_log = binary_mi_cmd_support_effects_log, + .ns_list = NULL, .ns_list_log = binary_changed_ns_list_log, .nvm_id_ns = binary_nvm_id_ns, .persistent_event_log = binary_persistent_event_log, @@ -338,14 +343,40 @@ static struct print_ops binary_print_ops = { .resv_report = binary_resv_report, .sanitize_log_page = binary_sanitize_log, .secondary_ctrl_list = binary_list_secondary_ctrl, + .select_result = NULL, .self_test_log = binary_self_test_log, + .single_property = NULL, .smart_log = binary_smart_log, .supported_cap_config_list_log = binary_supported_cap_config_log, .supported_log_pages = binary_supported_log, + .zns_start_zone_list = NULL, .zns_changed_zone_log = binary_zns_changed, + .zns_finish_zone_list = NULL, .zns_id_ctrl = binary_zns_id_ctrl, .zns_id_ns = binary_zns_id_ns, .zns_report_zones = binary_zns_report_zones, + .show_feature = NULL, + .show_feature_fields = NULL, + .id_ctrl_rpmbs = NULL, + .lba_range = NULL, + .lba_status_info = NULL, + .d = NULL, + .show_init = NULL, + .show_finish = NULL, + + /* libnvme tree print functions */ + .list_item = NULL, + .list_items = NULL, + .print_nvme_subsystem_list = NULL, + .topology_ctrl = NULL, + .topology_namespace = NULL, + + /* status and error messages */ + .connect_msg = NULL, + .show_message = NULL, + .show_perror = NULL, + .show_status = NULL, + .show_error_status = NULL, }; struct print_ops *nvme_get_binary_print_ops(enum nvme_print_flags flags) diff --git a/nvme-print-json.c b/nvme-print-json.c index 485c013..5a09b6b 100644 --- a/nvme-print-json.c +++ b/nvme-print-json.c @@ -2,6 +2,7 @@ #include #include +#include #include "nvme-print.h" @@ -10,9 +11,194 @@ #include "common.h" #define ERROR_MSG_LEN 100 +#define STR_LEN 100 +#define NAME_LEN 128 +#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))) + +#define array_add_obj json_array_add_value_object +#define array_add_str json_array_add_value_string + +#define obj_add_array json_object_add_value_array +#define obj_add_int json_object_add_value_int +#define obj_add_obj json_object_add_value_object +#define obj_add_str json_object_add_value_string +#define obj_add_uint json_object_add_value_uint +#define obj_add_uint128 json_object_add_value_uint128 +#define obj_add_uint64 json_object_add_value_uint64 static const uint8_t zero_uuid[16] = { 0 }; static struct print_ops json_print_ops; +static struct json_object *json_r = NULL; + +static void d_json(unsigned char *buf, int len, int width, int group, struct json_object *array) +{ + int i; + char ascii[32 + 1] = { 0 }; + + assert(width < sizeof(ascii)); + + for (i = 0; i < len; i++) { + ascii[i % width] = (buf[i] >= '!' && buf[i] <= '~') ? buf[i] : '.'; + if (!((i + 1) % width)) { + array_add_str(array, ascii); + memset(ascii, 0, sizeof(ascii)); + } + } + + if (strlen(ascii)) { + ascii[i % width + 1] = '\0'; + array_add_str(array, ascii); + } +} + +static void obj_add_uint_x(struct json_object *o, const char *k, __u32 v) +{ + char str[STR_LEN]; + + sprintf(str, "%x", v); + obj_add_str(o, k, str); +} + +static void obj_add_uint_0x(struct json_object *o, const char *k, __u32 v) +{ + char str[STR_LEN]; + + sprintf(str, "0x%x", v); + obj_add_str(o, k, str); +} + +static void obj_add_uint_02x(struct json_object *o, const char *k, __u32 v) +{ + char str[STR_LEN]; + + sprintf(str, "0x%02x", v); + obj_add_str(o, k, str); +} + +static void obj_add_uint_nx(struct json_object *o, const char *k, __u32 v) +{ + char str[STR_LEN]; + + sprintf(str, "%#x", v); + obj_add_str(o, k, str); +} + +static void obj_add_nprix64(struct json_object *o, const char *k, uint64_t v) +{ + char str[STR_LEN]; + + sprintf(str, "%#"PRIx64"", v); + obj_add_str(o, k, str); +} + +static void obj_add_prix64(struct json_object *o, const char *k, uint64_t v) +{ + char str[STR_LEN]; + + sprintf(str, "%"PRIx64"", v); + obj_add_str(o, k, str); +} + +static void obj_add_int_secs(struct json_object *o, const char *k, int v) +{ + char str[STR_LEN]; + + sprintf(str, "%d secs", v); + obj_add_str(o, k, str); +} + +static void obj_add_result(struct json_object *o, const char *v, ...) +{ + va_list ap; + va_start(ap, v); + char *value; + + if (vasprintf(&value, v, ap) < 0) + value = NULL; + + if (value) + obj_add_str(o, "Result", value); + else + obj_add_str(o, "Result", "Could not allocate string"); + + free(value); +} + +static void obj_add_key(struct json_object *o, const char *k, const char *v, ...) +{ + va_list ap; + va_start(ap, v); + char *value; + + if (vasprintf(&value, v, ap) < 0) + value = NULL; + + if (value) + obj_add_str(o, k, value); + else + obj_add_str(o, k, "Could not allocate string"); + + free(value); +} + +static struct json_object *obj_create_array_obj(struct json_object *o, const char *k) +{ + struct json_object *array = json_create_array(); + struct json_object *obj = json_create_object(); + + obj_add_array(o, k, array); + array_add_obj(array, obj); + + return obj; +} + +static struct json_object *obj_create(const char *k) +{ + struct json_object *array; + struct json_object *obj = json_create_object(); + + if (json_r) { + array = json_create_array(); + obj_add_array(json_r, k, array); + array_add_obj(array, obj); + } + + return obj; +} + +static void json_print(struct json_object *r) +{ + json_print_object(r, NULL); + printf("\n"); + json_free_object(r); +} + +static bool human(void) +{ + return json_print_ops.flags & VERBOSE; +} + +static void json_id_iocs(struct nvme_id_iocs *iocs) +{ + struct json_object *r = json_create_object(); + char json_str[STR_LEN]; + __u16 i; + + for (i = 0; i < ARRAY_SIZE(iocs->iocsc); i++) { + if (iocs->iocsc[i]) { + sprintf(json_str, "I/O Command Set Combination[%u]", i); + obj_add_uint64(r, json_str, le64_to_cpu(iocs->iocsc[i])); + } + } + + json_print(r); +} static void json_nvme_id_ns(struct nvme_id_ns *ns, unsigned int nsid, unsigned int lba_index, bool cap_only) @@ -20,106 +206,107 @@ static void json_nvme_id_ns(struct nvme_id_ns *ns, unsigned int nsid, char nguid_buf[2 * sizeof(ns->nguid) + 1], eui64_buf[2 * sizeof(ns->eui64) + 1]; char *nguid = nguid_buf, *eui64 = eui64_buf; - struct json_object *root; - struct json_object *lbafs; + struct json_object *r = json_create_object(); + struct json_object *lbafs = json_create_array(); + struct json_object *vs = json_create_array(); int i; - nvme_uint128_t nvmcap = le128_to_cpu(ns->nvmcap); - root = json_create_object(); + if (!cap_only) { + obj_add_uint64(r, "nsze", le64_to_cpu(ns->nsze)); + obj_add_uint64(r, "ncap", le64_to_cpu(ns->ncap)); + obj_add_uint64(r, "nuse", le64_to_cpu(ns->nuse)); + obj_add_int(r, "nsfeat", ns->nsfeat); + } + + obj_add_int(r, "nlbaf", ns->nlbaf); + + if (!cap_only) + obj_add_int(r, "flbas", ns->flbas); + + obj_add_int(r, "mc", ns->mc); + obj_add_int(r, "dpc", ns->dpc); if (!cap_only) { - json_object_add_value_uint64(root, "nsze", le64_to_cpu(ns->nsze)); - json_object_add_value_uint64(root, "ncap", le64_to_cpu(ns->ncap)); - json_object_add_value_uint64(root, "nuse", le64_to_cpu(ns->nuse)); - json_object_add_value_int(root, "nsfeat", ns->nsfeat); - } - json_object_add_value_int(root, "nlbaf", ns->nlbaf); - if (!cap_only) - json_object_add_value_int(root, "flbas", ns->flbas); - json_object_add_value_int(root, "mc", ns->mc); - json_object_add_value_int(root, "dpc", ns->dpc); - if (!cap_only) { - json_object_add_value_int(root, "dps", ns->dps); - json_object_add_value_int(root, "nmic", ns->nmic); - json_object_add_value_int(root, "rescap", ns->rescap); - json_object_add_value_int(root, "fpi", ns->fpi); - json_object_add_value_int(root, "dlfeat", ns->dlfeat); - json_object_add_value_int(root, "nawun", le16_to_cpu(ns->nawun)); - json_object_add_value_int(root, "nawupf", le16_to_cpu(ns->nawupf)); - json_object_add_value_int(root, "nacwu", le16_to_cpu(ns->nacwu)); - json_object_add_value_int(root, "nabsn", le16_to_cpu(ns->nabsn)); - json_object_add_value_int(root, "nabo", le16_to_cpu(ns->nabo)); - json_object_add_value_int(root, "nabspf", le16_to_cpu(ns->nabspf)); - json_object_add_value_int(root, "noiob", le16_to_cpu(ns->noiob)); - json_object_add_value_uint128(root, "nvmcap", nvmcap); - json_object_add_value_int(root, "nsattr", ns->nsattr); - json_object_add_value_int(root, "nvmsetid", le16_to_cpu(ns->nvmsetid)); + obj_add_int(r, "dps", ns->dps); + obj_add_int(r, "nmic", ns->nmic); + obj_add_int(r, "rescap", ns->rescap); + obj_add_int(r, "fpi", ns->fpi); + obj_add_int(r, "dlfeat", ns->dlfeat); + obj_add_int(r, "nawun", le16_to_cpu(ns->nawun)); + obj_add_int(r, "nawupf", le16_to_cpu(ns->nawupf)); + obj_add_int(r, "nacwu", le16_to_cpu(ns->nacwu)); + obj_add_int(r, "nabsn", le16_to_cpu(ns->nabsn)); + obj_add_int(r, "nabo", le16_to_cpu(ns->nabo)); + obj_add_int(r, "nabspf", le16_to_cpu(ns->nabspf)); + obj_add_int(r, "noiob", le16_to_cpu(ns->noiob)); + obj_add_uint128(r, "nvmcap", nvmcap); + obj_add_int(r, "nsattr", ns->nsattr); + obj_add_int(r, "nvmsetid", le16_to_cpu(ns->nvmsetid)); if (ns->nsfeat & 0x10) { - json_object_add_value_int(root, "npwg", le16_to_cpu(ns->npwg)); - json_object_add_value_int(root, "npwa", le16_to_cpu(ns->npwa)); - json_object_add_value_int(root, "npdg", le16_to_cpu(ns->npdg)); - json_object_add_value_int(root, "npda", le16_to_cpu(ns->npda)); - json_object_add_value_int(root, "nows", le16_to_cpu(ns->nows)); + obj_add_int(r, "npwg", le16_to_cpu(ns->npwg)); + obj_add_int(r, "npwa", le16_to_cpu(ns->npwa)); + obj_add_int(r, "npdg", le16_to_cpu(ns->npdg)); + obj_add_int(r, "npda", le16_to_cpu(ns->npda)); + obj_add_int(r, "nows", le16_to_cpu(ns->nows)); } - json_object_add_value_int(root, "mssrl", le16_to_cpu(ns->mssrl)); - json_object_add_value_uint(root, "mcl", le32_to_cpu(ns->mcl)); - json_object_add_value_int(root, "msrc", ns->msrc); + obj_add_int(r, "mssrl", le16_to_cpu(ns->mssrl)); + obj_add_uint(r, "mcl", le32_to_cpu(ns->mcl)); + obj_add_int(r, "msrc", ns->msrc); } - json_object_add_value_int(root, "nulbaf", ns->nulbaf); + + obj_add_int(r, "nulbaf", ns->nulbaf); if (!cap_only) { - json_object_add_value_uint(root, "anagrpid", le32_to_cpu(ns->anagrpid)); - json_object_add_value_int(root, "endgid", le16_to_cpu(ns->endgid)); + obj_add_uint(r, "anagrpid", le32_to_cpu(ns->anagrpid)); + obj_add_int(r, "endgid", le16_to_cpu(ns->endgid)); memset(eui64, 0, sizeof(eui64_buf)); + for (i = 0; i < sizeof(ns->eui64); i++) eui64 += sprintf(eui64, "%02x", ns->eui64[i]); memset(nguid, 0, sizeof(nguid_buf)); + for (i = 0; i < sizeof(ns->nguid); i++) nguid += sprintf(nguid, "%02x", ns->nguid[i]); - json_object_add_value_string(root, "eui64", eui64_buf); - json_object_add_value_string(root, "nguid", nguid_buf); + obj_add_str(r, "eui64", eui64_buf); + obj_add_str(r, "nguid", nguid_buf); } - lbafs = json_create_array(); - json_object_add_value_array(root, "lbafs", lbafs); + obj_add_array(r, "lbafs", lbafs); for (i = 0; i <= ns->nlbaf; i++) { struct json_object *lbaf = json_create_object(); - json_object_add_value_int(lbaf, "ms", - le16_to_cpu(ns->lbaf[i].ms)); - json_object_add_value_int(lbaf, "ds", ns->lbaf[i].ds); - json_object_add_value_int(lbaf, "rp", ns->lbaf[i].rp); + obj_add_int(lbaf, "ms", le16_to_cpu(ns->lbaf[i].ms)); + obj_add_int(lbaf, "ds", ns->lbaf[i].ds); + obj_add_int(lbaf, "rp", ns->lbaf[i].rp); - json_array_add_value_object(lbafs, lbaf); + array_add_obj(lbafs, lbaf); } - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + d_json(ns->vs, strnlen((const char *)ns->vs, sizeof(ns->vs)), 16, 1, vs); + obj_add_array(r, "vs", vs); + + json_print(r); } void json_nvme_id_ctrl(struct nvme_id_ctrl *ctrl, - void (*vs)(__u8 *vs, struct json_object *root)) + void (*vs)(__u8 *vs, struct json_object *r)) { - struct json_object *root; - struct json_object *psds; - + struct json_object *r = json_create_object(); + struct json_object *psds = json_create_array(); nvme_uint128_t tnvmcap = le128_to_cpu(ctrl->tnvmcap); nvme_uint128_t unvmcap = le128_to_cpu(ctrl->unvmcap); nvme_uint128_t megcap = le128_to_cpu(ctrl->megcap); nvme_uint128_t maxdna = le128_to_cpu(ctrl->maxdna); - char sn[sizeof(ctrl->sn) + 1], mn[sizeof(ctrl->mn) + 1], fr[sizeof(ctrl->fr) + 1], subnqn[sizeof(ctrl->subnqn) + 1]; __u32 ieee = ctrl->ieee[2] << 16 | ctrl->ieee[1] << 8 | ctrl->ieee[0]; - int i; snprintf(sn, sizeof(sn), "%-.*s", (int)sizeof(ctrl->sn), ctrl->sn); @@ -127,208 +314,170 @@ static void json_nvme_id_ns(struct nvme_id_ns *ns, unsigned int nsid, snprintf(fr, sizeof(fr), "%-.*s", (int)sizeof(ctrl->fr), ctrl->fr); snprintf(subnqn, sizeof(subnqn), "%-.*s", (int)sizeof(ctrl->subnqn), ctrl->subnqn); - root = json_create_object(); - - json_object_add_value_int(root, "vid", le16_to_cpu(ctrl->vid)); - json_object_add_value_int(root, "ssvid", le16_to_cpu(ctrl->ssvid)); - json_object_add_value_string(root, "sn", sn); - json_object_add_value_string(root, "mn", mn); - json_object_add_value_string(root, "fr", fr); - json_object_add_value_int(root, "rab", ctrl->rab); - json_object_add_value_int(root, "ieee", ieee); - json_object_add_value_int(root, "cmic", ctrl->cmic); - json_object_add_value_int(root, "mdts", ctrl->mdts); - json_object_add_value_int(root, "cntlid", le16_to_cpu(ctrl->cntlid)); - json_object_add_value_uint(root, "ver", le32_to_cpu(ctrl->ver)); - json_object_add_value_uint(root, "rtd3r", le32_to_cpu(ctrl->rtd3r)); - json_object_add_value_uint(root, "rtd3e", le32_to_cpu(ctrl->rtd3e)); - json_object_add_value_uint(root, "oaes", le32_to_cpu(ctrl->oaes)); - json_object_add_value_uint(root, "ctratt", le32_to_cpu(ctrl->ctratt)); - json_object_add_value_int(root, "rrls", le16_to_cpu(ctrl->rrls)); - json_object_add_value_int(root, "cntrltype", ctrl->cntrltype); - json_object_add_value_string(root, "fguid", util_uuid_to_string(ctrl->fguid)); - json_object_add_value_int(root, "crdt1", le16_to_cpu(ctrl->crdt1)); - json_object_add_value_int(root, "crdt2", le16_to_cpu(ctrl->crdt2)); - json_object_add_value_int(root, "crdt3", le16_to_cpu(ctrl->crdt3)); - json_object_add_value_int(root, "nvmsr", ctrl->nvmsr); - json_object_add_value_int(root, "vwci", ctrl->vwci); - json_object_add_value_int(root, "mec", ctrl->mec); - json_object_add_value_int(root, "oacs", le16_to_cpu(ctrl->oacs)); - json_object_add_value_int(root, "acl", ctrl->acl); - json_object_add_value_int(root, "aerl", ctrl->aerl); - json_object_add_value_int(root, "frmw", ctrl->frmw); - json_object_add_value_int(root, "lpa", ctrl->lpa); - json_object_add_value_int(root, "elpe", ctrl->elpe); - json_object_add_value_int(root, "npss", ctrl->npss); - json_object_add_value_int(root, "avscc", ctrl->avscc); - json_object_add_value_int(root, "apsta", ctrl->apsta); - json_object_add_value_int(root, "wctemp", le16_to_cpu(ctrl->wctemp)); - json_object_add_value_int(root, "cctemp", le16_to_cpu(ctrl->cctemp)); - json_object_add_value_int(root, "mtfa", le16_to_cpu(ctrl->mtfa)); - json_object_add_value_uint(root, "hmpre", le32_to_cpu(ctrl->hmpre)); - json_object_add_value_uint(root, "hmmin", le32_to_cpu(ctrl->hmmin)); - json_object_add_value_uint128(root, "tnvmcap", tnvmcap); - json_object_add_value_uint128(root, "unvmcap", unvmcap); - json_object_add_value_uint(root, "rpmbs", le32_to_cpu(ctrl->rpmbs)); - json_object_add_value_int(root, "edstt", le16_to_cpu(ctrl->edstt)); - json_object_add_value_int(root, "dsto", ctrl->dsto); - json_object_add_value_int(root, "fwug", ctrl->fwug); - json_object_add_value_int(root, "kas", le16_to_cpu(ctrl->kas)); - json_object_add_value_int(root, "hctma", le16_to_cpu(ctrl->hctma)); - json_object_add_value_int(root, "mntmt", le16_to_cpu(ctrl->mntmt)); - json_object_add_value_int(root, "mxtmt", le16_to_cpu(ctrl->mxtmt)); - json_object_add_value_uint(root, "sanicap", le32_to_cpu(ctrl->sanicap)); - json_object_add_value_uint(root, "hmminds", le32_to_cpu(ctrl->hmminds)); - json_object_add_value_int(root, "hmmaxd", le16_to_cpu(ctrl->hmmaxd)); - json_object_add_value_int(root, "nsetidmax", - le16_to_cpu(ctrl->nsetidmax)); - json_object_add_value_int(root, "endgidmax", le16_to_cpu(ctrl->endgidmax)); - json_object_add_value_int(root, "anatt",ctrl->anatt); - json_object_add_value_int(root, "anacap", ctrl->anacap); - json_object_add_value_uint(root, "anagrpmax", - le32_to_cpu(ctrl->anagrpmax)); - json_object_add_value_uint(root, "nanagrpid", - le32_to_cpu(ctrl->nanagrpid)); - json_object_add_value_uint(root, "pels", le32_to_cpu(ctrl->pels)); - json_object_add_value_int(root, "domainid", le16_to_cpu(ctrl->domainid)); - json_object_add_value_uint128(root, "megcap", megcap); - json_object_add_value_int(root, "sqes", ctrl->sqes); - json_object_add_value_int(root, "cqes", ctrl->cqes); - json_object_add_value_int(root, "maxcmd", le16_to_cpu(ctrl->maxcmd)); - json_object_add_value_uint(root, "nn", le32_to_cpu(ctrl->nn)); - json_object_add_value_int(root, "oncs", le16_to_cpu(ctrl->oncs)); - json_object_add_value_int(root, "fuses", le16_to_cpu(ctrl->fuses)); - json_object_add_value_int(root, "fna", ctrl->fna); - json_object_add_value_int(root, "vwc", ctrl->vwc); - json_object_add_value_int(root, "awun", le16_to_cpu(ctrl->awun)); - json_object_add_value_int(root, "awupf", le16_to_cpu(ctrl->awupf)); - json_object_add_value_int(root, "icsvscc", ctrl->icsvscc); - json_object_add_value_int(root, "nwpc", ctrl->nwpc); - json_object_add_value_int(root, "acwu", le16_to_cpu(ctrl->acwu)); - json_object_add_value_int(root, "ocfs", le16_to_cpu(ctrl->ocfs)); - json_object_add_value_uint(root, "sgls", le32_to_cpu(ctrl->sgls)); - json_object_add_value_uint(root, "mnan", le32_to_cpu(ctrl->mnan)); - json_object_add_value_uint128(root, "maxdna", maxdna); - json_object_add_value_uint(root, "maxcna", le32_to_cpu(ctrl->maxcna)); - json_object_add_value_uint(root, "oaqd", le32_to_cpu(ctrl->oaqd)); + obj_add_int(r, "vid", le16_to_cpu(ctrl->vid)); + obj_add_int(r, "ssvid", le16_to_cpu(ctrl->ssvid)); + obj_add_str(r, "sn", sn); + obj_add_str(r, "mn", mn); + obj_add_str(r, "fr", fr); + obj_add_int(r, "rab", ctrl->rab); + obj_add_int(r, "ieee", ieee); + obj_add_int(r, "cmic", ctrl->cmic); + obj_add_int(r, "mdts", ctrl->mdts); + obj_add_int(r, "cntlid", le16_to_cpu(ctrl->cntlid)); + obj_add_uint(r, "ver", le32_to_cpu(ctrl->ver)); + obj_add_uint(r, "rtd3r", le32_to_cpu(ctrl->rtd3r)); + obj_add_uint(r, "rtd3e", le32_to_cpu(ctrl->rtd3e)); + obj_add_uint(r, "oaes", le32_to_cpu(ctrl->oaes)); + obj_add_uint(r, "ctratt", le32_to_cpu(ctrl->ctratt)); + obj_add_int(r, "rrls", le16_to_cpu(ctrl->rrls)); + obj_add_int(r, "cntrltype", ctrl->cntrltype); + obj_add_str(r, "fguid", util_uuid_to_string(ctrl->fguid)); + obj_add_int(r, "crdt1", le16_to_cpu(ctrl->crdt1)); + obj_add_int(r, "crdt2", le16_to_cpu(ctrl->crdt2)); + obj_add_int(r, "crdt3", le16_to_cpu(ctrl->crdt3)); + obj_add_int(r, "nvmsr", ctrl->nvmsr); + obj_add_int(r, "vwci", ctrl->vwci); + obj_add_int(r, "mec", ctrl->mec); + obj_add_int(r, "oacs", le16_to_cpu(ctrl->oacs)); + obj_add_int(r, "acl", ctrl->acl); + obj_add_int(r, "aerl", ctrl->aerl); + obj_add_int(r, "frmw", ctrl->frmw); + obj_add_int(r, "lpa", ctrl->lpa); + obj_add_int(r, "elpe", ctrl->elpe); + obj_add_int(r, "npss", ctrl->npss); + obj_add_int(r, "avscc", ctrl->avscc); + obj_add_int(r, "apsta", ctrl->apsta); + obj_add_int(r, "wctemp", le16_to_cpu(ctrl->wctemp)); + obj_add_int(r, "cctemp", le16_to_cpu(ctrl->cctemp)); + obj_add_int(r, "mtfa", le16_to_cpu(ctrl->mtfa)); + obj_add_uint(r, "hmpre", le32_to_cpu(ctrl->hmpre)); + obj_add_uint(r, "hmmin", le32_to_cpu(ctrl->hmmin)); + obj_add_uint128(r, "tnvmcap", tnvmcap); + obj_add_uint128(r, "unvmcap", unvmcap); + obj_add_uint(r, "rpmbs", le32_to_cpu(ctrl->rpmbs)); + obj_add_int(r, "edstt", le16_to_cpu(ctrl->edstt)); + obj_add_int(r, "dsto", ctrl->dsto); + obj_add_int(r, "fwug", ctrl->fwug); + obj_add_int(r, "kas", le16_to_cpu(ctrl->kas)); + obj_add_int(r, "hctma", le16_to_cpu(ctrl->hctma)); + obj_add_int(r, "mntmt", le16_to_cpu(ctrl->mntmt)); + obj_add_int(r, "mxtmt", le16_to_cpu(ctrl->mxtmt)); + obj_add_uint(r, "sanicap", le32_to_cpu(ctrl->sanicap)); + obj_add_uint(r, "hmminds", le32_to_cpu(ctrl->hmminds)); + obj_add_int(r, "hmmaxd", le16_to_cpu(ctrl->hmmaxd)); + obj_add_int(r, "nsetidmax", le16_to_cpu(ctrl->nsetidmax)); + obj_add_int(r, "endgidmax", le16_to_cpu(ctrl->endgidmax)); + obj_add_int(r, "anatt",ctrl->anatt); + obj_add_int(r, "anacap", ctrl->anacap); + obj_add_uint(r, "anagrpmax", le32_to_cpu(ctrl->anagrpmax)); + obj_add_uint(r, "nanagrpid", le32_to_cpu(ctrl->nanagrpid)); + obj_add_uint(r, "pels", le32_to_cpu(ctrl->pels)); + obj_add_int(r, "domainid", le16_to_cpu(ctrl->domainid)); + obj_add_uint128(r, "megcap", megcap); + obj_add_int(r, "sqes", ctrl->sqes); + obj_add_int(r, "cqes", ctrl->cqes); + obj_add_int(r, "maxcmd", le16_to_cpu(ctrl->maxcmd)); + obj_add_uint(r, "nn", le32_to_cpu(ctrl->nn)); + obj_add_int(r, "oncs", le16_to_cpu(ctrl->oncs)); + obj_add_int(r, "fuses", le16_to_cpu(ctrl->fuses)); + obj_add_int(r, "fna", ctrl->fna); + obj_add_int(r, "vwc", ctrl->vwc); + obj_add_int(r, "awun", le16_to_cpu(ctrl->awun)); + obj_add_int(r, "awupf", le16_to_cpu(ctrl->awupf)); + obj_add_int(r, "icsvscc", ctrl->icsvscc); + obj_add_int(r, "nwpc", ctrl->nwpc); + obj_add_int(r, "acwu", le16_to_cpu(ctrl->acwu)); + obj_add_int(r, "ocfs", le16_to_cpu(ctrl->ocfs)); + obj_add_uint(r, "sgls", le32_to_cpu(ctrl->sgls)); + obj_add_uint(r, "mnan", le32_to_cpu(ctrl->mnan)); + obj_add_uint128(r, "maxdna", maxdna); + obj_add_uint(r, "maxcna", le32_to_cpu(ctrl->maxcna)); + obj_add_uint(r, "oaqd", le32_to_cpu(ctrl->oaqd)); if (strlen(subnqn)) - json_object_add_value_string(root, "subnqn", subnqn); + obj_add_str(r, "subnqn", subnqn); - json_object_add_value_uint(root, "ioccsz", le32_to_cpu(ctrl->ioccsz)); - json_object_add_value_uint(root, "iorcsz", le32_to_cpu(ctrl->iorcsz)); - json_object_add_value_int(root, "icdoff", le16_to_cpu(ctrl->icdoff)); - json_object_add_value_int(root, "fcatt", ctrl->fcatt); - json_object_add_value_int(root, "msdbd", ctrl->msdbd); - json_object_add_value_int(root, "ofcs", le16_to_cpu(ctrl->ofcs)); + obj_add_uint(r, "ioccsz", le32_to_cpu(ctrl->ioccsz)); + obj_add_uint(r, "iorcsz", le32_to_cpu(ctrl->iorcsz)); + obj_add_int(r, "icdoff", le16_to_cpu(ctrl->icdoff)); + obj_add_int(r, "fcatt", ctrl->fcatt); + obj_add_int(r, "msdbd", ctrl->msdbd); + obj_add_int(r, "ofcs", le16_to_cpu(ctrl->ofcs)); - psds = json_create_array(); - json_object_add_value_array(root, "psds", psds); + obj_add_array(r, "psds", psds); for (i = 0; i <= ctrl->npss; i++) { struct json_object *psd = json_create_object(); - json_object_add_value_int(psd, "max_power", - le16_to_cpu(ctrl->psd[i].mp)); - json_object_add_value_int(psd, "max_power_scale", - ctrl->psd[i].flags & 0x1); - json_object_add_value_int(psd, "non-operational_state", - (ctrl->psd[i].flags & 0x2) >> 1); - json_object_add_value_uint(psd, "entry_lat", - le32_to_cpu(ctrl->psd[i].enlat)); - json_object_add_value_uint(psd, "exit_lat", - le32_to_cpu(ctrl->psd[i].exlat)); - json_object_add_value_int(psd, "read_tput", - ctrl->psd[i].rrt); - json_object_add_value_int(psd, "read_lat", - ctrl->psd[i].rrl); - json_object_add_value_int(psd, "write_tput", - ctrl->psd[i].rwt); - json_object_add_value_int(psd, "write_lat", - ctrl->psd[i].rwl); - json_object_add_value_int(psd, "idle_power", - le16_to_cpu(ctrl->psd[i].idlp)); - json_object_add_value_int(psd, "idle_scale", - nvme_psd_power_scale(ctrl->psd[i].ips)); - json_object_add_value_int(psd, "active_power", - le16_to_cpu(ctrl->psd[i].actp)); - json_object_add_value_int(psd, "active_power_work", - ctrl->psd[i].apws & 0x7); - json_object_add_value_int(psd, "active_scale", - nvme_psd_power_scale(ctrl->psd[i].apws)); + obj_add_int(psd, "max_power", le16_to_cpu(ctrl->psd[i].mp)); + obj_add_int(psd, "max_power_scale", ctrl->psd[i].flags & 0x1); + obj_add_int(psd, "non-operational_state", (ctrl->psd[i].flags & 2) >> 1); + obj_add_uint(psd, "entry_lat", le32_to_cpu(ctrl->psd[i].enlat)); + obj_add_uint(psd, "exit_lat", le32_to_cpu(ctrl->psd[i].exlat)); + obj_add_int(psd, "read_tput", ctrl->psd[i].rrt); + obj_add_int(psd, "read_lat", ctrl->psd[i].rrl); + obj_add_int(psd, "write_tput", ctrl->psd[i].rwt); + obj_add_int(psd, "write_lat", ctrl->psd[i].rwl); + obj_add_int(psd, "idle_power", le16_to_cpu(ctrl->psd[i].idlp)); + obj_add_int(psd, "idle_scale", nvme_psd_power_scale(ctrl->psd[i].ips)); + obj_add_int(psd, "active_power", le16_to_cpu(ctrl->psd[i].actp)); + obj_add_int(psd, "active_power_work", ctrl->psd[i].apws & 7); + obj_add_int(psd, "active_scale", nvme_psd_power_scale(ctrl->psd[i].apws)); - json_array_add_value_object(psds, psd); + array_add_obj(psds, psd); } if(vs) - vs(ctrl->vs, root); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + vs(ctrl->vs, r); + + json_print(r); } static void json_error_log(struct nvme_error_log_page *err_log, int entries, const char *devname) { - struct json_object *root; - struct json_object *errors; + struct json_object *r = json_create_object(); + struct json_object *errors = json_create_array(); int i; - root = json_create_object(); - errors = json_create_array(); - json_object_add_value_array(root, "errors", errors); + obj_add_array(r, "errors", errors); for (i = 0; i < entries; i++) { struct json_object *error = json_create_object(); - json_object_add_value_uint64(error, "error_count", - le64_to_cpu(err_log[i].error_count)); - json_object_add_value_int(error, "sqid", - le16_to_cpu(err_log[i].sqid)); - json_object_add_value_int(error, "cmdid", - le16_to_cpu(err_log[i].cmdid)); - json_object_add_value_int(error, "status_field", - le16_to_cpu(err_log[i].status_field >> 0x1)); - json_object_add_value_int(error, "phase_tag", - le16_to_cpu(err_log[i].status_field & 0x1)); - json_object_add_value_int(error, "parm_error_location", - le16_to_cpu(err_log[i].parm_error_location)); - json_object_add_value_uint64(error, "lba", - le64_to_cpu(err_log[i].lba)); - json_object_add_value_uint(error, "nsid", - le32_to_cpu(err_log[i].nsid)); - json_object_add_value_int(error, "vs", err_log[i].vs); - json_object_add_value_int(error, "trtype", err_log[i].trtype); - json_object_add_value_uint64(error, "cs", - le64_to_cpu(err_log[i].cs)); - json_object_add_value_int(error, "trtype_spec_info", - le16_to_cpu(err_log[i].trtype_spec_info)); + obj_add_uint64(error, "error_count", le64_to_cpu(err_log[i].error_count)); + obj_add_int(error, "sqid", le16_to_cpu(err_log[i].sqid)); + obj_add_int(error, "cmdid", le16_to_cpu(err_log[i].cmdid)); + obj_add_int(error, "status_field", le16_to_cpu(err_log[i].status_field >> 0x1)); + obj_add_int(error, "phase_tag", le16_to_cpu(err_log[i].status_field & 0x1)); + obj_add_int(error, "parm_error_location", + le16_to_cpu(err_log[i].parm_error_location)); + obj_add_uint64(error, "lba", le64_to_cpu(err_log[i].lba)); + obj_add_uint(error, "nsid", le32_to_cpu(err_log[i].nsid)); + obj_add_int(error, "vs", err_log[i].vs); + obj_add_int(error, "trtype", err_log[i].trtype); + obj_add_uint64(error, "cs", le64_to_cpu(err_log[i].cs)); + obj_add_int(error, "trtype_spec_info", le16_to_cpu(err_log[i].trtype_spec_info)); - json_array_add_value_object(errors, error); + array_add_obj(errors, error); } - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } void json_nvme_resv_report(struct nvme_resv_status *status, int bytes, bool eds) { - struct json_object *root; - struct json_object *rcs; - int i, j, regctl, entries; + struct json_object *r = json_create_object(); + struct json_object *rcs = json_create_array(); + int i, j, entries; + int regctl = status->regctl[0] | (status->regctl[1] << 8); - regctl = status->regctl[0] | (status->regctl[1] << 8); + obj_add_uint(r, "gen", le32_to_cpu(status->gen)); + obj_add_int(r, "rtype", status->rtype); + obj_add_int(r, "regctl", regctl); + obj_add_int(r, "ptpls", status->ptpls); - root = json_create_object(); - - json_object_add_value_uint(root, "gen", le32_to_cpu(status->gen)); - json_object_add_value_int(root, "rtype", status->rtype); - json_object_add_value_int(root, "regctl", regctl); - json_object_add_value_int(root, "ptpls", status->ptpls); - - rcs = json_create_array(); /* check Extended Data Structure bit */ if (!eds) { /* @@ -339,67 +488,57 @@ void json_nvme_resv_report(struct nvme_resv_status *status, if (entries < regctl) regctl = entries; - json_object_add_value_array(root, "regctls", rcs); + obj_add_array(r, "regctls", rcs); for (i = 0; i < regctl; i++) { struct json_object *rc = json_create_object(); - json_object_add_value_int(rc, "cntlid", - le16_to_cpu(status->regctl_ds[i].cntlid)); - json_object_add_value_int(rc, "rcsts", - status->regctl_ds[i].rcsts); - json_object_add_value_uint64(rc, "hostid", - le64_to_cpu(status->regctl_ds[i].hostid)); - json_object_add_value_uint64(rc, "rkey", - le64_to_cpu(status->regctl_ds[i].rkey)); + obj_add_int(rc, "cntlid", le16_to_cpu(status->regctl_ds[i].cntlid)); + obj_add_int(rc, "rcsts", status->regctl_ds[i].rcsts); + obj_add_uint64(rc, "hostid", le64_to_cpu(status->regctl_ds[i].hostid)); + obj_add_uint64(rc, "rkey", le64_to_cpu(status->regctl_ds[i].rkey)); - json_array_add_value_object(rcs, rc); + array_add_obj(rcs, rc); } } else { char hostid[33]; /* if status buffer was too small, don't loop past the end of the buffer */ entries = (bytes - 64) / 64; + if (entries < regctl) regctl = entries; - json_object_add_value_array(root, "regctlext", rcs); + obj_add_array(r, "regctlext", rcs); + for (i = 0; i < regctl; i++) { struct json_object *rc = json_create_object(); - json_object_add_value_int(rc, "cntlid", - le16_to_cpu(status->regctl_eds[i].cntlid)); - json_object_add_value_int(rc, "rcsts", - status->regctl_eds[i].rcsts); - json_object_add_value_uint64(rc, "rkey", - le64_to_cpu(status->regctl_eds[i].rkey)); - for (j = 0; j < 16; j++) - sprintf(hostid + j * 2, "%02x", - status->regctl_eds[i].hostid[j]); + obj_add_int(rc, "cntlid", le16_to_cpu(status->regctl_eds[i].cntlid)); + obj_add_int(rc, "rcsts", status->regctl_eds[i].rcsts); + obj_add_uint64(rc, "rkey", le64_to_cpu(status->regctl_eds[i].rkey)); - json_object_add_value_string(rc, "hostid", hostid); - json_array_add_value_object(rcs, rc); + for (j = 0; j < 16; j++) + sprintf(hostid + j * 2, "%02x", status->regctl_eds[i].hostid[j]); + + obj_add_str(rc, "hostid", hostid); + array_add_obj(rcs, rc); } } - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } void json_fw_log(struct nvme_firmware_slot *fw_log, const char *devname) { - struct json_object *root; - struct json_object *fwsi; + struct json_object *r = json_create_object(); + struct json_object *fwsi = json_create_object(); char fmt[21]; char str[32]; int i; __le64 *frs; - root = json_create_object(); - fwsi = json_create_object(); + obj_add_int(fwsi, "Active Firmware Slot (afi)", fw_log->afi); - json_object_add_value_int(fwsi, "Active Firmware Slot (afi)", - fw_log->afi); for (i = 0; i < 7; i++) { if (fw_log->frs[i][0]) { snprintf(fmt, sizeof(fmt), "Firmware Rev Slot %d", @@ -408,21 +547,20 @@ void json_fw_log(struct nvme_firmware_slot *fw_log, const char *devname) snprintf(str, sizeof(str), "%"PRIu64" (%s)", le64_to_cpu(*frs), util_fw_to_string(fw_log->frs[i])); - json_object_add_value_string(fwsi, fmt, str); + obj_add_str(fwsi, fmt, str); } } - json_object_add_value_object(root, devname, fwsi); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + obj_add_obj(r, devname, fwsi); + + json_print(r); } void json_changed_ns_list_log(struct nvme_ns_list *log, const char *devname) { - struct json_object *root; - struct json_object *nsi; + struct json_object *r = json_create_object(); + struct json_object *nsi = json_create_object(); char fmt[32]; char str[32]; __u32 nsid; @@ -431,11 +569,7 @@ void json_changed_ns_list_log(struct nvme_ns_list *log, if (log->ns[0] == cpu_to_le32(0xffffffff)) return; - root = json_create_object(); - nsi = json_create_object(); - - json_object_add_value_string(root, "Changed Namespace List Log", - devname); + obj_add_str(r, "Changed Namespace List Log", devname); for (i = 0; i < NVME_ID_NS_LIST_MAX; i++) { nsid = le32_to_cpu(log->ns[i]); @@ -445,20 +579,18 @@ void json_changed_ns_list_log(struct nvme_ns_list *log, snprintf(fmt, sizeof(fmt), "[%4u]", i + 1); snprintf(str, sizeof(str), "%#x", nsid); - json_object_add_value_string(nsi, fmt, str); + obj_add_str(nsi, fmt, str); } - json_object_add_value_object(root, devname, nsi); - json_print_object(root, NULL); - printf("\n"); + obj_add_obj(r, devname, nsi); - json_free_object(root); + json_print(r); } static void json_endurance_log(struct nvme_endurance_group_log *endurance_group, __u16 group_id, const char *devname) { - struct json_object *root; + struct json_object *r = json_create_object(); nvme_uint128_t endurance_estimate = le128_to_cpu(endurance_group->endurance_estimate); nvme_uint128_t data_units_read = le128_to_cpu(endurance_group->data_units_read); nvme_uint128_t data_units_written = le128_to_cpu(endurance_group->data_units_written); @@ -472,42 +604,34 @@ static void json_endurance_log(struct nvme_endurance_group_log *endurance_group, nvme_uint128_t total_end_grp_cap = le128_to_cpu(endurance_group->total_end_grp_cap); nvme_uint128_t unalloc_end_grp_cap = le128_to_cpu(endurance_group->unalloc_end_grp_cap); - root = json_create_object(); + obj_add_int(r, "critical_warning", endurance_group->critical_warning); + obj_add_int(r, "endurance_group_features", endurance_group->endurance_group_features); + obj_add_int(r, "avl_spare", endurance_group->avl_spare); + obj_add_int(r, "avl_spare_threshold", endurance_group->avl_spare_threshold); + obj_add_int(r, "percent_used", endurance_group->percent_used); + obj_add_int(r, "domain_identifier", endurance_group->domain_identifier); + obj_add_uint128(r, "endurance_estimate", endurance_estimate); + obj_add_uint128(r, "data_units_read", data_units_read); + obj_add_uint128(r, "data_units_written", data_units_written); + obj_add_uint128(r, "media_units_written", media_units_written); + obj_add_uint128(r, "host_read_cmds", host_read_cmds); + obj_add_uint128(r, "host_write_cmds", host_write_cmds); + obj_add_uint128(r, "media_data_integrity_err", media_data_integrity_err); + obj_add_uint128(r, "num_err_info_log_entries", num_err_info_log_entries); + obj_add_uint128(r, "total_end_grp_cap", total_end_grp_cap); + obj_add_uint128(r, "unalloc_end_grp_cap", unalloc_end_grp_cap); - json_object_add_value_int(root, "critical_warning", endurance_group->critical_warning); - json_object_add_value_int(root, "endurance_group_features", - endurance_group->endurance_group_features); - json_object_add_value_int(root, "avl_spare", endurance_group->avl_spare); - json_object_add_value_int(root, "avl_spare_threshold", - endurance_group->avl_spare_threshold); - json_object_add_value_int(root, "percent_used", endurance_group->percent_used); - json_object_add_value_int(root, "domain_identifier", endurance_group->domain_identifier); - json_object_add_value_uint128(root, "endurance_estimate", endurance_estimate); - json_object_add_value_uint128(root, "data_units_read", data_units_read); - json_object_add_value_uint128(root, "data_units_written", data_units_written); - json_object_add_value_uint128(root, "media_units_written", media_units_written); - json_object_add_value_uint128(root, "host_read_cmds", host_read_cmds); - json_object_add_value_uint128(root, "host_write_cmds", host_write_cmds); - json_object_add_value_uint128(root, "media_data_integrity_err", media_data_integrity_err); - json_object_add_value_uint128(root, "num_err_info_log_entries", num_err_info_log_entries); - json_object_add_value_uint128(root, "total_end_grp_cap", total_end_grp_cap); - json_object_add_value_uint128(root, "unalloc_end_grp_cap", unalloc_end_grp_cap); - - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char *devname) { - int c, human = json_print_ops.flags & VERBOSE; - struct json_object *root; + struct json_object *r = json_create_object(); + int c; char key[21]; - unsigned int temperature = ((smart->temperature[1] << 8) | smart->temperature[0]); - nvme_uint128_t data_units_read = le128_to_cpu(smart->data_units_read); nvme_uint128_t data_units_written = le128_to_cpu(smart->data_units_written); nvme_uint128_t host_read_commands = le128_to_cpu(smart->host_reads); @@ -519,71 +643,56 @@ static void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid, nvme_uint128_t media_errors = le128_to_cpu(smart->media_errors); nvme_uint128_t num_err_log_entries = le128_to_cpu(smart->num_err_log_entries); - root = json_create_object(); - - if (human) { + if (human()) { struct json_object *crt = json_create_object(); - json_object_add_value_int(crt, "value", smart->critical_warning); - json_object_add_value_int(crt, "available_spare", smart->critical_warning & 0x01); - json_object_add_value_int(crt, "temp_threshold", (smart->critical_warning & 0x02) >> 1); - json_object_add_value_int(crt, "reliability_degraded", (smart->critical_warning & 0x04) >> 2); - json_object_add_value_int(crt, "ro", (smart->critical_warning & 0x08) >> 3); - json_object_add_value_int(crt, "vmbu_failed", (smart->critical_warning & 0x10) >> 4); - json_object_add_value_int(crt, "pmr_ro", (smart->critical_warning & 0x20) >> 5); + obj_add_int(crt, "value", smart->critical_warning); + obj_add_int(crt, "available_spare", smart->critical_warning & 1); + obj_add_int(crt, "temp_threshold", (smart->critical_warning & 2) >> 1); + obj_add_int(crt, "reliability_degraded", (smart->critical_warning & 4) >> 2); + obj_add_int(crt, "ro", (smart->critical_warning & 8) >> 3); + obj_add_int(crt, "vmbu_failed", (smart->critical_warning & 0x10) >> 4); + obj_add_int(crt, "pmr_ro", (smart->critical_warning & 0x20) >> 5); - json_object_add_value_object(root, "critical_warning", crt); - } else - json_object_add_value_int(root, "critical_warning", - smart->critical_warning); + obj_add_obj(r, "critical_warning", crt); + } else { + obj_add_int(r, "critical_warning", smart->critical_warning); + } - json_object_add_value_int(root, "temperature", temperature); - json_object_add_value_int(root, "avail_spare", smart->avail_spare); - json_object_add_value_int(root, "spare_thresh", smart->spare_thresh); - json_object_add_value_int(root, "percent_used", smart->percent_used); - json_object_add_value_int(root, "endurance_grp_critical_warning_summary", - smart->endu_grp_crit_warn_sumry); - json_object_add_value_uint128(root, "data_units_read", data_units_read); - json_object_add_value_uint128(root, "data_units_written", - data_units_written); - json_object_add_value_uint128(root, "host_read_commands", - host_read_commands); - json_object_add_value_uint128(root, "host_write_commands", - host_write_commands); - json_object_add_value_uint128(root, "controller_busy_time", - controller_busy_time); - json_object_add_value_uint128(root, "power_cycles", power_cycles); - json_object_add_value_uint128(root, "power_on_hours", power_on_hours); - json_object_add_value_uint128(root, "unsafe_shutdowns", unsafe_shutdowns); - json_object_add_value_uint128(root, "media_errors", media_errors); - json_object_add_value_uint128(root, "num_err_log_entries", - num_err_log_entries); - json_object_add_value_uint(root, "warning_temp_time", - le32_to_cpu(smart->warning_temp_time)); - json_object_add_value_uint(root, "critical_comp_time", - le32_to_cpu(smart->critical_comp_time)); + obj_add_int(r, "temperature", temperature); + obj_add_int(r, "avail_spare", smart->avail_spare); + obj_add_int(r, "spare_thresh", smart->spare_thresh); + obj_add_int(r, "percent_used", smart->percent_used); + obj_add_int(r, "endurance_grp_critical_warning_summary", smart->endu_grp_crit_warn_sumry); + obj_add_uint128(r, "data_units_read", data_units_read); + obj_add_uint128(r, "data_units_written", data_units_written); + obj_add_uint128(r, "host_read_commands", host_read_commands); + obj_add_uint128(r, "host_write_commands", host_write_commands); + obj_add_uint128(r, "controller_busy_time", controller_busy_time); + obj_add_uint128(r, "power_cycles", power_cycles); + obj_add_uint128(r, "power_on_hours", power_on_hours); + obj_add_uint128(r, "unsafe_shutdowns", unsafe_shutdowns); + obj_add_uint128(r, "media_errors", media_errors); + obj_add_uint128(r, "num_err_log_entries", num_err_log_entries); + obj_add_uint(r, "warning_temp_time", le32_to_cpu(smart->warning_temp_time)); + obj_add_uint(r, "critical_comp_time", le32_to_cpu(smart->critical_comp_time)); - for (c=0; c < 8; c++) { + for (c = 0; c < 8; c++) { __s32 temp = le16_to_cpu(smart->temp_sensor[c]); if (temp == 0) continue; + sprintf(key, "temperature_sensor_%d",c+1); - json_object_add_value_int(root, key, temp); + obj_add_int(r, key, temp); } - json_object_add_value_uint(root, "thm_temp1_trans_count", - le32_to_cpu(smart->thm_temp1_trans_count)); - json_object_add_value_uint(root, "thm_temp2_trans_count", - le32_to_cpu(smart->thm_temp2_trans_count)); - json_object_add_value_uint(root, "thm_temp1_total_time", - le32_to_cpu(smart->thm_temp1_total_time)); - json_object_add_value_uint(root, "thm_temp2_total_time", - le32_to_cpu(smart->thm_temp2_total_time)); + obj_add_uint(r, "thm_temp1_trans_count", le32_to_cpu(smart->thm_temp1_trans_count)); + obj_add_uint(r, "thm_temp2_trans_count", le32_to_cpu(smart->thm_temp2_trans_count)); + obj_add_uint(r, "thm_temp1_total_time", le32_to_cpu(smart->thm_temp1_total_time)); + obj_add_uint(r, "thm_temp2_total_time", le32_to_cpu(smart->thm_temp2_total_time)); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_ana_log(struct nvme_ana_log *ana_log, const char *devname, @@ -592,25 +701,20 @@ static void json_ana_log(struct nvme_ana_log *ana_log, const char *devname, int offset = sizeof(struct nvme_ana_log); struct nvme_ana_log *hdr = ana_log; struct nvme_ana_group_desc *ana_desc; - struct json_object *desc_list; + struct json_object *desc_list = json_create_array(); struct json_object *ns_list; struct json_object *desc; struct json_object *nsid; - struct json_object *root; + struct json_object *r = json_create_object(); size_t nsid_buf_size; void *base = ana_log; __u32 nr_nsids; int i, j; - root = json_create_object(); - json_object_add_value_string(root, - "Asymmetric Namespace Access Log for NVMe device", - devname); - json_object_add_value_uint64(root, "chgcnt", - le64_to_cpu(hdr->chgcnt)); - json_object_add_value_uint(root, "ngrps", le16_to_cpu(hdr->ngrps)); + obj_add_str(r, "Asymmetric Namespace Access Log for NVMe device", devname); + obj_add_uint64(r, "chgcnt", le64_to_cpu(hdr->chgcnt)); + obj_add_uint(r, "ngrps", le16_to_cpu(hdr->ngrps)); - desc_list = json_create_array(); for (i = 0; i < le16_to_cpu(ana_log->ngrps); i++) { desc = json_create_object(); ana_desc = base + offset; @@ -618,261 +722,696 @@ static void json_ana_log(struct nvme_ana_log *ana_log, const char *devname, nsid_buf_size = nr_nsids * sizeof(__le32); offset += sizeof(*ana_desc); - json_object_add_value_uint(desc, "grpid", - le32_to_cpu(ana_desc->grpid)); - json_object_add_value_uint(desc, "nnsids", - le32_to_cpu(ana_desc->nnsids)); - json_object_add_value_uint(desc, "chgcnt", - le64_to_cpu(ana_desc->chgcnt)); - json_object_add_value_string(desc, "state", - nvme_ana_state_to_string(ana_desc->state)); + obj_add_uint(desc, "grpid", le32_to_cpu(ana_desc->grpid)); + obj_add_uint(desc, "nnsids", le32_to_cpu(ana_desc->nnsids)); + obj_add_uint64(desc, "chgcnt", le64_to_cpu(ana_desc->chgcnt)); + obj_add_str(desc, "state", nvme_ana_state_to_string(ana_desc->state)); ns_list = json_create_array(); for (j = 0; j < le32_to_cpu(ana_desc->nnsids); j++) { nsid = json_create_object(); - json_object_add_value_uint(nsid, "nsid", - le32_to_cpu(ana_desc->nsids[j])); - json_array_add_value_object(ns_list, nsid); + obj_add_uint(nsid, "nsid", le32_to_cpu(ana_desc->nsids[j])); + array_add_obj(ns_list, nsid); } - json_object_add_value_array(desc, "NSIDS", ns_list); + obj_add_array(desc, "NSIDS", ns_list); offset += nsid_buf_size; - json_array_add_value_object(desc_list, desc); + array_add_obj(desc_list, desc); } - json_object_add_value_array(root, "ANA DESC LIST ", desc_list); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + obj_add_array(r, "ANA DESC LIST ", desc_list); + + json_print(r); +} + +static void json_select_result(enum nvme_features_id fid, __u32 result) +{ + struct json_object *r = json_r ? json_r : json_create_object(); + char json_str[STR_LEN]; + struct json_object *feature = json_create_array(); + + if (result & 0x1) + array_add_str(feature, "saveable"); + if (result & 0x2) + array_add_str(feature, "per-namespace"); + if (result & 0x4) + array_add_str(feature, "changeable"); + + sprintf(json_str, "Feature: %#0*x: select", fid ? 4 : 2, fid); + obj_add_array(r, json_str, feature); + + json_print(r); } static void json_self_test_log(struct nvme_self_test_log *self_test, __u8 dst_entries, __u32 size, const char *devname) { struct json_object *valid_attrs; - struct json_object *root; - struct json_object *valid; + struct json_object *r = json_create_object(); + struct json_object *valid = json_create_array(); int i; - __u32 num_entries; + __u32 num_entries = min(dst_entries, NVME_LOG_ST_MAX_RESULTS); - root = json_create_object(); - json_object_add_value_int(root, "Current Device Self-Test Operation", - self_test->current_operation); - json_object_add_value_int(root, "Current Device Self-Test Completion", - self_test->completion); - valid = json_create_array(); + obj_add_int(r, "Current Device Self-Test Operation", self_test->current_operation); + obj_add_int(r, "Current Device Self-Test Completion", self_test->completion); - num_entries = min(dst_entries, NVME_LOG_ST_MAX_RESULTS); for (i = 0; i < num_entries; i++) { valid_attrs = json_create_object(); - json_object_add_value_int(valid_attrs, "Self test result", - self_test->result[i].dsts & 0xf); + obj_add_int(valid_attrs, "Self test result", self_test->result[i].dsts & 0xf); + if ((self_test->result[i].dsts & 0xf) == 0xf) goto add; - json_object_add_value_int(valid_attrs, "Self test code", + + obj_add_int(valid_attrs, "Self test code", self_test->result[i].dsts >> 4); - json_object_add_value_int(valid_attrs, "Segment number", + obj_add_int(valid_attrs, "Segment number", self_test->result[i].seg); - json_object_add_value_int(valid_attrs, "Valid Diagnostic Information", + obj_add_int(valid_attrs, "Valid Diagnostic Information", self_test->result[i].vdi); - json_object_add_value_uint64(valid_attrs, "Power on hours", - le64_to_cpu(self_test->result[i].poh)); + obj_add_uint64(valid_attrs, "Power on hours", + le64_to_cpu(self_test->result[i].poh)); + if (self_test->result[i].vdi & NVME_ST_VALID_DIAG_INFO_NSID) - json_object_add_value_uint(valid_attrs, "Namespace Identifier", - le32_to_cpu(self_test->result[i].nsid)); - if (self_test->result[i].vdi & NVME_ST_VALID_DIAG_INFO_FLBA) { - json_object_add_value_uint64(valid_attrs, "Failing LBA", - le64_to_cpu(self_test->result[i].flba)); - } + obj_add_uint(valid_attrs, "Namespace Identifier", + le32_to_cpu(self_test->result[i].nsid)); + + if (self_test->result[i].vdi & NVME_ST_VALID_DIAG_INFO_FLBA) + obj_add_uint64(valid_attrs, "Failing LBA", + le64_to_cpu(self_test->result[i].flba)); + if (self_test->result[i].vdi & NVME_ST_VALID_DIAG_INFO_SCT) - json_object_add_value_int(valid_attrs, "Status Code Type", - self_test->result[i].sct); + obj_add_int(valid_attrs, "Status Code Type", self_test->result[i].sct); + if (self_test->result[i].vdi & NVME_ST_VALID_DIAG_INFO_SC) - json_object_add_value_int(valid_attrs, "Status Code", - self_test->result[i].sc); - json_object_add_value_int(valid_attrs, "Vendor Specific", - (self_test->result[i].vs[1] << 8) | - (self_test->result[i].vs[0])); + obj_add_int(valid_attrs, "Status Code", self_test->result[i].sc); + + obj_add_int(valid_attrs, "Vendor Specific", + self_test->result[i].vs[1] << 8 | self_test->result[i].vs[0]); + add: - json_array_add_value_object(valid, valid_attrs); + array_add_obj(valid, valid_attrs); } - json_object_add_value_array(root, "List of Valid Reports", valid); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + + obj_add_array(r, "List of Valid Reports", valid); + + json_print(r); +} + +static void json_registers_cap(struct nvme_bar_cap *cap, struct json_object *r) +{ + char json_str[STR_LEN]; + struct json_object *cssa = json_create_array(); + struct json_object *csso = json_create_object(); + struct json_object *amsa = json_create_array(); + struct json_object *amso = json_create_object(); + + sprintf(json_str, "%"PRIx64"", *(uint64_t *)cap); + obj_add_str(r, "cap", json_str); + + obj_add_str(r, "Controller Ready With Media Support (CRWMS)", + cap->crwms ? "Supported" : "Not supported"); + obj_add_str(r, "Controller Ready Independent of Media Support (CRIMS)", + cap->crims ? "Supported" : "Not supported"); + obj_add_str(r, "NVM Subsystem Shutdown Supported (NSSS)", + cap->nsss ? "Supported" : "Not supported"); + obj_add_str(r, "Controller Memory Buffer Supported (CMBS):", + cap->cmbs ? "Supported" : "Not supported"); + obj_add_str(r, "Persistent Memory Region Supported (PMRS)", + cap->pmrs ? "Supported" : "Not supported"); + + sprintf(json_str, "%u bytes", 1 << (12 + cap->mpsmax)); + obj_add_str(r, "Memory Page Size Maximum (MPSMAX)", json_str); + + sprintf(json_str, "%u bytes", 1 << (12 + cap->mpsmin)); + obj_add_str(r, "Memory Page Size Minimum (MPSMIN)", json_str); + + obj_add_str(r, "Controller Power Scope (CPS)", !cap->cps ? "Not Reported" : cap->cps == 1 ? + "Controller scope" : cap->cps == 2 ? "Domain scope" : "NVM subsystem scope"); + obj_add_str(r, "Boot Partition Support (BPS)", cap->bps ? "Yes" : "No"); + + obj_add_array(r, "Command Sets Supported (CSS)", cssa); + obj_add_str(csso, "NVM command set", cap->css & 1 ? "Supported" : "Not supported"); + obj_add_str(csso, "One or more I/O Command Sets", + cap->css & 0x40 ? "Supported" : "Not supported"); + obj_add_str(csso, cap->css & 0x80 ? "Only Admin Command Set" : "I/O Command Set", + "Supported"); + array_add_obj(cssa, csso); + + obj_add_str(r, "NVM Subsystem Reset Supported (NSSRS)", cap->nssrs ? "Yes" : "No"); + + sprintf(json_str, "%u bytes", 1 << (2 + cap->dstrd)); + obj_add_str(r, "Doorbell Stride (DSTRD)", json_str); + + sprintf(json_str, "%u ms", MS500_TO_MS(cap->to)); + obj_add_str(r, "Timeout (TO)", json_str); + + obj_add_array(r, "Arbitration Mechanism Supported (AMS)", amsa); + obj_add_str(amso, "Weighted Round Robin with Urgent Priority Class", + cap->ams & 2 ? "Supported" : "Not supported"); + array_add_obj(amsa, amso); + + obj_add_str(r, "Contiguous Queues Required (CQR)", cap->cqr ? "Yes" : "No"); + obj_add_uint(r, "Maximum Queue Entries Supported (MQES)", cap->mqes + 1); +} + +static void json_registers_version(__u32 vs, struct json_object *r) +{ + char json_str[STR_LEN]; + + sprintf(json_str, "%x", vs); + obj_add_str(r, "Version", json_str); + + sprintf(json_str, "%d.%d", (vs & 0xffff0000) >> 16, (vs & 0x0000ff00) >> 8); + obj_add_str(r, "NVMe specification", json_str); +} + +static void json_registers_intms(__u32 intms, struct json_object *r) +{ + obj_add_uint_x(r, "intms", intms); + + obj_add_uint_x(r, "Interrupt Vector Mask Set (IVMS)", intms); +} + +static void json_registers_intmc(__u32 intmc, struct json_object *r) +{ + obj_add_uint_x(r, "intmc", intmc); + + obj_add_uint_x(r, "Interrupt Vector Mask Set (IVMC)", intmc); +} + +static void json_registers_cc_ams(__u8 ams, struct json_object *r) +{ + char json_str[STR_LEN]; + + switch (ams) { + case 0: + sprintf(json_str, "Round Robin"); + break; + case 1: + sprintf(json_str, "Weighted Round Robin with Urgent Priority Class"); + break; + case 7: + sprintf(json_str, "Vendor Specific"); + break; + default: + sprintf(json_str, "%s", "Reserved"); + break; + } + + obj_add_str(r, "Arbitration Mechanism Selected (AMS)", json_str); +} + +static void json_registers_cc_shn(__u8 shn, struct json_object *r) +{ + char json_str[STR_LEN]; + + switch (shn) { + case 0: + sprintf(json_str, "No notification; no effect"); + break; + case 1: + sprintf(json_str, "Normal shutdown notification"); + break; + case 2: + sprintf(json_str, "Abrupt shutdown notification"); + break; + default: + sprintf(json_str, "%s", "Reserved"); + break; + } + + obj_add_str(r, "Shutdown Notification (SHN)", json_str); +} + +static void json_registers_cc(__u32 cc, struct json_object *r) +{ + char json_str[STR_LEN]; + + sprintf(json_str, "%x", cc); + obj_add_str(r, "cc", json_str); + + 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))); + 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))); + 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); + + sprintf(json_str, "%u bytes", POWER_OF_TWO(12 + NVME_GET(cc, CC_MPS))); + 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"); +} + +static void json_registers_csts_shst(__u8 shst, struct json_object *r) +{ + char json_str[STR_LEN]; + + switch (shst) { + case 0: + sprintf(json_str, "Normal operation (no shutdown has been requested)"); + break; + case 1: + sprintf(json_str, "Shutdown processing occurring"); + break; + case 2: + sprintf(json_str, "Shutdown processing complete"); + break; + default: + sprintf(json_str, "%s", "Reserved"); + break; + } + + obj_add_str(r, "Shutdown Status (SHST)", json_str); +} + +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"); + + json_registers_csts_shst((csts & 0xc) >> 2, r); + + obj_add_str(r, "Controller Fatal Status (CFS)", csts & 2 ? "True" : "False"); + obj_add_str(r, "Ready (RDY)", csts & 1 ? "Yes" : "No"); +} + +static void json_registers_nssr(__u32 nssr, struct json_object *r) +{ + obj_add_uint_x(r, "nssr", nssr); + obj_add_uint(r, "NVM Subsystem Reset Control (NSSRC)", nssr); +} + +static void json_registers_crto(__u32 crto, struct json_object *r) +{ + obj_add_uint_x(r, "crto", crto); + + obj_add_int_secs(r, "CRIMT", MS500_TO_SEC(NVME_CRTO_CRIMT(crto))); + obj_add_int_secs(r, "CRWMT", MS500_TO_SEC(NVME_CRTO_CRWMT(crto))); +} + +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); +} + +static void json_registers_asq(uint64_t asq, struct json_object *r) +{ + obj_add_prix64(r, "asq", asq); + obj_add_prix64(r, "Admin Submission Queue Base (ASQB)", asq); +} + +static void json_registers_acq(uint64_t acq, struct json_object *r) +{ + obj_add_prix64(r, "acq", acq); + obj_add_prix64(r, "Admin Completion Queue Base (ACQB)", acq); +} + +static void json_registers_cmbloc(uint32_t cmbloc, void *bar, struct json_object *r) +{ + uint32_t cmbsz = mmio_read32(bar + NVME_REG_CMBSZ); + + obj_add_uint_x(r, "cmbloc", cmbloc); + + if (!cmbsz) { + obj_add_result(r, "Controller Memory Buffer feature is not supported"); + return; + } + + obj_add_uint_0x(r, "Offset (OFST) (See cmbsz.szu for granularity)", + (cmbloc & 0xfffff000) >> 12); + obj_add_int(r, "CMB Queue Dword Alignment (CQDA)", (cmbloc & 0x100) >> 8); + obj_add_str(r, "CMB Data Metadata Mixed Memory Support (CDMMMS)", + (cmbloc & 0x00000080) >> 7 ? "Not enforced" : "Enforced"); + obj_add_str(r, "CMB Data Pointer and Command Independent Locations Support (CDPCILS)", + (cmbloc & 0x00000040) >> 6 ? "Not enforced" : "Enforced"); + obj_add_str(r, "CMB Data Pointer Mixed Locations Support (CDPMLS)", + (cmbloc & 0x00000020) >> 5 ? "Not enforced" : "Enforced"); + obj_add_str(r, "CMB Queue Physically Discontiguous Support (CQPDS)", + (cmbloc & 0x00000010) >> 4 ? "Not enforced" : "Enforced"); + obj_add_str(r, "CMB Queue Mixed Memory Support (CQMMS)", + (cmbloc & 0x00000008) >> 3 ? "Not enforced" : "Enforced"); + obj_add_uint_0x(r, "Base Indicator Register (BIR)", (cmbloc & 0x00000007)); +} + +static void json_registers_cmbsz(uint32_t cmbsz, struct json_object *r) +{ + obj_add_uint_x(r, "cmbsz", cmbsz); + + if (!cmbsz) { + obj_add_result(r, "Controller Memory Buffer feature is not supported"); + return; + } + + obj_add_uint(r, "Size (SZ)", (cmbsz & 0xfffff000) >> 12); + obj_add_str(r, "Size Units (SZU)", nvme_register_szu_to_string((cmbsz & 0xf00) >> 8)); + obj_add_str(r, "Write Data Support (WDS)", cmbsz & 0x10 ? "Supported" : "Not supported"); + obj_add_str(r, "Read Data Support (RDS)", cmbsz & 8 ? "Supported" : "Not supported"); + obj_add_str(r, "PRP SGL List Support (LISTS)", cmbsz & 4 ? "Supported" : "Not supported"); + obj_add_str(r, "Completion Queue Support (CQS)", cmbsz & 2 ? "Supported" : "Not supported"); + obj_add_str(r, "Submission Queue Support (SQS)", cmbsz & 1 ? "Supported" : "Not supported"); +} + +static void json_registers_bpinfo_brs(__u8 brs, struct json_object *r) +{ + char json_str[STR_LEN]; + + switch (brs) { + case 0: + sprintf(json_str, "No Boot Partition read operation requested"); + break; + case 1: + sprintf(json_str, "Boot Partition read in progress"); + break; + case 2: + sprintf(json_str, "Boot Partition read completed successfully"); + break; + case 3: + sprintf(json_str, "Error completing Boot Partition read"); + break; + default: + sprintf(json_str, "%s", "Invalid"); + break; + } + + obj_add_str(r, "Boot Read Status (BRS)", json_str); +} + +static void json_registers_bpinfo(uint32_t bpinfo, struct json_object *r) +{ + obj_add_uint_x(r, "bpinfo", bpinfo); + + obj_add_uint(r, "Active Boot Partition ID (ABPID)", (bpinfo & 0x80000000) >> 31); + json_registers_bpinfo_brs((bpinfo & 0x3000000) >> 24, r); + obj_add_uint(r, "Boot Partition Size (BPSZ)", bpinfo & 0x7fff); +} + +static void json_registers_bprsel(uint32_t bprsel, struct json_object *r) +{ + obj_add_uint_x(r, "bprsel", bprsel); + + obj_add_uint(r, "Boot Partition Identifier (BPID)", (bprsel & 0x80000000) >> 31); + obj_add_uint_x(r, "Boot Partition Read Offset (BPROF)", (bprsel & 0x3ffffc00) >> 10); + obj_add_uint_x(r, "Boot Partition Read Size (BPRSZ)", bprsel & 0x3ff); +} + +static void json_registers_bpmbl(uint64_t bpmbl, struct json_object *r) +{ + obj_add_prix64(r, "bpmbl", bpmbl); + + obj_add_prix64(r, "Boot Partition Memory Buffer Base Address (BMBBA)", bpmbl); +} + +static void json_registers_cmbmsc(uint64_t cmbmsc, struct json_object *r) +{ + obj_add_prix64(r, "cmbmsc", cmbmsc); + + obj_add_prix64(r, "Controller Base Address (CBA)", (cmbmsc & 0xfffffffffffff000) >> 12); + obj_add_prix64(r, "Controller Memory Space Enable (CMSE)", (cmbmsc & 2) >> 1); + obj_add_str(r, "Capabilities Registers Enabled (CRE)", + cmbmsc & 1 ? "Enabled" : "Not enabled"); +} + +static void json_registers_cmbsts(uint32_t cmbsts , struct json_object *r) +{ + obj_add_uint_x(r, "cmbsts", cmbsts); + + obj_add_uint_x(r, "Controller Base Address Invalid (CBAI)", cmbsts & 1); +} + +static void json_registers_pmrcap(uint32_t pmrcap, struct json_object *r) +{ + obj_add_uint_x(r, "pmrcap", pmrcap); + + obj_add_str(r, "Controller Memory Space Supported (CMSS)", + ((pmrcap & 0x01000000) >> 24) ? "Supported" : "Not supported"); + obj_add_uint_x(r, "Persistent Memory Region Timeout (PMRTO)", (pmrcap & 0xff0000) >> 16); + obj_add_uint_x(r, "Persistent Memory Region Write Barrier Mechanisms (PMRWBM)", + (pmrcap & 0x3c00) >> 10); + obj_add_str(r, "Persistent Memory Region Time Units (PMRTU)", + (pmrcap & 0x300) >> 8 ? "minutes" : "500 milliseconds"); + obj_add_uint_x(r, "Base Indicator Register (BIR)", (pmrcap & 0xe0) >> 5); + obj_add_str(r, "Write Data Support (WDS)", pmrcap & 0x10 ? "Supported" : "Not supported"); + obj_add_str(r, "Read Data Support (RDS)", pmrcap & 8 ? "Supported" : "Not supported"); +} + +static void json_registers_pmrctl(uint32_t pmrctl, struct json_object *r) +{ + obj_add_uint_x(r, "pmrctl", pmrctl); + + obj_add_str(r, "Enable (EN)", pmrctl & 1 ? "Ready" : "Disabled"); +} + +static void json_registers_pmrsts(uint32_t pmrsts, void *bar, 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)); + obj_add_str(r, "Not Ready (NRDY)", + !(pmrsts & 0x100) && (pmrctl & 1) ? "Ready" : "Not ready"); + obj_add_uint_x(r, "Error (ERR)", pmrsts & 0xff); +} + +static void json_registers_pmrebs(uint32_t pmrebs, struct json_object *r) +{ + obj_add_uint_x(r, "pmrebs", pmrebs); + + 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)); +} + +static void json_registers_pmrswtp(uint32_t pmrswtp, struct json_object *r) +{ + obj_add_uint_x(r, "pmrswtp", pmrswtp); + + 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)); +} + +static void json_registers_pmrmscl(uint32_t pmrmscl, struct json_object *r) +{ + obj_add_uint_nx(r, "pmrmscl", pmrmscl); + + obj_add_uint_nx(r, "Controller Base Address (CBA)", (pmrmscl & 0xfffff000) >> 12); + obj_add_uint_nx(r, "Controller Memory Space Enable (CMSE)", (pmrmscl & 2) >> 1); +} + +static void json_registers_pmrmscu(uint32_t pmrmscu, struct json_object *r) +{ + obj_add_uint_nx(r, "pmrmscu", pmrmscu); + + obj_add_uint_nx(r, "Controller Base Address (CBA)", pmrmscu); +} + +static void json_registers_unknown(int offset, uint64_t value64, struct json_object *r) +{ + obj_add_uint_02x(r, "unknown property", offset); + obj_add_str(r, "name", nvme_register_to_string(offset)); + obj_add_prix64(r, "value", value64); +} + +static void json_single_property_human(int offset, uint64_t value64, struct json_object *r) +{ + uint32_t value32 = (uint32_t)value64; + + switch (offset) { + case NVME_REG_CAP: + json_registers_cap((struct nvme_bar_cap *)&value64, r); + break; + case NVME_REG_VS: + json_registers_version(value32, r); + break; + case NVME_REG_CC: + json_registers_cc(value32, r); + break; + case NVME_REG_CSTS: + json_registers_csts(value32, r); + break; + case NVME_REG_NSSR: + json_registers_nssr(value32, r); + break; + case NVME_REG_CRTO: + json_registers_crto(value32, r); + break; + default: + json_registers_unknown(offset, value64, r); + break; + } +} + +static void json_single_property(int offset, uint64_t value64) +{ + struct json_object *r = json_create_object(); + char json_str[STR_LEN]; + uint32_t value32 = (uint32_t)value64; + + if (human()) { + json_single_property_human(offset, value64, r); + } else { + sprintf(json_str, "0x%02x", offset); + obj_add_str(r, "property", json_str); + + obj_add_str(r, "name", nvme_register_to_string(offset)); + + if (nvme_is_64bit_reg(offset)) + sprintf(json_str, "%"PRIx64"", value64); + else + sprintf(json_str, "%x", value32); + + obj_add_str(r, "value", json_str); + } + + json_print(r); } struct json_object* json_effects_log(enum nvme_csi csi, struct nvme_cmd_effects_log *effects_log) { - struct json_object *root; - struct json_object *acs; - struct json_object *iocs; + struct json_object *r = json_create_object(); + struct json_object *acs = json_create_object(); + struct json_object *iocs = json_create_object(); unsigned int opcode; char key[128]; __u32 effect; - root = json_create_object(); - json_object_add_value_uint(root, "command_set_identifier", csi); + obj_add_uint(r, "command_set_identifier", csi); - acs = json_create_object(); for (opcode = 0; opcode < 256; opcode++) { effect = le32_to_cpu(effects_log->acs[opcode]); if (effect & NVME_CMD_EFFECTS_CSUPP) { sprintf(key, "ACS_%u (%s)", opcode, nvme_cmd_to_string(1, opcode)); - json_object_add_value_uint(acs, key, effect); + obj_add_uint(acs, key, effect); } } - json_object_add_value_object(root, "admin_cmd_set", acs); + obj_add_obj(r, "admin_cmd_set", acs); - iocs = json_create_object(); for (opcode = 0; opcode < 256; opcode++) { effect = le32_to_cpu(effects_log->iocs[opcode]); if (effect & NVME_CMD_EFFECTS_CSUPP) { sprintf(key, "IOCS_%u (%s)", opcode, nvme_cmd_to_string(0, opcode)); - json_object_add_value_uint(iocs, key, effect); + obj_add_uint(iocs, key, effect); } } - json_object_add_value_object(root, "io_cmd_set", iocs); - return root; + obj_add_obj(r, "io_cmd_set", iocs); + return r; } static void json_effects_log_list(struct list_head *list) { - struct json_object *json_list; + struct json_object *r = json_create_array(); nvme_effects_log_node_t *node; - json_list = json_create_array(); - list_for_each(list, node, node) { struct json_object *json_page = json_effects_log(node->csi, &node->effects); - json_array_add_value_object(json_list, json_page); + array_add_obj(r, json_page); } - json_print_object(json_list, NULL); - printf("\n"); - json_free_object(json_list); + json_print(r); } static void json_sanitize_log(struct nvme_sanitize_log_page *sanitize_log, const char *devname) { - struct json_object *root; - struct json_object *dev; - struct json_object *sstat; + struct json_object *r = json_create_object(); + struct json_object *dev = json_create_object(); + struct json_object *sstat = json_create_object(); const char *status_str; char str[128]; __u16 status = le16_to_cpu(sanitize_log->sstat); - root = json_create_object(); - dev = json_create_object(); - sstat = json_create_object(); - - json_object_add_value_int(dev, "sprog", - le16_to_cpu(sanitize_log->sprog)); - json_object_add_value_int(sstat, "global_erased", - (status & NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED) >> 8); - json_object_add_value_int(sstat, "no_cmplted_passes", - (status >> NVME_SANITIZE_SSTAT_COMPLETED_PASSES_SHIFT) & - NVME_SANITIZE_SSTAT_COMPLETED_PASSES_MASK); + obj_add_int(dev, "sprog", le16_to_cpu(sanitize_log->sprog)); + obj_add_int(sstat, "global_erased", (status & NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED) >> 8); + obj_add_int(sstat, "no_cmplted_passes", + (status >> NVME_SANITIZE_SSTAT_COMPLETED_PASSES_SHIFT) & + NVME_SANITIZE_SSTAT_COMPLETED_PASSES_MASK); status_str = nvme_sstat_status_to_string(status); sprintf(str, "(%d) %s", status & NVME_SANITIZE_SSTAT_STATUS_MASK, status_str); - json_object_add_value_string(sstat, "status", str); + obj_add_str(sstat, status_str, str); - json_object_add_value_object(dev, "sstat", sstat); - json_object_add_value_uint(dev, "cdw10_info", - le32_to_cpu(sanitize_log->scdw10)); - json_object_add_value_uint(dev, "time_over_write", - le32_to_cpu(sanitize_log->eto)); - json_object_add_value_uint(dev, "time_block_erase", - le32_to_cpu(sanitize_log->etbe)); - json_object_add_value_uint(dev, "time_crypto_erase", - le32_to_cpu(sanitize_log->etce)); + obj_add_obj(dev, "sstat", sstat); + obj_add_uint(dev, "cdw10_info", le32_to_cpu(sanitize_log->scdw10)); + obj_add_uint(dev, "time_over_write", le32_to_cpu(sanitize_log->eto)); + obj_add_uint(dev, "time_block_erase", le32_to_cpu(sanitize_log->etbe)); + obj_add_uint(dev, "time_crypto_erase", le32_to_cpu(sanitize_log->etce)); + obj_add_uint(dev, "time_over_write_no_dealloc", le32_to_cpu(sanitize_log->etond)); + obj_add_uint(dev, "time_block_erase_no_dealloc", le32_to_cpu(sanitize_log->etbend)); + obj_add_uint(dev, "time_crypto_erase_no_dealloc", le32_to_cpu(sanitize_log->etcend)); - json_object_add_value_uint(dev, "time_over_write_no_dealloc", - le32_to_cpu(sanitize_log->etond)); - json_object_add_value_uint(dev, "time_block_erase_no_dealloc", - le32_to_cpu(sanitize_log->etbend)); - json_object_add_value_uint(dev, "time_crypto_erase_no_dealloc", - le32_to_cpu(sanitize_log->etcend)); + obj_add_obj(r, devname, dev); - json_object_add_value_object(root, devname, dev); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_predictable_latency_per_nvmset( struct nvme_nvmset_predictable_lat_log *plpns_log, __u16 nvmset_id, const char *devname) { - struct json_object *root; + struct json_object *r = json_create_object(); - root = json_create_object(); - json_object_add_value_uint(root, "nvmset_id", - le16_to_cpu(nvmset_id)); - json_object_add_value_uint(root, "status", - plpns_log->status); - json_object_add_value_uint(root, "event_type", - le16_to_cpu(plpns_log->event_type)); - json_object_add_value_uint64(root, "dtwin_reads_typical", - le64_to_cpu(plpns_log->dtwin_rt)); - json_object_add_value_uint64(root, "dtwin_writes_typical", - le64_to_cpu(plpns_log->dtwin_wt)); - json_object_add_value_uint64(root, "dtwin_time_maximum", - le64_to_cpu(plpns_log->dtwin_tmax)); - json_object_add_value_uint64(root, "ndwin_time_minimum_high", - le64_to_cpu(plpns_log->ndwin_tmin_hi)); - json_object_add_value_uint64(root, "ndwin_time_minimum_low", - le64_to_cpu(plpns_log->ndwin_tmin_lo)); - json_object_add_value_uint64(root, "dtwin_reads_estimate", - le64_to_cpu(plpns_log->dtwin_re)); - json_object_add_value_uint64(root, "dtwin_writes_estimate", - le64_to_cpu(plpns_log->dtwin_we)); - json_object_add_value_uint64(root, "dtwin_time_estimate", - le64_to_cpu(plpns_log->dtwin_te)); + obj_add_uint(r, "nvmset_id", le16_to_cpu(nvmset_id)); + obj_add_uint(r, "status", plpns_log->status); + obj_add_uint(r, "event_type", le16_to_cpu(plpns_log->event_type)); + obj_add_uint64(r, "dtwin_reads_typical", le64_to_cpu(plpns_log->dtwin_rt)); + obj_add_uint64(r, "dtwin_writes_typical", le64_to_cpu(plpns_log->dtwin_wt)); + obj_add_uint64(r, "dtwin_time_maximum", le64_to_cpu(plpns_log->dtwin_tmax)); + obj_add_uint64(r, "ndwin_time_minimum_high", le64_to_cpu(plpns_log->ndwin_tmin_hi)); + obj_add_uint64(r, "ndwin_time_minimum_low", le64_to_cpu(plpns_log->ndwin_tmin_lo)); + obj_add_uint64(r, "dtwin_reads_estimate", le64_to_cpu(plpns_log->dtwin_re)); + obj_add_uint64(r, "dtwin_writes_estimate", le64_to_cpu(plpns_log->dtwin_we)); + obj_add_uint64(r, "dtwin_time_estimate", le64_to_cpu(plpns_log->dtwin_te)); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_predictable_latency_event_agg_log( struct nvme_aggregate_predictable_lat_event *pea_log, __u64 log_entries, __u32 size, const char *devname) { - struct json_object *root; + struct json_object *r = json_create_object(); struct json_object *valid_attrs; - struct json_object *valid; - __u64 num_iter; - __u64 num_entries; + struct json_object *valid = json_create_array(); + __u64 num_entries = le64_to_cpu(pea_log->num_entries); + __u64 num_iter = min(num_entries, log_entries); - root = json_create_object(); - num_entries = le64_to_cpu(pea_log->num_entries); - json_object_add_value_uint64(root, "num_entries_avail", - num_entries); - valid = json_create_array(); + obj_add_uint64(r, "num_entries_avail", num_entries); - num_iter = min(num_entries, log_entries); for (int i = 0; i < num_iter; i++) { valid_attrs = json_create_object(); - json_object_add_value_uint(valid_attrs, "entry", - le16_to_cpu(pea_log->entries[i])); - json_array_add_value_object(valid, valid_attrs); + obj_add_uint(valid_attrs, "entry", le16_to_cpu(pea_log->entries[i])); + array_add_obj(valid, valid_attrs); } - json_object_add_value_array(root, "list_of_entries", valid); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + + obj_add_array(r, "list_of_entries", valid); + + json_print(r); } -static void json_add_bitmap(int i, __u8 seb, struct json_object *root) +static void json_add_bitmap(int i, __u8 seb, struct json_object *r) { char evt_str[50]; char key[128]; @@ -883,589 +1422,587 @@ static void json_add_bitmap(int i, __u8 seb, struct json_object *root) if ((seb >> bit) & 0x1) snprintf(evt_str, sizeof(evt_str), "Support %s", nvme_pel_event_to_string(bit + i * 8)); - json_object_add_value_string(root, key, evt_str); + obj_add_str(r, key, evt_str); } } } - -static void json_persistent_event_log(void *pevent_log_info, __u8 action, - __u32 size, const char *devname) - +static void json_pevent_log_head(struct nvme_persistent_event_log *pevent_log_head, + struct json_object *r) { - struct json_object *root; - struct json_object *valid_attrs; - struct json_object *valid; - __u32 offset, por_info_len, por_info_list; - __u64 *fw_rev; - char key[128]; - char fw_str[50]; + int i; + char sn[sizeof(pevent_log_head->sn) + 1]; + char mn[sizeof(pevent_log_head->mn) + 1]; + char subnqn[sizeof(pevent_log_head->subnqn) + 1]; - struct nvme_smart_log *smart_event; - struct nvme_fw_commit_event *fw_commit_event; - struct nvme_time_stamp_change_event *ts_change_event; - struct nvme_power_on_reset_info_list *por_event; - struct nvme_nss_hw_err_event *nss_hw_err_event; - struct nvme_change_ns_event *ns_event; - struct nvme_format_nvm_start_event *format_start_event; - struct nvme_format_nvm_compln_event *format_cmpln_event; - struct nvme_sanitize_start_event *sanitize_start_event; - struct nvme_sanitize_compln_event *sanitize_cmpln_event; - struct nvme_thermal_exc_event *thermal_exc_event; - struct nvme_persistent_event_log *pevent_log_head; - struct nvme_persistent_event_entry *pevent_entry_head; + snprintf(sn, sizeof(sn), "%-.*s", (int)sizeof(pevent_log_head->sn), pevent_log_head->sn); + snprintf(mn, sizeof(mn), "%-.*s", (int)sizeof(pevent_log_head->mn), pevent_log_head->mn); + snprintf(subnqn, sizeof(subnqn), "%-.*s", (int)sizeof(pevent_log_head->subnqn), + pevent_log_head->subnqn); - root = json_create_object(); - valid = json_create_array(); + obj_add_uint(r, "log_id", pevent_log_head->lid); + obj_add_uint(r, "total_num_of_events", le32_to_cpu(pevent_log_head->tnev)); + obj_add_uint64(r, "total_log_len", le64_to_cpu(pevent_log_head->tll)); + obj_add_uint(r, "log_revision", pevent_log_head->rv); + obj_add_uint(r, "log_header_len", le16_to_cpu(pevent_log_head->lhl)); + obj_add_uint64(r, "timestamp", le64_to_cpu(pevent_log_head->ts)); + obj_add_uint128(r, "power_on_hours", le128_to_cpu(pevent_log_head->poh)); + obj_add_uint64(r, "power_cycle_count", le64_to_cpu(pevent_log_head->pcc)); + obj_add_uint(r, "pci_vid", le16_to_cpu(pevent_log_head->vid)); + obj_add_uint(r, "pci_ssvid", le16_to_cpu(pevent_log_head->ssvid)); + obj_add_str(r, "sn", sn); + obj_add_str(r, "mn", mn); + obj_add_str(r, "subnqn", subnqn); + obj_add_uint(r, "gen_number", le16_to_cpu(pevent_log_head->gen_number)); + obj_add_uint(r, "rci", le32_to_cpu(pevent_log_head->rci)); - offset = sizeof(*pevent_log_head); - if (size >= offset) { - pevent_log_head = pevent_log_info; - char sn[sizeof(pevent_log_head->sn) + 1], - mn[sizeof(pevent_log_head->mn) + 1], - subnqn[sizeof(pevent_log_head->subnqn) + 1]; - - snprintf(sn, sizeof(sn), "%-.*s", - (int)sizeof(pevent_log_head->sn), pevent_log_head->sn); - snprintf(mn, sizeof(mn), "%-.*s", - (int)sizeof(pevent_log_head->mn), pevent_log_head->mn); - snprintf(subnqn, sizeof(subnqn), "%-.*s", - (int)sizeof(pevent_log_head->subnqn), pevent_log_head->subnqn); - - json_object_add_value_uint(root, "log_id", - pevent_log_head->lid); - json_object_add_value_uint(root, "total_num_of_events", - le32_to_cpu(pevent_log_head->tnev)); - json_object_add_value_uint64(root, "total_log_len", - le64_to_cpu(pevent_log_head->tll)); - json_object_add_value_uint(root, "log_revision", - pevent_log_head->rv); - json_object_add_value_uint(root, "log_header_len", - le16_to_cpu(pevent_log_head->lhl)); - json_object_add_value_uint64(root, "timestamp", - le64_to_cpu(pevent_log_head->ts)); - json_object_add_value_uint128(root, "power_on_hours", - le128_to_cpu(pevent_log_head->poh)); - json_object_add_value_uint64(root, "power_cycle_count", - le64_to_cpu(pevent_log_head->pcc)); - json_object_add_value_uint(root, "pci_vid", - le16_to_cpu(pevent_log_head->vid)); - json_object_add_value_uint(root, "pci_ssvid", - le16_to_cpu(pevent_log_head->ssvid)); - json_object_add_value_string(root, "sn", sn); - json_object_add_value_string(root, "mn", mn); - json_object_add_value_string(root, "subnqn", subnqn); - json_object_add_value_uint(root, "gen_number", - le16_to_cpu(pevent_log_head->gen_number)); - json_object_add_value_uint(root, "rci", - le32_to_cpu(pevent_log_head->rci)); - for (int i = 0; i < 32; i++) { - if (pevent_log_head->seb[i] == 0) - continue; - json_add_bitmap(i, pevent_log_head->seb[i], root); - } - } else { - printf("No log data can be shown with this log len at least " \ - "512 bytes is required or can be 0 to read the complete "\ - "log page after context established\n"); - return; + for (i = 0; i < ARRAY_SIZE(pevent_log_head->seb); i++) { + if (!pevent_log_head->seb[i]) + continue; + json_add_bitmap(i, pevent_log_head->seb[i], r); } - for (int i = 0; i < le32_to_cpu(pevent_log_head->tnev); i++) { +} + +static void json_pel_smart_health(void *pevent_log_info, __u32 offset, + struct json_object *valid_attrs) +{ + char key[128]; + struct nvme_smart_log *smart_event = pevent_log_info + offset; + unsigned int temperature = (smart_event->temperature[1] << 8) | smart_event->temperature[0]; + nvme_uint128_t data_units_read = le128_to_cpu(smart_event->data_units_read); + nvme_uint128_t data_units_written = le128_to_cpu(smart_event->data_units_written); + nvme_uint128_t host_read_commands = le128_to_cpu(smart_event->host_reads); + nvme_uint128_t host_write_commands = le128_to_cpu(smart_event->host_writes); + nvme_uint128_t controller_busy_time = le128_to_cpu(smart_event->ctrl_busy_time); + nvme_uint128_t power_cycles = le128_to_cpu(smart_event->power_cycles); + nvme_uint128_t power_on_hours = le128_to_cpu(smart_event->power_on_hours); + nvme_uint128_t unsafe_shutdowns = le128_to_cpu(smart_event->unsafe_shutdowns); + nvme_uint128_t media_errors = le128_to_cpu(smart_event->media_errors); + nvme_uint128_t num_err_log_entries = le128_to_cpu(smart_event->num_err_log_entries); + int c; + __s32 temp; + + obj_add_int(valid_attrs, "critical_warning", smart_event->critical_warning); + obj_add_int(valid_attrs, "temperature", temperature); + obj_add_int(valid_attrs, "avail_spare", smart_event->avail_spare); + obj_add_int(valid_attrs, "spare_thresh", smart_event->spare_thresh); + obj_add_int(valid_attrs, "percent_used", smart_event->percent_used); + obj_add_int(valid_attrs, "endurance_grp_critical_warning_summary", + smart_event->endu_grp_crit_warn_sumry); + obj_add_uint128(valid_attrs, "data_units_read", data_units_read); + obj_add_uint128(valid_attrs, "data_units_written", data_units_written); + obj_add_uint128(valid_attrs, "host_read_commands", host_read_commands); + obj_add_uint128(valid_attrs, "host_write_commands", host_write_commands); + obj_add_uint128(valid_attrs, "controller_busy_time", controller_busy_time); + obj_add_uint128(valid_attrs, "power_cycles", power_cycles); + obj_add_uint128(valid_attrs, "power_on_hours", power_on_hours); + obj_add_uint128(valid_attrs, "unsafe_shutdowns", unsafe_shutdowns); + obj_add_uint128(valid_attrs, "media_errors", media_errors); + obj_add_uint128(valid_attrs, "num_err_log_entries", num_err_log_entries); + obj_add_uint(valid_attrs, "warning_temp_time", le32_to_cpu(smart_event->warning_temp_time)); + obj_add_uint(valid_attrs, "critical_comp_time", + le32_to_cpu(smart_event->critical_comp_time)); + + for (c = 0; c < 8; c++) { + temp = le16_to_cpu(smart_event->temp_sensor[c]); + if (!temp) + continue; + sprintf(key, "temperature_sensor_%d",c + 1); + obj_add_int(valid_attrs, key, temp); + } + + obj_add_uint(valid_attrs, "thm_temp1_trans_count", + le32_to_cpu(smart_event->thm_temp1_trans_count)); + obj_add_uint(valid_attrs, "thm_temp2_trans_count", + le32_to_cpu(smart_event->thm_temp2_trans_count)); + obj_add_uint(valid_attrs, "thm_temp1_total_time", + le32_to_cpu(smart_event->thm_temp1_total_time)); + obj_add_uint(valid_attrs, "thm_temp2_total_time", + le32_to_cpu(smart_event->thm_temp2_total_time)); +} + +static void json_pel_fw_commit(void *pevent_log_info, __u32 offset, struct json_object *valid_attrs) +{ + char fw_str[50]; + struct nvme_fw_commit_event *fw_commit_event = pevent_log_info + offset; + + snprintf(fw_str, sizeof(fw_str), "%"PRIu64" (%s)", le64_to_cpu(fw_commit_event->old_fw_rev), + util_fw_to_string((char *)&fw_commit_event->old_fw_rev)); + obj_add_str(valid_attrs, "old_fw_rev", fw_str); + snprintf(fw_str, sizeof(fw_str), "%"PRIu64" (%s)", le64_to_cpu(fw_commit_event->new_fw_rev), + util_fw_to_string((char *)&fw_commit_event->new_fw_rev)); + obj_add_str(valid_attrs, "new_fw_rev", fw_str); + obj_add_uint(valid_attrs, "fw_commit_action", fw_commit_event->fw_commit_action); + obj_add_uint(valid_attrs, "fw_slot", fw_commit_event->fw_slot); + obj_add_uint(valid_attrs, "sct_fw", fw_commit_event->sct_fw); + obj_add_uint(valid_attrs, "sc_fw", fw_commit_event->sc_fw); + obj_add_uint(valid_attrs, "vu_assign_fw_commit_rc", + le16_to_cpu(fw_commit_event->vndr_assign_fw_commit_rc)); +} + +static void json_pel_timestamp(void *pevent_log_info, __u32 offset, struct json_object *valid_attrs) +{ + struct nvme_time_stamp_change_event *ts_change_event = pevent_log_info + offset; + + obj_add_uint64(valid_attrs, "prev_ts", le64_to_cpu(ts_change_event->previous_timestamp)); + obj_add_uint64(valid_attrs, "ml_secs_since_reset", + le64_to_cpu(ts_change_event->ml_secs_since_reset)); +} + +static void json_pel_power_on_reset(void *pevent_log_info, __u32 offset, + struct json_object *valid_attrs, __le16 vsil, __le16 el) +{ + __u64 *fw_rev; + char fw_str[50]; + struct nvme_power_on_reset_info_list *por_event; + __u32 por_info_len = le16_to_cpu(el) - le16_to_cpu(vsil) - sizeof(*fw_rev); + __u32 por_info_list = por_info_len / sizeof(*por_event); + int i; + + fw_rev = pevent_log_info + offset; + snprintf(fw_str, sizeof(fw_str), "%"PRIu64" (%s)", le64_to_cpu(*fw_rev), + util_fw_to_string((char *)fw_rev)); + obj_add_str(valid_attrs, "fw_rev", fw_str); + + for (i = 0; i < por_info_list; i++) { + por_event = pevent_log_info + offset + sizeof(*fw_rev) + i * sizeof(*por_event); + obj_add_uint(valid_attrs, "ctrl_id", le16_to_cpu(por_event->cid)); + obj_add_uint(valid_attrs, "fw_act", por_event->fw_act); + obj_add_uint(valid_attrs, "op_in_prog", por_event->op_in_prog); + obj_add_uint(valid_attrs, "ctrl_power_cycle", + le32_to_cpu(por_event->ctrl_power_cycle)); + obj_add_uint64(valid_attrs, "power_on_ml_secs", + le64_to_cpu(por_event->power_on_ml_seconds)); + obj_add_uint64(valid_attrs, "ctrl_time_stamp", + le64_to_cpu(por_event->ctrl_time_stamp)); + } +} + +static void json_pel_nss_hw_error(void *pevent_log_info, __u32 offset, + struct json_object *valid_attrs) +{ + struct nvme_nss_hw_err_event *nss_hw_err_event = pevent_log_info + offset; + + obj_add_uint(valid_attrs, "nss_hw_err_code", + le16_to_cpu(nss_hw_err_event->nss_hw_err_event_code)); +} + +static void json_pel_change_ns(void *pevent_log_info, __u32 offset, struct json_object *valid_attrs) +{ + struct nvme_change_ns_event *ns_event = pevent_log_info + offset; + + obj_add_uint(valid_attrs, "nsmgt_cdw10", le32_to_cpu(ns_event->nsmgt_cdw10)); + obj_add_uint64(valid_attrs, "nsze", le64_to_cpu(ns_event->nsze)); + obj_add_uint64(valid_attrs, "nscap", le64_to_cpu(ns_event->nscap)); + obj_add_uint(valid_attrs, "flbas", ns_event->flbas); + obj_add_uint(valid_attrs, "dps", ns_event->dps); + obj_add_uint(valid_attrs, "nmic", ns_event->nmic); + obj_add_uint(valid_attrs, "ana_grp_id", le32_to_cpu(ns_event->ana_grp_id)); + obj_add_uint(valid_attrs, "nvmset_id", le16_to_cpu(ns_event->nvmset_id)); + obj_add_uint(valid_attrs, "nsid", le32_to_cpu(ns_event->nsid)); +} + +static void json_pel_format_start(void *pevent_log_info, __u32 offset, + struct json_object *valid_attrs) +{ + struct nvme_format_nvm_start_event *format_start_event = pevent_log_info + offset; + + obj_add_uint(valid_attrs, "nsid", le32_to_cpu(format_start_event->nsid)); + obj_add_uint(valid_attrs, "fna", format_start_event->fna); + obj_add_uint(valid_attrs, "format_nvm_cdw10", + le32_to_cpu(format_start_event->format_nvm_cdw10)); +} + +static void json_pel_format_completion(void *pevent_log_info, __u32 offset, + struct json_object *valid_attrs) +{ + struct nvme_format_nvm_compln_event *format_cmpln_event = pevent_log_info + offset; + + obj_add_uint(valid_attrs, "nsid", le32_to_cpu(format_cmpln_event->nsid)); + obj_add_uint(valid_attrs, "smallest_fpi", format_cmpln_event->smallest_fpi); + obj_add_uint(valid_attrs, "format_nvm_status", format_cmpln_event->format_nvm_status); + obj_add_uint(valid_attrs, "compln_info", le16_to_cpu(format_cmpln_event->compln_info)); + obj_add_uint(valid_attrs, "status_field", le32_to_cpu(format_cmpln_event->status_field)); +} +static void json_pel_sanitize_start(void *pevent_log_info, __u32 offset, + struct json_object *valid_attrs) +{ + struct nvme_sanitize_start_event *sanitize_start_event = pevent_log_info + offset; + + obj_add_uint(valid_attrs, "SANICAP", le32_to_cpu(sanitize_start_event->sani_cap)); + obj_add_uint(valid_attrs, "sani_cdw10", le32_to_cpu(sanitize_start_event->sani_cdw10)); + obj_add_uint(valid_attrs, "sani_cdw11", le32_to_cpu(sanitize_start_event->sani_cdw11)); +} + +static void json_pel_sanitize_completion(void *pevent_log_info, __u32 offset, + struct json_object *valid_attrs) +{ + struct nvme_sanitize_compln_event *sanitize_cmpln_event = pevent_log_info + offset; + + obj_add_uint(valid_attrs, "sani_prog", le16_to_cpu(sanitize_cmpln_event->sani_prog)); + obj_add_uint(valid_attrs, "sani_status", le16_to_cpu(sanitize_cmpln_event->sani_status)); + obj_add_uint(valid_attrs, "cmpln_info", le16_to_cpu(sanitize_cmpln_event->cmpln_info)); +} + +static void json_pel_thermal_excursion(void *pevent_log_info, __u32 offset, + struct json_object *valid_attrs) +{ + struct nvme_thermal_exc_event *thermal_exc_event = pevent_log_info + offset; + + obj_add_uint(valid_attrs, "over_temp", thermal_exc_event->over_temp); + obj_add_uint(valid_attrs, "threshold", thermal_exc_event->threshold); +} + +static void json_pevent_entry(void *pevent_log_info, __u8 action, __u32 size, const char *devname, + __u32 offset, struct json_object *valid) +{ + int i; + struct nvme_persistent_event_log *pevent_log_head = pevent_log_info; + struct nvme_persistent_event_entry *pevent_entry_head; + struct json_object *valid_attrs; + + for (i = 0; i < le32_to_cpu(pevent_log_head->tnev); i++) { if (offset + sizeof(*pevent_entry_head) >= size) break; pevent_entry_head = pevent_log_info + offset; - if ((offset + pevent_entry_head->ehl + 3 + - le16_to_cpu(pevent_entry_head->el)) >= size) + if (offset + pevent_entry_head->ehl + 3 + le16_to_cpu(pevent_entry_head->el) >= + size) break; + valid_attrs = json_create_object(); - json_object_add_value_uint(valid_attrs, "event_number", i); - json_object_add_value_string(valid_attrs, "event_type", - nvme_pel_event_to_string(pevent_entry_head->etype)); - json_object_add_value_uint(valid_attrs, "event_type_rev", - pevent_entry_head->etype_rev); - json_object_add_value_uint(valid_attrs, "event_header_len", - pevent_entry_head->ehl); - json_object_add_value_uint(valid_attrs, "event_header_additional_info", - pevent_entry_head->ehai); - json_object_add_value_uint(valid_attrs, "ctrl_id", - le16_to_cpu(pevent_entry_head->cntlid)); - json_object_add_value_uint64(valid_attrs, "event_time_stamp", - le64_to_cpu(pevent_entry_head->ets)); - json_object_add_value_uint(valid_attrs, "port_id", - le16_to_cpu(pevent_entry_head->pelpid)); - json_object_add_value_uint(valid_attrs, "vu_info_len", - le16_to_cpu(pevent_entry_head->vsil)); - json_object_add_value_uint(valid_attrs, "event_len", - le16_to_cpu(pevent_entry_head->el)); + obj_add_uint(valid_attrs, "event_number", i); + obj_add_str(valid_attrs, "event_type", + nvme_pel_event_to_string(pevent_entry_head->etype)); + obj_add_uint(valid_attrs, "event_type_rev", pevent_entry_head->etype_rev); + obj_add_uint(valid_attrs, "event_header_len", pevent_entry_head->ehl); + obj_add_uint(valid_attrs, "event_header_additional_info", pevent_entry_head->ehai); + obj_add_uint(valid_attrs, "ctrl_id", le16_to_cpu(pevent_entry_head->cntlid)); + obj_add_uint64(valid_attrs, "event_time_stamp", + le64_to_cpu(pevent_entry_head->ets)); + obj_add_uint(valid_attrs, "port_id", le16_to_cpu(pevent_entry_head->pelpid)); + obj_add_uint(valid_attrs, "vu_info_len", le16_to_cpu(pevent_entry_head->vsil)); + obj_add_uint(valid_attrs, "event_len", le16_to_cpu(pevent_entry_head->el)); offset += pevent_entry_head->ehl + 3; switch (pevent_entry_head->etype) { case NVME_PEL_SMART_HEALTH_EVENT: - smart_event = pevent_log_info + offset; - unsigned int temperature = ((smart_event->temperature[1] << 8) | - smart_event->temperature[0]); - - nvme_uint128_t data_units_read = le128_to_cpu(smart_event->data_units_read); - nvme_uint128_t data_units_written = le128_to_cpu(smart_event->data_units_written); - nvme_uint128_t host_read_commands = le128_to_cpu(smart_event->host_reads); - nvme_uint128_t host_write_commands = le128_to_cpu(smart_event->host_writes); - nvme_uint128_t controller_busy_time = le128_to_cpu(smart_event->ctrl_busy_time); - nvme_uint128_t power_cycles = le128_to_cpu(smart_event->power_cycles); - nvme_uint128_t power_on_hours = le128_to_cpu(smart_event->power_on_hours); - nvme_uint128_t unsafe_shutdowns = le128_to_cpu(smart_event->unsafe_shutdowns); - nvme_uint128_t media_errors = le128_to_cpu(smart_event->media_errors); - nvme_uint128_t num_err_log_entries = le128_to_cpu(smart_event->num_err_log_entries); - json_object_add_value_int(valid_attrs, "critical_warning", - smart_event->critical_warning); - - json_object_add_value_int(valid_attrs, "temperature", - temperature); - json_object_add_value_int(valid_attrs, "avail_spare", - smart_event->avail_spare); - json_object_add_value_int(valid_attrs, "spare_thresh", - smart_event->spare_thresh); - json_object_add_value_int(valid_attrs, "percent_used", - smart_event->percent_used); - json_object_add_value_int(valid_attrs, - "endurance_grp_critical_warning_summary", - smart_event->endu_grp_crit_warn_sumry); - json_object_add_value_uint128(valid_attrs, "data_units_read", - data_units_read); - json_object_add_value_uint128(valid_attrs, "data_units_written", - data_units_written); - json_object_add_value_uint128(valid_attrs, "host_read_commands", - host_read_commands); - json_object_add_value_uint128(valid_attrs, "host_write_commands", - host_write_commands); - json_object_add_value_uint128(valid_attrs, "controller_busy_time", - controller_busy_time); - json_object_add_value_uint128(valid_attrs, "power_cycles", - power_cycles); - json_object_add_value_uint128(valid_attrs, "power_on_hours", - power_on_hours); - json_object_add_value_uint128(valid_attrs, "unsafe_shutdowns", - unsafe_shutdowns); - json_object_add_value_uint128(valid_attrs, "media_errors", - media_errors); - json_object_add_value_uint128(valid_attrs, "num_err_log_entries", - num_err_log_entries); - json_object_add_value_uint(valid_attrs, "warning_temp_time", - le32_to_cpu(smart_event->warning_temp_time)); - json_object_add_value_uint(valid_attrs, "critical_comp_time", - le32_to_cpu(smart_event->critical_comp_time)); - - for (int c = 0; c < 8; c++) { - __s32 temp = le16_to_cpu(smart_event->temp_sensor[c]); - if (temp == 0) - continue; - sprintf(key, "temperature_sensor_%d",c + 1); - json_object_add_value_int(valid_attrs, key, temp); - } - - json_object_add_value_uint(valid_attrs, "thm_temp1_trans_count", - le32_to_cpu(smart_event->thm_temp1_trans_count)); - json_object_add_value_uint(valid_attrs, "thm_temp2_trans_count", - le32_to_cpu(smart_event->thm_temp2_trans_count)); - json_object_add_value_uint(valid_attrs, "thm_temp1_total_time", - le32_to_cpu(smart_event->thm_temp1_total_time)); - json_object_add_value_uint(valid_attrs, "thm_temp2_total_time", - le32_to_cpu(smart_event->thm_temp2_total_time)); + json_pel_smart_health(pevent_log_info, offset, valid_attrs); break; case NVME_PEL_FW_COMMIT_EVENT: - fw_commit_event = pevent_log_info + offset; - snprintf(fw_str, sizeof(fw_str), "%"PRIu64" (%s)", - le64_to_cpu(fw_commit_event->old_fw_rev), - util_fw_to_string((char *)&fw_commit_event->old_fw_rev)); - json_object_add_value_string(valid_attrs, "old_fw_rev", fw_str); - snprintf(fw_str, sizeof(fw_str), "%"PRIu64" (%s)", - le64_to_cpu(fw_commit_event->new_fw_rev), - util_fw_to_string((char *)&fw_commit_event->new_fw_rev)); - json_object_add_value_string(valid_attrs, "new_fw_rev", fw_str); - json_object_add_value_uint(valid_attrs, "fw_commit_action", - fw_commit_event->fw_commit_action); - json_object_add_value_uint(valid_attrs, "fw_slot", - fw_commit_event->fw_slot); - json_object_add_value_uint(valid_attrs, "sct_fw", - fw_commit_event->sct_fw); - json_object_add_value_uint(valid_attrs, "sc_fw", - fw_commit_event->sc_fw); - json_object_add_value_uint(valid_attrs, - "vu_assign_fw_commit_rc", - le16_to_cpu(fw_commit_event->vndr_assign_fw_commit_rc)); + json_pel_fw_commit(pevent_log_info, offset, valid_attrs); break; case NVME_PEL_TIMESTAMP_EVENT: - ts_change_event = pevent_log_info + offset; - json_object_add_value_uint64(valid_attrs, "prev_ts", - le64_to_cpu(ts_change_event->previous_timestamp)); - json_object_add_value_uint64(valid_attrs, - "ml_secs_since_reset", - le64_to_cpu(ts_change_event->ml_secs_since_reset)); + json_pel_timestamp(pevent_log_info, offset, valid_attrs); break; case NVME_PEL_POWER_ON_RESET_EVENT: - por_info_len = (le16_to_cpu(pevent_entry_head->el) - - le16_to_cpu(pevent_entry_head->vsil) - sizeof(*fw_rev)); - - por_info_list = por_info_len / sizeof(*por_event); - - fw_rev = pevent_log_info + offset; - snprintf(fw_str, sizeof(fw_str), "%"PRIu64" (%s)", - le64_to_cpu(*fw_rev), - util_fw_to_string((char *)fw_rev)); - json_object_add_value_string(valid_attrs, "fw_rev", fw_str); - for (int i = 0; i < por_info_list; i++) { - por_event = pevent_log_info + offset + - sizeof(*fw_rev) + i * sizeof(*por_event); - json_object_add_value_uint(valid_attrs, "ctrl_id", - le16_to_cpu(por_event->cid)); - json_object_add_value_uint(valid_attrs, "fw_act", - por_event->fw_act); - json_object_add_value_uint(valid_attrs, "op_in_prog", - por_event->op_in_prog); - json_object_add_value_uint(valid_attrs, "ctrl_power_cycle", - le32_to_cpu(por_event->ctrl_power_cycle)); - json_object_add_value_uint64(valid_attrs, "power_on_ml_secs", - le64_to_cpu(por_event->power_on_ml_seconds)); - json_object_add_value_uint64(valid_attrs, "ctrl_time_stamp", - le64_to_cpu(por_event->ctrl_time_stamp)); - } + json_pel_power_on_reset(pevent_log_info, offset, valid_attrs, + pevent_entry_head->el, pevent_entry_head->vsil); break; case NVME_PEL_NSS_HW_ERROR_EVENT: - nss_hw_err_event = pevent_log_info + offset; - json_object_add_value_uint(valid_attrs, "nss_hw_err_code", - le16_to_cpu(nss_hw_err_event->nss_hw_err_event_code)); + json_pel_nss_hw_error(pevent_log_info, offset, valid_attrs); break; case NVME_PEL_CHANGE_NS_EVENT: - ns_event = pevent_log_info + offset; - json_object_add_value_uint(valid_attrs, "nsmgt_cdw10", - le32_to_cpu(ns_event->nsmgt_cdw10)); - json_object_add_value_uint64(valid_attrs, "nsze", - le64_to_cpu(ns_event->nsze)); - json_object_add_value_uint64(valid_attrs, "nscap", - le64_to_cpu(ns_event->nscap)); - json_object_add_value_uint(valid_attrs, "flbas", - ns_event->flbas); - json_object_add_value_uint(valid_attrs, "dps", - ns_event->dps); - json_object_add_value_uint(valid_attrs, "nmic", - ns_event->nmic); - json_object_add_value_uint(valid_attrs, "ana_grp_id", - le32_to_cpu(ns_event->ana_grp_id)); - json_object_add_value_uint(valid_attrs, "nvmset_id", - le16_to_cpu(ns_event->nvmset_id)); - json_object_add_value_uint(valid_attrs, "nsid", - le32_to_cpu(ns_event->nsid)); + json_pel_change_ns(pevent_log_info, offset, valid_attrs); break; case NVME_PEL_FORMAT_START_EVENT: - format_start_event = pevent_log_info + offset; - json_object_add_value_uint(valid_attrs, "nsid", - le32_to_cpu(format_start_event->nsid)); - json_object_add_value_uint(valid_attrs, "fna", - format_start_event->fna); - json_object_add_value_uint(valid_attrs, "format_nvm_cdw10", - le32_to_cpu(format_start_event->format_nvm_cdw10)); + json_pel_format_start(pevent_log_info, offset, valid_attrs); break; case NVME_PEL_FORMAT_COMPLETION_EVENT: - format_cmpln_event = pevent_log_info + offset; - json_object_add_value_uint(valid_attrs, "nsid", - le32_to_cpu(format_cmpln_event->nsid)); - json_object_add_value_uint(valid_attrs, "smallest_fpi", - format_cmpln_event->smallest_fpi); - json_object_add_value_uint(valid_attrs, "format_nvm_status", - format_cmpln_event->format_nvm_status); - json_object_add_value_uint(valid_attrs, "compln_info", - le16_to_cpu(format_cmpln_event->compln_info)); - json_object_add_value_uint(valid_attrs, "status_field", - le32_to_cpu(format_cmpln_event->status_field)); + json_pel_format_completion(pevent_log_info, offset, valid_attrs); break; case NVME_PEL_SANITIZE_START_EVENT: - sanitize_start_event = pevent_log_info + offset; - json_object_add_value_uint(valid_attrs, "SANICAP", - le32_to_cpu(sanitize_start_event->sani_cap)); - json_object_add_value_uint(valid_attrs, "sani_cdw10", - le32_to_cpu(sanitize_start_event->sani_cdw10)); - json_object_add_value_uint(valid_attrs, "sani_cdw11", - le32_to_cpu(sanitize_start_event->sani_cdw11)); + json_pel_sanitize_start(pevent_log_info, offset, valid_attrs); break; case NVME_PEL_SANITIZE_COMPLETION_EVENT: - sanitize_cmpln_event = pevent_log_info + offset; - json_object_add_value_uint(valid_attrs, "sani_prog", - le16_to_cpu(sanitize_cmpln_event->sani_prog)); - json_object_add_value_uint(valid_attrs, "sani_status", - le16_to_cpu(sanitize_cmpln_event->sani_status)); - json_object_add_value_uint(valid_attrs, "cmpln_info", - le16_to_cpu(sanitize_cmpln_event->cmpln_info)); + json_pel_sanitize_completion(pevent_log_info, offset, valid_attrs); break; case NVME_PEL_THERMAL_EXCURSION_EVENT: - thermal_exc_event = pevent_log_info + offset; - json_object_add_value_uint(valid_attrs, "over_temp", - thermal_exc_event->over_temp); - json_object_add_value_uint(valid_attrs, "threshold", - thermal_exc_event->threshold); + json_pel_thermal_excursion(pevent_log_info, offset, valid_attrs); + break; + default: break; } - json_array_add_value_object(valid, valid_attrs); + array_add_obj(valid, valid_attrs); offset += le16_to_cpu(pevent_entry_head->el); } - - json_object_add_value_array(root, "list_of_event_entries", valid); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); } +static void json_persistent_event_log(void *pevent_log_info, __u8 action, + __u32 size, const char *devname) +{ + struct json_object *r = json_create_object(); + struct json_object *valid = json_create_array(); + __u32 offset = sizeof(struct nvme_persistent_event_log); + + if (size >= offset) { + json_pevent_log_head(pevent_log_info, r); + json_pevent_entry(pevent_log_info, action, size, devname, offset, valid); + obj_add_array(r, "list_of_event_entries", valid); + } else { + obj_add_result(r, "No log data can be shown with this log len at least " \ + "512 bytes is required or can be 0 to read the complete "\ + "log page after context established"); + } + + json_print(r); +} static void json_endurance_group_event_agg_log( struct nvme_aggregate_predictable_lat_event *endurance_log, __u64 log_entries, __u32 size, const char *devname) { - struct json_object *root; + struct json_object *r = json_create_object(); struct json_object *valid_attrs; - struct json_object *valid; + struct json_object *valid = json_create_array(); - root = json_create_object(); - json_object_add_value_uint64(root, "num_entries_avail", - le64_to_cpu(endurance_log->num_entries)); - valid = json_create_array(); + obj_add_uint64(r, "num_entries_avail", le64_to_cpu(endurance_log->num_entries)); for (int i = 0; i < log_entries; i++) { valid_attrs = json_create_object(); - json_object_add_value_uint(valid_attrs, "entry", - le16_to_cpu(endurance_log->entries[i])); - json_array_add_value_object(valid, valid_attrs); + obj_add_uint(valid_attrs, "entry", le16_to_cpu(endurance_log->entries[i])); + array_add_obj(valid, valid_attrs); } - json_object_add_value_array(root, "list_of_entries", valid); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + + obj_add_array(r, "list_of_entries", valid); + + json_print(r); } - -static void json_lba_status_log(void *lba_status, __u32 size, - const char *devname) +static void json_lba_status(struct nvme_lba_status *list, + unsigned long len) { - struct json_object *root; + struct json_object *r = json_create_object(); + int idx; + struct nvme_lba_status_desc *e; + struct json_object *lsde; + char json_str[STR_LEN]; + + obj_add_uint(r, "Number of LBA Status Descriptors (NLSD)", le32_to_cpu(list->nlsd)); + obj_add_uint(r, "Completion Condition (CMPC)", list->cmpc); + + switch (list->cmpc) { + case 1: + obj_add_str(r, "cmpc-definition", + "Completed due to transferring the amount of data specified in the MNDW field"); + break; + case 2: + obj_add_str(r, "cmpc-definition", + "Completed due to having performed the action specified in the Action Type field over the number of logical blocks specified in the Range Length field"); + break; + default: + break; + } + + for (idx = 0; idx < list->nlsd; idx++) { + lsde = json_create_array(); + sprintf(json_str, "LSD entry %d", idx); + obj_add_array(r, json_str, lsde); + e = &list->descs[idx]; + sprintf(json_str, "0x%016"PRIu64"", le64_to_cpu(e->dslba)); + obj_add_str(lsde, "DSLBA", json_str); + sprintf(json_str, "0x%08x", le32_to_cpu(e->nlb)); + obj_add_str(lsde, "NLB", json_str); + sprintf(json_str, "0x%02x", e->status); + obj_add_str(lsde, "status", json_str); + } + + json_print(r); +} + +static void json_lba_status_log(void *lba_status, __u32 size, const char *devname) +{ + struct json_object *r = json_create_object(); struct json_object *desc; struct json_object *element; struct json_object *desc_list; - struct json_object *elements_list; - struct nvme_lba_status_log *hdr; + struct json_object *elements_list = json_create_array(); + struct nvme_lba_status_log *hdr = lba_status; struct nvme_lbas_ns_element *ns_element; struct nvme_lba_rd *range_desc; int offset = sizeof(*hdr); - __u32 num_lba_desc, num_elements; + __u32 num_lba_desc; + __u32 num_elements = le32_to_cpu(hdr->nlslne); + int ele; + int i; - root = json_create_object(); - hdr = lba_status; - json_object_add_value_uint(root, "lslplen", le32_to_cpu(hdr->lslplen)); - num_elements = le32_to_cpu(hdr->nlslne); - json_object_add_value_uint(root, "nlslne", num_elements); - json_object_add_value_uint(root, "estulb", le32_to_cpu(hdr->estulb)); - json_object_add_value_uint(root, "lsgc", le16_to_cpu(hdr->lsgc)); + obj_add_uint(r, "lslplen", le32_to_cpu(hdr->lslplen)); + obj_add_uint(r, "nlslne", num_elements); + obj_add_uint(r, "estulb", le32_to_cpu(hdr->estulb)); + obj_add_uint(r, "lsgc", le16_to_cpu(hdr->lsgc)); - elements_list = json_create_array(); - for (int ele = 0; ele < num_elements; ele++) { + for (ele = 0; ele < num_elements; ele++) { ns_element = lba_status + offset; element = json_create_object(); - json_object_add_value_uint(element, "neid", - le32_to_cpu(ns_element->neid)); + obj_add_uint(element, "neid", le32_to_cpu(ns_element->neid)); num_lba_desc = le32_to_cpu(ns_element->nlrd); - json_object_add_value_uint(element, "nlrd", num_lba_desc); - json_object_add_value_uint(element, "ratype", ns_element->ratype); + obj_add_uint(element, "nlrd", num_lba_desc); + obj_add_uint(element, "ratype", ns_element->ratype); offset += sizeof(*ns_element); desc_list = json_create_array(); + if (num_lba_desc != 0xffffffff) { - for (int i = 0; i < num_lba_desc; i++) { + for (i = 0; i < num_lba_desc; i++) { range_desc = lba_status + offset; desc = json_create_object(); - json_object_add_value_uint64(desc, "rslba", - le64_to_cpu(range_desc->rslba)); - json_object_add_value_uint(desc, "rnlb", - le32_to_cpu(range_desc->rnlb)); + obj_add_uint64(desc, "rslba", le64_to_cpu(range_desc->rslba)); + obj_add_uint(desc, "rnlb", le32_to_cpu(range_desc->rnlb)); offset += sizeof(*range_desc); - json_array_add_value_object(desc_list, desc); + array_add_obj(desc_list, desc); } } else { - printf("Number of LBA Range Descriptors (NLRD) set to %#x for " \ - "NS element %d", num_lba_desc, ele); + obj_add_result(r, "Number of LBA Range Descriptors (NLRD) set to %#x for NS element %d", + num_lba_desc, ele); } - json_object_add_value_array(element, "descs", desc_list); - json_array_add_value_object(elements_list, element); + obj_add_array(element, "descs", desc_list); + array_add_obj(elements_list, element); } - json_object_add_value_array(root, "ns_elements", elements_list); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); -} + obj_add_array(r, "ns_elements", elements_list); + json_print(r); +} static void json_resv_notif_log(struct nvme_resv_notification_log *resv, const char *devname) { - struct json_object *root; + struct json_object *r = json_create_object(); - root = json_create_object(); - json_object_add_value_uint64(root, "count", - le64_to_cpu(resv->lpc)); - json_object_add_value_uint(root, "rn_log_type", - resv->rnlpt); - json_object_add_value_uint(root, "num_logs", - resv->nalp); - json_object_add_value_uint(root, "nsid", - le32_to_cpu(resv->nsid)); + obj_add_uint64(r, "count", le64_to_cpu(resv->lpc)); + obj_add_uint(r, "rn_log_type", resv->rnlpt); + obj_add_uint(r, "num_logs", resv->nalp); + obj_add_uint(r, "NSID", le32_to_cpu(resv->nsid)); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } - static void json_fid_support_effects_log( struct nvme_fid_supported_effects_log *fid_log, const char *devname) { - struct json_object *root; + struct json_object *r = json_create_object(); struct json_object *fids; - struct json_object *fids_list; + struct json_object *fids_list = json_create_array(); unsigned int fid; char key[128]; __u32 fid_support; - root = json_create_object(); - fids_list = json_create_array(); - for (fid = 0; fid < 256; fid++) { + for (fid = 0; fid < NVME_LOG_FID_SUPPORTED_EFFECTS_MAX; fid++) { fid_support = le32_to_cpu(fid_log->fid_support[fid]); if (fid_support & NVME_FID_SUPPORTED_EFFECTS_FSUPP) { fids = json_create_object(); sprintf(key, "fid_%u", fid); - json_object_add_value_uint(fids, key, fid_support); - json_array_add_value_object(fids_list, fids); + obj_add_uint(fids, key, fid_support); + array_add_obj(fids_list, fids); } } - json_object_add_value_object(root, "fid_support", fids_list); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); -} + obj_add_obj(r, "fid_support", fids_list); + json_print(r); +} static void json_mi_cmd_support_effects_log( struct nvme_mi_cmd_supported_effects_log *mi_cmd_log, const char *devname) { - struct json_object *root; + struct json_object *r = json_create_object(); struct json_object *mi_cmds; - struct json_object *mi_cmds_list; + struct json_object *mi_cmds_list = json_create_array(); unsigned int mi_cmd; char key[128]; __u32 mi_cmd_support; - root = json_create_object(); - mi_cmds_list = json_create_array(); - for (mi_cmd = 0; mi_cmd < 256; mi_cmd++) { + for (mi_cmd = 0; mi_cmd < NVME_LOG_MI_CMD_SUPPORTED_EFFECTS_MAX; mi_cmd++) { mi_cmd_support = le32_to_cpu(mi_cmd_log->mi_cmd_support[mi_cmd]); if (mi_cmd_support & NVME_MI_CMD_SUPPORTED_EFFECTS_CSUPP) { mi_cmds = json_create_object(); sprintf(key, "mi_cmd_%u", mi_cmd); - json_object_add_value_uint(mi_cmds, key, mi_cmd_support); - json_array_add_value_object(mi_cmds_list, mi_cmds); + obj_add_uint(mi_cmds, key, mi_cmd_support); + array_add_obj(mi_cmds_list, mi_cmds); } } - json_object_add_value_object(root, "mi_command_support", mi_cmds_list); - json_print_object(root, NULL); - printf("\n"); + obj_add_obj(r, "mi_command_support", mi_cmds_list); - json_free_object(root); + json_print(r); } - static void json_boot_part_log(void *bp_log, const char *devname, __u32 size) { - struct nvme_boot_partition *hdr; - struct json_object *root; + struct nvme_boot_partition *hdr = bp_log; + struct json_object *r = json_create_object(); - hdr = bp_log; - root = 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); - json_object_add_value_uint(root, "count", hdr->lid); - json_object_add_value_uint(root, "abpid", - (le32_to_cpu(hdr->bpinfo) >> 31) & 0x1); - json_object_add_value_uint(root, "bpsz", - le32_to_cpu(hdr->bpinfo) & 0x7fff); - - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } /* Printable Eye string is allocated and returned, caller must free */ static char *json_eom_printable_eye(struct nvme_eom_lane_desc *lane, - struct json_object *root) + struct json_object *r) { char *eye = (char *)lane->eye_desc; - char *printable = malloc(lane->nrows * lane->ncols + lane->ncols); char *printable_start = printable; + int i, j; + if (!printable) goto exit; - int i, j; for (i = 0; i < lane->nrows; i++) { for (j = 0; j < lane->ncols; j++, printable++) sprintf(printable, "%c", eye[i * lane->ncols + j]); sprintf(printable++, "\n"); } - json_object_add_value_string(root, "printable_eye", printable_start); + obj_add_str(r, "printable_eye", printable_start); exit: return printable_start; } - static void json_phy_rx_eom_descs(struct nvme_phy_rx_eom_log *log, - struct json_object *root, char **allocated_eyes) + struct json_object *r, char **allocated_eyes) { void *p = log->descs; uint16_t num_descs = le16_to_cpu(log->nd); int i; - struct json_object *descs; + struct json_object *descs = json_create_array(); - descs = json_create_array(); - json_object_add_value_array(root, "descs", descs); + obj_add_array(r, "descs", descs); for (i = 0; i < num_descs; i++) { struct nvme_eom_lane_desc *desc = p; struct json_object *jdesc = json_create_object(); - json_object_add_value_uint(jdesc, "lid", desc->mstatus); - json_object_add_value_uint(jdesc, "lane", desc->lane); - json_object_add_value_uint(jdesc, "eye", desc->eye); - json_object_add_value_uint(jdesc, "top", le16_to_cpu(desc->top)); - json_object_add_value_uint(jdesc, "bottom", le16_to_cpu(desc->bottom)); - json_object_add_value_uint(jdesc, "left", le16_to_cpu(desc->left)); - json_object_add_value_uint(jdesc, "right", le16_to_cpu(desc->right)); - json_object_add_value_uint(jdesc, "nrows", le16_to_cpu(desc->nrows)); - json_object_add_value_uint(jdesc, "ncols", le16_to_cpu(desc->ncols)); - json_object_add_value_uint(jdesc, "edlen", le16_to_cpu(desc->edlen)); + obj_add_uint(jdesc, "lid", desc->mstatus); + obj_add_uint(jdesc, "lane", desc->lane); + obj_add_uint(jdesc, "eye", desc->eye); + obj_add_uint(jdesc, "top", le16_to_cpu(desc->top)); + obj_add_uint(jdesc, "bottom", le16_to_cpu(desc->bottom)); + obj_add_uint(jdesc, "left", le16_to_cpu(desc->left)); + obj_add_uint(jdesc, "right", le16_to_cpu(desc->right)); + obj_add_uint(jdesc, "nrows", le16_to_cpu(desc->nrows)); + 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) - allocated_eyes[i] = json_eom_printable_eye(desc, root); + allocated_eyes[i] = json_eom_printable_eye(desc, r); /* Eye Data field is vendor specific, doesn't map to JSON */ - json_array_add_value_object(descs, jdesc); + array_add_obj(descs, jdesc); p += log->dsize; } @@ -1475,39 +2012,34 @@ static void json_phy_rx_eom_log(struct nvme_phy_rx_eom_log *log, __u16 controlle { char **allocated_eyes = NULL; int i; + struct json_object *r = json_create_object(); - struct json_object *root; - root = json_create_object(); - - json_object_add_value_uint(root, "lid", log->lid); - json_object_add_value_uint(root, "eomip", log->eomip); - json_object_add_value_uint(root, "hsize", le16_to_cpu(log->hsize)); - json_object_add_value_uint(root, "rsize", le32_to_cpu(log->rsize)); - json_object_add_value_uint(root, "eomdgn", log->eomdgn); - json_object_add_value_uint(root, "lr", log->lr); - json_object_add_value_uint(root, "lanes", log->lanes); - json_object_add_value_uint(root, "epl", log->epl); - json_object_add_value_uint(root, "lspfc", log->lspfc); - json_object_add_value_uint(root, "li", log->li); - json_object_add_value_uint(root, "lsic", le16_to_cpu(log->lsic)); - json_object_add_value_uint(root, "dsize", le32_to_cpu(log->dsize)); - json_object_add_value_uint(root, "nd", le16_to_cpu(log->nd)); - json_object_add_value_uint(root, "maxtb", le16_to_cpu(log->maxtb)); - json_object_add_value_uint(root, "maxlr", le16_to_cpu(log->maxlr)); - json_object_add_value_uint(root, "etgood", le16_to_cpu(log->etgood)); - json_object_add_value_uint(root, "etbetter", le16_to_cpu(log->etbetter)); - json_object_add_value_uint(root, "etbest", le16_to_cpu(log->etbest)); + obj_add_uint(r, "lid", log->lid); + obj_add_uint(r, "eomip", log->eomip); + obj_add_uint(r, "hsize", le16_to_cpu(log->hsize)); + obj_add_uint(r, "rsize", le32_to_cpu(log->rsize)); + obj_add_uint(r, "eomdgn", log->eomdgn); + obj_add_uint(r, "lr", log->lr); + obj_add_uint(r, "lanes", log->lanes); + obj_add_uint(r, "epl", log->epl); + obj_add_uint(r, "lspfc", log->lspfc); + obj_add_uint(r, "li", log->li); + obj_add_uint(r, "lsic", le16_to_cpu(log->lsic)); + obj_add_uint(r, "dsize", le32_to_cpu(log->dsize)); + obj_add_uint(r, "nd", le16_to_cpu(log->nd)); + obj_add_uint(r, "maxtb", le16_to_cpu(log->maxtb)); + obj_add_uint(r, "maxlr", le16_to_cpu(log->maxlr)); + obj_add_uint(r, "etgood", le16_to_cpu(log->etgood)); + obj_add_uint(r, "etbetter", le16_to_cpu(log->etbetter)); + obj_add_uint(r, "etbest", le16_to_cpu(log->etbest)); if (log->eomip == NVME_PHY_RX_EOM_COMPLETED) { /* Save Printable Eye strings allocated to free later */ allocated_eyes = malloc(log->nd * sizeof(char *)); if (allocated_eyes) - json_phy_rx_eom_descs(log, root, allocated_eyes); + json_phy_rx_eom_descs(log, r, allocated_eyes); } - json_print_object(root, NULL); - printf("\n"); - if (allocated_eyes) { for (i = 0; i < log->nd; i++) { /* Free any Printable Eye strings allocated */ @@ -1516,50 +2048,45 @@ static void json_phy_rx_eom_log(struct nvme_phy_rx_eom_log *log, __u16 controlle } free(allocated_eyes); } - json_free_object(root); + + json_print(r); } static void json_media_unit_stat_log(struct nvme_media_unit_stat_log *mus) { - - struct json_object *root; - struct json_object *entries; + struct json_object *r = json_create_object(); + struct json_object *entries = json_create_array(); struct json_object *entry; int i; - root = json_create_object(); - entries = json_create_array(); - - json_object_add_value_uint(root, "nmu", le16_to_cpu(mus->nmu)); - json_object_add_value_uint(root, "cchans", le16_to_cpu(mus->cchans)); - json_object_add_value_uint(root, "sel_config", le16_to_cpu(mus->sel_config)); + obj_add_uint(r, "nmu", le16_to_cpu(mus->nmu)); + obj_add_uint(r, "cchans", le16_to_cpu(mus->cchans)); + obj_add_uint(r, "sel_config", le16_to_cpu(mus->sel_config)); for (i = 0; i < mus->nmu; i++) { entry = json_create_object(); - json_object_add_value_uint(entry, "muid", le16_to_cpu(mus->mus_desc[i].muid)); - json_object_add_value_uint(entry, "domainid", le16_to_cpu(mus->mus_desc[i].domainid)); - json_object_add_value_uint(entry, "endgid", le16_to_cpu(mus->mus_desc[i].endgid)); - json_object_add_value_uint(entry, "nvmsetid", le16_to_cpu(mus->mus_desc[i].nvmsetid)); - json_object_add_value_uint(entry, "cap_adj_fctr", le16_to_cpu(mus->mus_desc[i].cap_adj_fctr)); - json_object_add_value_uint(entry, "avl_spare", mus->mus_desc[i].avl_spare); - json_object_add_value_uint(entry, "percent_used", mus->mus_desc[i].percent_used); - json_object_add_value_uint(entry, "mucs", mus->mus_desc[i].mucs); - json_object_add_value_uint(entry, "cio", mus->mus_desc[i].cio); - json_array_add_value_object(entries, entry); + obj_add_uint(entry, "muid", le16_to_cpu(mus->mus_desc[i].muid)); + obj_add_uint(entry, "domainid", le16_to_cpu(mus->mus_desc[i].domainid)); + obj_add_uint(entry, "endgid", le16_to_cpu(mus->mus_desc[i].endgid)); + obj_add_uint(entry, "nvmsetid", le16_to_cpu(mus->mus_desc[i].nvmsetid)); + obj_add_uint(entry, "cap_adj_fctr", le16_to_cpu(mus->mus_desc[i].cap_adj_fctr)); + obj_add_uint(entry, "avl_spare", mus->mus_desc[i].avl_spare); + obj_add_uint(entry, "percent_used", mus->mus_desc[i].percent_used); + obj_add_uint(entry, "mucs", mus->mus_desc[i].mucs); + obj_add_uint(entry, "cio", mus->mus_desc[i].cio); + array_add_obj(entries, entry); } - json_object_add_value_array(root, "mus_list", entries); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); -} + obj_add_array(r, "mus_list", entries); + json_print(r); +} static void json_supported_cap_config_log( struct nvme_supported_cap_config_list_log *cap_log) { - struct json_object *root; - struct json_object *cap_list; + struct json_object *r = json_create_object(); + struct json_object *cap_list = json_create_array(); struct json_object *capacity; struct json_object *end_list; struct json_object *set_list; @@ -1570,96 +2097,89 @@ static void json_supported_cap_config_log( struct json_object *media; struct json_object *endurance; struct nvme_end_grp_chan_desc *chan_desc; - int i, j, k, l, m, sccn, egcn, egsets, egchans, chmus; + int i, j, k, l, m, egcn, egsets, egchans, chmus; + int sccn = cap_log->sccn; - root = json_create_object(); - - json_object_add_value_uint(root, "sccn", cap_log->sccn); - cap_list = json_create_array(); - sccn = cap_log->sccn; + obj_add_uint(r, "sccn", cap_log->sccn); for (i = 0; i < sccn; i++) { capacity = json_create_object(); - json_object_add_value_uint(capacity, "cap_config_id", - le16_to_cpu(cap_log->cap_config_desc[i].cap_config_id)); - json_object_add_value_uint(capacity, "domainid", - le16_to_cpu(cap_log->cap_config_desc[i].domainid)); - json_object_add_value_uint(capacity, "egcn", - le16_to_cpu(cap_log->cap_config_desc[i].egcn)); + obj_add_uint(capacity, "cap_config_id", + le16_to_cpu(cap_log->cap_config_desc[i].cap_config_id)); + obj_add_uint(capacity, "domainid", + le16_to_cpu(cap_log->cap_config_desc[i].domainid)); + obj_add_uint(capacity, "egcn", le16_to_cpu(cap_log->cap_config_desc[i].egcn)); end_list = json_create_array(); egcn = le16_to_cpu(cap_log->cap_config_desc[i].egcn); for (j = 0; j < egcn; j++) { endurance = json_create_object(); - json_object_add_value_uint(endurance, "endgid", - le16_to_cpu(cap_log->cap_config_desc[i].egcd[j].endgid)); - json_object_add_value_uint(endurance, "cap_adj_factor", - le16_to_cpu(cap_log->cap_config_desc[i].egcd[j].cap_adj_factor)); - json_object_add_value_uint128(endurance, "tegcap", - le128_to_cpu(cap_log->cap_config_desc[i].egcd[j].tegcap)); - json_object_add_value_uint128(endurance, "segcap", - le128_to_cpu(cap_log->cap_config_desc[i].egcd[j].segcap)); - json_object_add_value_uint(endurance, "egsets", - le16_to_cpu(cap_log->cap_config_desc[i].egcd[j].egsets)); + obj_add_uint(endurance, "endgid", + le16_to_cpu(cap_log->cap_config_desc[i].egcd[j].endgid)); + obj_add_uint(endurance, "cap_adj_factor", + le16_to_cpu(cap_log->cap_config_desc[i].egcd[j].cap_adj_factor)); + obj_add_uint128(endurance, "tegcap", + le128_to_cpu(cap_log->cap_config_desc[i].egcd[j].tegcap)); + obj_add_uint128(endurance, "segcap", + le128_to_cpu(cap_log->cap_config_desc[i].egcd[j].segcap)); + obj_add_uint(endurance, "egsets", + le16_to_cpu(cap_log->cap_config_desc[i].egcd[j].egsets)); egsets = le16_to_cpu(cap_log->cap_config_desc[i].egcd[j].egsets); set_list = json_create_array(); for (k = 0; k < egsets; k++) { set = json_create_object(); - json_object_add_value_uint(set, "nvmsetid", - le16_to_cpu(cap_log->cap_config_desc[i].egcd[j].nvmsetid[k])); - json_array_add_value_object(set_list, set); + obj_add_uint(set, "nvmsetid", + le16_to_cpu(cap_log->cap_config_desc[i].egcd[j].nvmsetid[k])); + array_add_obj(set_list, set); } - chan_desc = (struct nvme_end_grp_chan_desc *) \ - ((cap_log->cap_config_desc[i].egcd[j].nvmsetid[0]) * (sizeof(__u16)*egsets)); + chan_desc = (struct nvme_end_grp_chan_desc *) + (cap_log->cap_config_desc[i].egcd[j].nvmsetid[0] * sizeof(__u16) * egsets); egchans = le16_to_cpu(chan_desc->egchans); - json_object_add_value_uint(endurance, "egchans", - le16_to_cpu(chan_desc->egchans)); + obj_add_uint(endurance, "egchans", le16_to_cpu(chan_desc->egchans)); chan_list = json_create_array(); for (l = 0; l < egchans; l++) { channel = json_create_object(); - json_object_add_value_uint(channel, "chanid", - le16_to_cpu(chan_desc->chan_config_desc[l].chanid)); - json_object_add_value_uint(channel, "chmus", - le16_to_cpu(chan_desc->chan_config_desc[l].chmus)); + obj_add_uint(channel, "chanid", + le16_to_cpu(chan_desc->chan_config_desc[l].chanid)); + obj_add_uint(channel, "chmus", + le16_to_cpu(chan_desc->chan_config_desc[l].chmus)); chmus = le16_to_cpu(chan_desc->chan_config_desc[l].chmus); media_list = json_create_array(); for (m = 0; m < chmus; m++) { media = json_create_object(); - json_object_add_value_uint(media, "chanid", - le16_to_cpu(chan_desc->chan_config_desc[l].mu_config_desc[m].muid)); - json_object_add_value_uint(media, "chmus", - le16_to_cpu(chan_desc->chan_config_desc[l].mu_config_desc[m].mudl)); - json_array_add_value_object(media_list, media); + obj_add_uint(media, "chanid", + le16_to_cpu(chan_desc->chan_config_desc[l].mu_config_desc[m].muid)); + obj_add_uint(media, "chmus", + le16_to_cpu(chan_desc->chan_config_desc[l].mu_config_desc[m].mudl)); + array_add_obj(media_list, media); } - json_object_add_value_array(channel, "Media Descriptor", media_list); - json_array_add_value_object(chan_list, channel); + obj_add_array(channel, "Media Descriptor", media_list); + array_add_obj(chan_list, channel); } - json_object_add_value_array(endurance, "Channel Descriptor", chan_list); - json_object_add_value_array(endurance, "NVM Set IDs", set_list); - json_array_add_value_object(end_list, endurance); + obj_add_array(endurance, "Channel Descriptor", chan_list); + obj_add_array(endurance, "NVM Set IDs", set_list); + array_add_obj(end_list, endurance); } - json_object_add_value_array(capacity, "Endurance Descriptor", end_list); - json_array_add_value_object(cap_list, capacity); + obj_add_array(capacity, "Endurance Descriptor", end_list); + array_add_obj(cap_list, capacity); } - json_object_add_value_array(root, "Capacity Descriptor", cap_list); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); -} + obj_add_array(r, "Capacity Descriptor", cap_list); + json_print(r); +} static void json_nvme_fdp_configs(struct nvme_fdp_config_log *log, size_t len) { - struct json_object *root, *obj_configs; + struct json_object *r, *obj_configs; uint16_t n; void *p = log->configs; - root = json_create_object(); + r = json_create_object(); obj_configs = json_create_array(); n = le16_to_cpu(log->n); - json_object_add_value_uint(root, "n", n); + obj_add_uint(r, "n", n); for (int i = 0; i < n + 1; i++) { struct nvme_fdp_config_desc *config = p; @@ -1667,163 +2187,144 @@ static void json_nvme_fdp_configs(struct nvme_fdp_config_log *log, size_t len) struct json_object *obj_config = json_create_object(); struct json_object *obj_ruhs = json_create_array(); - json_object_add_value_uint(obj_config, "fdpa", config->fdpa); - json_object_add_value_uint(obj_config, "vss", config->vss); - json_object_add_value_uint(obj_config, "nrg", le32_to_cpu(config->nrg)); - json_object_add_value_uint(obj_config, "nruh", le16_to_cpu(config->nruh)); - json_object_add_value_uint(obj_config, "nnss", le32_to_cpu(config->nnss)); - json_object_add_value_uint64(obj_config, "runs", le64_to_cpu(config->runs)); - json_object_add_value_uint(obj_config, "erutl", le32_to_cpu(config->erutl)); + obj_add_uint(obj_config, "fdpa", config->fdpa); + obj_add_uint(obj_config, "vss", config->vss); + obj_add_uint(obj_config, "nrg", le32_to_cpu(config->nrg)); + obj_add_uint(obj_config, "nruh", le16_to_cpu(config->nruh)); + obj_add_uint(obj_config, "nnss", le32_to_cpu(config->nnss)); + obj_add_uint64(obj_config, "runs", le64_to_cpu(config->runs)); + obj_add_uint(obj_config, "erutl", le32_to_cpu(config->erutl)); for (int j = 0; j < le16_to_cpu(config->nruh); j++) { struct nvme_fdp_ruh_desc *ruh = &config->ruhs[j]; struct json_object *obj_ruh = json_create_object(); - json_object_add_value_uint(obj_ruh, "ruht", ruh->ruht); + obj_add_uint(obj_ruh, "ruht", ruh->ruht); - json_array_add_value_object(obj_ruhs, obj_ruh); + array_add_obj(obj_ruhs, obj_ruh); } - json_array_add_value_object(obj_configs, obj_config); + array_add_obj(obj_configs, obj_config); p += config->size; } - json_object_add_value_array(root, "configs", obj_configs); + obj_add_array(r, "configs", obj_configs); - json_print_object(root, NULL); - printf("\n"); - - json_free_object(root); + json_print(r); } - static void json_nvme_fdp_usage(struct nvme_fdp_ruhu_log *log, size_t len) { - struct json_object *root, *obj_ruhus; + struct json_object *r, *obj_ruhus; uint16_t nruh; - root = json_create_object(); + r = json_create_object(); obj_ruhus = json_create_array(); nruh = le16_to_cpu(log->nruh); - json_object_add_value_uint(root, "nruh", nruh); + obj_add_uint(r, "nruh", nruh); for (int i = 0; i < nruh; i++) { struct nvme_fdp_ruhu_desc *ruhu = &log->ruhus[i]; struct json_object *obj_ruhu = json_create_object(); - json_object_add_value_uint(obj_ruhu, "ruha", ruhu->ruha); + obj_add_uint(obj_ruhu, "ruha", ruhu->ruha); - json_array_add_value_object(obj_ruhus, obj_ruhu); + array_add_obj(obj_ruhus, obj_ruhu); } - json_object_add_value_array(root, "ruhus", obj_ruhus); + obj_add_array(r, "ruhus", obj_ruhus); - json_print_object(root, NULL); - printf("\n"); - - json_free_object(root); + json_print(r); } - static void json_nvme_fdp_stats(struct nvme_fdp_stats_log *log) { - struct json_object *root = json_create_object(); + struct json_object *r = json_create_object(); - json_object_add_value_uint128(root, "hbmw", le128_to_cpu(log->hbmw)); - json_object_add_value_uint128(root, "mbmw", le128_to_cpu(log->mbmw)); - json_object_add_value_uint128(root, "mbe", le128_to_cpu(log->mbe)); + obj_add_uint128(r, "hbmw", le128_to_cpu(log->hbmw)); + obj_add_uint128(r, "mbmw", le128_to_cpu(log->mbmw)); + obj_add_uint128(r, "mbe", le128_to_cpu(log->mbe)); - json_print_object(root, NULL); - printf("\n"); - - json_free_object(root); + json_print(r); } - static void json_nvme_fdp_events(struct nvme_fdp_events_log *log) { - struct json_object *root, *obj_events; + struct json_object *r, *obj_events; uint32_t n; - root = json_create_object(); + r = json_create_object(); obj_events = json_create_array(); n = le32_to_cpu(log->n); - json_object_add_value_uint(root, "n", n); + obj_add_uint(r, "n", n); for (unsigned int i = 0; i < n; i++) { struct nvme_fdp_event *event = &log->events[i]; struct json_object *obj_event = json_create_object(); - json_object_add_value_uint(obj_event, "type", event->type); - json_object_add_value_uint(obj_event, "fdpef", event->flags); - json_object_add_value_uint(obj_event, "pid", le16_to_cpu(event->pid)); - json_object_add_value_uint64(obj_event, "timestamp", le64_to_cpu(*(uint64_t *)&event->ts)); - json_object_add_value_uint(obj_event, "nsid", le32_to_cpu(event->nsid)); + obj_add_uint(obj_event, "type", event->type); + obj_add_uint(obj_event, "fdpef", event->flags); + obj_add_uint(obj_event, "pid", le16_to_cpu(event->pid)); + obj_add_uint64(obj_event, "timestamp", le64_to_cpu(*(uint64_t *)&event->ts)); + obj_add_uint(obj_event, "nsid", 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; - json_object_add_value_uint(obj_event, "nlbam", le16_to_cpu(mr->nlbam)); + obj_add_uint(obj_event, "nlbam", le16_to_cpu(mr->nlbam)); if (mr->flags & NVME_FDP_EVENT_REALLOC_F_LBAV) - json_object_add_value_uint64(obj_event, "lba", le64_to_cpu(mr->lba)); + obj_add_uint64(obj_event, "lba", le64_to_cpu(mr->lba)); } - json_array_add_value_object(obj_events, obj_event); + array_add_obj(obj_events, obj_event); } - json_object_add_value_array(root, "events", obj_events); + obj_add_array(r, "events", obj_events); - json_print_object(root, NULL); - printf("\n"); - - json_free_object(root); + json_print(r); } static void json_nvme_fdp_ruh_status(struct nvme_fdp_ruh_status *status, size_t len) { - struct json_object *root, *obj_ruhss; + struct json_object *r, *obj_ruhss; uint16_t nruhsd; - root = json_create_object(); + r = json_create_object(); obj_ruhss = json_create_array(); nruhsd = le16_to_cpu(status->nruhsd); - json_object_add_value_uint(root, "nruhsd", nruhsd); + obj_add_uint(r, "nruhsd", nruhsd); for (unsigned int i = 0; i < nruhsd; i++) { struct nvme_fdp_ruh_status_desc *ruhs = &status->ruhss[i]; struct json_object *obj_ruhs = json_create_object(); - json_object_add_value_uint(obj_ruhs, "pid", le16_to_cpu(ruhs->pid)); - json_object_add_value_uint(obj_ruhs, "ruhid", le16_to_cpu(ruhs->ruhid)); - json_object_add_value_uint(obj_ruhs, "earutr", le32_to_cpu(ruhs->earutr)); - json_object_add_value_uint64(obj_ruhs, "ruamw", le64_to_cpu(ruhs->ruamw)); + obj_add_uint(obj_ruhs, "pid", le16_to_cpu(ruhs->pid)); + obj_add_uint(obj_ruhs, "ruhid", le16_to_cpu(ruhs->ruhid)); + obj_add_uint(obj_ruhs, "earutr", le32_to_cpu(ruhs->earutr)); + obj_add_uint64(obj_ruhs, "ruamw", le64_to_cpu(ruhs->ruamw)); - json_array_add_value_object(obj_ruhss, obj_ruhs); + array_add_obj(obj_ruhss, obj_ruhs); } - json_object_add_value_array(root, "ruhss", obj_ruhss); + obj_add_array(r, "ruhss", obj_ruhss); - json_print_object(root, NULL); - printf("\n"); - - json_free_object(root); + json_print(r); } -static unsigned int json_print_nvme_subsystem_multipath(nvme_subsystem_t s, - json_object *paths) +static unsigned int json_print_nvme_subsystem_multipath(nvme_subsystem_t s, json_object *paths) { nvme_ns_t n; nvme_path_t p; @@ -1838,17 +2339,12 @@ static unsigned int json_print_nvme_subsystem_multipath(nvme_subsystem_t s, nvme_ctrl_t c = nvme_path_get_ctrl(p); path_attrs = json_create_object(); - json_object_add_value_string(path_attrs, "Name", - nvme_ctrl_get_name(c)); - json_object_add_value_string(path_attrs, "Transport", - nvme_ctrl_get_transport(c)); - json_object_add_value_string(path_attrs, "Address", - nvme_ctrl_get_address(c)); - json_object_add_value_string(path_attrs, "State", - nvme_ctrl_get_state(c)); - json_object_add_value_string(path_attrs, "ANAState", - nvme_path_get_ana_state(p)); - json_array_add_value_object(paths, path_attrs); + obj_add_str(path_attrs, "Name", nvme_ctrl_get_name(c)); + obj_add_str(path_attrs, "Transport", nvme_ctrl_get_transport(c)); + obj_add_str(path_attrs, "Address", nvme_ctrl_get_address(c)); + obj_add_str(path_attrs, "State", nvme_ctrl_get_state(c)); + obj_add_str(path_attrs, "ANAState", nvme_path_get_ana_state(p)); + array_add_obj(paths, path_attrs); i++; } @@ -1864,190 +2360,366 @@ static void json_print_nvme_subsystem_ctrls(nvme_subsystem_t s, struct json_object *path_attrs; path_attrs = json_create_object(); - json_object_add_value_string(path_attrs, "Name", - nvme_ctrl_get_name(c)); - json_object_add_value_string(path_attrs, "Transport", - nvme_ctrl_get_transport(c)); - json_object_add_value_string(path_attrs, "Address", - nvme_ctrl_get_address(c)); - json_object_add_value_string(path_attrs, "State", - nvme_ctrl_get_state(c)); - json_array_add_value_object(paths, path_attrs); + obj_add_str(path_attrs, "Name", nvme_ctrl_get_name(c)); + obj_add_str(path_attrs, "Transport", nvme_ctrl_get_transport(c)); + obj_add_str(path_attrs, "Address", nvme_ctrl_get_address(c)); + obj_add_str(path_attrs, "State", nvme_ctrl_get_state(c)); + array_add_obj(paths, path_attrs); } } static void json_print_nvme_subsystem_list(nvme_root_t r, bool show_ana) - { struct json_object *host_attrs, *subsystem_attrs; struct json_object *subsystems, *paths; - struct json_object *root; + struct json_object *a = json_create_array(); nvme_host_t h; - root = json_create_array(); - nvme_for_each_host(r, h) { nvme_subsystem_t s; const char *hostid; host_attrs = json_create_object(); - json_object_add_value_string(host_attrs, "HostNQN", - nvme_host_get_hostnqn(h)); + obj_add_str(host_attrs, "HostNQN", nvme_host_get_hostnqn(h)); hostid = nvme_host_get_hostid(h); if (hostid) - json_object_add_value_string(host_attrs, "HostID", hostid); + obj_add_str(host_attrs, "HostID", hostid); subsystems = json_create_array(); nvme_for_each_subsystem(h, s) { subsystem_attrs = json_create_object(); - json_object_add_value_string(subsystem_attrs, "Name", - nvme_subsystem_get_name(s)); - json_object_add_value_string(subsystem_attrs, "NQN", - nvme_subsystem_get_nqn(s)); - json_object_add_value_string(subsystem_attrs, "IOPolicy", - nvme_subsystem_get_iopolicy(s)); + obj_add_str(subsystem_attrs, "Name", nvme_subsystem_get_name(s)); + obj_add_str(subsystem_attrs, "NQN", nvme_subsystem_get_nqn(s)); + obj_add_str(subsystem_attrs, "IOPolicy", nvme_subsystem_get_iopolicy(s)); - json_array_add_value_object(subsystems, subsystem_attrs); + array_add_obj(subsystems, subsystem_attrs); paths = json_create_array(); if (!show_ana || !json_print_nvme_subsystem_multipath(s, paths)) json_print_nvme_subsystem_ctrls(s, paths); - json_object_add_value_array(subsystem_attrs, "Paths", - paths); + obj_add_array(subsystem_attrs, "Paths", paths); } - json_object_add_value_array(host_attrs, "Subsystems", subsystems); - json_array_add_value_object(root, host_attrs); + obj_add_array(host_attrs, "Subsystems", subsystems); + array_add_obj(a, host_attrs); } - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + + json_print(a); +} + +static void json_ctrl_registers_cap(void *bar, struct json_object *r) +{ + uint64_t cap = mmio_read64(bar + NVME_REG_CAP); + + if (human()) + json_registers_cap((struct nvme_bar_cap *)&cap, obj_create_array_obj(r, "cap")); + else + obj_add_uint64(r, "cap", cap); +} + +static void json_ctrl_registers_vs(void *bar, struct json_object *r) +{ + uint32_t vs = mmio_read32(bar + NVME_REG_VS); + + if (human()) + json_registers_version(vs, obj_create_array_obj(r, "vs")); + else + obj_add_int(r, "vs", vs); +} + +static void json_ctrl_registers_intms(void *bar, struct json_object *r) +{ + uint32_t intms = mmio_read32(bar + NVME_REG_INTMS); + + if (human()) + json_registers_intms(intms, obj_create_array_obj(r, "intms")); + else + obj_add_int(r, "intms", intms); +} + +static void json_ctrl_registers_intmc(void *bar, struct json_object *r) +{ + uint32_t intmc = mmio_read32(bar + NVME_REG_INTMC); + + if (human()) + json_registers_intmc(intmc, obj_create_array_obj(r, "intmc")); + else + obj_add_int(r, "intmc", intmc); +} + +static void json_ctrl_registers_cc(void *bar, struct json_object *r) +{ + uint32_t cc = mmio_read32(bar + NVME_REG_CC); + + if (human()) + json_registers_cc(cc, obj_create_array_obj(r, "cc")); + else + obj_add_int(r, "cc", cc); +} + +static void json_ctrl_registers_csts(void *bar, struct json_object *r) +{ + uint32_t csts = mmio_read32(bar + NVME_REG_CSTS); + + if (human()) + json_registers_csts(csts, obj_create_array_obj(r, "csts")); + else + obj_add_int(r, "csts", csts); +} + +static void json_ctrl_registers_nssr(void *bar, struct json_object *r) +{ + uint32_t nssr = mmio_read32(bar + NVME_REG_NSSR); + + if (human()) + json_registers_nssr(nssr, obj_create_array_obj(r, "nssr")); + else + obj_add_int(r, "nssr", nssr); +} + +static void json_ctrl_registers_crto(void *bar, struct json_object *r) +{ + uint32_t crto = mmio_read32(bar + NVME_REG_CRTO); + + if (human()) + json_registers_crto(crto, obj_create_array_obj(r, "crto")); + else + obj_add_int(r, "crto", crto); +} + +static void json_ctrl_registers_aqa(void *bar, struct json_object *r) +{ + uint32_t aqa = mmio_read32(bar + NVME_REG_AQA); + + if (human()) + json_registers_aqa(aqa, obj_create_array_obj(r, "aqa")); + else + obj_add_int(r, "aqa", aqa); +} + +static void json_ctrl_registers_asq(void *bar, struct json_object *r) +{ + uint64_t asq = mmio_read64(bar + NVME_REG_ASQ); + + if (human()) + json_registers_asq(asq, obj_create_array_obj(r, "asq")); + else + obj_add_uint64(r, "asq", asq); +} + +static void json_ctrl_registers_acq(void *bar, struct json_object *r) +{ + uint64_t acq = mmio_read64(bar + NVME_REG_ACQ); + + if (human()) + json_registers_acq(acq, obj_create_array_obj(r, "acq")); + else + obj_add_uint64(r, "acq", acq); +} + +static void json_ctrl_registers_cmbloc(void *bar, struct json_object *r) +{ + uint32_t cmbloc = mmio_read32(bar + NVME_REG_CMBLOC); + + if (human()) + json_registers_cmbloc(cmbloc, bar, 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) +{ + uint32_t cmbsz = mmio_read32(bar + NVME_REG_CMBSZ); + + if (human()) + json_registers_cmbsz(cmbsz, obj_create_array_obj(r, "cmbsz")); + else + obj_add_int(r, "cmbsz", cmbsz); +} + +static void json_ctrl_registers_bpinfo(void *bar, struct json_object *r) +{ + uint32_t bpinfo = mmio_read32(bar + NVME_REG_BPINFO); + + if (human()) + json_registers_bpinfo(bpinfo, obj_create_array_obj(r, "bpinfo")); + else + obj_add_int(r, "bpinfo", bpinfo); +} + +static void json_ctrl_registers_bprsel(void *bar, struct json_object *r) +{ + uint32_t bprsel = mmio_read32(bar + NVME_REG_BPRSEL); + + if (human()) + json_registers_bprsel(bprsel, obj_create_array_obj(r, "bprsel")); + else + obj_add_int(r, "bprsel", bprsel); +} + +static void json_ctrl_registers_bpmbl(void *bar, struct json_object *r) +{ + uint64_t bpmbl = mmio_read64(bar + NVME_REG_BPMBL); + + if (human()) + json_registers_bpmbl(bpmbl, obj_create_array_obj(r, "bpmbl")); + else + obj_add_uint64(r, "bpmbl", bpmbl); +} + +static void json_ctrl_registers_cmbmsc(void *bar, struct json_object *r) +{ + uint64_t cmbmsc = mmio_read64(bar + NVME_REG_CMBMSC); + + if (human()) + json_registers_cmbmsc(cmbmsc, obj_create_array_obj(r, "cmbmsc")); + else + obj_add_uint64(r, "cmbmsc", cmbmsc); +} + +static void json_ctrl_registers_cmbsts(void *bar, struct json_object *r) +{ + uint32_t cmbsts = mmio_read32(bar + NVME_REG_CMBSTS); + + if (human()) + json_registers_cmbsts(cmbsts, obj_create_array_obj(r, "cmbsts")); + else + obj_add_int(r, "cmbsts", cmbsts); +} + +static void json_ctrl_registers_pmrcap(void *bar, struct json_object *r) +{ + uint32_t pmrcap = mmio_read32(bar + NVME_REG_PMRCAP); + + if (human()) + json_registers_pmrcap(pmrcap, obj_create_array_obj(r, "pmrcap")); + else + obj_add_int(r, "pmrcap", pmrcap); +} + +static void json_ctrl_registers_pmrctl(void *bar, struct json_object *r) +{ + uint32_t pmrctl = mmio_read32(bar + NVME_REG_PMRCTL); + + if (human()) + json_registers_pmrctl(pmrctl, obj_create_array_obj(r, "pmrctl")); + else + obj_add_int(r, "pmrctl", pmrctl); +} + +static void json_ctrl_registers_pmrsts(void *bar, struct json_object *r) +{ + uint32_t pmrsts = mmio_read32(bar + NVME_REG_PMRSTS); + + if (human()) + json_registers_pmrsts(pmrsts, bar, 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) +{ + uint32_t pmrebs = mmio_read32(bar + NVME_REG_PMREBS); + + if (human()) + json_registers_pmrebs(pmrebs, obj_create_array_obj(r, "pmrebs")); + else + obj_add_int(r, "pmrebs", pmrebs); +} + +static void json_ctrl_registers_pmrswtp(void *bar, struct json_object *r) +{ + uint32_t pmrswtp = mmio_read32(bar + NVME_REG_PMRSWTP); + + if (human()) + json_registers_pmrswtp(pmrswtp, obj_create_array_obj(r, "pmrswtp")); + else + obj_add_int(r, "pmrswtp", pmrswtp); +} + +static void json_ctrl_registers_pmrmscl(void *bar, struct json_object *r) +{ + uint32_t pmrmscl = mmio_read32(bar + NVME_REG_PMRMSCL); + + if (human()) + json_registers_pmrmscl(pmrmscl, obj_create_array_obj(r, "pmrmscl")); + else + obj_add_uint(r, "pmrmscl", pmrmscl); +} + +static void json_ctrl_registers_pmrmscu(void *bar, struct json_object *r) +{ + uint32_t pmrmscu = mmio_read32(bar + NVME_REG_PMRMSCU); + + if (human()) + json_registers_pmrmscu(pmrmscu, obj_create_array_obj(r, "pmrmscu")); + else + obj_add_uint(r, "pmrmscu", pmrmscu); } static void json_ctrl_registers(void *bar, bool fabrics) { - 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; - struct json_object *root; + struct json_object *r = json_create_object(); - 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); + json_ctrl_registers_cap(bar, r); + json_ctrl_registers_vs(bar, r); + json_ctrl_registers_intms(bar, r); + json_ctrl_registers_intmc(bar, r); + json_ctrl_registers_cc(bar, r); + json_ctrl_registers_csts(bar, r); + json_ctrl_registers_nssr(bar, r); + json_ctrl_registers_crto(bar, r); + json_ctrl_registers_aqa(bar, r); + json_ctrl_registers_asq(bar, r); + json_ctrl_registers_acq(bar, r); + json_ctrl_registers_cmbloc(bar, r); + json_ctrl_registers_cmbsz(bar, r); + json_ctrl_registers_bpinfo(bar, r); + json_ctrl_registers_bprsel(bar, r); + json_ctrl_registers_bpmbl(bar, r); + json_ctrl_registers_cmbmsc(bar, r); + json_ctrl_registers_cmbsts(bar, r); + json_ctrl_registers_pmrcap(bar, r); + json_ctrl_registers_pmrctl(bar, r); + json_ctrl_registers_pmrsts(bar, r); + json_ctrl_registers_pmrebs(bar, r); + json_ctrl_registers_pmrswtp(bar, r); + json_ctrl_registers_pmrmscl(bar, r); + json_ctrl_registers_pmrmscu(bar, r); - root = json_create_object(); - json_object_add_value_uint64(root, "cap", cap); - json_object_add_value_int(root, "vs", vs); - json_object_add_value_int(root, "intms", intms); - json_object_add_value_int(root, "intmc", intmc); - json_object_add_value_int(root, "cc", cc); - json_object_add_value_int(root, "csts", csts); - json_object_add_value_int(root, "nssr", nssr); - json_object_add_value_int(root, "crto", crto); - json_object_add_value_int(root, "aqa", aqa); - json_object_add_value_uint64(root, "asq", asq); - json_object_add_value_uint64(root, "acq", acq); - json_object_add_value_int(root, "cmbloc", cmbloc); - json_object_add_value_int(root, "cmbsz", cmbsz); - json_object_add_value_int(root, "bpinfo", bpinfo); - json_object_add_value_int(root, "bprsel", bprsel); - json_object_add_value_uint64(root, "bpmbl", bpmbl); - json_object_add_value_uint64(root, "cmbmsc", cmbmsc); - json_object_add_value_int(root, "cmbsts", cmbsts); - json_object_add_value_int(root, "pmrcap", pmrcap); - json_object_add_value_int(root, "pmrctl", pmrctl); - json_object_add_value_int(root, "pmrsts", pmrsts); - json_object_add_value_int(root, "pmrebs", pmrebs); - json_object_add_value_int(root, "pmrswtp", pmrswtp); - json_object_add_value_uint(root, "pmrmscl", pmrmscl); - json_object_add_value_uint(root, "pmrmscu", pmrmscu); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } -static void d_json(unsigned char *buf, int len, int width, int group, - struct json_object *array) +static void json_nvme_cmd_set_independent_id_ns(struct nvme_id_independent_id_ns *ns, + unsigned int nsid) { - int i, line_done = 0; - char ascii[32 + 1]; - assert(width < sizeof(ascii)); + struct json_object *r = json_create_object(); - for (i = 0; i < len; i++) { - line_done = 0; - ascii[i % width] = (buf[i] >= '!' && buf[i] <= '~') ? buf[i] : '.'; - if (((i + 1) % width) == 0) { - ascii[i % width + 1] = '\0'; - json_array_add_value_string(array, ascii); - line_done = 1; - } - } - if (!line_done) { - ascii[i % width + 1] = '\0'; - json_array_add_value_string(array, ascii); - } -} + obj_add_int(r, "nsfeat", ns->nsfeat); + obj_add_int(r, "nmic", ns->nmic); + obj_add_int(r, "rescap", ns->rescap); + obj_add_int(r, "fpi", ns->fpi); + obj_add_uint(r, "anagrpid", le32_to_cpu(ns->anagrpid)); + obj_add_int(r, "nsattr", ns->nsattr); + obj_add_int(r, "nvmsetid", le16_to_cpu(ns->nvmsetid)); + obj_add_int(r, "endgid", le16_to_cpu(ns->endgid)); + obj_add_int(r, "nstat", ns->nstat); -static void json_nvme_cmd_set_independent_id_ns( - struct nvme_id_independent_id_ns *ns, - unsigned int nsid) -{ - struct json_object *root; - root = json_create_object(); - - json_object_add_value_int(root, "nsfeat", ns->nsfeat); - json_object_add_value_int(root, "nmic", ns->nmic); - json_object_add_value_int(root, "rescap", ns->rescap); - json_object_add_value_int(root, "fpi", ns->fpi); - json_object_add_value_uint(root, "anagrpid", le32_to_cpu(ns->anagrpid)); - json_object_add_value_int(root, "nsattr", ns->nsattr); - json_object_add_value_int(root, "nvmsetid", le16_to_cpu(ns->nvmsetid)); - json_object_add_value_int(root, "endgid", le16_to_cpu(ns->endgid)); - json_object_add_value_int(root, "nstat", ns->nstat); - - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_nvme_id_ns_descs(void *data, unsigned int nsid) { /* large enough to hold uuid str (37) or nguid str (32) + zero byte */ - char json_str[40]; + char json_str[STR_LEN]; char *json_str_p; - union { __u8 eui64[NVME_NIDT_EUI64_LEN]; __u8 nguid[NVME_NIDT_NGUID_LEN]; __u8 uuid[NVME_UUID_LEN]; __u8 csi; } desc; - - struct json_object *root; + struct json_object *r = json_create_object(); struct json_object *json_array = NULL; - off_t off; int pos, len = 0; int i; @@ -2071,7 +2743,6 @@ static void json_nvme_id_ns_descs(void *data, unsigned int nsid) len = sizeof(desc.eui64); nidt_name = "eui64"; break; - case NVME_NIDT_NGUID: memcpy(desc.nguid, data + off, sizeof(desc.nguid)); for (i = 0; i < sizeof(desc.nguid); i++) @@ -2079,14 +2750,12 @@ static void json_nvme_id_ns_descs(void *data, unsigned int nsid) len = sizeof(desc.nguid); nidt_name = "nguid"; break; - case NVME_NIDT_UUID: memcpy(desc.uuid, data + off, sizeof(desc.uuid)); nvme_uuid_to_string(desc.uuid, json_str); len = sizeof(desc.uuid); nidt_name = "uuid"; break; - case NVME_NIDT_CSI: memcpy(&desc.csi, data + off, sizeof(desc.csi)); sprintf(json_str_p, "%#x", desc.csi); @@ -2102,47 +2771,38 @@ static void json_nvme_id_ns_descs(void *data, unsigned int nsid) if (nidt_name) { struct json_object *elem = json_create_object(); - json_object_add_value_int(elem, "loc", pos); - json_object_add_value_int(elem, "nidt", (int)cur->nidt); - json_object_add_value_int(elem, "nidl", (int)cur->nidl); - json_object_add_value_string(elem, "type", nidt_name); - json_object_add_value_string(elem, nidt_name, json_str); + obj_add_int(elem, "loc", pos); + obj_add_int(elem, "nidt", (int)cur->nidt); + obj_add_int(elem, "nidl", (int)cur->nidl); + obj_add_str(elem, "Type", nidt_name); + obj_add_str(elem, nidt_name, json_str); - if (!json_array) { + if (!json_array) json_array = json_create_array(); - } - json_array_add_value_object(json_array, elem); + array_add_obj(json_array, elem); } len += sizeof(*cur); } - root = json_create_object(); - if (json_array) - json_object_add_value_array(root, "ns-descs", json_array); + obj_add_array(r, "ns-descs", json_array); - json_print_object(root, NULL); - printf("\n"); - - json_free_object(root); + json_print(r); } static void json_nvme_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm) { - struct json_object *root; + struct json_object *r = json_create_object(); - root = json_create_object(); - json_object_add_value_uint(root, "vsl", ctrl_nvm->vsl); - json_object_add_value_uint(root, "wzsl", ctrl_nvm->wzsl); - json_object_add_value_uint(root, "wusl", ctrl_nvm->wusl); - json_object_add_value_uint(root, "dmrl", ctrl_nvm->dmrl); - json_object_add_value_uint(root, "dmrsl", le32_to_cpu(ctrl_nvm->dmrsl)); - json_object_add_value_uint64(root, "dmsl", le64_to_cpu(ctrl_nvm->dmsl)); + obj_add_uint(r, "vsl", ctrl_nvm->vsl); + obj_add_uint(r, "wzsl", ctrl_nvm->wzsl); + obj_add_uint(r, "wusl", ctrl_nvm->wusl); + obj_add_uint(r, "dmrl", ctrl_nvm->dmrl); + obj_add_uint(r, "dmrsl", le32_to_cpu(ctrl_nvm->dmrsl)); + obj_add_uint64(r, "dmsl", le64_to_cpu(ctrl_nvm->dmsl)); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_nvme_nvm_id_ns(struct nvme_nvm_id_ns *nvm_ns, @@ -2150,122 +2810,131 @@ static void json_nvme_nvm_id_ns(struct nvme_nvm_id_ns *nvm_ns, unsigned int lba_index, bool cap_only) { - struct json_object *root; - struct json_object *elbafs; + struct json_object *r = json_create_object(); + struct json_object *elbafs = json_create_array(); int i; - root = json_create_object(); + if (!cap_only) + obj_add_uint64(r, "lbstm", le64_to_cpu(nvm_ns->lbstm)); - if (!cap_only) { - json_object_add_value_uint64(root, "lbstm", le64_to_cpu(nvm_ns->lbstm)); - } - json_object_add_value_int(root, "pic", nvm_ns->pic); + obj_add_int(r, "pic", nvm_ns->pic); - elbafs = json_create_array(); - json_object_add_value_array(root, "elbafs", elbafs); + obj_add_array(r, "elbafs", elbafs); for (i = 0; i <= ns->nlbaf; i++) { struct json_object *elbaf = json_create_object(); unsigned int elbaf_val = le32_to_cpu(nvm_ns->elbaf[i]); - json_object_add_value_uint(elbaf, "sts", elbaf_val & 0x7F); - json_object_add_value_uint(elbaf, "pif", (elbaf_val >> 7) & 0x3); + obj_add_uint(elbaf, "sts", elbaf_val & 0x7F); + obj_add_uint(elbaf, "pif", (elbaf_val >> 7) & 0x3); - json_array_add_value_object(elbafs, elbaf); + array_add_obj(elbafs, elbaf); } - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_nvme_zns_id_ctrl(struct nvme_zns_id_ctrl *ctrl) { - struct json_object *root; + struct json_object *r = json_create_object(); - root = json_create_object(); - json_object_add_value_int(root, "zasl", ctrl->zasl); + obj_add_int(r, "zasl", ctrl->zasl); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_nvme_zns_id_ns(struct nvme_zns_id_ns *ns, struct nvme_id_ns *id_ns) { - struct json_object *root; - struct json_object *lbafs; + struct json_object *r = json_create_object(); + struct json_object *lbafs = json_create_array(); int i; - root = json_create_object(); - json_object_add_value_int(root, "zoc", le16_to_cpu(ns->zoc)); - json_object_add_value_int(root, "ozcs", le16_to_cpu(ns->ozcs)); - json_object_add_value_uint(root, "mar", le32_to_cpu(ns->mar)); - json_object_add_value_uint(root, "mor", le32_to_cpu(ns->mor)); - json_object_add_value_uint(root, "rrl", le32_to_cpu(ns->rrl)); - json_object_add_value_uint(root, "frl", le32_to_cpu(ns->frl)); - json_object_add_value_uint(root, "rrl1", le32_to_cpu(ns->rrl1)); - json_object_add_value_uint(root, "rrl2", le32_to_cpu(ns->rrl2)); - json_object_add_value_uint(root, "rrl3", le32_to_cpu(ns->rrl3)); - json_object_add_value_uint(root, "frl1", le32_to_cpu(ns->frl1)); - json_object_add_value_uint(root, "frl2", le32_to_cpu(ns->frl2)); - json_object_add_value_uint(root, "frl3", le32_to_cpu(ns->frl3)); - json_object_add_value_uint(root, "numzrwa", le32_to_cpu(ns->numzrwa)); - json_object_add_value_int(root, "zrwafg", le16_to_cpu(ns->zrwafg)); - json_object_add_value_int(root, "zrwasz", le16_to_cpu(ns->zrwasz)); - json_object_add_value_int(root, "zrwacap", ns->zrwacap); + obj_add_int(r, "zoc", le16_to_cpu(ns->zoc)); + obj_add_int(r, "ozcs", le16_to_cpu(ns->ozcs)); + obj_add_uint(r, "mar", le32_to_cpu(ns->mar)); + obj_add_uint(r, "mor", le32_to_cpu(ns->mor)); + obj_add_uint(r, "rrl", le32_to_cpu(ns->rrl)); + obj_add_uint(r, "frl", le32_to_cpu(ns->frl)); + obj_add_uint(r, "rrl1", le32_to_cpu(ns->rrl1)); + obj_add_uint(r, "rrl2", le32_to_cpu(ns->rrl2)); + obj_add_uint(r, "rrl3", le32_to_cpu(ns->rrl3)); + obj_add_uint(r, "frl1", le32_to_cpu(ns->frl1)); + obj_add_uint(r, "frl2", le32_to_cpu(ns->frl2)); + obj_add_uint(r, "frl3", le32_to_cpu(ns->frl3)); + obj_add_uint(r, "numzrwa", le32_to_cpu(ns->numzrwa)); + obj_add_int(r, "zrwafg", le16_to_cpu(ns->zrwafg)); + obj_add_int(r, "zrwasz", le16_to_cpu(ns->zrwasz)); + obj_add_int(r, "zrwacap", ns->zrwacap); - lbafs = json_create_array(); - json_object_add_value_array(root, "lbafe", lbafs); + obj_add_array(r, "lbafe", lbafs); for (i = 0; i <= id_ns->nlbaf; i++) { struct json_object *lbaf = json_create_object(); - json_object_add_value_int(lbaf, "zsze", - le64_to_cpu(ns->lbafe[i].zsze)); - json_object_add_value_int(lbaf, "zdes", ns->lbafe[i].zdes); + obj_add_uint64(lbaf, "zsze", le64_to_cpu(ns->lbafe[i].zsze)); + obj_add_int(lbaf, "zdes", ns->lbafe[i].zdes); - json_array_add_value_object(lbafs, lbaf); + array_add_obj(lbafs, lbaf); } - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + + json_print(r); } static void json_nvme_list_ns(struct nvme_ns_list *ns_list) { - struct json_object *root; + struct json_object *r = json_create_object(); struct json_object *valid_attrs; - struct json_object *valid; + struct json_object *valid = json_create_array(); int i; - root = json_create_object(); - valid = json_create_array(); - for (i = 0; i < 1024; i++) { if (ns_list->ns[i]) { valid_attrs = json_create_object(); - json_object_add_value_uint(valid_attrs, "nsid", - le32_to_cpu(ns_list->ns[i])); - json_array_add_value_object(valid, valid_attrs); + obj_add_uint(valid_attrs, "nsid", le32_to_cpu(ns_list->ns[i])); + array_add_obj(valid, valid_attrs); } } - json_object_add_value_array(root, "nsid_list", valid); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + + obj_add_array(r, "nsid_list", valid); + + json_print(r); +} + +static void json_zns_start_zone_list(__u64 nr_zones, struct json_object **zone_list) +{ + *zone_list = json_create_array(); +} + +static void json_zns_changed(struct nvme_zns_changed_zone_log *log) +{ + struct json_object *r = json_create_object(); + char json_str[STR_LEN]; + uint16_t nrzid = le16_to_cpu(log->nrzid); + int i; + + if (nrzid == 0xFFFF) { + obj_add_result(r, "Too many zones have changed to fit into the log. Use report zones for changes."); + } else { + obj_add_uint(r, "nrzid", nrzid); + for (i = 0; i < nrzid; i++) { + sprintf(json_str, "zid %03d", i); + obj_add_uint64(r, json_str, (uint64_t)le64_to_cpu(log->zid[i])); + } + } + + json_print(r); } static void json_zns_finish_zone_list(__u64 nr_zones, struct json_object *zone_list) { - struct json_object *root = json_create_object(); - json_object_add_value_uint(root, "nr_zones", nr_zones); - json_object_add_value_array(root, "zone_list", zone_list); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + struct json_object *r = json_create_object(); + + obj_add_uint(r, "nr_zones", nr_zones); + obj_add_array(r, "zone_list", zone_list); + + json_print(r); } static void json_nvme_zns_report_zones(void *report, __u32 descs, @@ -2283,127 +2952,739 @@ static void json_nvme_zns_report_zones(void *report, __u32 descs, (report + sizeof(*r) + i * (sizeof(*desc) + ext_size)); zone = json_create_object(); - json_object_add_value_uint64(zone, "slba", - le64_to_cpu(desc->zslba)); - json_object_add_value_uint64(zone, "wp", - le64_to_cpu(desc->wp)); - json_object_add_value_uint64(zone, "cap", - le64_to_cpu(desc->zcap)); - json_object_add_value_string(zone, "state", - nvme_zone_state_to_string(desc->zs >> 4)); - json_object_add_value_string(zone, "type", - nvme_zone_type_to_string(desc->zt)); - json_object_add_value_uint(zone, "attrs", desc->za); - json_object_add_value_uint(zone, "attrs_info", desc->zai); + obj_add_uint64(zone, "slba", le64_to_cpu(desc->zslba)); + obj_add_uint64(zone, "wp", le64_to_cpu(desc->wp)); + obj_add_uint64(zone, "cap", le64_to_cpu(desc->zcap)); + obj_add_str(zone, "state", nvme_zone_state_to_string(desc->zs >> 4)); + obj_add_str(zone, "type", nvme_zone_type_to_string(desc->zt)); + obj_add_uint(zone, "attrs", desc->za); + obj_add_uint(zone, "attrs_info", desc->zai); if (ext_size) { if (desc->za & NVME_ZNS_ZA_ZDEV) { ext_data = json_create_array(); d_json((unsigned char *)desc + sizeof(*desc), ext_size, 16, 1, ext_data); - json_object_add_value_array(zone, "ext_data", - ext_data); + obj_add_array(zone, "ext_data", ext_data); } else { - json_object_add_value_string(zone, "ext_data", "Not valid"); + obj_add_str(zone, "ext_data", "Not valid"); } } - json_array_add_value_object(zone_list, zone); + array_add_obj(zone_list, zone); } } +static void json_feature_show_fields_arbitration(struct json_object *r, unsigned int result) +{ + char json_str[STR_LEN]; + + obj_add_uint(r, "High Priority Weight (HPW)", ((result & 0xff000000) >> 24) + 1); + obj_add_uint(r, "Medium Priority Weight (MPW)", ((result & 0xff0000) >> 16) + 1); + obj_add_uint(r, "Low Priority Weight (LPW)", ((result & 0xff00) >> 8) + 1); + + if ((result & 7) == 7) + sprintf(json_str, "No limit"); + else + sprintf(json_str, "%u", 1 << (result & 7)); + + obj_add_str(r, "Arbitration Burst (AB)", json_str); +} + +static void json_feature_show_fields_power_mgmt(struct json_object *r, unsigned int result) +{ + __u8 field = (result & 0xe0) >> 5; + + obj_add_uint(r, "Workload Hint (WH)", field); + obj_add_str(r, "WH description", nvme_feature_wl_hints_to_string(field)); + obj_add_uint(r, "Power State (PS)", result & 0x1f); +} + +static void json_lba_range_entry(struct nvme_lba_range_type *lbrt, int nr_ranges, + struct json_object *r) +{ + char json_str[STR_LEN]; + struct json_object *lbare; + int i; + int j; + struct json_object *lbara = json_create_array(); + + obj_add_array(r, "LBA Ranges", lbara); + + for (i = 0; i <= nr_ranges; i++) { + lbare = json_create_object(); + array_add_obj(lbara, lbare); + + obj_add_int(lbare, "LBA range", i); + + obj_add_uint_nx(lbare, "type", lbrt->entry[i].type); + + obj_add_str(lbare, "type description", + nvme_feature_lba_type_to_string(lbrt->entry[i].type)); + + obj_add_uint_nx(lbare, "attributes", lbrt->entry[i].attributes); + + obj_add_str(lbare, "attribute[0]", lbrt->entry[i].attributes & 1 ? + "LBA range may be overwritten" : "LBA range should not be overwritten"); + + obj_add_str(lbare, "attribute[1]", lbrt->entry[i].attributes & 2 ? + "LBA range should be hidden from the OS/EFI/BIOS" : + "LBA range should be visible from the OS/EFI/BIOS"); + + obj_add_nprix64(lbare, "slba", le64_to_cpu(lbrt->entry[i].slba)); + + obj_add_nprix64(lbare, "nlb", le64_to_cpu(lbrt->entry[i].nlb)); + + for (j = 0; j < ARRAY_SIZE(lbrt->entry[i].guid); j++) + sprintf(&json_str[j * 2], "%02x", lbrt->entry[i].guid[j]); + + obj_add_str(lbare, "guid", json_str); + } +} + +static void json_feature_show_fields_lba_range(struct json_object *r, __u8 field, + unsigned char *buf) +{ + obj_add_uint(r, "Number of LBA Ranges (NUM)", field + 1); + + if (buf) + json_lba_range_entry((struct nvme_lba_range_type *)buf, field, r); +} + +static void json_feature_show_fields_temp_thresh(struct json_object *r, unsigned int result) +{ + __u8 field = (result & 0x300000) >> 20; + char json_str[STR_LEN]; + + obj_add_uint(r, "Threshold Type Select (THSEL)", field); + obj_add_str(r, "THSEL description", nvme_feature_temp_type_to_string(field)); + + field = (result & 0xf0000) >> 16; + + obj_add_uint(r, "Threshold Temperature Select (TMPSEL)", field); + obj_add_str(r, "TMPSEL description", nvme_feature_temp_sel_to_string(field)); + + sprintf(json_str, "%ld Celsius", kelvin_to_celsius(result & 0xffff)); + obj_add_str(r, "Temperature Threshold (TMPTH)", json_str); + + sprintf(json_str, "%u K", result & 0xffff); + obj_add_str(r, "TMPTH kelvin", json_str); +} + +static void json_feature_show_fields_err_recovery(struct json_object *r, unsigned int result) +{ + char json_str[STR_LEN]; + + obj_add_str(r, "Deallocated or Unwritten Logical Block Error Enable (DULBE)", + (result & 0x10000) >> 16 ? "Enabled" : "Disabled"); + + sprintf(json_str, "%u ms", (result & 0xffff) * 100); + obj_add_str(r, "Time Limited Error Recovery (TLER)", json_str); +} + +static void json_feature_show_fields_volatile_wc(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Volatile Write Cache Enable (WCE)", result & 1 ? "Enabled" : "Disabled"); +} + +static void json_feature_show_fields_num_queues(struct json_object *r, unsigned int result) +{ + obj_add_uint(r, "Number of IO Completion Queues Allocated (NCQA)", + ((result & 0xffff0000) >> 16) + 1); + obj_add_uint(r, "Number of IO Submission Queues Allocated (NSQA)", (result & 0xffff) + 1); +} + +static void json_feature_show_fields_irq_coalesce(struct json_object *r, unsigned int result) +{ + char json_str[STR_LEN]; + + sprintf(json_str, "%u usec", ((result & 0xff00) >> 8) * 100); + obj_add_str(r, "Aggregation Time (TIME)", json_str); + + obj_add_uint(r, "Aggregation Threshold (THR)", (result & 0xff) + 1); +} + +static void json_feature_show_fields_irq_config(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Coalescing Disable (CD)", (result & 0x10000) >> 16 ? "True" : "False"); + obj_add_uint(r, "Interrupt Vector (IV)", result & 0xffff); +} + +static void json_feature_show_fields_write_atomic(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Disable Normal (DN)", result & 1 ? "True" : "False"); +} + +static void json_feature_show_fields_async_event(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Discovery Log Page Change Notices", (result & 0x80000000) >> 31 ? + "Send async event" : "Do not send async event"); + obj_add_str(r, "Endurance Group Event Aggregate Log Change Notices", (result & 0x4000) >> 14 ? + "Send async event" : "Do not send async event"); + obj_add_str(r, "LBA Status Information Notices", (result & 0x2000) >> 13 ? + "Send async event" : "Do not send async event"); + obj_add_str(r, "Predictable Latency Event Aggregate Log Change Notices", + (result & 0x1000) >> 12 ? "Send async event" : "Do not send async event"); + obj_add_str(r, "Asymmetric Namespace Access Change Notices", (result & 0x800) >> 11 ? + "Send async event" : "Do not send async event"); + obj_add_str(r, "Telemetry Log Notices", (result & 0x400) >> 10 ? "Send async event" : + "Do not send async event"); + obj_add_str(r, "Firmware Activation Notices", (result & 0x200) >> 9 ? "Send async event" : + "Do not send async event"); + obj_add_str(r, "Namespace Attribute Notices", (result & 0x100) >> 8 ? "Send async event" : + "Do not send async event"); + obj_add_str(r, "SMART / Health Critical Warnings", result & 0xff ? "Send async event" : + "Do not send async event"); +} + +static void json_auto_pst(struct nvme_feat_auto_pst *apst, struct json_object *r) +{ + int i; + __u64 value; + char json_str[STR_LEN]; + struct json_object *apsta = json_create_array(); + struct json_object *apste; + + obj_add_array(r, "Auto PST Entries", apsta); + + for (i = 0; i < ARRAY_SIZE(apst->apst_entry); i++) { + apste = json_create_object(); + array_add_obj(apsta, apste); + sprintf(json_str, "%2d", i); + obj_add_str(apste, "entry", json_str); + value = le64_to_cpu(apst->apst_entry[i]); + sprintf(json_str, "%u ms", (__u32)NVME_GET(value, APST_ENTRY_ITPT)); + obj_add_str(apste, "Idle Time Prior to Transition (ITPT)", json_str); + obj_add_uint(apste, "Idle Transition Power State (ITPS)", + (__u32)NVME_GET(value, APST_ENTRY_ITPS)); + } +} + +static void json_feature_show_fields_auto_pst(struct json_object *r, unsigned int result, + unsigned char *buf) +{ + obj_add_str(r, "Autonomous Power State Transition Enable (APSTE)", result & 1 ? "Enabled" : + "Disabled"); + + if (buf) + json_auto_pst((struct nvme_feat_auto_pst *)buf, r); +} + +static void json_host_mem_buffer(struct nvme_host_mem_buf_attrs *hmb, struct json_object *r) +{ + char json_str[STR_LEN]; + + obj_add_uint(r, "Host Memory Descriptor List Entry Count (HMDLEC)", le32_to_cpu(hmb->hmdlec)); + + sprintf(json_str, "0x%x", le32_to_cpu(hmb->hmdlau)); + obj_add_str(r, "Host Memory Descriptor List Address (HMDLAU)", json_str); + + sprintf(json_str, "0x%x", le32_to_cpu(hmb->hmdlal)); + obj_add_str(r, "Host Memory Descriptor List Address (HMDLAL)", json_str); + + obj_add_uint(r, "Host Memory Buffer Size (HSIZE)", le32_to_cpu(hmb->hsize)); +} + +static void json_feature_show_fields_host_mem_buf(struct json_object *r, unsigned int result, + unsigned char *buf) +{ + obj_add_str(r, "Enable Host Memory (EHM)", result & 1 ? "Enabled" : "Disabled"); + + if (buf) + json_host_mem_buffer((struct nvme_host_mem_buf_attrs *)buf, r); +} + +static void json_timestamp(struct json_object *r, struct nvme_timestamp *ts) +{ + char buffer[BUF_LEN]; + time_t timestamp = int48_to_long(ts->timestamp) / 1000; + struct tm *tm = localtime(×tamp); + + obj_add_uint64(r, "timestamp", int48_to_long(ts->timestamp)); + + if(!strftime(buffer, sizeof(buffer), "%c %Z", tm)) + sprintf(buffer, "%s", "-"); + + obj_add_str(r, "timestamp string", buffer); + + obj_add_str(r, "timestamp origin", ts->attr & 2 ? + "The Timestamp field was initialized with a Timestamp value using a Set Features command." : + "The Timestamp field was initialized to 0h by a Controller Level Reset."); + + obj_add_str(r, "synch", ts->attr & 1 ? + "The controller may have stopped counting during vendor specific intervals after the Timestamp value was initialized." : + "The controller counted time in milliseconds continuously since the Timestamp value was initialized."); +} + +static void json_feature_show_fields_timestamp(struct json_object *r, unsigned char *buf) +{ + if (buf) + json_timestamp(r, (struct nvme_timestamp *)buf); +} + +static void json_feature_show_fields_kato(struct json_object *r, unsigned int result) +{ + obj_add_uint(r, "Keep Alive Timeout (KATO) in milliseconds", result); +} + +static void json_feature_show_fields_hctm(struct json_object *r, unsigned int result) +{ + char json_str[STR_LEN]; + + sprintf(json_str, "%u K", result >> 16); + obj_add_str(r, "Thermal Management Temperature 1 (TMT1)", json_str); + + sprintf(json_str, "%ld Celsius", kelvin_to_celsius(result >> 16)); + obj_add_str(r, "TMT1 celsius", json_str); + + sprintf(json_str, "%u K", result & 0xffff); + obj_add_str(r, "Thermal Management Temperature 2", json_str); + + sprintf(json_str, "%ld Celsius", kelvin_to_celsius(result & 0xffff)); + obj_add_str(r, "TMT2 celsius", json_str); +} + +static void json_feature_show_fields_nopsc(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Non-Operational Power State Permissive Mode Enable (NOPPME)", result & 1 ? + "True" : "False"); +} + +static void json_feature_show_fields_rrl(struct json_object *r, unsigned int result) +{ + obj_add_uint(r, "Read Recovery Level (RRL)", result & 0xf); +} + +static void json_plm_config(struct nvme_plm_config *plmcfg, struct json_object *r) +{ + char json_str[STR_LEN]; + + sprintf(json_str, "%04x", le16_to_cpu(plmcfg->ee)); + obj_add_str(r, "Enable Event", json_str); + + obj_add_uint64(r, "DTWIN Reads Threshold", le64_to_cpu(plmcfg->dtwinrt)); + obj_add_uint64(r, "DTWIN Writes Threshold", le64_to_cpu(plmcfg->dtwinwt)); + obj_add_uint64(r, "DTWIN Time Threshold", le64_to_cpu(plmcfg->dtwintt)); +} + +static void json_feature_show_fields_plm_config(struct json_object *r, unsigned int result, + unsigned char *buf) +{ + obj_add_str(r, "Predictable Latency Window Enabled", result & 1 ? "True" : "False"); + + if (buf) + json_plm_config((struct nvme_plm_config *)buf, r); +} + +static void json_feature_show_fields_plm_window(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Window Select", nvme_plm_window_to_string(result)); +} + +static void json_feature_show_fields_lba_sts_interval(struct json_object *r, unsigned int result) +{ + obj_add_uint(r, "LBA Status Information Poll Interval (LSIPI)", result >> 16); + obj_add_uint(r, "LBA Status Information Report Interval (LSIRI)", result & 0xffff); +} + +static void json_feature_show_fields_host_behavior(struct json_object *r, unsigned char *buf) +{ + if (buf) + obj_add_str(r, "Host Behavior Support", buf[0] & 0x1 ? "True" : "False"); +} + +static void json_feature_show_fields_sanitize(struct json_object *r, unsigned int result) +{ + obj_add_uint(r, "No-Deallocate Response Mode (NODRM)", result & 1); +} + +static void json_feature_show_fields_endurance_evt_cfg(struct json_object *r, unsigned int result) +{ + obj_add_uint(r, "Endurance Group Identifier (ENDGID)", result & 0xffff); + obj_add_uint(r, "Endurance Group Critical Warnings", result >> 16 & 0xff); +} + +static void json_feature_show_fields_iocs_profile(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "I/O Command Set Profile", result & 0x1 ? "True" : "False"); +} + +static void json_feature_show_fields_spinup_control(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Spinup control feature Enabled", result & 1 ? "True" : "False"); +} + +static void json_host_metadata(struct json_object *r, enum nvme_features_id fid, + struct nvme_host_metadata *data) +{ + struct nvme_metadata_element_desc *desc = &data->descs[0]; + int i; + char val[VAL_LEN]; + __u16 len; + char json_str[STR_LEN]; + struct json_object *desca = json_create_array(); + struct json_object *desce; + + obj_add_int(r, "Num Metadata Element Descriptors", data->ndesc); + + obj_add_array(r, "Metadata Element Descriptors", desca); + + for (i = 0; i < data->ndesc; i++) { + desce = json_create_object(); + array_add_obj(desca, desce); + + obj_add_int(desce, "Element", i); + + sprintf(json_str, "0x%02x", desc->type); + obj_add_str(desce, "Type", json_str); + + obj_add_str(desce, "Type definition", + nvme_host_metadata_type_to_string(fid, desc->type)); + + obj_add_int(desce, "Revision", desc->rev); + + len = le16_to_cpu(desc->len); + obj_add_int(desce, "Length", len); + + strncpy(val, (char *)desc->val, min(sizeof(val) - 1, len)); + obj_add_str(desce, "Value", val); + + desc = (struct nvme_metadata_element_desc *)&desc->val[desc->len]; + } +} + +static void json_feature_show_fields_ns_metadata(struct json_object *r, enum nvme_features_id fid, + unsigned char *buf) +{ + if (buf) + json_host_metadata(r, fid, (struct nvme_host_metadata *)buf); +} + +static void json_feature_show_fields_sw_progress(struct json_object *r, unsigned int result) +{ + obj_add_uint(r, "Pre-boot Software Load Count (PBSLC)", result & 0xff); +} + +static void json_feature_show_fields_host_id(struct json_object *r, unsigned char *buf) +{ + uint64_t ull = 0; + int i; + + if (buf) { + for (i = sizeof(ull) / sizeof(*buf); i; i--) { + ull |= buf[i - 1]; + if (i - 1) + ull <<= BYTE_TO_BIT(sizeof(buf[i])); + } + obj_add_uint64(r, "Host Identifier (HOSTID)", ull); + } +} + +static void json_feature_show_fields_resv_mask(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Mask Reservation Preempted Notification (RESPRE)", (result & 8) >> 3 ? + "True" : "False"); + obj_add_str(r, "Mask Reservation Released Notification (RESREL)", (result & 4) >> 2 ? + "True" : "False"); + obj_add_str(r, "Mask Registration Preempted Notification (REGPRE)", (result & 2) >> 1 ? + "True" : "False"); +} + +static void json_feature_show_fields_resv_persist(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Persist Through Power Loss (PTPL)", result & 1 ? "True" : "False"); +} + +static void json_feature_show_fields_write_protect(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Namespace Write Protect", nvme_ns_wp_cfg_to_string(result)); +} + +static void json_feature_show_fields_fdp(struct json_object *r, unsigned int result) +{ + obj_add_str(r, "Flexible Direct Placement Enable (FDPE)", result & 1 ? "Yes" : "No"); + obj_add_uint(r, "Flexible Direct Placement Configuration Index", result >> 8 & 0xf); +} + +static void json_feature_show_fields_fdp_events(struct json_object *r, unsigned int result, + unsigned char *buf) +{ + unsigned int i; + struct nvme_fdp_supported_event_desc *d; + char json_str[STR_LEN]; + + for (i = 0; i < result; i++) { + d = &((struct nvme_fdp_supported_event_desc *)buf)[i]; + sprintf(json_str, "%s", d->evta & 0x1 ? "Enabled" : "Not enabled"); + obj_add_str(r, nvme_fdp_event_to_string(d->evt), json_str); + } +} + +static void json_feature_show(enum nvme_features_id fid, int sel, unsigned int result) +{ + struct json_object *r; + char json_str[STR_LEN]; + + sprintf(json_str, "feature: %#0*x", fid ? 4 : 2, fid); + r = obj_create(json_str); + + obj_add_str(r, "name", nvme_feature_to_string(fid)); + + sprintf(json_str, "%#0*x", result ? 10 : 8, result); + obj_add_str(r, nvme_select_to_string(sel), json_str); + + json_print(r); +} + +static void json_feature_show_fields(enum nvme_features_id fid, unsigned int result, + unsigned char *buf) +{ + struct json_object *r; + char json_str[STR_LEN]; + + sprintf(json_str, "Feature: %#0*x", fid ? 4 : 2, fid); + r = obj_create(json_str); + + switch (fid) { + case NVME_FEAT_FID_ARBITRATION: + json_feature_show_fields_arbitration(r, result); + break; + case NVME_FEAT_FID_POWER_MGMT: + json_feature_show_fields_power_mgmt(r, result); + break; + case NVME_FEAT_FID_LBA_RANGE: + json_feature_show_fields_lba_range(r, result & 0x3f, buf); + break; + case NVME_FEAT_FID_TEMP_THRESH: + json_feature_show_fields_temp_thresh(r, result); + break; + case NVME_FEAT_FID_ERR_RECOVERY: + json_feature_show_fields_err_recovery(r, result); + break; + case NVME_FEAT_FID_VOLATILE_WC: + json_feature_show_fields_volatile_wc(r, result); + break; + case NVME_FEAT_FID_NUM_QUEUES: + json_feature_show_fields_num_queues(r, result); + break; + case NVME_FEAT_FID_IRQ_COALESCE: + json_feature_show_fields_irq_coalesce(r, result); + break; + case NVME_FEAT_FID_IRQ_CONFIG: + json_feature_show_fields_irq_config(r, result); + break; + case NVME_FEAT_FID_WRITE_ATOMIC: + json_feature_show_fields_write_atomic(r, result); + break; + case NVME_FEAT_FID_ASYNC_EVENT: + json_feature_show_fields_async_event(r, result); + break; + case NVME_FEAT_FID_AUTO_PST: + json_feature_show_fields_auto_pst(r, result, buf); + break; + case NVME_FEAT_FID_HOST_MEM_BUF: + json_feature_show_fields_host_mem_buf(r, result, buf); + break; + case NVME_FEAT_FID_TIMESTAMP: + json_feature_show_fields_timestamp(r, buf); + break; + case NVME_FEAT_FID_KATO: + json_feature_show_fields_kato(r, result); + break; + case NVME_FEAT_FID_HCTM: + json_feature_show_fields_hctm(r, result); + break; + case NVME_FEAT_FID_NOPSC: + json_feature_show_fields_nopsc(r, result); + break; + case NVME_FEAT_FID_RRL: + json_feature_show_fields_rrl(r, result); + break; + case NVME_FEAT_FID_PLM_CONFIG: + json_feature_show_fields_plm_config(r, result, buf); + break; + case NVME_FEAT_FID_PLM_WINDOW: + json_feature_show_fields_plm_window(r, result); + break; + case NVME_FEAT_FID_LBA_STS_INTERVAL: + json_feature_show_fields_lba_sts_interval(r, result); + break; + case NVME_FEAT_FID_HOST_BEHAVIOR: + json_feature_show_fields_host_behavior(r, buf); + break; + case NVME_FEAT_FID_SANITIZE: + json_feature_show_fields_sanitize(r, result); + break; + case NVME_FEAT_FID_ENDURANCE_EVT_CFG: + json_feature_show_fields_endurance_evt_cfg(r, result); + break; + case NVME_FEAT_FID_IOCS_PROFILE: + json_feature_show_fields_iocs_profile(r, result); + break; + case NVME_FEAT_FID_SPINUP_CONTROL: + 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; + case NVME_FEAT_FID_SW_PROGRESS: + json_feature_show_fields_sw_progress(r, result); + break; + case NVME_FEAT_FID_HOST_ID: + json_feature_show_fields_host_id(r, buf); + break; + case NVME_FEAT_FID_RESV_MASK: + json_feature_show_fields_resv_mask(r, result); + break; + case NVME_FEAT_FID_RESV_PERSIST: + json_feature_show_fields_resv_persist(r, result); + break; + case NVME_FEAT_FID_WRITE_PROTECT: + json_feature_show_fields_write_protect(r, result); + break; + case NVME_FEAT_FID_FDP: + json_feature_show_fields_fdp(r, result); + break; + case NVME_FEAT_FID_FDP_EVENTS: + json_feature_show_fields_fdp_events(r, result, buf); + break; + default: + break; + } + + json_print(r); +} + +void json_id_ctrl_rpmbs(__le32 ctrl_rpmbs) +{ + struct json_object *r = json_create_object(); + __u32 rpmbs = le32_to_cpu(ctrl_rpmbs); + __u32 asz = (rpmbs & 0xFF000000) >> 24; + __u32 tsz = (rpmbs & 0xFF0000) >> 16; + __u32 rsvd = (rpmbs & 0xFFC0) >> 6; + __u32 auth = (rpmbs & 0x38) >> 3; + __u32 rpmb = rpmbs & 7; + + obj_add_uint_nx(r, "[31:24]: Access Size", asz); + obj_add_uint_nx(r, "[23:16]: Total Size", tsz); + + if (rsvd) + obj_add_uint_nx(r, "[15:6]: Reserved", rsvd); + + obj_add_uint_nx(r, "[5:3]: Authentication Method", auth); + obj_add_uint_nx(r, "[2:0]: Number of RPMB Units", rpmb); + + json_print(r); +} + +static void json_lba_range(struct nvme_lba_range_type *lbrt, int nr_ranges) +{ + struct json_object *r = json_create_object(); + + json_lba_range_entry(lbrt, nr_ranges, r); + + json_print(r); +} + +static void json_lba_status_info(__u32 result) +{ + struct json_object *r = json_create_object(); + + obj_add_uint(r, "LBA Status Information Poll Interval (LSIPI)", (result >> 16) & 0xffff); + obj_add_uint(r, "LBA Status Information Report Interval (LSIRI)", result & 0xffff); + + json_print(r); +} + +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); + + json_print(r); +} + static void json_nvme_list_ctrl(struct nvme_ctrl_list *ctrl_list) { __u16 num = le16_to_cpu(ctrl_list->num); - struct json_object *root; + struct json_object *r = json_create_object(); struct json_object *valid_attrs; - struct json_object *valid; + struct json_object *valid = json_create_array(); int i; - root = json_create_object(); - valid = json_create_array(); - - json_object_add_value_uint(root, "num_ctrl", - le16_to_cpu(ctrl_list->num)); + obj_add_uint(r, "num_ctrl", le16_to_cpu(ctrl_list->num)); for (i = 0; i < min(num, 2047); i++) { - valid_attrs = json_create_object(); - json_object_add_value_uint(valid_attrs, "ctrl_id", - le16_to_cpu(ctrl_list->identifier[i])); - json_array_add_value_object(valid, valid_attrs); + obj_add_uint(valid_attrs, "ctrl_id", le16_to_cpu(ctrl_list->identifier[i])); + array_add_obj(valid, valid_attrs); } - json_object_add_value_array(root, "ctrl_list", valid); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + obj_add_array(r, "ctrl_list", valid); + + json_print(r); } static void json_nvme_id_nvmset(struct nvme_id_nvmset_list *nvmset, unsigned int nvmeset_id) { __u32 nent = nvmset->nid; - struct json_object *entries; - struct json_object *root; + struct json_object *entries = json_create_array(); + struct json_object *r = json_create_object(); int i; - root = json_create_object(); + obj_add_int(r, "nid", nent); - json_object_add_value_int(root, "nid", nent); - - entries = json_create_array(); for (i = 0; i < nent; i++) { struct json_object *entry = json_create_object(); - json_object_add_value_int(entry, "nvmset_id", - le16_to_cpu(nvmset->ent[i].nvmsetid)); - json_object_add_value_int(entry, "endurance_group_id", - le16_to_cpu(nvmset->ent[i].endgid)); - json_object_add_value_uint(entry, "random_4k_read_typical", - le32_to_cpu(nvmset->ent[i].rr4kt)); - json_object_add_value_uint(entry, "optimal_write_size", - le32_to_cpu(nvmset->ent[i].ows)); - json_object_add_value_uint128(entry, "total_nvmset_cap", - le128_to_cpu(nvmset->ent[i].tnvmsetcap)); - json_object_add_value_uint128(entry, "unalloc_nvmset_cap", - le128_to_cpu(nvmset->ent[i].unvmsetcap)); - json_array_add_value_object(entries, entry); + obj_add_int(entry, "nvmset_id", le16_to_cpu(nvmset->ent[i].nvmsetid)); + obj_add_int(entry, "endurance_group_id", le16_to_cpu(nvmset->ent[i].endgid)); + obj_add_uint(entry, "random_4k_read_typical", le32_to_cpu(nvmset->ent[i].rr4kt)); + obj_add_uint(entry, "optimal_write_size", le32_to_cpu(nvmset->ent[i].ows)); + obj_add_uint128(entry, "total_nvmset_cap", le128_to_cpu(nvmset->ent[i].tnvmsetcap)); + obj_add_uint128(entry, "unalloc_nvmset_cap", + le128_to_cpu(nvmset->ent[i].unvmsetcap)); + array_add_obj(entries, entry); } - json_object_add_value_array(root, "NVMSet", entries); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + obj_add_array(r, "NVMSet", entries); + + json_print(r); } static void json_nvme_primary_ctrl_cap(const struct nvme_primary_ctrl_cap *caps) { - struct json_object *root; + struct json_object *r = json_create_object(); - root = json_create_object(); + obj_add_uint(r, "cntlid", le16_to_cpu(caps->cntlid)); + obj_add_uint(r, "portid", le16_to_cpu(caps->portid)); + obj_add_uint(r, "crt", caps->crt); - json_object_add_value_uint(root, "cntlid", le16_to_cpu(caps->cntlid)); - json_object_add_value_uint(root, "portid", le16_to_cpu(caps->portid)); - json_object_add_value_uint(root, "crt", caps->crt); + obj_add_uint(r, "vqfrt", le32_to_cpu(caps->vqfrt)); + obj_add_uint(r, "vqrfa", le32_to_cpu(caps->vqrfa)); + obj_add_int(r, "vqrfap", le16_to_cpu(caps->vqrfap)); + obj_add_int(r, "vqprt", le16_to_cpu(caps->vqprt)); + obj_add_int(r, "vqfrsm", le16_to_cpu(caps->vqfrsm)); + obj_add_int(r, "vqgran", le16_to_cpu(caps->vqgran)); - json_object_add_value_uint(root, "vqfrt", le32_to_cpu(caps->vqfrt)); - json_object_add_value_uint(root, "vqrfa", le32_to_cpu(caps->vqrfa)); - json_object_add_value_int(root, "vqrfap", le16_to_cpu(caps->vqrfap)); - json_object_add_value_int(root, "vqprt", le16_to_cpu(caps->vqprt)); - json_object_add_value_int(root, "vqfrsm", le16_to_cpu(caps->vqfrsm)); - json_object_add_value_int(root, "vqgran", le16_to_cpu(caps->vqgran)); + obj_add_uint(r, "vifrt", le32_to_cpu(caps->vifrt)); + obj_add_uint(r, "virfa", le32_to_cpu(caps->virfa)); + obj_add_int(r, "virfap", le16_to_cpu(caps->virfap)); + obj_add_int(r, "viprt", le16_to_cpu(caps->viprt)); + obj_add_int(r, "vifrsm", le16_to_cpu(caps->vifrsm)); + obj_add_int(r, "vigran", le16_to_cpu(caps->vigran)); - json_object_add_value_uint(root, "vifrt", le32_to_cpu(caps->vifrt)); - json_object_add_value_uint(root, "virfa", le32_to_cpu(caps->virfa)); - json_object_add_value_int(root, "virfap", le16_to_cpu(caps->virfap)); - json_object_add_value_int(root, "viprt", le16_to_cpu(caps->viprt)); - json_object_add_value_int(root, "vifrsm", le16_to_cpu(caps->vifrsm)); - json_object_add_value_int(root, "vigran", le16_to_cpu(caps->vigran)); - - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_nvme_list_secondary_ctrl(const struct nvme_secondary_ctrl_list *sc_list, @@ -2411,82 +3692,61 @@ static void json_nvme_list_secondary_ctrl(const struct nvme_secondary_ctrl_list { const struct nvme_secondary_ctrl *sc_entry = &sc_list->sc_entry[0]; __u32 nent = min(sc_list->num, count); - struct json_object *entries; - struct json_object *root; + struct json_object *entries = json_create_array(); + struct json_object *r = json_create_object(); int i; - root = json_create_object(); + obj_add_int(r, "num", nent); - json_object_add_value_int(root, "num", nent); - - entries = json_create_array(); for (i = 0; i < nent; i++) { struct json_object *entry = json_create_object(); - json_object_add_value_int(entry, - "secondary-controller-identifier", - le16_to_cpu(sc_entry[i].scid)); - json_object_add_value_int(entry, - "primary-controller-identifier", - le16_to_cpu(sc_entry[i].pcid)); - json_object_add_value_int(entry, "secondary-controller-state", - sc_entry[i].scs); - json_object_add_value_int(entry, "virtual-function-number", - le16_to_cpu(sc_entry[i].vfn)); - json_object_add_value_int(entry, "num-virtual-queues", - le16_to_cpu(sc_entry[i].nvq)); - json_object_add_value_int(entry, "num-virtual-interrupts", - le16_to_cpu(sc_entry[i].nvi)); - json_array_add_value_object(entries, entry); + obj_add_int(entry, "secondary-controller-identifier", + le16_to_cpu(sc_entry[i].scid)); + obj_add_int(entry, "primary-controller-identifier", le16_to_cpu(sc_entry[i].pcid)); + obj_add_int(entry, "secondary-controller-state", sc_entry[i].scs); + obj_add_int(entry, "virtual-function-number", le16_to_cpu(sc_entry[i].vfn)); + obj_add_int(entry, "num-virtual-queues", le16_to_cpu(sc_entry[i].nvq)); + obj_add_int(entry, "num-virtual-interrupts", le16_to_cpu(sc_entry[i].nvi)); + array_add_obj(entries, entry); } - json_object_add_value_array(root, "secondary-controllers", entries); + obj_add_array(r, "secondary-controllers", entries); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_nvme_id_ns_granularity_list( const struct nvme_id_ns_granularity_list *glist) { int i; - struct json_object *root; - struct json_object *entries; + struct json_object *r = json_create_object(); + struct json_object *entries = json_create_array(); - root = json_create_object(); + obj_add_int(r, "attributes", glist->attributes); + obj_add_int(r, "num-descriptors", glist->num_descriptors); - json_object_add_value_int(root, "attributes", glist->attributes); - json_object_add_value_int(root, "num-descriptors", - glist->num_descriptors); - - entries = json_create_array(); for (i = 0; i <= glist->num_descriptors; i++) { struct json_object *entry = json_create_object(); - json_object_add_value_uint64(entry, "namespace-size-granularity", - le64_to_cpu(glist->entry[i].nszegran)); - json_object_add_value_uint64(entry, "namespace-capacity-granularity", - le64_to_cpu(glist->entry[i].ncapgran)); - json_array_add_value_object(entries, entry); + obj_add_uint64(entry, "namespace-size-granularity", + le64_to_cpu(glist->entry[i].nszegran)); + obj_add_uint64(entry, "namespace-capacity-granularity", + le64_to_cpu(glist->entry[i].ncapgran)); + array_add_obj(entries, entry); } - json_object_add_value_array(root, "namespace-granularity-list", entries); + obj_add_array(r, "namespace-granularity-list", entries); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_nvme_id_uuid_list(const struct nvme_id_uuid_list *uuid_list) { - struct json_object *root; - struct json_object *entries; + struct json_object *r = json_create_object(); + struct json_object *entries = json_create_array(); int i; - root = json_create_object(); - entries = json_create_array(); - for (i = 0; i < NVME_ID_UUID_LIST_MAX; i++) { __u8 uuid[NVME_UUID_LEN]; struct json_object *entry = json_create_object(); @@ -2495,30 +3755,27 @@ static void json_nvme_id_uuid_list(const struct nvme_id_uuid_list *uuid_list) if (memcmp(uuid_list->entry[i].uuid, zero_uuid, sizeof(zero_uuid)) == 0) break; memcpy(&uuid, uuid_list->entry[i].uuid, sizeof(uuid)); - json_object_add_value_int(entry, "association", + obj_add_int(entry, "association", uuid_list->entry[i].header & 0x3); - json_object_add_value_string(entry, "uuid", + obj_add_str(entry, "uuid", util_uuid_to_string(uuid)); - json_array_add_value_object(entries, entry); + array_add_obj(entries, entry); } - json_object_add_value_array(root, "UUID-list", entries); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + + obj_add_array(r, "UUID-list", entries); + + json_print(r); } static void json_id_domain_list(struct nvme_id_domain_list *id_dom) { - struct json_object *root; - struct json_object *entries; + struct json_object *r = json_create_object(); + struct json_object *entries = json_create_array(); struct json_object *entry; int i; nvme_uint128_t dom_cap, unalloc_dom_cap, max_egrp_dom_cap; - root = json_create_object(); - entries = json_create_array(); - - json_object_add_value_uint(root, "num_dom_entries", id_dom->num); + obj_add_uint(r, "num_dom_entries", id_dom->num); for (i = 0; i < id_dom->num; i++) { entry = json_create_object(); @@ -2526,78 +3783,67 @@ static void json_id_domain_list(struct nvme_id_domain_list *id_dom) unalloc_dom_cap = le128_to_cpu(id_dom->domain_attr[i].unalloc_dom_cap); max_egrp_dom_cap = le128_to_cpu(id_dom->domain_attr[i].max_egrp_dom_cap); - json_object_add_value_uint(entry, "dom_id", le16_to_cpu(id_dom->domain_attr[i].dom_id)); - json_object_add_value_uint128(entry, "dom_cap", dom_cap); - json_object_add_value_uint128(entry, "unalloc_dom_cap", unalloc_dom_cap); - json_object_add_value_uint128(entry, "max_egrp_dom_cap", max_egrp_dom_cap); + obj_add_uint(entry, "dom_id", le16_to_cpu(id_dom->domain_attr[i].dom_id)); + obj_add_uint128(entry, "dom_cap", dom_cap); + obj_add_uint128(entry, "unalloc_dom_cap", unalloc_dom_cap); + obj_add_uint128(entry, "max_egrp_dom_cap", max_egrp_dom_cap); - json_array_add_value_object(entries, entry); + array_add_obj(entries, entry); } - json_object_add_value_array(root, "domain_list", entries); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + obj_add_array(r, "domain_list", entries); + + json_print(r); } static void json_nvme_endurance_group_list(struct nvme_id_endurance_group_list *endgrp_list) { - struct json_object *root; + struct json_object *r = json_create_object(); struct json_object *valid_attrs; - struct json_object *valid; + struct json_object *valid = json_create_array(); int i; - root = json_create_object(); - valid = json_create_array(); - - json_object_add_value_uint(root, "num_endgrp_id", - le16_to_cpu(endgrp_list->num)); + obj_add_uint(r, "num_endgrp_id", le16_to_cpu(endgrp_list->num)); for (i = 0; i < min(le16_to_cpu(endgrp_list->num), 2047); i++) { valid_attrs = json_create_object(); - json_object_add_value_uint(valid_attrs, "endgrp_id", - le16_to_cpu(endgrp_list->identifier[i])); - json_array_add_value_object(valid, valid_attrs); + obj_add_uint(valid_attrs, "endgrp_id", le16_to_cpu(endgrp_list->identifier[i])); + array_add_obj(valid, valid_attrs); } - json_object_add_value_array(root, "endgrp_list", valid); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + obj_add_array(r, "endgrp_list", valid); + + json_print(r); } static void json_support_log(struct nvme_supported_log_pages *support_log, const char *devname) { - struct json_object *root; - struct json_object *valid; + struct json_object *r = json_create_object(); + struct json_object *valid = json_create_array(); struct json_object *valid_attrs; unsigned int lid; char key[128]; __u32 support; - root = json_create_object(); - valid = json_create_array(); - for (lid = 0; lid < 256; lid++) { support = le32_to_cpu(support_log->lid_support[lid]); if (support & 0x1) { valid_attrs = json_create_object(); sprintf(key, "lid_0x%x ", lid); - json_object_add_value_uint(valid_attrs, key, support); - json_array_add_value_object(valid, valid_attrs); + obj_add_uint(valid_attrs, key, support); + array_add_obj(valid, valid_attrs); } } - json_object_add_value_object(root, "supported_logs", valid); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + obj_add_obj(r, "supported_logs", valid); + + json_print(r); } -static void json_detail_list(nvme_root_t r) +static void json_detail_list(nvme_root_t t) { - struct json_object *jroot = json_create_object(); + struct json_object *r = json_create_object(); struct json_object *jdev = json_create_array(); nvme_host_t h; @@ -2606,36 +3852,36 @@ static void json_detail_list(nvme_root_t r) nvme_path_t p; nvme_ns_t n; - nvme_for_each_host(r, h) { + nvme_for_each_host(t, h) { struct json_object *hss = json_create_object(); struct json_object *jsslist = json_create_array(); const char *hostid; - json_object_add_value_string(hss, "HostNQN", nvme_host_get_hostnqn(h)); + obj_add_str(hss, "HostNQN", nvme_host_get_hostnqn(h)); hostid = nvme_host_get_hostid(h); if (hostid) - json_object_add_value_string(hss, "HostID", hostid); + obj_add_str(hss, "HostID", hostid); nvme_for_each_subsystem(h , s) { struct json_object *jss = json_create_object(); struct json_object *jctrls = json_create_array(); struct json_object *jnss = json_create_array(); - json_object_add_value_string(jss, "Subsystem", nvme_subsystem_get_name(s)); - json_object_add_value_string(jss, "SubsystemNQN", nvme_subsystem_get_nqn(s)); + obj_add_str(jss, "Subsystem", nvme_subsystem_get_name(s)); + obj_add_str(jss, "SubsystemNQN", nvme_subsystem_get_nqn(s)); nvme_subsystem_for_each_ctrl(s, c) { struct json_object *jctrl = json_create_object(); struct json_object *jnss = json_create_array(); struct json_object *jpaths = json_create_array(); - json_object_add_value_string(jctrl, "Controller", nvme_ctrl_get_name(c)); - json_object_add_value_string(jctrl, "SerialNumber", nvme_ctrl_get_serial(c)); - json_object_add_value_string(jctrl, "ModelNumber", nvme_ctrl_get_model(c)); - json_object_add_value_string(jctrl, "Firmware", nvme_ctrl_get_firmware(c)); - json_object_add_value_string(jctrl, "Transport", nvme_ctrl_get_transport(c)); - json_object_add_value_string(jctrl, "Address", nvme_ctrl_get_address(c)); - json_object_add_value_string(jctrl, "Slot", nvme_ctrl_get_phy_slot(c)); + obj_add_str(jctrl, "Controller", nvme_ctrl_get_name(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)); + obj_add_str(jctrl, "Transport", nvme_ctrl_get_transport(c)); + obj_add_str(jctrl, "Address", nvme_ctrl_get_address(c)); + obj_add_str(jctrl, "Slot", nvme_ctrl_get_phy_slot(c)); nvme_ctrl_for_each_ns(c, n) { struct json_object *jns = json_create_object(); @@ -2643,31 +3889,31 @@ static void json_detail_list(nvme_root_t r) uint64_t nsze = nvme_ns_get_lba_count(n) * lba; uint64_t nuse = nvme_ns_get_lba_util(n) * lba; - json_object_add_value_string(jns, "NameSpace", nvme_ns_get_name(n)); - json_object_add_value_string(jns, "Generic", nvme_ns_get_generic_name(n)); - json_object_add_value_int(jns, "NSID", nvme_ns_get_nsid(n)); - json_object_add_value_uint64(jns, "UsedBytes", nuse); - json_object_add_value_uint64(jns, "MaximumLBA", nvme_ns_get_lba_count(n)); - json_object_add_value_uint64(jns, "PhysicalSize", nsze); - json_object_add_value_int(jns, "SectorSize", lba); + obj_add_str(jns, "NameSpace", nvme_ns_get_name(n)); + obj_add_str(jns, "Generic", nvme_ns_get_generic_name(n)); + obj_add_int(jns, "NSID", nvme_ns_get_nsid(n)); + obj_add_uint64(jns, "UsedBytes", nuse); + obj_add_uint64(jns, "MaximumLBA", nvme_ns_get_lba_count(n)); + obj_add_uint64(jns, "PhysicalSize", nsze); + obj_add_int(jns, "SectorSize", lba); - json_array_add_value_object(jnss, jns); + array_add_obj(jnss, jns); } - json_object_add_value_object(jctrl, "Namespaces", jnss); + obj_add_obj(jctrl, "Namespaces", jnss); nvme_ctrl_for_each_path(c, p) { struct json_object *jpath = json_create_object(); - json_object_add_value_string(jpath, "Path", nvme_path_get_name(p)); - json_object_add_value_string(jpath, "ANAState", nvme_path_get_ana_state(p)); + obj_add_str(jpath, "Path", nvme_path_get_name(p)); + obj_add_str(jpath, "ANAState", nvme_path_get_ana_state(p)); - json_array_add_value_object(jpaths, jpath); + array_add_obj(jpaths, jpath); } - json_object_add_value_object(jctrl, "Paths", jpaths); + obj_add_obj(jctrl, "Paths", jpaths); - json_array_add_value_object(jctrls, jctrl); + array_add_obj(jctrls, jctrl); } - json_object_add_value_object(jss, "Controllers", jctrls); + obj_add_obj(jss, "Controllers", jctrls); nvme_subsystem_for_each_ns(s, n) { struct json_object *jns = json_create_object(); @@ -2676,36 +3922,35 @@ static void json_detail_list(nvme_root_t r) uint64_t nsze = nvme_ns_get_lba_count(n) * lba; uint64_t nuse = nvme_ns_get_lba_util(n) * lba; - json_object_add_value_string(jns, "NameSpace", nvme_ns_get_name(n)); - json_object_add_value_string(jns, "Generic", nvme_ns_get_generic_name(n)); - json_object_add_value_int(jns, "NSID", nvme_ns_get_nsid(n)); - json_object_add_value_uint64(jns, "UsedBytes", nuse); - json_object_add_value_uint64(jns, "MaximumLBA", nvme_ns_get_lba_count(n)); - json_object_add_value_uint64(jns, "PhysicalSize", nsze); - json_object_add_value_int(jns, "SectorSize", lba); + obj_add_str(jns, "NameSpace", nvme_ns_get_name(n)); + obj_add_str(jns, "Generic", nvme_ns_get_generic_name(n)); + obj_add_int(jns, "NSID", nvme_ns_get_nsid(n)); + obj_add_uint64(jns, "UsedBytes", nuse); + obj_add_uint64(jns, "MaximumLBA", nvme_ns_get_lba_count(n)); + obj_add_uint64(jns, "PhysicalSize", nsze); + obj_add_int(jns, "SectorSize", lba); - json_array_add_value_object(jnss, jns); + array_add_obj(jnss, jns); } - json_object_add_value_object(jss, "Namespaces", jnss); + obj_add_obj(jss, "Namespaces", jnss); - json_array_add_value_object(jsslist, jss); + array_add_obj(jsslist, jss); } - json_object_add_value_object(hss, "Subsystems", jsslist); - json_array_add_value_object(jdev, hss); + obj_add_obj(hss, "Subsystems", jsslist); + array_add_obj(jdev, hss); } - json_object_add_value_array(jroot, "Devices", jdev); - json_print_object(jroot, NULL); - printf("\n"); - json_free_object(jroot); + + obj_add_array(r, "Devices", jdev); + + json_print(r); } -static struct json_object *json_list_item(nvme_ns_t n) +static struct json_object *json_list_item_obj(nvme_ns_t n) { - struct json_object *jdevice = json_create_object(); - char devname[128] = { 0 }; - char genname[128] = { 0 }; - + struct json_object *r = json_create_object(); + char devname[NAME_LEN] = { 0 }; + char genname[NAME_LEN] = { 0 }; int lba = nvme_ns_get_lba_size(n); uint64_t nsze = nvme_ns_get_lba_count(n) * lba; uint64_t nuse = nvme_ns_get_lba_util(n) * lba; @@ -2713,23 +3958,23 @@ static struct json_object *json_list_item(nvme_ns_t n) nvme_dev_full_path(n, devname, sizeof(devname)); nvme_generic_full_path(n, genname, sizeof(genname)); - json_object_add_value_int(jdevice, "NameSpace", nvme_ns_get_nsid(n)); - json_object_add_value_string(jdevice, "DevicePath", devname); - json_object_add_value_string(jdevice, "GenericPath", genname); - json_object_add_value_string(jdevice, "Firmware", nvme_ns_get_firmware(n)); - json_object_add_value_string(jdevice, "ModelNumber", nvme_ns_get_model(n)); - json_object_add_value_string(jdevice, "SerialNumber", nvme_ns_get_serial(n)); - json_object_add_value_uint64(jdevice, "UsedBytes", nuse); - json_object_add_value_uint64(jdevice, "MaximumLBA", nvme_ns_get_lba_count(n)); - json_object_add_value_uint64(jdevice, "PhysicalSize", nsze); - json_object_add_value_int(jdevice, "SectorSize", lba); + obj_add_int(r, "NameSpace", nvme_ns_get_nsid(n)); + obj_add_str(r, "DevicePath", devname); + obj_add_str(r, "GenericPath", genname); + obj_add_str(r, "Firmware", nvme_ns_get_firmware(n)); + obj_add_str(r, "ModelNumber", nvme_ns_get_model(n)); + obj_add_str(r, "SerialNumber", nvme_ns_get_serial(n)); + obj_add_uint64(r, "UsedBytes", nuse); + obj_add_uint64(r, "MaximumLBA", nvme_ns_get_lba_count(n)); + obj_add_uint64(r, "PhysicalSize", nsze); + obj_add_int(r, "SectorSize", lba); - return jdevice; + return r; } -static void json_simple_list(nvme_root_t r) +static void json_simple_list(nvme_root_t t) { - struct json_object *jroot = json_create_object(); + struct json_object *r = json_create_object(); struct json_object *jdevices = json_create_array(); nvme_host_t h; @@ -2737,30 +3982,35 @@ static void json_simple_list(nvme_root_t r) nvme_ctrl_t c; nvme_ns_t n; - nvme_for_each_host(r, h) { + nvme_for_each_host(t, h) { nvme_for_each_subsystem(h, s) { nvme_subsystem_for_each_ns(s, n) - json_array_add_value_object(jdevices, - json_list_item(n)); + array_add_obj(jdevices, json_list_item_obj(n)); nvme_subsystem_for_each_ctrl(s, c) nvme_ctrl_for_each_ns(c, n) - json_array_add_value_object(jdevices, - json_list_item(n)); + array_add_obj(jdevices, json_list_item_obj(n)); } } - json_object_add_value_array(jroot, "Devices", jdevices); - json_print_object(jroot, NULL); - printf("\n"); - json_free_object(jroot); + + obj_add_array(r, "Devices", jdevices); + + json_print(r); } -static void json_print_list_items(nvme_root_t r) +static void json_list_item(nvme_ns_t n) +{ + struct json_object *r = json_list_item_obj(n); + + json_print(r); +} + +static void json_print_list_items(nvme_root_t t) { if (json_print_ops.flags & VERBOSE) - json_detail_list(r); + json_detail_list(t); else - json_simple_list(r); + json_simple_list(t); } static unsigned int json_subsystem_topology_multipath(nvme_subsystem_t s, @@ -2775,8 +4025,7 @@ static unsigned int json_subsystem_topology_multipath(nvme_subsystem_t s, struct json_object *paths; ns_attrs = json_create_object(); - json_object_add_value_int(ns_attrs, "NSID", - nvme_ns_get_nsid(n)); + obj_add_int(ns_attrs, "NSID", nvme_ns_get_nsid(n)); paths = json_create_array(); nvme_namespace_for_each_path(n, p) { @@ -2785,20 +4034,15 @@ static unsigned int json_subsystem_topology_multipath(nvme_subsystem_t s, nvme_ctrl_t c = nvme_path_get_ctrl(p); path_attrs = json_create_object(); - json_object_add_value_string(path_attrs, "Name", - nvme_ctrl_get_name(c)); - json_object_add_value_string(path_attrs, "Transport", - nvme_ctrl_get_transport(c)); - json_object_add_value_string(path_attrs, "Address", - nvme_ctrl_get_address(c)); - json_object_add_value_string(path_attrs, "State", - nvme_ctrl_get_state(c)); - json_object_add_value_string(path_attrs, "ANAState", - nvme_path_get_ana_state(p)); - json_array_add_value_object(paths, path_attrs); + obj_add_str(path_attrs, "Name", nvme_ctrl_get_name(c)); + obj_add_str(path_attrs, "Transport", nvme_ctrl_get_transport(c)); + obj_add_str(path_attrs, "Address", nvme_ctrl_get_address(c)); + obj_add_str(path_attrs, "State", nvme_ctrl_get_state(c)); + obj_add_str(path_attrs, "ANAState", nvme_path_get_ana_state(p)); + array_add_obj(paths, path_attrs); } - json_object_add_value_array(ns_attrs, "Paths", paths); - json_array_add_value_object(namespaces, ns_attrs); + obj_add_array(ns_attrs, "Paths", paths); + array_add_obj(namespaces, ns_attrs); i++; } @@ -2818,23 +4062,22 @@ static void json_print_nvme_subsystem_topology(nvme_subsystem_t s, struct json_object *ctrl; ns_attrs = json_create_object(); - json_object_add_value_int(ns_attrs, "NSID", - nvme_ns_get_nsid(n)); + obj_add_int(ns_attrs, "NSID", nvme_ns_get_nsid(n)); - ctrl = json_create_array(); + ctrl = json_create_array(); ctrl_attrs = json_create_object(); - json_object_add_value_string(ctrl_attrs, "Name", + obj_add_str(ctrl_attrs, "Name", nvme_ctrl_get_name(c)); - json_object_add_value_string(ctrl_attrs, "Transport", + obj_add_str(ctrl_attrs, "Transport", nvme_ctrl_get_transport(c)); - json_object_add_value_string(ctrl_attrs, "Address", + obj_add_str(ctrl_attrs, "Address", nvme_ctrl_get_address(c)); - json_object_add_value_string(ctrl_attrs, "State", + obj_add_str(ctrl_attrs, "State", nvme_ctrl_get_state(c)); - json_array_add_value_object(ctrl, ctrl_attrs); - json_object_add_value_array(ns_attrs, "Controller", ctrl); - json_array_add_value_object(namespaces, ns_attrs); + array_add_obj(ctrl, ctrl_attrs); + obj_add_array(ns_attrs, "Controller", ctrl); + array_add_obj(namespaces, ns_attrs); } } } @@ -2843,130 +4086,233 @@ static void json_simple_topology(nvme_root_t r) { struct json_object *host_attrs, *subsystem_attrs; struct json_object *subsystems, *namespaces; - struct json_object *root; + struct json_object *a = json_create_array(); nvme_host_t h; - root = json_create_array(); - nvme_for_each_host(r, h) { nvme_subsystem_t s; const char *hostid; host_attrs = json_create_object(); - json_object_add_value_string(host_attrs, "HostNQN", - nvme_host_get_hostnqn(h)); + obj_add_str(host_attrs, "HostNQN", nvme_host_get_hostnqn(h)); hostid = nvme_host_get_hostid(h); if (hostid) - json_object_add_value_string(host_attrs, "HostID", hostid); + obj_add_str(host_attrs, "HostID", hostid); subsystems = json_create_array(); nvme_for_each_subsystem(h, s) { subsystem_attrs = json_create_object(); - json_object_add_value_string(subsystem_attrs, "Name", - nvme_subsystem_get_name(s)); - json_object_add_value_string(subsystem_attrs, "NQN", - nvme_subsystem_get_nqn(s)); - json_object_add_value_string(subsystem_attrs, "IOPolicy", - nvme_subsystem_get_iopolicy(s)); + obj_add_str(subsystem_attrs, "Name", nvme_subsystem_get_name(s)); + obj_add_str(subsystem_attrs, "NQN", nvme_subsystem_get_nqn(s)); + obj_add_str(subsystem_attrs, "IOPolicy", nvme_subsystem_get_iopolicy(s)); - json_array_add_value_object(subsystems, subsystem_attrs); + array_add_obj(subsystems, subsystem_attrs); namespaces = json_create_array(); if (!json_subsystem_topology_multipath(s, namespaces)) json_print_nvme_subsystem_topology(s, namespaces); - json_object_add_value_array(subsystem_attrs, "Namespaces", - namespaces); + obj_add_array(subsystem_attrs, "Namespaces", namespaces); } - json_object_add_value_array(host_attrs, "Subsystems", subsystems); - json_array_add_value_object(root, host_attrs); + obj_add_array(host_attrs, "Subsystems", subsystems); + array_add_obj(a, host_attrs); } - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + + json_print(a); +} + +static void json_directive_show_fields_identify(__u8 doper, __u8 *field, struct json_object *r) +{ + struct json_object *support; + struct json_object *enabled; + struct json_object *persistent; + + switch (doper) { + case NVME_DIRECTIVE_RECEIVE_IDENTIFY_DOPER_PARAM: + support = json_create_array(); + obj_add_array(r, "Directive support", support); + obj_add_str(support, "Identify Directive", + *field & 0x1 ? "Supported" : "Not supported"); + obj_add_str(support, "Stream Directive", + *field & 0x2 ? "Supported" : "Not supported"); + obj_add_str(support, "Data Placement Directive", + *field & 0x4 ? "Supported" : "Not supported"); + enabled = json_create_array(); + obj_add_array(r, "Directive enabled", enabled); + obj_add_str(enabled, "Identify Directive", + *(field + 32) & 0x1 ? "Enabled" : "Disabled"); + obj_add_str(enabled, "Stream Directive", + *(field + 32) & 0x2 ? "Enabled" : "Disabled"); + obj_add_str(enabled, "Data Placement Directive", + *(field + 32) & 0x4 ? "Enabled" : "Disabled"); + persistent = json_create_array(); + obj_add_array(r, "Directive Persistent Across Controller Level Resets", + persistent); + obj_add_str(persistent, "Identify Directive", + *(field + 32) & 0x1 ? "Enabled" : "Disabled"); + obj_add_str(persistent, "Stream Directive", + *(field + 32) & 0x2 ? "Enabled" : "Disabled"); + obj_add_str(persistent, "Data Placement Directive", + *(field + 32) & 0x4 ? "Enabled" : "Disabled"); + break; + default: + obj_add_str(r, "Error", "invalid directive operations for Identify Directives"); + break; + } +} + +static void json_directive_show_fields_streams(__u8 doper, unsigned int result, __u16 *field, + struct json_object *r) +{ + int count; + int i; + char json_str[STR_LEN]; + + switch (doper) { + case NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_PARAM: + obj_add_uint(r, "Max Streams Limit (MSL)", le16_to_cpu(*field)); + obj_add_uint(r, "NVM Subsystem Streams Available (NSSA)", le16_to_cpu(*(field + 2))); + obj_add_uint(r, "NVM Subsystem Streams Open (NSSO)", le16_to_cpu(*(field + 4))); + obj_add_uint(r, "NVM Subsystem Stream Capability (NSSC)", le16_to_cpu(*(field + 6))); + obj_add_uint(r, "Stream Write Size (in unit of LB size) (SWS)", + le16_to_cpu(*(__u32 *)(field + 16))); + obj_add_uint(r, "Stream Granularity Size (in unit of SWS) (SGS)", + le16_to_cpu(*(field + 20))); + obj_add_uint(r, "Namespace Streams Allocated (NSA)", le16_to_cpu(*(field + 22))); + obj_add_uint(r, "Namespace Streams Open (NSO)", le16_to_cpu(*(field + 24))); + break; + case NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_STATUS: + count = *field; + obj_add_uint(r, "Open Stream Count", le16_to_cpu(*field)); + for (i = 0; i < count; i++) { + sprintf(json_str, "Stream Identifier %.6u", i + 1); + obj_add_uint(r, json_str, le16_to_cpu(*(field + (i + 1) * 2))); + } + break; + case NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_RESOURCE: + obj_add_uint(r, "Namespace Streams Allocated (NSA)", result & 0xffff); + break; + default: + obj_add_str(r, "Error", + "invalid directive operations for Streams Directives"); + break; + } +} + +static void json_directive_show_fields(__u8 dtype, __u8 doper, unsigned int result, + __u8 *field, struct json_object *r) +{ + switch (dtype) { + case NVME_DIRECTIVE_DTYPE_IDENTIFY: + json_directive_show_fields_identify(doper, field, r); + break; + case NVME_DIRECTIVE_DTYPE_STREAMS: + json_directive_show_fields_streams(doper, result, (__u16 *)field, r); + break; + default: + obj_add_str(r, "Error", "invalid directive type"); + break; + } +} + +static void json_directive_show(__u8 type, __u8 oper, __u16 spec, __u32 nsid, __u32 result, + void *buf, __u32 len) +{ + struct json_object *r = json_create_object(); + struct json_object *data; + char json_str[STR_LEN]; + + sprintf(json_str, "%#x", type); + obj_add_str(r, "Type", json_str); + sprintf(json_str, "%#x", oper); + obj_add_str(r, "Operation", json_str); + sprintf(json_str, "%#x", spec); + obj_add_str(r, "spec", json_str); + sprintf(json_str, "%#x", nsid); + obj_add_str(r, "NSID", json_str); + sprintf(json_str, "%#x", result); + obj_add_result(r, json_str); + + if (json_print_ops.flags & VERBOSE) { + json_directive_show_fields(type, oper, result, buf, r); + } else if (buf) { + data = json_create_array(); + d_json((unsigned char *)buf, len, 16, 1, data); + obj_add_array(r, "data", data); + } + + json_print(r); } static void json_discovery_log(struct nvmf_discovery_log *log, int numrec) { - struct json_object *root; - struct json_object *entries; + struct json_object *r = json_create_object(); + struct json_object *entries = json_create_array(); int i; - root = json_create_object(); - entries = json_create_array(); - json_object_add_value_uint64(root, "genctr", le64_to_cpu(log->genctr)); - json_object_add_value_array(root, "records", entries); + obj_add_uint64(r, "genctr", le64_to_cpu(log->genctr)); + obj_add_array(r, "records", entries); for (i = 0; i < numrec; i++) { struct nvmf_disc_log_entry *e = &log->entries[i]; struct json_object *entry = json_create_object(); - json_object_add_value_string(entry, "trtype", - nvmf_trtype_str(e->trtype)); - json_object_add_value_string(entry, "adrfam", - nvmf_adrfam_str(e->adrfam)); - json_object_add_value_string(entry, "subtype", - nvmf_subtype_str(e->subtype)); - json_object_add_value_string(entry,"treq", - nvmf_treq_str(e->treq)); - json_object_add_value_uint(entry, "portid", - le16_to_cpu(e->portid)); - json_object_add_value_string(entry, "trsvcid", e->trsvcid); - json_object_add_value_string(entry, "subnqn", e->subnqn); - json_object_add_value_string(entry, "traddr", e->traddr); - json_object_add_value_string(entry, "eflags", - nvmf_eflags_str(le16_to_cpu(e->eflags))); + obj_add_str(entry, "trtype", nvmf_trtype_str(e->trtype)); + obj_add_str(entry, "adrfam", nvmf_adrfam_str(e->adrfam)); + obj_add_str(entry, "subtype", nvmf_subtype_str(e->subtype)); + obj_add_str(entry,"treq", nvmf_treq_str(e->treq)); + obj_add_uint(entry, "portid", le16_to_cpu(e->portid)); + obj_add_str(entry, "trsvcid", e->trsvcid); + obj_add_str(entry, "subnqn", e->subnqn); + obj_add_str(entry, "traddr", e->traddr); + obj_add_str(entry, "eflags", nvmf_eflags_str(le16_to_cpu(e->eflags))); switch (e->trtype) { case NVMF_TRTYPE_RDMA: - json_object_add_value_string(entry, "rdma_prtype", - nvmf_prtype_str(e->tsas.rdma.prtype)); - json_object_add_value_string(entry, "rdma_qptype", - nvmf_qptype_str(e->tsas.rdma.qptype)); - json_object_add_value_string(entry, "rdma_cms", - nvmf_cms_str(e->tsas.rdma.cms)); - json_object_add_value_uint(entry, "rdma_pkey", - le16_to_cpu(e->tsas.rdma.pkey)); + obj_add_str(entry, "rdma_prtype", nvmf_prtype_str(e->tsas.rdma.prtype)); + obj_add_str(entry, "rdma_qptype", nvmf_qptype_str(e->tsas.rdma.qptype)); + obj_add_str(entry, "rdma_cms", nvmf_cms_str(e->tsas.rdma.cms)); + obj_add_uint(entry, "rdma_pkey", le16_to_cpu(e->tsas.rdma.pkey)); break; case NVMF_TRTYPE_TCP: - json_object_add_value_string(entry, "sectype", - nvmf_sectype_str(e->tsas.tcp.sectype)); + obj_add_str(entry, "sectype", nvmf_sectype_str(e->tsas.tcp.sectype)); + break; + default: break; } - json_array_add_value_object(entries, entry); + array_add_obj(entries, entry); } - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + + json_print(r); } static void json_connect_msg(nvme_ctrl_t c) { - struct json_object *root; + struct json_object *r = json_create_object(); - root = json_create_object(); - json_object_add_value_string(root, "device", nvme_ctrl_get_name(c)); + obj_add_str(r, "device", nvme_ctrl_get_name(c)); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } -static void json_output_object(struct json_object *root) +static void json_output_object(struct json_object *r) { - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); + json_print(r); } static void json_output_status(int status) { - struct json_object *root = json_create_object(); + struct json_object *r; + char json_str[STR_LEN]; int val; int type; + sprintf(json_str, "status: %d", status); + r = obj_create(json_str); + if (status < 0) { - json_object_add_value_string(root, "error", nvme_strerror(errno)); - return json_output_object(root); + obj_add_str(r, "error", nvme_strerror(errno)); + json_print(r); + return; } val = nvme_status_get_value(status); @@ -2974,66 +4320,119 @@ static void json_output_status(int status) switch (type) { case NVME_STATUS_TYPE_NVME: - json_object_add_value_string(root, "error", nvme_status_to_string(val, false)); - json_object_add_value_string(root, "type", "nvme"); + obj_add_str(r, "error", nvme_status_to_string(val, false)); + obj_add_str(r, "type", "nvme"); break; case NVME_STATUS_TYPE_MI: - json_object_add_value_string(root, "error", nvme_mi_status_to_string(val)); - json_object_add_value_string(root, "type", "nvme-mi"); + obj_add_str(r, "error", nvme_mi_status_to_string(val)); + obj_add_str(r, "type", "nvme-mi"); break; default: - json_object_add_value_string(root, "type", "unknow"); + obj_add_str(r, "type", "Unknown"); break; } - json_object_add_value_int(root, "value", val); - - json_output_object(root); + json_print(r); } -static void json_output_message(bool error, const char *msg, va_list ap) +static void json_output_error_status(int status, const char *msg, va_list ap) { - struct json_object *root = json_create_object(); + struct json_object *r; + char json_str[STR_LEN]; char *value; - const char *key = error ? "error" : "result"; + int val; + int type; if (vasprintf(&value, msg, ap) < 0) value = NULL; - if (value) - json_object_add_value_string(root, key, value); - else - json_object_add_value_string(root, key, "Could not allocate string"); - - json_output_object(root); + sprintf(json_str, "Error: %s", value ? value : "Could not allocate string"); + r = obj_create(json_str); free(value); + + if (status < 0) { + obj_add_str(r, "error", nvme_strerror(errno)); + json_print(r); + return; + } + + val = nvme_status_get_value(status); + type = nvme_status_get_type(status); + + switch (type) { + case NVME_STATUS_TYPE_NVME: + obj_add_str(r, "status", nvme_status_to_string(val, false)); + obj_add_str(r, "type", "nvme"); + break; + case NVME_STATUS_TYPE_MI: + obj_add_str(r, "status", nvme_mi_status_to_string(val)); + obj_add_str(r, "type", "nvme-mi"); + break; + default: + obj_add_str(r, "type", "Unknown"); + break; + } + + obj_add_int(r, "value", val); + + json_print(r); +} + +static void json_output_message(bool error, const char *msg, va_list ap) +{ + struct json_object *r = json_r ? json_r : json_create_object(); + char *value; + + if (vasprintf(&value, msg, ap) < 0) + value = NULL; + + obj_add_str(r, error ? "error" : "result", value ? value : "Could not allocate string"); + + free(value); + + json_print(r); } static void json_output_perror(const char *msg) { - struct json_object *root = json_create_object(); + struct json_object *r = json_create_object(); char *error; if (asprintf(&error, "%s: %s", msg, strerror(errno)) < 0) error = NULL; if (error) - json_object_add_value_string(root, "error", error); + obj_add_str(r, "error", error); else - json_object_add_value_string(root, "error", "Could not allocate string"); + obj_add_str(r, "error", "Could not allocate string"); - json_output_object(root); + json_output_object(r); free(error); } +void json_show_init(void) +{ + json_r = json_create_object(); +} + +void json_show_finish(void) +{ + if (json_r) + json_output_object(json_r); + + json_r = NULL; +} + static struct print_ops json_print_ops = { + /* libnvme types.h print functions */ .ana_log = json_ana_log, .boot_part_log = json_boot_part_log, .phy_rx_eom_log = json_phy_rx_eom_log, .ctrl_list = json_nvme_list_ctrl, .ctrl_registers = json_ctrl_registers, + .directive = json_directive_show, .discovery_log = json_discovery_log, .effects_log_list = json_effects_log_list, .endurance_group_event_agg_log = json_endurance_group_event_agg_log, @@ -3048,20 +4447,22 @@ static struct print_ops json_print_ops = { .fid_supported_effects_log = json_fid_support_effects_log, .fw_log = json_fw_log, .id_ctrl = json_nvme_id_ctrl, - .ns_list = json_nvme_list_ns, - .nvm_id_ns = json_nvme_nvm_id_ns, .id_ctrl_nvm = json_nvme_id_ctrl_nvm, .id_domain_list = json_id_domain_list, .id_independent_id_ns = json_nvme_cmd_set_independent_id_ns, + .id_iocs = json_id_iocs, .id_ns = json_nvme_id_ns, .id_ns_descs = json_nvme_id_ns_descs, .id_ns_granularity_list = json_nvme_id_ns_granularity_list, .id_nvmset_list = json_nvme_id_nvmset, .id_uuid_list = json_nvme_id_uuid_list, + .lba_status = json_lba_status, .lba_status_log = json_lba_status_log, .media_unit_stat_log = json_media_unit_stat_log, .mi_cmd_support_effects_log = json_mi_cmd_support_effects_log, + .ns_list = json_nvme_list_ns, .ns_list_log = json_changed_ns_list_log, + .nvm_id_ns = json_nvme_nvm_id_ns, .persistent_event_log = json_persistent_event_log, .predictable_latency_event_agg_log = json_predictable_latency_event_agg_log, .predictable_latency_per_nvmset = json_predictable_latency_per_nvmset, @@ -3070,25 +4471,40 @@ static struct print_ops json_print_ops = { .resv_report = json_nvme_resv_report, .sanitize_log_page = json_sanitize_log, .secondary_ctrl_list = json_nvme_list_secondary_ctrl, + .select_result = json_select_result, .self_test_log = json_self_test_log, + .single_property = json_single_property, .smart_log = json_smart_log, .supported_cap_config_list_log = json_supported_cap_config_log, .supported_log_pages = json_support_log, - .zns_changed_zone_log = NULL, - .zns_report_zones = json_nvme_zns_report_zones, + .zns_start_zone_list = json_zns_start_zone_list, + .zns_changed_zone_log = json_zns_changed, .zns_finish_zone_list = json_zns_finish_zone_list, .zns_id_ctrl = json_nvme_zns_id_ctrl, .zns_id_ns = json_nvme_zns_id_ns, + .zns_report_zones = json_nvme_zns_report_zones, + .show_feature = json_feature_show, + .show_feature_fields = json_feature_show_fields, + .id_ctrl_rpmbs = json_id_ctrl_rpmbs, + .lba_range = json_lba_range, + .lba_status_info = json_lba_status_info, + .d = json_d, + .show_init = json_show_init, + .show_finish = json_show_finish, + /* libnvme tree print functions */ + .list_item = json_list_item, .list_items = json_print_list_items, .print_nvme_subsystem_list = json_print_nvme_subsystem_list, .topology_ctrl = json_simple_topology, .topology_namespace = json_simple_topology, + /* status and error messages */ .connect_msg = json_connect_msg, .show_message = json_output_message, .show_perror = json_output_perror, .show_status = json_output_status, + .show_error_status = json_output_error_status, }; struct print_ops *nvme_get_json_print_ops(enum nvme_print_flags flags) diff --git a/nvme-print-stdout.c b/nvme-print-stdout.c index 90cd8dd..e3c9a74 100644 --- a/nvme-print-stdout.c +++ b/nvme-print-stdout.c @@ -26,27 +26,6 @@ static const char dash[100] = {[0 ... 99] = '-'}; static struct print_ops stdout_print_ops; -struct nvme_bar_cap { - __u16 mqes; - __u8 cqr:1; - __u8 ams:2; - __u8 rsvd19:5; - __u8 to; - __u16 dstrd:4; - __u16 nssrs:1; - __u16 css:8; - __u16 bps:1; - __u8 cps:2; - __u8 mpsmin:4; - __u8 mpsmax:4; - __u8 pmrs:1; - __u8 cmbs:1; - __u8 nsss:1; - __u8 crwms:1; - __u8 crims:1; - __u8 rsvd61:3; -}; - static const char *subsys_key(const struct nvme_subsystem *s) { return nvme_subsystem_get_name((nvme_subsystem_t)s); @@ -538,6 +517,7 @@ static void stdout_persistent_event_log(void *pevent_log_info, break; default: printf("Reserved Event\n\n"); + break; } offset += le16_to_cpu(pevent_entry_head->el); printf("\n"); @@ -732,6 +712,7 @@ static const char *eomip_to_string(__u8 eomip) break; default: string = "Unknown"; + break; } return string; } @@ -1165,6 +1146,7 @@ static void stdout_registers_cc_ams (__u8 ams) break; default: printf("Reserved\n"); + break; } } @@ -1183,13 +1165,14 @@ static void stdout_registers_cc_shn (__u8 shn) break; default: printf("Reserved\n"); + break; } } static void stdout_registers_cc(__u32 cc) { printf("\tController Ready Independent of Media Enable (CRIME): %s\n", - NVME_CC_CRIME(cc) ? "Enabled":"Disabled"); + NVME_CC_CRIME(cc) ? "Enabled" : "Disabled"); printf("\tI/O Completion Queue Entry Size (IOCQES): %u bytes\n", 1 << ((cc & 0x00f00000) >> NVME_CC_IOCQES_SHIFT)); @@ -1204,7 +1187,7 @@ static void stdout_registers_cc(__u32 cc) (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"); + (cc & 0x00000001) ? "Yes" : "No"); } static void stdout_registers_csts_shst(__u8 shst) @@ -1222,29 +1205,28 @@ static void stdout_registers_csts_shst(__u8 shst) break; default: printf("Reserved\n"); + break; } } static void stdout_registers_csts(__u32 csts) { printf("\tProcessing Paused (PP): %s\n", - (csts & 0x00000020) ? "Yes":"No"); + (csts & 0x00000020) ? "Yes" : "No"); printf("\tNVM Subsystem Reset Occurred (NSSRO): %s\n", - (csts & 0x00000010) ? "Yes":"No"); + (csts & 0x00000010) ? "Yes" : "No"); stdout_registers_csts_shst((csts & 0x0000000c) >> 2); printf("\tController Fatal Status (CFS): %s\n", - (csts & 0x00000002) ? "True":"False"); + (csts & 0x00000002) ? "True" : "False"); printf("\tReady (RDY): %s\n\n", - (csts & 0x00000001) ? "Yes":"No"); + (csts & 0x00000001) ? "Yes" : "No"); } static void stdout_registers_crto(__u32 crto) { - printf("\tCRIMT : %d secs\n", - NVME_CRTO_CRIMT(crto)/2 ); - printf("\tCRWMT : %d secs\n", - NVME_CRTO_CRWMT(crto)/2 ); + printf("\tCRIMT : %d secs\n", NVME_CRTO_CRIMT(crto) / 2); + printf("\tCRWMT : %d secs\n", NVME_CRTO_CRWMT(crto) / 2); } static void stdout_registers_aqa(__u32 aqa) @@ -1265,28 +1247,28 @@ static void stdout_registers_cmbloc(__u32 cmbloc, __u32 cmbsz) return; } printf("\tOffset (OFST): 0x%x (See cmbsz.szu for granularity)\n", - (cmbloc & 0xfffff000) >> 12); + (cmbloc & 0xfffff000) >> 12); printf("\tCMB Queue Dword Alignment (CQDA): %d\n", - (cmbloc & 0x00000100) >> 8); + (cmbloc & 0x00000100) >> 8); printf("\tCMB Data Metadata Mixed Memory Support (CDMMMS): %s\n", - enforced[(cmbloc & 0x00000080) >> 7]); + enforced[(cmbloc & 0x00000080) >> 7]); printf("\tCMB Data Pointer and Command Independent Locations Support (CDPCILS): %s\n", - enforced[(cmbloc & 0x00000040) >> 6]); + enforced[(cmbloc & 0x00000040) >> 6]); printf("\tCMB Data Pointer Mixed Locations Support (CDPMLS): %s\n", - enforced[(cmbloc & 0x00000020) >> 5]); + enforced[(cmbloc & 0x00000020) >> 5]); printf("\tCMB Queue Physically Discontiguous Support (CQPDS): %s\n", - enforced[(cmbloc & 0x00000010) >> 4]); + enforced[(cmbloc & 0x00000010) >> 4]); printf("\tCMB Queue Mixed Memory Support (CQMMS): %s\n", - enforced[(cmbloc & 0x00000008) >> 3]); + enforced[(cmbloc & 0x00000008) >> 3]); printf("\tBase Indicator Register (BIR): 0x%x\n\n", - (cmbloc & 0x00000007)); + (cmbloc & 0x00000007)); } static void stdout_registers_cmbsz(__u32 cmbsz) @@ -1295,20 +1277,19 @@ static void stdout_registers_cmbsz(__u32 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", (cmbsz & 0xfffff000) >> 12); printf("\tSize Units (SZU): %s\n", - nvme_register_szu_to_string((cmbsz & 0x00000f00) >> 8)); + nvme_register_szu_to_string((cmbsz & 0x00000f00) >> 8)); printf("\tWrite Data Support (WDS): Write Data and metadata transfer in Controller Memory Buffer is %s\n", - (cmbsz & 0x00000010) ? "Supported":"Not supported"); + (cmbsz & 0x00000010) ? "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"); + (cmbsz & 0x00000008) ? "Supported" : "Not supported"); printf("\tPRP SGL List Support (LISTS): PRP/SG Lists in Controller Memory Buffer is %s\n", - (cmbsz & 0x00000004) ? "Supported":"Not supported"); + (cmbsz & 0x00000004) ? "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"); + (cmbsz & 0x00000002) ? "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"); + (cmbsz & 0x00000001) ? "Supported" : "Not supported"); } static void stdout_registers_bpinfo_brs(__u8 brs) @@ -1329,6 +1310,7 @@ static void stdout_registers_bpinfo_brs(__u8 brs) break; default: printf("Invalid\n"); + break; } } @@ -1353,7 +1335,6 @@ static void stdout_registers_bprsel(__u32 bprsel) static void stdout_registers_bpmbl(uint64_t bpmbl) { - printf("\tBoot Partition Memory Buffer Base Address (BMBBA): %"PRIx64"\n", bpmbl); } @@ -1385,13 +1366,13 @@ static void stdout_registers_pmrcap(__u32 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"); + (pmrcap & 0x00000300) >> 8 ? "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"); + (pmrcap & 0x00000010) ? "supported" : "not supported"); printf("\tRead Data Support (RDS): Read data from the PMR is %s\n", - (pmrcap & 0x00000008) ? "supported":"not supported"); + (pmrcap & 0x00000008) ? "supported" : "not supported"); } static void stdout_registers_pmrctl(__u32 pmrctl) @@ -1410,7 +1391,7 @@ static void stdout_registers_pmrsts(__u32 pmrsts, __u32 pmrctl) "The Persistent Memory Region is %s to process "\ "PCI Express memory read and write requests\n", (pmrsts & 0x00000100) == 0 && (pmrctl & 0x00000001) ? - "READY":"Not Ready"); + "READY" : "Not Ready"); printf("\tError (ERR): %x\n", (pmrsts & 0x000000ff)); } @@ -1419,7 +1400,7 @@ 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"); + (pmrebs & 0x00000010) ? "SHALL" : "MAY"); printf("\tPMR Elasticity Buffer Size Units (PMRSZU): %s\n", nvme_register_pmr_pmrszu_to_string(pmrebs & 0x0000000f)); } @@ -1607,59 +1588,46 @@ void stdout_ctrl_registers(void *bar, bool fabrics) static void stdout_single_property(int offset, uint64_t value64) { int human = stdout_print_ops.flags & VERBOSE; - - uint32_t value32; + 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); + offset, nvme_register_to_string(offset), value64); else printf("property: 0x%02x (%s), value: %x\n", offset, - nvme_register_to_string(offset), - (uint32_t) value64); - + nvme_register_to_string(offset), value32); return; } - value32 = (uint32_t) value64; - 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); + 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); + offset, nvme_register_to_string(offset), value64); break; } } @@ -1697,6 +1665,13 @@ static void stdout_status(int status) } } +static void stdout_error_status(int status, const char *msg, va_list ap) +{ + vfprintf(stderr, msg, ap); + fprintf(stderr, ": "); + stdout_status(status); +} + static void stdout_id_ctrl_cmic(__u8 cmic) { __u8 rsvd = (cmic & 0xF0) >> 4; @@ -2168,19 +2143,25 @@ static void stdout_id_ctrl_cqes(__u8 cqes) static void stdout_id_ctrl_oncs(__le16 ctrl_oncs) { __u16 oncs = le16_to_cpu(ctrl_oncs); - __u16 rsvd = (oncs & 0xFE00) >> 9; - __u16 copy = (oncs & 0x100) >> 8; - __u16 vrfy = (oncs & 0x80) >> 7; - __u16 tmst = (oncs & 0x40) >> 6; - __u16 resv = (oncs & 0x20) >> 5; - __u16 save = (oncs & 0x10) >> 4; - __u16 wzro = (oncs & 0x8) >> 3; - __u16 dsms = (oncs & 0x4) >> 2; - __u16 wunc = (oncs & 0x2) >> 1; - __u16 cmp = oncs & 0x1; + __u16 rsvd = oncs >> 11; + bool afc = !!(oncs & NVME_CTRL_ONCS_ALL_FAST_COPY); + bool csa = !!(oncs & NVME_CTRL_ONCS_COPY_SINGLE_ATOMICITY); + bool copy = !!(oncs & NVME_CTRL_ONCS_COPY); + bool vrfy = !!(oncs & NVME_CTRL_ONCS_VERIFY); + bool tmst = !!(oncs & NVME_CTRL_ONCS_TIMESTAMP); + bool resv = !!(oncs & NVME_CTRL_ONCS_RESERVATIONS); + bool save = !!(oncs & NVME_CTRL_ONCS_SAVE_FEATURES); + bool wzro = !!(oncs & NVME_CTRL_ONCS_WRITE_ZEROES); + bool dsms = !!(oncs & NVME_CTRL_ONCS_DSM); + bool wunc = !!(oncs & NVME_CTRL_ONCS_WRITE_UNCORRECTABLE); + bool cmp = !!(oncs & NVME_CTRL_ONCS_COMPARE); if (rsvd) - printf(" [15:9] : %#x\tReserved\n", rsvd); + printf(" [15:11] : %#x\tReserved\n", rsvd); + printf(" [10:10] : %#x\tAll Fast Copy %sSupported\n", + afc, afc ? "" : "Not "); + printf(" [9:9] : %#x\tCopy Single Atomicity %sSupported\n", + csa, csa ? "" : "Not "); printf(" [8:8] : %#x\tCopy %sSupported\n", copy, copy ? "" : "Not "); printf(" [7:7] : %#x\tVerify %sSupported\n", @@ -2289,15 +2270,16 @@ static void stdout_id_ctrl_nwpc(__u8 nwpc) static void stdout_id_ctrl_ocfs(__le16 ctrl_ocfs) { __u16 ocfs = le16_to_cpu(ctrl_ocfs); - __u16 rsvd = (ocfs & 0xfffc) >> 2; - __u8 copy_fmt_1 = (ocfs >> 1) & 0x1; - __u8 copy_fmt_0 = ocfs & 0x1; + __u16 rsvd = ocfs >> 4; + __u8 copy_fmt_supported; + int copy_fmt; if (rsvd) - printf(" [15:2] : %#x\tReserved\n", rsvd); - printf(" [1:1] : %#x\tController Copy Format 1h %sSupported\n", - copy_fmt_1, copy_fmt_1 ? "" : "Not "); - printf(" [0:0] : %#x\tController Copy Format 0h %sSupported\n", - copy_fmt_0, copy_fmt_0 ? "" : "Not "); + 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("\n"); } @@ -2791,19 +2773,17 @@ static void print_psd_workload(__u8 apw) /* Unknown or not provided */ printf("-"); break; - case 1: /* Extended idle period with burst of random write */ printf("1MiB 32 RW, 30s idle"); break; - case 2: /* Heavy sequential writes */ printf("80K 128KiB SW"); break; - default: printf("reserved"); + break; } } @@ -2816,19 +2796,17 @@ static void print_ps_power_and_scale(__le16 ctr_power, __u8 scale) /* Not reported for this power state */ printf("-"); break; - case NVME_PSD_PS_100_MICRO_WATT: /* Units of 0.0001W */ printf("%01u.%04uW", power / 10000, power % 10000); break; - case NVME_PSD_PS_10_MILLI_WATT: /* Units of 0.01W */ printf("%01u.%02uW", power / 100, power % 100); break; - default: printf("reserved"); + break; } } @@ -3261,6 +3239,11 @@ static void stdout_list_ns(struct nvme_ns_list *ns_list) } } +static void stdout_zns_start_zone_list(__u64 nr_zones, struct json_object **zone_list) +{ + printf("nr_zones: %"PRIu64"\n", (uint64_t)le64_to_cpu(nr_zones)); +} + static void stdout_zns_changed(struct nvme_zns_changed_zone_log *log) { uint16_t nrzid; @@ -3282,7 +3265,7 @@ 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"}; - printf("Attrs: Zone Descriptor Extension is %sVaild\n", + printf("Attrs: Zone Descriptor Extension is %sVaild\n", (za & NVME_ZNS_ZA_ZDEV)? "" : "Not "); if(za & NVME_ZNS_ZA_RZR) { printf(" Reset Zone Recommended with Reset Recommended Limit%s\n", @@ -3318,8 +3301,7 @@ static void stdout_zns_report_zones(void *report, __u32 descs, (uint64_t)le64_to_cpu(desc->zcap), nvme_zone_state_to_string(desc->zs >> 4), nvme_zone_type_to_string(desc->zt)); stdout_zns_report_zone_attributes(desc->za, desc->zai); - } - else { + } else { printf("SLBA: %#-10"PRIx64" WP: %#-10"PRIx64" Cap: %#-10"PRIx64" State: %#-4x Type: %#-4x Attrs: %#-4x AttrsInfo: %#-4x\n", (uint64_t)le64_to_cpu(desc->zslba), (uint64_t)le64_to_cpu(desc->wp), (uint64_t)le64_to_cpu(desc->zcap), desc->zs, desc->zt, @@ -3340,9 +3322,8 @@ static void stdout_list_ctrl(struct nvme_ctrl_list *ctrl_list) int i; printf("num of ctrls present: %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(ctrl_list->identifier[i])); - } } static void stdout_id_nvmset(struct nvme_id_nvmset_list *nvmset, @@ -3540,7 +3521,7 @@ static void stdout_id_iocs(struct nvme_id_iocs *iocs) { __u16 i; - for (i = 0; i < 512; i++) + for (i = 0; i < ARRAY_SIZE(iocs->iocsc); i++) if (iocs->iocsc[i]) printf("I/O Command Set Combination[%u]:%"PRIx64"\n", i, (uint64_t)le64_to_cpu(iocs->iocsc[i])); @@ -4132,7 +4113,7 @@ static void stdout_sanitize_log(struct nvme_sanitize_log_page *sanitize, le32_to_cpu(sanitize->etcend)); } -static void stdout_select_result(__u32 result) +static void stdout_select_result(enum nvme_features_id fid, __u32 result) { if (result & 0x1) printf(" Feature is saveable\n"); @@ -4159,7 +4140,7 @@ static void stdout_lba_range(struct nvme_lba_range_type *lbrt, int nr_ranges) printf("\tslba : %#"PRIx64"\n", le64_to_cpu(lbrt->entry[i].slba)); printf("\tnlb : %#"PRIx64"\n", le64_to_cpu(lbrt->entry[i].nlb)); printf("\tguid : "); - for (j = 0; j < 16; j++) + for (j = 0; j < ARRAY_SIZE(lbrt->entry[i].guid); j++) printf("%02x", lbrt->entry[i].guid[j]); printf("\n"); } @@ -4172,15 +4153,15 @@ static void stdout_auto_pst(struct nvme_feat_auto_pst *apst) printf( "\tAuto PST Entries"); printf("\t.................\n"); - for (i = 0; i < 32; i++) { + for (i = 0; i < ARRAY_SIZE(apst->apst_entry); i++) { value = le64_to_cpu(apst->apst_entry[i]); printf("\tEntry[%2d] \n", i); printf("\t.................\n"); printf("\tIdle Time Prior to Transition (ITPT): %u ms\n", - (__u32)(value >> NVME_APST_ENTRY_ITPT_SHIFT) & NVME_APST_ENTRY_ITPT_MASK); + (__u32)NVME_GET(value, APST_ENTRY_ITPT)); printf("\tIdle Transition Power State (ITPS): %u\n", - (__u32)(value >> NVME_APST_ENTRY_ITPS_SHIFT ) & NVME_APST_ENTRY_ITPS_MASK); + (__u32)NVME_GET(value, APST_ENTRY_ITPS)); printf("\t.................\n"); } } @@ -4232,11 +4213,11 @@ static void stdout_directive_show_fields(__u8 dtype, __u8 doper, case NVME_DIRECTIVE_RECEIVE_IDENTIFY_DOPER_PARAM: printf("\tDirective support \n"); printf("\t\tIdentify Directive : %s\n", - (*field & 0x1) ? "supported":"not supported"); + (*field & 0x1) ? "supported" : "not supported"); printf("\t\tStream Directive : %s\n", - (*field & 0x2) ? "supported":"not supported"); + (*field & 0x2) ? "supported" : "not supported"); printf("\t\tData Placement Directive : %s\n", - (*field & 0x4) ? "supported":"not supported"); + (*field & 0x4) ? "supported" : "not supported"); printf("\tDirective enabled \n"); printf("\t\tIdentify Directive : %s\n", (*(field + 32) & 0x1) ? "enabled" : "disabled"); @@ -4251,40 +4232,39 @@ static void stdout_directive_show_fields(__u8 dtype, __u8 doper, (*(field + 32) & 0x2) ? "enabled" : "disabled"); printf("\t\tData Placement Directive : %s\n", (*(field + 32) & 0x4) ? "enabled" : "disabled"); - break; default: fprintf(stderr, "invalid directive operations for Identify Directives\n"); + break; } break; case NVME_DIRECTIVE_DTYPE_STREAMS: switch (doper) { case NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_PARAM: printf("\tMax Streams Limit (MSL): %u\n", - *(__u16 *) field); + *(__u16 *)field); printf("\tNVM Subsystem Streams Available (NSSA): %u\n", - *(__u16 *) (field + 2)); + *(__u16 *)(field + 2)); printf("\tNVM Subsystem Streams Open (NSSO): %u\n", - *(__u16 *) (field + 4)); + *(__u16 *)(field + 4)); printf("\tNVM Subsystem Stream Capability (NSSC): %u\n", - *(__u16 *) (field + 6)); + *(__u16 *)(field + 6)); printf("\tStream Write Size (in unit of LB size) (SWS): %u\n", - *(__u32 *) (field + 16)); + *(__u32 *)(field + 16)); printf("\tStream Granularity Size (in unit of SWS) (SGS): %u\n", - *(__u16 *) (field + 20)); + *(__u16 *)(field + 20)); printf("\tNamespace Streams Allocated (NSA): %u\n", - *(__u16 *) (field + 22)); + *(__u16 *)(field + 22)); printf("\tNamespace Streams Open (NSO): %u\n", - *(__u16 *) (field + 24)); + *(__u16 *)(field + 24)); break; case NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_STATUS: - count = *(__u16 *) field; - printf("\tOpen Stream Count : %u\n", *(__u16 *) field); - for ( i = 0; i < count; i++ ) { + count = *(__u16 *)field; + printf("\tOpen Stream Count : %u\n", *(__u16 *)field); + for (i = 0; i < count; i++) printf("\tStream Identifier %.6u : %u\n", i + 1, - *(__u16 *) (field + ((i + 1) * 2))); - } + *(__u16 *)(field + ((i + 1) * 2))); break; case NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_RESOURCE: printf("\tNamespace Streams Allocated (NSA): %u\n", @@ -4293,13 +4273,13 @@ static void stdout_directive_show_fields(__u8 dtype, __u8 doper, default: fprintf(stderr, "invalid directive operations for Streams Directives\n"); + break; } break; default: fprintf(stderr, "invalid directive type\n"); break; } - return; } static void stdout_directive_show(__u8 type, __u8 oper, __u16 spec, __u32 nsid, __u32 result, @@ -4319,6 +4299,41 @@ static void stdout_lba_status_info(__u32 result) printf("\tLBA Status Information Report Interval (LSIRI): %u\n", result & 0xffff); } +void stdout_d(unsigned char *buf, int len, int width, int group) +{ + int i, offset = 0; + char ascii[32 + 1] = { 0 }; + + assert(width < sizeof(ascii)); + + printf(" "); + + for (i = 0; i <= 15; i++) + printf("%3x", i); + + for (i = 0; i < len; i++) { + if (!(i % width)) + printf( "\n%04x:", offset); + if (i % group) + printf( "%02x", buf[i]); + else + printf( " %02x", buf[i]); + ascii[i % width] = (buf[i] >= '!' && buf[i] <= '~') ? buf[i] : '.'; + if (!((i + 1) % width)) { + 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); + } + + printf( "\n"); +} + static void stdout_plm_config(struct nvme_plm_config *plmcfg) { printf("\tEnable Event :%04x\n", le16_to_cpu(plmcfg->ee)); @@ -4330,26 +4345,31 @@ static void stdout_plm_config(struct nvme_plm_config *plmcfg) static void stdout_host_metadata(enum nvme_features_id fid, struct nvme_host_metadata *data) { - struct nvme_metadata_element_desc *desc = &data->descs[0]; - int i; - char val[4096]; - __u16 len; + struct nvme_metadata_element_desc *desc = &data->descs[0]; + int i; + char val[4096]; + __u16 len; - printf("\tNum Metadata Element Descriptors: %d\n", data->ndesc); - for (i = 0; i < data->ndesc; i++) { - len = le16_to_cpu(desc->len); - strncpy(val, (char *)desc->val, min(sizeof(val) - 1, len)); + printf("\tNum Metadata Element Descriptors: %d\n", data->ndesc); + for (i = 0; i < data->ndesc; i++) { + len = le16_to_cpu(desc->len); + 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("\tElement[%-3d]:\n", i); + printf("\t\tType : 0x%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); - printf("\t\tValue : %s\n", val); + printf("\t\tRevision : %d\n", desc->rev); + printf("\t\tLength : %d\n", len); + printf("\t\tValue : %s\n", val); - desc = (struct nvme_metadata_element_desc *) - &desc->val[desc->len]; - } + desc = (struct nvme_metadata_element_desc *)&desc->val[desc->len]; + } +} + +static void stdout_feature_show(enum nvme_features_id fid, int sel, unsigned int result) +{ + printf("get-feature:%#0*x (%s), %s value:%#0*x\n", fid ? 4 : 2, fid, + nvme_feature_to_string(fid), nvme_select_to_string(sel), result ? 10 : 8, result); } static void stdout_feature_show_fields(enum nvme_features_id fid, @@ -4372,8 +4392,8 @@ static void stdout_feature_show_fields(enum nvme_features_id fid, break; case NVME_FEAT_FID_POWER_MGMT: field = (result & 0x000000E0) >> 5; - printf("\tWorkload Hint (WH): %u - %s\n", field, nvme_feature_wl_hints_to_string(field)); - printf("\tPower State (PS): %u\n", result & 0x0000001f); + printf("\tWorkload Hint (WH): %u - %s\n", field, nvme_feature_wl_hints_to_string(field)); + printf("\tPower State (PS): %u\n", result & 0x0000001f); break; case NVME_FEAT_FID_LBA_RANGE: field = result & 0x0000003f; @@ -4393,56 +4413,56 @@ static void stdout_feature_show_fields(enum nvme_features_id fid, break; case NVME_FEAT_FID_ERR_RECOVERY: printf("\tDeallocated or Unwritten Logical Block Error Enable (DULBE): %s\n", - ((result & 0x00010000) >> 16) ? "Enabled":"Disabled"); + ((result & 0x00010000) >> 16) ? "Enabled" : "Disabled"); printf("\tTime Limited Error Recovery (TLER): %u ms\n", (result & 0x0000ffff) * 100); break; case NVME_FEAT_FID_VOLATILE_WC: - printf("\tVolatile Write Cache Enable (WCE): %s\n", (result & 0x00000001) ? "Enabled":"Disabled"); + printf("\tVolatile Write Cache Enable (WCE): %s\n", (result & 0x00000001) ? "Enabled" : "Disabled"); break; case NVME_FEAT_FID_NUM_QUEUES: printf("\tNumber of IO Completion Queues Allocated (NCQA): %u\n", ((result & 0xffff0000) >> 16) + 1); - printf("\tNumber of IO Submission Queues Allocated (NSQA): %u\n", (result & 0x0000ffff) + 1); + printf("\tNumber of IO Submission Queues Allocated (NSQA): %u\n", (result & 0x0000ffff) + 1); break; case NVME_FEAT_FID_IRQ_COALESCE: printf("\tAggregation Time (TIME): %u usec\n", ((result & 0x0000ff00) >> 8) * 100); - printf("\tAggregation Threshold (THR): %u\n", (result & 0x000000ff) + 1); + printf("\tAggregation Threshold (THR): %u\n", (result & 0x000000ff) + 1); break; case NVME_FEAT_FID_IRQ_CONFIG: - printf("\tCoalescing Disable (CD): %s\n", ((result & 0x00010000) >> 16) ? "True":"False"); - printf("\tInterrupt Vector (IV): %u\n", result & 0x0000ffff); + printf("\tCoalescing Disable (CD): %s\n", ((result & 0x00010000) >> 16) ? "True" : "False"); + printf("\tInterrupt Vector (IV): %u\n", result & 0x0000ffff); break; case NVME_FEAT_FID_WRITE_ATOMIC: - printf("\tDisable Normal (DN): %s\n", (result & 0x00000001) ? "True":"False"); + printf("\tDisable Normal (DN): %s\n", (result & 0x00000001) ? "True" : "False"); break; case NVME_FEAT_FID_ASYNC_EVENT: printf("\tDiscovery Log Page Change Notices : %s\n", - ((result & 0x80000000) >> 31) ? "Send async event":"Do not send async event"); + ((result & 0x80000000) >> 31) ? "Send async event" : "Do not send async event"); printf("\tEndurance Group Event Aggregate Log Change Notices : %s\n", - ((result & 0x00004000) >> 14) ? "Send async event":"Do not send async event"); + ((result & 0x00004000) >> 14) ? "Send async event" : "Do not send async event"); printf("\tLBA Status Information Notices : %s\n", - ((result & 0x00002000) >> 13) ? "Send async event":"Do not send async event"); + ((result & 0x00002000) >> 13) ? "Send async event" : "Do not send async event"); printf("\tPredictable Latency Event Aggregate Log Change Notices : %s\n", - ((result & 0x00001000) >> 12) ? "Send async event":"Do not send async event"); + ((result & 0x00001000) >> 12) ? "Send async event" : "Do not send async event"); printf("\tAsymmetric Namespace Access Change Notices : %s\n", - ((result & 0x00000800) >> 11) ? "Send async event":"Do not send async event"); + ((result & 0x00000800) >> 11) ? "Send async event" : "Do not send async event"); printf("\tTelemetry Log Notices : %s\n", - ((result & 0x00000400) >> 10) ? "Send async event":"Do not send async event"); + ((result & 0x00000400) >> 10) ? "Send async event" : "Do not send async event"); printf("\tFirmware Activation Notices : %s\n", - ((result & 0x00000200) >> 9) ? "Send async event":"Do not send async event"); + ((result & 0x00000200) >> 9) ? "Send async event" : "Do not send async event"); printf("\tNamespace Attribute Notices : %s\n", - ((result & 0x00000100) >> 8) ? "Send async event":"Do not send async event"); + ((result & 0x00000100) >> 8) ? "Send async event" : "Do not send async event"); printf("\tSMART / Health Critical Warnings : %s\n", - (result & 0x000000ff) ? "Send async event":"Do not send async event"); + (result & 0x000000ff) ? "Send async event" : "Do not send async event"); break; case NVME_FEAT_FID_AUTO_PST: printf("\tAutonomous Power State Transition Enable (APSTE): %s\n", - (result & 0x00000001) ? "Enabled":"Disabled"); + (result & 0x00000001) ? "Enabled" : "Disabled"); if (buf) stdout_auto_pst((struct nvme_feat_auto_pst *)buf); break; case NVME_FEAT_FID_HOST_MEM_BUF: - printf("\tEnable Host Memory (EHM): %s\n", (result & 0x00000001) ? "Enabled":"Disabled"); + printf("\tEnable Host Memory (EHM): %s\n", (result & 0x00000001) ? "Enabled" : "Disabled"); if (buf) stdout_host_mem_buffer((struct nvme_host_mem_buf_attrs *)buf); break; @@ -4467,7 +4487,7 @@ static void stdout_feature_show_fields(enum nvme_features_id fid, printf("\tRead Recovery Level (RRL): %u\n", result & 0xf); break; case NVME_FEAT_FID_PLM_CONFIG: - printf("\tPredictable Latency Window Enabled: %s\n", result & 0x1 ? "True":"False"); + printf("\tPredictable Latency Window Enabled: %s\n", result & 0x1 ? "True" : "False"); if (buf) stdout_plm_config((struct nvme_plm_config *)buf); break; @@ -4478,8 +4498,20 @@ static void stdout_feature_show_fields(enum nvme_features_id fid, stdout_lba_status_info(result); break; case NVME_FEAT_FID_HOST_BEHAVIOR: - if (buf) - printf("\tHost Behavior Support: %s\n", (buf[0] & 0x1) ? "True" : "False"); + if (buf) { + struct nvme_feat_host_behavior *host_behavior = + (struct nvme_feat_host_behavior *)buf; + printf("\tAdvanced Command Retry Enable (ACRE): %s\n", + host_behavior->acre ? "True" : "False"); + printf("\tExtended Telemetry Data Area 4 Supported (ETDAS): %s\n", + host_behavior->etdas ? "True" : "False"); + printf("\tLBA Format Extension Enable (LBAFEE): %s\n", + host_behavior->lbafee ? "True" : "False"); + printf("\tCopy Descriptor Format 2h Enabled (CDFE): %s\n", + host_behavior->cdfe & (1 << 2) ? "True" : "False"); + printf("\tCopy Descriptor Format 3h Enabled (CDFE): %s\n", + host_behavior->cdfe & (1 << 3) ? "True" : "False"); + } break; case NVME_FEAT_FID_SANITIZE: printf("\tNo-Deallocate Response Mode (NODRM) : %u\n", result & 0x1); @@ -4489,13 +4521,15 @@ static void stdout_feature_show_fields(enum nvme_features_id fid, printf("\tEndurance Group Critical Warnings : %u\n", (result >> 16) & 0xff); break; case NVME_FEAT_FID_IOCS_PROFILE: - printf("\tI/O Command Set Profile: %s\n", result & 0x1 ? "True":"False"); + printf("\tI/O Command Set Profile: %s\n", result & 0x1 ? "True" : "False"); break; case NVME_FEAT_FID_SPINUP_CONTROL: 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); @@ -4513,14 +4547,14 @@ static void stdout_feature_show_fields(enum nvme_features_id fid, break; case NVME_FEAT_FID_RESV_MASK: printf("\tMask Reservation Preempted Notification (RESPRE): %s\n", - ((result & 0x00000008) >> 3) ? "True":"False"); + ((result & 0x00000008) >> 3) ? "True" : "False"); printf("\tMask Reservation Released Notification (RESREL): %s\n", - ((result & 0x00000004) >> 2) ? "True":"False"); + ((result & 0x00000004) >> 2) ? "True" : "False"); printf("\tMask Registration Preempted Notification (REGPRE): %s\n", - ((result & 0x00000002) >> 1) ? "True":"False"); + ((result & 0x00000002) >> 1) ? "True" : "False"); break; case NVME_FEAT_FID_RESV_PERSIST: - printf("\tPersist Through Power Loss (PTPL): %s\n", (result & 0x00000001) ? "True":"False"); + printf("\tPersist Through Power Loss (PTPL): %s\n", (result & 0x00000001) ? "True" : "False"); break; case NVME_FEAT_FID_WRITE_PROTECT: printf("\tNamespace Write Protect: %s\n", nvme_ns_wp_cfg_to_string(result)); @@ -4540,6 +4574,7 @@ static void stdout_feature_show_fields(enum nvme_features_id fid, printf("\t%-53s: %sEnabled\n", nvme_fdp_event_to_string(d->evt), d->evta & 0x1 ? "" : "Not "); } + break; default: break; } @@ -4565,6 +4600,8 @@ static void stdout_lba_status(struct nvme_lba_status *list, "\tnumber of logical blocks specified in the\n"\ "\tRange Length field\n"); break; + default: + break; } for (idx = 0; idx < list->nlsd; idx++) { @@ -4651,7 +4688,7 @@ static bool stdout_simple_ns(const char *name, void *arg) n = htable_ns_get(&res->ht_n, name); stdout_list_item(n); - return true; + return true; } static void stdout_simple_list(nvme_root_t r) @@ -4661,9 +4698,9 @@ static void stdout_simple_list(nvme_root_t r) nvme_resources_init(r, &res); printf("%-21s %-21s %-20s %-40s %-10s %-26s %-16s %-8s\n", - "Node", "Generic", "SN", "Model", "Namespace", "Usage", "Format", "FW Rev"); + "Node", "Generic", "SN", "Model", "Namespace", "Usage", "Format", "FW Rev"); printf("%-.21s %-.21s %-.20s %-.40s %-.10s %-.26s %-.16s %-.8s\n", - dash, dash, dash, dash, dash, dash, dash, dash); + dash, dash, dash, dash, dash, dash, dash, dash); strset_iterate(&res.namespaces, stdout_simple_ns, &res); nvme_resources_free(&res); @@ -4717,7 +4754,6 @@ static bool stdout_detailed_subsys(const char *name, void *arg) for (s = htable_subsys_getfirst(&res->ht_s, name, &it); s; s = htable_subsys_getnext(&res->ht_s, name, &it)) { - if (first) { printf("%-16s %-96s ", name, nvme_subsystem_get_nqn(s)); first = false; @@ -4792,7 +4828,6 @@ static bool stdout_detailed_ns(const char *name, void *arg) for (n = htable_ns_getfirst(&res->ht_n, name, &it); n; n = htable_ns_getnext(&res->ht_n, name, &it)) { - if (first) { stdout_ns_details(n); first = false; @@ -4994,7 +5029,7 @@ static void stdout_message(bool error, const char *msg, va_list ap) { vfprintf(error ? stderr : stdout, msg, ap); - printf("\n"); + fprintf(error ? stderr : stdout, "\n"); } static void stdout_perror(const char *msg) @@ -5047,10 +5082,11 @@ static void stdout_discovery_log(struct nvmf_discovery_log *log, int numrec) static void stdout_connect_msg(nvme_ctrl_t c) { - printf("device: %s\n", nvme_ctrl_get_name(c)); + printf("connecting to device: %s\n", nvme_ctrl_get_name(c)); } static struct print_ops stdout_print_ops = { + /* libnvme types.h print functions */ .ana_log = stdout_ana_log, .boot_part_log = stdout_boot_part_log, .phy_rx_eom_log = stdout_phy_rx_eom_log, @@ -5072,7 +5108,6 @@ static struct print_ops stdout_print_ops = { .fw_log = stdout_fw_log, .id_ctrl = stdout_id_ctrl, .id_ctrl_nvm = stdout_id_ctrl_nvm, - .id_ctrl_rpmbs = stdout_id_ctrl_rpmbs, .id_domain_list = stdout_id_domain_list, .id_independent_id_ns = stdout_cmd_set_independent_id_ns, .id_iocs = stdout_id_iocs, @@ -5081,9 +5116,7 @@ static struct print_ops stdout_print_ops = { .id_ns_granularity_list = stdout_id_ns_granularity_list, .id_nvmset_list = stdout_id_nvmset, .id_uuid_list = stdout_id_uuid_list, - .lba_range = stdout_lba_range, .lba_status = stdout_lba_status, - .lba_status_info = stdout_lba_status_info, .lba_status_log = stdout_lba_status_log, .media_unit_stat_log = stdout_media_unit_stat_log, .mi_cmd_support_effects_log = stdout_mi_cmd_support_effects_log, @@ -5100,25 +5133,38 @@ static struct print_ops stdout_print_ops = { .secondary_ctrl_list = stdout_list_secondary_ctrl, .select_result = stdout_select_result, .self_test_log = stdout_self_test_log, - .show_feature_fields = stdout_feature_show_fields, .single_property = stdout_single_property, .smart_log = stdout_smart_log, .supported_cap_config_list_log = stdout_supported_cap_config_log, .supported_log_pages = stdout_supported_log, + .zns_start_zone_list = stdout_zns_start_zone_list, .zns_changed_zone_log = stdout_zns_changed, + .zns_finish_zone_list = NULL, .zns_id_ctrl = stdout_zns_id_ctrl, .zns_id_ns = stdout_zns_id_ns, .zns_report_zones = stdout_zns_report_zones, + .show_feature = stdout_feature_show, + .show_feature_fields = stdout_feature_show_fields, + .id_ctrl_rpmbs = stdout_id_ctrl_rpmbs, + .lba_range = stdout_lba_range, + .lba_status_info = stdout_lba_status_info, + .d = stdout_d, + .show_init = NULL, + .show_finish = NULL, + /* libnvme tree print functions */ + .list_item = stdout_list_item, .list_items = stdout_list_items, .print_nvme_subsystem_list = stdout_subsystem_list, .topology_ctrl = stdout_topology_ctrl, .topology_namespace = stdout_topology_namespace, - .show_status = stdout_status, + /* status and error messages */ + .connect_msg = stdout_connect_msg, .show_message = stdout_message, .show_perror = stdout_perror, - .connect_msg = stdout_connect_msg, + .show_status = stdout_status, + .show_error_status = stdout_error_status, }; struct print_ops *nvme_get_stdout_print_ops(enum nvme_print_flags flags) diff --git a/nvme-print.c b/nvme-print.c index ea5bf76..1086aad 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -15,21 +15,21 @@ #include "util/types.h" #include "common.h" -#define nvme_print(name, flags, ...) \ -do { \ - struct print_ops *ops = nvme_print_ops(flags); \ - if (ops) { \ - if (ops->name) \ - ops->name(__VA_ARGS__); \ - return; \ - } \ -} while(0); +#define nvme_print(name, flags, ...) \ + do { \ + struct print_ops *ops = nvme_print_ops(flags); \ + if (ops && ops->name) \ + ops->name(__VA_ARGS__); \ + } while (false) + +#define nvme_print_output_format(name, ...) \ + nvme_print(name, nvme_is_output_format_json() ? JSON : NORMAL, ##__VA_ARGS__); static struct print_ops *nvme_print_ops(enum nvme_print_flags flags) { struct print_ops *ops = NULL; - if (flags & JSON) + if (flags & JSON || nvme_is_output_format_json()) ops = nvme_get_json_print_ops(flags); else if (flags & BINARY) ops = nvme_get_binary_print_ops(flags); @@ -135,7 +135,6 @@ void nvme_show_predictable_latency_per_nvmset( __u16 nvmset_id, const char *devname, enum nvme_print_flags flags) { - nvme_print(predictable_latency_per_nvmset, flags, plpns_log, nvmset_id, devname); } @@ -279,7 +278,6 @@ void nvme_show_fdp_configs(struct nvme_fdp_config_log *log, size_t len, void nvme_show_fdp_usage(struct nvme_fdp_ruhu_log *log, size_t len, enum nvme_print_flags flags) { - nvme_print(fdp_usage_log, flags,log, len); } @@ -312,7 +310,6 @@ void nvme_show_fdp_events(struct nvme_fdp_events_log *log, void nvme_show_fdp_ruh_status(struct nvme_fdp_ruh_status *status, size_t len, enum nvme_print_flags flags) { - nvme_print(fdp_ruh_status, flags, status, len); } @@ -382,37 +379,7 @@ void nvme_show_relatives(const char *name) void d(unsigned char *buf, int len, int width, int group) { - int i, offset = 0, line_done = 0; - char ascii[32 + 1]; - - assert(width < sizeof(ascii)); - printf(" "); - for (i = 0; i <= 15; i++) - printf("%3x", i); - for (i = 0; i < len; i++) { - line_done = 0; - if (i % width == 0) - printf( "\n%04x:", offset); - if (i % group == 0) - printf( " %02x", buf[i]); - else - printf( "%02x", buf[i]); - ascii[i % width] = (buf[i] >= '!' && buf[i] <= '~') ? buf[i] : '.'; - if (((i + 1) % width) == 0) { - ascii[i % width + 1] = '\0'; - printf( " \"%.*s\"", width, ascii); - offset += width; - line_done = 1; - } - } - if (!line_done) { - unsigned b = width - (i % width); - ascii[i % width + 1] = '\0'; - printf( " %*s \"%.*s\"", - 2 * b + b / group + (b % group ? 1 : 0), "", - width, ascii); - } - printf( "\n"); + nvme_print(d, NORMAL, buf, len, width, group); } void d_raw(unsigned char *buf, unsigned len) @@ -424,20 +391,29 @@ void d_raw(unsigned char *buf, unsigned len) void nvme_show_status(int status) { - struct print_ops *ops; + struct print_ops *ops = nvme_print_ops(NORMAL); if (nvme_is_output_format_json()) ops = nvme_print_ops(JSON); - else - ops =nvme_print_ops(0); - if (!ops) - return; + if (ops && ops->show_status) + ops->show_status(status); +} - if (!ops->show_status) - return; +void nvme_show_error_status(int status, const char *msg, ...) +{ + struct print_ops *ops = nvme_print_ops(NORMAL); + va_list ap; - ops->show_status(status); + va_start(ap, msg); + + if (nvme_is_output_format_json()) + ops = nvme_print_ops(JSON); + + if (ops && ops->show_status) + ops->show_error_status(status, msg, ap); + + va_end(ap); } void nvme_show_id_ctrl_rpmbs(__le32 ctrl_rpmbs, enum nvme_print_flags flags) @@ -501,12 +477,24 @@ void nvme_show_list_ns(struct nvme_ns_list *ns_list, enum nvme_print_flags flags nvme_print(ns_list, flags, ns_list); } +void nvme_zns_start_zone_list(__u64 nr_zones, struct json_object **zone_list, + enum nvme_print_flags flags) +{ + nvme_print(zns_start_zone_list, flags, nr_zones, zone_list); +} + void nvme_show_zns_changed(struct nvme_zns_changed_zone_log *log, enum nvme_print_flags flags) { nvme_print(zns_changed_zone_log, flags, log); } +void nvme_zns_finish_zone_list(__u64 nr_zones, struct json_object *zone_list, + enum nvme_print_flags flags) +{ + nvme_print(zns_finish_zone_list, flags, nr_zones, zone_list); +} + const char *nvme_zone_type_to_string(__u8 cond) { switch (cond) { @@ -619,13 +607,13 @@ const char *nvme_trtype_to_string(__u8 trtype) } void nvme_show_error_log(struct nvme_error_log_page *err_log, int entries, - const char *devname, enum nvme_print_flags flags) + const char *devname, enum nvme_print_flags flags) { nvme_print(error_log, flags, err_log, entries, devname); } void nvme_show_resv_report(struct nvme_resv_status *status, int bytes, - bool eds, enum nvme_print_flags flags) + bool eds, enum nvme_print_flags flags) { nvme_print(resv_report, flags, status, bytes, eds); } @@ -664,12 +652,19 @@ const char *nvme_log_to_string(__u8 lid) case NVME_LOG_LID_ENDURANCE_GROUP: return "Endurance Group Information"; case NVME_LOG_LID_PREDICTABLE_LAT_NVMSET: return "Predictable Latency Per NVM Set"; case NVME_LOG_LID_PREDICTABLE_LAT_AGG: return "Predictable Latency Event Aggregate"; + case NVME_LOG_LID_MEDIA_UNIT_STATUS: return "Media Unit Status"; + case NVME_LOG_LID_SUPPORTED_CAP_CONFIG_LIST: return "Supported Capacity Configuration List"; case NVME_LOG_LID_ANA: return "Asymmetric Namespace Access"; case NVME_LOG_LID_PERSISTENT_EVENT: return "Persistent Event Log"; case NVME_LOG_LID_LBA_STATUS: return "LBA Status Information"; case NVME_LOG_LID_ENDURANCE_GRP_EVT: return "Endurance Group Event Aggregate"; case NVME_LOG_LID_FID_SUPPORTED_EFFECTS: return "Feature Identifiers Supported and Effects"; + case NVME_LOG_LID_MI_CMD_SUPPORTED_EFFECTS: return "NVMe-MI Commands Supported and Effects"; case NVME_LOG_LID_BOOT_PARTITION: return "Boot Partition"; + case NVME_LOG_LID_FDP_CONFIGS: return "FDP Configurations"; + case NVME_LOG_LID_FDP_RUH_USAGE: return "Reclaim Unit Handle Usage"; + case NVME_LOG_LID_FDP_STATS: return "FDP Statistics"; + case NVME_LOG_LID_FDP_EVENTS: return "FDP Events"; case NVME_LOG_LID_DISCOVER: return "Discovery"; case NVME_LOG_LID_RESERVATION: return "Reservation Notification"; case NVME_LOG_LID_SANITIZE: return "Sanitize Status"; @@ -794,9 +789,9 @@ const char *nvme_select_to_string(int sel) } } -void nvme_show_select_result(__u32 result) +void nvme_show_select_result(enum nvme_features_id fid, __u32 result) { - nvme_print(select_result, 0, result); + nvme_print(select_result, NORMAL, fid, result); } const char *nvme_feature_lba_type_to_string(__u8 type) @@ -873,9 +868,8 @@ const char *nvme_ns_wp_cfg_to_string(enum nvme_ns_write_protect_cfg state) } void nvme_directive_show(__u8 type, __u8 oper, __u16 spec, __u32 nsid, __u32 result, - void *buf, __u32 len, enum nvme_print_flags flags) + void *buf, __u32 len, enum nvme_print_flags flags) { - nvme_print(directive, flags, type, oper, spec, nsid, result, buf, len); } @@ -893,7 +887,7 @@ const char *nvme_plm_window_to_string(__u32 plm) void nvme_show_lba_status_info(__u32 result) { - nvme_print(lba_status_info, 0, result); + nvme_print(lba_status_info, NORMAL, result); } const char *nvme_host_metadata_type_to_string(enum nvme_features_id fid, @@ -956,13 +950,18 @@ const char *nvme_host_metadata_type_to_string(enum nvme_features_id fid, } } +void nvme_feature_show(enum nvme_features_id fid, int sel, unsigned int result) +{ + nvme_print(show_feature, NORMAL, fid, sel, result); +} + void nvme_feature_show_fields(enum nvme_features_id fid, unsigned int result, unsigned char *buf) { - nvme_print(show_feature_fields, 0, fid, result, buf); + nvme_print(show_feature_fields, NORMAL, fid, result, buf); } void nvme_show_lba_status(struct nvme_lba_status *list, unsigned long len, - enum nvme_print_flags flags) + enum nvme_print_flags flags) { nvme_print(lba_status, flags, list, len); } @@ -1010,7 +1009,7 @@ void nvme_generic_full_path(nvme_ns_t n, char *path, size_t len) void nvme_show_list_item(nvme_ns_t n) { - nvme_print(list_item, 0, n); + nvme_print(list_item, NORMAL, n); } void nvme_show_list_items(nvme_root_t r, enum nvme_print_flags flags) @@ -1022,49 +1021,37 @@ void nvme_show_topology(nvme_root_t r, enum nvme_cli_topo_ranking ranking, enum nvme_print_flags flags) { - if (ranking == NVME_CLI_TOPO_NAMESPACE) { + if (ranking == NVME_CLI_TOPO_NAMESPACE) nvme_print(topology_namespace, flags, r); - } else { + else nvme_print(topology_ctrl, flags, r); - } } void nvme_show_message(bool error, const char *msg, ...) { - struct print_ops *ops; + struct print_ops *ops = nvme_print_ops(NORMAL); va_list ap; + va_start(ap, msg); if (nvme_is_output_format_json()) ops = nvme_print_ops(JSON); - else - ops = nvme_print_ops(0); - if (!ops) - return; - - if (!ops->show_message) - return; - ops->show_message(error, msg, ap); + if (ops && ops->show_message) + ops->show_message(error, msg, ap); va_end(ap); } void nvme_show_perror(const char *msg) { - struct print_ops *ops; + struct print_ops *ops = nvme_print_ops(NORMAL); if (nvme_is_output_format_json()) ops = nvme_print_ops(JSON); - else - ops = nvme_print_ops(0); - if (!ops) - return; - - if (!ops->show_perror) - return; - ops->show_perror(msg); + if (ops && ops->show_perror) + ops->show_perror(msg); } void nvme_show_discovery_log(struct nvmf_discovery_log *log, uint64_t numrec, @@ -1077,3 +1064,13 @@ void nvme_show_connect_msg(nvme_ctrl_t c, enum nvme_print_flags flags) { nvme_print(connect_msg, flags, c); } + +void nvme_show_init(void) +{ + nvme_print_output_format(show_init); +} + +void nvme_show_finish(void) +{ + nvme_print_output_format(show_finish); +} diff --git a/nvme-print.h b/nvme-print.h index 1c7e5dc..4533474 100644 --- a/nvme-print.h +++ b/nvme-print.h @@ -65,21 +65,26 @@ struct print_ops { void (*resv_report)(struct nvme_resv_status *status, int bytes, bool eds); void (*sanitize_log_page)(struct nvme_sanitize_log_page *sanitize_log, const char *devname); void (*secondary_ctrl_list)(const struct nvme_secondary_ctrl_list *sc_list, __u32 count); - void (*select_result)(__u32 result); + void (*select_result)(enum nvme_features_id fid, __u32 result); void (*self_test_log)(struct nvme_self_test_log *self_test, __u8 dst_entries, __u32 size, const char *devname); void (*single_property)(int offset, uint64_t value64); void (*smart_log)(struct nvme_smart_log *smart, unsigned int nsid, const char *devname); void (*supported_cap_config_list_log)(struct nvme_supported_cap_config_list_log *cap_log); void (*supported_log_pages)(struct nvme_supported_log_pages *support_log, const char *devname); + void (*zns_start_zone_list)(__u64 nr_zones, struct json_object **zone_list); void (*zns_changed_zone_log)(struct nvme_zns_changed_zone_log *log); void (*zns_finish_zone_list)(__u64 nr_zones, struct json_object *zone_list); void (*zns_id_ctrl)(struct nvme_zns_id_ctrl *ctrl); void (*zns_id_ns)(struct nvme_zns_id_ns *ns, struct nvme_id_ns *id_ns); void (*zns_report_zones)(void *report, __u32 descs, __u8 ext_size, __u32 report_size, struct json_object *zone_list); - void (*show_feature_fields)(enum nvme_features_id id, unsigned int result, unsigned char *buf); + void (*show_feature)(enum nvme_features_id fid, int sel, unsigned int result); + void (*show_feature_fields)(enum nvme_features_id fid, unsigned int result, unsigned char *buf); void (*id_ctrl_rpmbs)(__le32 ctrl_rpmbs); void (*lba_range)(struct nvme_lba_range_type *lbrt, int nr_ranges); void (*lba_status_info)(__u32 result); + void (*d)(unsigned char *buf, int len, int width, int group); + void (*show_init)(void); + void (*show_finish)(void); /* libnvme tree print functions */ void (*list_item)(nvme_ns_t n); @@ -93,10 +98,32 @@ struct print_ops { void (*show_message)(bool error, const char *msg, va_list ap); void (*show_perror)(const char *msg); void (*show_status)(int status); + void (*show_error_status)(int status, const char *msg, va_list ap); enum nvme_print_flags flags; }; +struct nvme_bar_cap { + __u16 mqes; + __u8 cqr:1; + __u8 ams:2; + __u8 rsvd19:5; + __u8 to; + __u16 dstrd:4; + __u16 nssrs:1; + __u16 css:8; + __u16 bps:1; + __u8 cps:2; + __u8 mpsmin:4; + __u8 mpsmax:4; + __u8 pmrs:1; + __u8 cmbs:1; + __u8 nsss:1; + __u8 crwms:1; + __u8 crims:1; + __u8 rsvd61:3; +}; + #ifdef CONFIG_JSONC struct print_ops *nvme_get_json_print_ops(enum nvme_print_flags flags); @@ -207,10 +234,11 @@ void nvme_show_topology(nvme_root_t t, enum nvme_cli_topo_ranking ranking, enum nvme_print_flags flags); +void nvme_feature_show(enum nvme_features_id fid, int sel, unsigned int result); void nvme_feature_show_fields(enum nvme_features_id fid, unsigned int result, unsigned char *buf); void nvme_directive_show(__u8 type, __u8 oper, __u16 spec, __u32 nsid, __u32 result, void *buf, __u32 len, enum nvme_print_flags flags); -void nvme_show_select_result(__u32 result); +void nvme_show_select_result(enum nvme_features_id fid, __u32 result); void nvme_show_zns_id_ctrl(struct nvme_zns_id_ctrl *ctrl, enum nvme_print_flags flags); @@ -221,8 +249,12 @@ void nvme_show_nvm_id_ns(struct nvme_nvm_id_ns *nvm_ns, unsigned int nsid, bool cap_only, enum nvme_print_flags flags); void nvme_show_zns_id_ns(struct nvme_zns_id_ns *ns, struct nvme_id_ns *id_ns, enum nvme_print_flags flags); +void nvme_zns_start_zone_list(__u64 nr_zones, struct json_object **zone_list, + enum nvme_print_flags flags); void nvme_show_zns_changed(struct nvme_zns_changed_zone_log *log, enum nvme_print_flags flags); +void nvme_zns_finish_zone_list(__u64 nr_zones, struct json_object *zone_list, + enum nvme_print_flags flags); void nvme_show_zns_report_zones(void *report, __u32 descs, __u8 ext_size, __u32 report_size, struct json_object *zone_list, @@ -275,5 +307,7 @@ 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); void nvme_show_message(bool error, const char *msg, ...); void nvme_show_perror(const char *msg); - -#endif +void nvme_show_error_status(int status, const char *msg, ...); +void nvme_show_init(void); +void nvme_show_finish(void); +#endif /* NVME_PRINT_H */ diff --git a/nvme-rpmb.c b/nvme-rpmb.c index 3dbbbd3..345e6ea 100644 --- a/nvme-rpmb.c +++ b/nvme-rpmb.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (C) 2020 Micron Techology Inc. All rights reserved. + * Copyright (C) 2020 Micron Technology Inc. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -68,7 +68,7 @@ unsigned char *create_hash(const char *algo, .salg_name = { 0 } }; - /* copy algorith name */ + /* copy algorithm name */ if (strlen(algo) > sizeof(provider_sa.salg_name)) { fprintf(stderr, "%s: algorithm name overflow", __func__); return hash; @@ -608,7 +608,7 @@ static int rpmb_program_auth_key(int fd, unsigned char target, goto out; } - /* re-use response buffer */ + /* reuse response buffer */ memset(rsp, 0, rsp_size); err = recv_rpmb_rsp(fd, req->target, rsp_size, rsp); if (err != 0) { @@ -1005,7 +1005,7 @@ int rpmb_cmd_option(int argc, char **argv, struct command *cmd, struct plugin *p cfg.blocks, (regs.access_size + 1)); if (err > 0 && msg_buf != NULL) { - printf("Writting %d bytes to file %s\n", + printf("Writing %d bytes to file %s\n", err * 512, cfg.msgfile); write_file(msg_buf, err * 512, NULL, cfg.msgfile, NULL); diff --git a/nvme.c b/nvme.c index 968214a..872dc89 100644 --- a/nvme.c +++ b/nvme.c @@ -42,10 +42,6 @@ #include #include -#ifdef CONFIG_LIBHUGETLBFS -#include -#endif - #include #include @@ -193,100 +189,6 @@ static char *output_format_val = "normal"; static void *mmap_registers(nvme_root_t r, struct nvme_dev *dev); -#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) - -static void *nvme_alloc(size_t len) -{ - size_t _len = ROUND_UP(len, 0x1000); - void *p; - - if (posix_memalign((void *)&p, getpagesize(), _len)) - return NULL; - - memset(p, 0, _len); - return p; -} - -void *nvme_realloc(void *p, size_t len) -{ - size_t old_len = malloc_usable_size(p); - - void *result = nvme_alloc(len); - - if (p) { - memcpy(result, p, min(old_len, len)); - free(p); - } - - return result; -} - -static void *__nvme_alloc_huge(size_t len, bool *huge) -{ - void *p; - - if (!posix_memalign(&p, getpagesize(), len)) { - *huge = false; - memset(p, 0, len); - return p; - } - return NULL; -} - -#define HUGE_MIN 0x80000 - -#ifdef CONFIG_LIBHUGETLBFS -void nvme_free_huge(void *p, bool huge) -{ - if (huge) { - if (p) - free_hugepage_region(p); - } else { - free(p); - } -} - -void *nvme_alloc_huge(size_t len, bool *huge) -{ - void *p; - - if (len < HUGE_MIN) - return __nvme_alloc_huge(len, huge); - - p = get_hugepage_region(len, GHR_DEFAULT); - if (!p) - return __nvme_alloc_huge(len, huge); - - *huge = true; - return p; -} -#else -void nvme_free_huge(void *p, bool huge) -{ - free(p); -} - -void *nvme_alloc_huge(size_t len, bool *huge) -{ - return __nvme_alloc_huge(len, huge); -} -#endif - -void *nvme_realloc_huge(void *p, size_t len, bool *huge) -{ - size_t old_len = malloc_usable_size(p); - bool was_huge = *huge; - - void *result = nvme_alloc_huge(len, huge); - - if (p) { - memcpy(result, p, min(old_len, len)); - nvme_free_huge(p, was_huge); - } - - return result; -} - const char *nvme_strerror(int errnum) { if (errnum >= ENVME_CONNECT_RESOLVE) @@ -299,7 +201,7 @@ int map_log_level(int verbose, bool quiet) int log_level; /* - * LOG_NOTICE is unsued thus the user has to provide two 'v' for getting + * LOG_NOTICE is unused thus the user has to provide two 'v' for getting * any feedback at all. Thus skip this level */ verbose++; @@ -515,26 +417,35 @@ int open_exclusive(struct nvme_dev **dev, int argc, char **argv, return get_dev(dev, argc, argv, flags); } -enum nvme_print_flags validate_output_format(const char *format) +int validate_output_format(const char *format, enum nvme_print_flags *flags) { + enum nvme_print_flags f; + if (!format) return -EINVAL; if (!strcmp(format, "normal")) - return NORMAL; + f = NORMAL; + else if (!strcmp(format, "json")) + f = JSON; + else if (!strcmp(format, "binary")) + f = BINARY; + else + return -EINVAL; - if (!strcmp(format, "json")) - return JSON; + *flags = f; - if (!strcmp(format, "binary")) - return BINARY; - - return -EINVAL; + return 0; } bool nvme_is_output_format_json(void) { - return validate_output_format(output_format_val) == JSON; + enum nvme_print_flags flags; + + if (validate_output_format(output_format_val, &flags)) + return false; + + return flags == JSON; } void dev_close(struct nvme_dev *dev) @@ -584,7 +495,7 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -643,7 +554,7 @@ static int get_ana_log(int argc, char **argv, struct command *cmd, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -851,6 +762,10 @@ static int __get_telemetry_log_host(struct nvme_dev *dev, _cleanup_free_ struct nvme_telemetry_log *log = NULL; int err; + log = nvme_alloc(sizeof(*log)); + if (!log) + return -errno; + err = nvme_cli_get_log_telemetry_host(dev, 0, NVME_LOG_TELEM_BLOCK_SIZE, log); @@ -897,7 +812,7 @@ static int get_telemetry_log(int argc, char **argv, struct command *cmd, }; NVME_ARGS(opts, cfg, - OPT_FILE("output-file", 'o', &cfg.file_name, fname), + OPT_FILE("output-file", 'O', &cfg.file_name, fname), OPT_UINT("host-generate", 'g', &cfg.host_gen, hgen), OPT_FLAG("controller-init", 'c', &cfg.ctrl_init, cgen), OPT_UINT("data-area", 'd', &cfg.data_area, dgen), @@ -996,7 +911,7 @@ static int get_endurance_log(int argc, char **argv, struct command *cmd, struct if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1074,7 +989,7 @@ static int get_effects_log(int argc, char **argv, struct command *cmd, struct pl if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1153,7 +1068,7 @@ static int get_supported_log_pages(int argc, char **argv, struct command *cmd, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1209,7 +1124,7 @@ static int get_error_log(int argc, char **argv, struct command *cmd, struct plug if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1274,7 +1189,7 @@ static int get_fw_log(int argc, char **argv, struct command *cmd, struct plugin if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1323,7 +1238,7 @@ static int get_changed_ns_list_log(int argc, char **argv, struct command *cmd, s if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1380,7 +1295,7 @@ static int get_pred_lat_per_nvmset_log(int argc, char **argv, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1442,7 +1357,7 @@ static int get_pred_lat_event_agg_log(int argc, char **argv, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1501,10 +1416,10 @@ static int get_persistent_event_log(int argc, char **argv, _cleanup_free_ struct nvme_persistent_event_log *pevent_collected = NULL; _cleanup_free_ struct nvme_persistent_event_log *pevent = NULL; + _cleanup_huge_ struct nvme_mem_huge mh = { 0, }; _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; enum nvme_print_flags flags; void *pevent_log_info; - bool huge; int err; struct config { @@ -1528,7 +1443,7 @@ static int get_persistent_event_log(int argc, char **argv, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1573,9 +1488,10 @@ static int get_persistent_event_log(int argc, char **argv, if (cfg.action == NVME_PEVENT_LOG_EST_CTX_AND_READ) cfg.action = NVME_PEVENT_LOG_READ; - pevent_log_info = nvme_alloc_huge(cfg.log_len, &huge); + pevent_log_info = nvme_alloc_huge(cfg.log_len, &mh); if (!pevent_log_info) return -ENOMEM; + err = nvme_cli_get_log_persistent_event(dev, cfg.action, cfg.log_len, pevent_log_info); if (!err) { @@ -1584,16 +1500,16 @@ static int get_persistent_event_log(int argc, char **argv, pevent); if (err < 0) { nvme_show_error("persistent event log: %s", nvme_strerror(errno)); - goto free; + return err; } else if (err) { nvme_show_status(err); - goto free; + return err; } pevent_collected = pevent_log_info; if (pevent_collected->gen_number != pevent->gen_number) { printf("Collected Persistent Event Log may be invalid,\n" "Re-read the log is required\n"); - goto free; + return -EINVAL; } nvme_show_persistent_event_log(pevent_log_info, cfg.action, @@ -1604,8 +1520,6 @@ static int get_persistent_event_log(int argc, char **argv, nvme_show_error("persistent event log: %s", nvme_strerror(errno)); } -free: - nvme_free_huge(pevent_log_info, huge); return err; } @@ -1645,7 +1559,7 @@ static int get_endurance_event_agg_log(int argc, char **argv, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1720,7 +1634,7 @@ static int get_lba_status_log(int argc, char **argv, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1770,7 +1684,7 @@ static int get_resv_notif_log(int argc, char **argv, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1825,7 +1739,7 @@ static int get_boot_part_log(int argc, char **argv, struct command *cmd, struct if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1904,27 +1818,22 @@ static int get_phy_rx_eom_log(int argc, char **argv, struct command *cmd, struct config { __u8 lsp; __u16 controller; - char *output_format; }; struct config cfg = { .lsp = 0, .controller = NVME_LOG_LSI_NONE, - .output_format = "normal", }; - OPT_ARGS(opts) = { - OPT_BYTE("lsp", 's', &cfg.lsp, lsp), - OPT_SHRT("controller", 'c', &cfg.controller, controller), - OPT_FMT("output-format", 'o', &cfg.output_format, output_format), - OPT_END() - }; + NVME_ARGS(opts, cfg, + OPT_BYTE("lsp", 's', &cfg.lsp, lsp), + OPT_SHRT("controller", 'c', &cfg.controller, controller)); err = parse_and_open(&dev, argc, argv, desc, opts); if (err) return err; - err = flags = validate_output_format(cfg.output_format); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -1950,8 +1859,8 @@ static int get_phy_rx_eom_log(int argc, char **argv, struct command *cmd, /* Just read measurement, take given action when fetching full log */ lsp_tmp = cfg.lsp & 0xf3; - err = nvme_cli_get_log_phy_rx_eom(dev, lsp_tmp, cfg.controller, - phy_rx_eom_log_len, phy_rx_eom_log); + err = nvme_cli_get_log_phy_rx_eom(dev, lsp_tmp, cfg.controller, phy_rx_eom_log_len, + phy_rx_eom_log); if (err) { if (err > 0) nvme_show_status(err); @@ -1961,20 +1870,19 @@ static int get_phy_rx_eom_log(int argc, char **argv, struct command *cmd, return err; } - if (phy_rx_eom_log->eomip == NVME_PHY_RX_EOM_COMPLETED) { + if (phy_rx_eom_log->eomip == NVME_PHY_RX_EOM_COMPLETED) phy_rx_eom_log_len = le16_to_cpu(phy_rx_eom_log->hsize) + le32_to_cpu(phy_rx_eom_log->dsize) * le16_to_cpu(phy_rx_eom_log->nd); - } else { + else phy_rx_eom_log_len = le16_to_cpu(phy_rx_eom_log->hsize); - } phy_rx_eom_log = nvme_realloc(phy_rx_eom_log, phy_rx_eom_log_len); if (!phy_rx_eom_log) return -ENOMEM; - err = nvme_cli_get_log_phy_rx_eom(dev, cfg.lsp, cfg.controller, - phy_rx_eom_log_len, phy_rx_eom_log); + err = nvme_cli_get_log_phy_rx_eom(dev, cfg.lsp, cfg.controller, phy_rx_eom_log_len, + phy_rx_eom_log); if (!err) nvme_show_phy_rx_eom_log(phy_rx_eom_log, cfg.controller, flags); else if (err > 0) @@ -2013,7 +1921,7 @@ static int get_media_unit_stat_log(int argc, char **argv, struct command *cmd, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -2065,7 +1973,7 @@ static int get_supp_cap_config_log(int argc, char **argv, struct command *cmd, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -2319,7 +2227,7 @@ static int get_log(int argc, char **argv, struct command *cmd, struct plugin *pl OPT_BYTE("log-id", 'i', &cfg.log_id, log_id), OPT_UINT("log-len", 'l', &cfg.log_len, log_len), OPT_UINT("aen", 'a', &cfg.aen, aen), - OPT_SUFFIX("lpo", 'o', &cfg.lpo, lpo), + OPT_SUFFIX("lpo", 'L', &cfg.lpo, lpo), OPT_BYTE("lsp", 's', &cfg.lsp, lsp), OPT_SHRT("lsi", 'S', &cfg.lsi, lsi), OPT_FLAG("rae", 'r', &cfg.rae, rae), @@ -2425,7 +2333,7 @@ static int sanitize_log(int argc, char **argv, struct command *command, struct p if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -2477,7 +2385,7 @@ static int get_fid_support_effects_log(int argc, char **argv, struct command *cm if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -2526,7 +2434,7 @@ static int get_mi_cmd_support_effects_log(int argc, char **argv, struct command if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -2579,7 +2487,7 @@ static int list_ctrl(int argc, char **argv, struct command *cmd, struct plugin * if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -2638,10 +2546,10 @@ static int list_ns(int argc, char **argv, struct command *cmd, struct plugin *pl if (err) return err; - err = flags = validate_output_format(output_format_val); - if (flags != JSON && flags != NORMAL) { + err = validate_output_format(output_format_val, &flags); + if (err < 0 || (flags != JSON && flags != NORMAL)) { nvme_show_error("Invalid output format"); - return err; + return -EINVAL; } if (!cfg.namespace_id) { @@ -2708,7 +2616,7 @@ static int id_ns_lba_format(int argc, char **argv, struct command *cmd, struct p if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -2760,10 +2668,10 @@ static int id_endurance_grp_list(int argc, char **argv, struct command *cmd, if (err) return err; - err = flags = validate_output_format(output_format_val); - if (flags != JSON && flags != NORMAL) { + err = validate_output_format(output_format_val, &flags); + if (err < 0 || (flags != JSON && flags != NORMAL)) { nvme_show_error("invalid output format"); - return err; + return -EINVAL; } endgrp_list = nvme_alloc(sizeof(*endgrp_list)); @@ -3115,7 +3023,7 @@ static int create_ns(int argc, char **argv, struct command *cmd, struct plugin * OPT_STR("ncap-si", 'C', &cfg.ncap_si, ncap_si), OPT_FLAG("azr", 'z', &cfg.azr, azr), OPT_UINT("rar", 'r', &cfg.rar, rar), - OPT_UINT("ror", 'o', &cfg.ror, ror), + OPT_UINT("ror", 'O', &cfg.ror, ror), OPT_UINT("rnumzrwa", 'u', &cfg.rnumzrwa, rnumzrwa), OPT_LIST("phndls", 'p', &cfg.phndls, phndls)); @@ -3275,10 +3183,10 @@ static int list_subsys(int argc, char **argv, struct command *cmd, if (optind < argc) devname = basename(argv[optind++]); - err = flags = validate_output_format(output_format_val); - if (flags != JSON && flags != NORMAL) { + err = validate_output_format(output_format_val, &flags); + if (err < 0 || (flags != JSON && flags != NORMAL)) { nvme_show_error("Invalid output format"); - goto ret; + return -EINVAL; } if (argconfig_parse_seen(opts, "verbose")) @@ -3332,8 +3240,8 @@ static int list(int argc, char **argv, struct command *cmd, struct plugin *plugi if (err < 0) return err; - flags = validate_output_format(output_format_val); - if (flags != JSON && flags != NORMAL) { + err = validate_output_format(output_format_val, &flags); + if (err < 0 || (flags != JSON && flags != NORMAL)) { nvme_show_error("Invalid output format"); return -EINVAL; } @@ -3387,7 +3295,7 @@ int __id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *plugin, }; NVME_ARGS(opts, cfg, - OPT_FLAG("vendor-specific", 'v', &cfg.vendor_specific, vendor_specific), + OPT_FLAG("vendor-specific", 'V', &cfg.vendor_specific, vendor_specific), OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw_identify), OPT_FLAG("human-readable", 'H', &cfg.human_readable, human_readable_identify)); @@ -3395,7 +3303,7 @@ int __id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *plugin, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -3448,7 +3356,7 @@ static int nvm_id_ctrl(int argc, char **argv, struct command *cmd, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -3500,7 +3408,7 @@ static int nvm_id_ns(int argc, char **argv, struct command *cmd, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -3574,7 +3482,7 @@ static int nvm_id_ns_lba_format(int argc, char **argv, struct command *cmd, stru if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -3639,7 +3547,7 @@ static int ns_descs(int argc, char **argv, struct command *cmd, struct plugin *p if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -3704,7 +3612,7 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug NVME_ARGS(opts, cfg, OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_id_desired), OPT_FLAG("force", 0, &cfg.force, force), - OPT_FLAG("vendor-specific", 'v', &cfg.vendor_specific, vendor_specific), + OPT_FLAG("vendor-specific", 'V', &cfg.vendor_specific, vendor_specific), OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw_identify), OPT_FLAG("human-readable", 'H', &cfg.human_readable, human_readable_identify)); @@ -3712,7 +3620,7 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -3787,7 +3695,7 @@ static int cmd_set_independent_id_ns(int argc, char **argv, struct command *cmd, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -3840,7 +3748,7 @@ static int id_ns_granularity(int argc, char **argv, struct command *cmd, struct if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -3889,7 +3797,7 @@ static int id_nvmset(int argc, char **argv, struct command *cmd, struct plugin * if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -3941,7 +3849,7 @@ static int id_uuid(int argc, char **argv, struct command *cmd, struct plugin *pl if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -4038,7 +3946,7 @@ static int id_domain(int argc, char **argv, struct command *cmd, struct plugin * if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -4184,7 +4092,7 @@ static int primary_ctrl_caps(int argc, char **argv, struct command *cmd, struct if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -4239,7 +4147,7 @@ static int list_secondary_ctrl(int argc, char **argv, struct command *cmd, struc if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -4494,7 +4402,7 @@ static int self_test_log(int argc, char **argv, struct command *cmd, struct plug if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -4572,13 +4480,9 @@ static void get_feature_id_print(struct feat_cfg cfg, int err, __u32 result, if (!err) { if (!cfg.raw_binary || !buf) { - printf("get-feature:%#0*x (%s), %s value:%#0*x\n", - cfg.feature_id ? 4 : 2, cfg.feature_id, - nvme_feature_to_string(cfg.feature_id), - nvme_select_to_string(cfg.sel), result ? 10 : 8, - result); + nvme_feature_show(cfg.feature_id, cfg.sel, result); if (cfg.sel == 3) - nvme_show_select_result(result); + nvme_show_select_result(cfg.feature_id, result); else if (cfg.human_readable) nvme_feature_show_fields(cfg.feature_id, result, buf); @@ -4592,7 +4496,7 @@ static void get_feature_id_print(struct feat_cfg cfg, int err, __u32 result, !nvme_status_equals(status, type, NVME_SC_INVALID_NS)) nvme_show_status(err); } else { - fprintf(stderr, "get-feature: %s\n", nvme_strerror(errno)); + nvme_show_error("get-feature: %s", nvme_strerror(errno)); } } @@ -4655,14 +4559,11 @@ static int get_feature_ids(struct nvme_dev *dev, struct feat_cfg cfg) continue; if (!nvme_status_equals(status, type, NVME_SC_INVALID_NS)) break; - fprintf(stderr, "get-feature:%#0*x (%s): ", - cfg.feature_id ? 4 : 2, cfg.feature_id, - nvme_feature_to_string(cfg.feature_id)); - nvme_show_status(err); + nvme_show_error_status(err, "get-feature:%#0*x (%s)", cfg.feature_id ? 4 : 2, + cfg.feature_id, nvme_feature_to_string(cfg.feature_id)); } - if (feat_num == 1 && - nvme_status_equals(status, type, NVME_SC_INVALID_FIELD)) + if (feat_num == 1 && nvme_status_equals(status, type, NVME_SC_INVALID_FIELD)) nvme_show_status(err); return err; @@ -4735,8 +4636,12 @@ static int get_feature(int argc, char **argv, struct command *cmd, return -1; } + nvme_show_init(); + err = get_feature_ids(dev, cfg); + nvme_show_finish(); + return err; } @@ -4854,12 +4759,12 @@ static int fw_download(int argc, char **argv, struct command *cmd, struct plugin const char *ignore_ovr = "ignore overwrite errors"; _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; + _cleanup_huge_ struct nvme_mem_huge mh = { 0, }; _cleanup_file_ int fw_fd = -1; unsigned int fw_size, pos; int err; struct stat sb; void *fw_buf; - bool huge; struct nvme_id_ctrl ctrl; struct config { @@ -4881,7 +4786,7 @@ static int fw_download(int argc, char **argv, struct command *cmd, struct plugin NVME_ARGS(opts, cfg, OPT_FILE("fw", 'f', &cfg.fw, fw), OPT_UINT("xfer", 'x', &cfg.xfer, xfer), - OPT_UINT("offset", 'o', &cfg.offset, offset), + OPT_UINT("offset", 'O', &cfg.offset, offset), OPT_FLAG("progress", 'p', &cfg.progress, progress), OPT_FLAG("ignore-ovr", 'i', &cfg.ignore_ovr, ignore_ovr)); @@ -4921,14 +4826,14 @@ static int fw_download(int argc, char **argv, struct command *cmd, struct plugin } else if (cfg.xfer % 4096) cfg.xfer = 4096; - fw_buf = nvme_alloc_huge(fw_size, &huge); + fw_buf = nvme_alloc_huge(fw_size, &mh); if (!fw_buf) return -ENOMEM; if (read(fw_fd, fw_buf, fw_size) != ((ssize_t)(fw_size))) { err = -errno; nvme_show_error("read :%s :%s", cfg.fw, strerror(errno)); - goto free; + return err; } for (pos = 0; pos < fw_size; pos += cfg.xfer) { @@ -4948,9 +4853,6 @@ static int fw_download(int argc, char **argv, struct command *cmd, struct plugin printf("Firmware download success\n"); } -free: - nvme_free_huge(fw_buf, huge); - return err; } @@ -5385,7 +5287,7 @@ static int show_registers(int argc, char **argv, struct command *cmd, struct plu return err; r = nvme_scan(NULL); - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); goto free_tree; @@ -5435,7 +5337,7 @@ static int get_property(int argc, char **argv, struct command *cmd, struct plugi }; NVME_ARGS(opts, cfg, - OPT_UINT("offset", 'o', &cfg.offset, offset), + OPT_UINT("offset", 'O', &cfg.offset, offset), OPT_FLAG("human-readable", 'H', &cfg.human_readable, human_readable)); err = parse_and_open(&dev, argc, argv, desc, opts); @@ -5486,8 +5388,8 @@ static int set_property(int argc, char **argv, struct command *cmd, struct plugi }; NVME_ARGS(opts, cfg, - OPT_UINT("offset", 'o', &cfg.offset, offset), - OPT_UINT("value", 'v', &cfg.value, value)); + OPT_UINT("offset", 'O', &cfg.offset, offset), + OPT_UINT("value", 'V', &cfg.value, value)); err = parse_and_open(&dev, argc, argv, desc, opts); if (err) @@ -5796,7 +5698,7 @@ static int set_feature(int argc, char **argv, struct command *cmd, struct plugin _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; _cleanup_free_ void *buf = NULL; - _cleanup_file_ int ffd = -1; + _cleanup_file_ int ffd = STDIN_FILENO; int err; __u32 result; @@ -5824,7 +5726,7 @@ static int set_feature(int argc, char **argv, struct command *cmd, struct plugin NVME_ARGS(opts, cfg, OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_desired), OPT_BYTE("feature-id", 'f', &cfg.feature_id, feature_id), - OPT_SUFFIX("value", 'v', &cfg.value, value), + OPT_SUFFIX("value", 'V', &cfg.value, value), OPT_UINT("cdw12", 'c', &cfg.cdw12, cdw12), OPT_BYTE("uuid-index", 'U', &cfg.uuid_index, uuid_index_specify), OPT_UINT("data-len", 'l', &cfg.data_len, buf_len), @@ -5877,16 +5779,16 @@ static int set_feature(int argc, char **argv, struct command *cmd, struct plugin if (cfg.feature_id == NVME_FEAT_FID_TIMESTAMP && cfg.value) { memcpy(buf, &cfg.value, NVME_FEAT_TIMESTAMP_DATA_SIZE); } else { - if (strlen(cfg.file)) { + if (strlen(cfg.file)) ffd = open(cfg.file, O_RDONLY); - if (ffd <= 0) { - nvme_show_error("Failed to open file %s: %s", - cfg.file, strerror(errno)); - return -EINVAL; - } + + if (ffd < 0) { + nvme_show_error("Failed to open file %s: %s", + cfg.file, strerror(errno)); + return -EINVAL; } - err = read(ffd, (void *)buf, cfg.data_len); + err = read(ffd, buf, cfg.data_len); if (err < 0) { nvme_show_error("failed to read data buffer from input file: %s", strerror(errno)); @@ -6055,7 +5957,7 @@ static int dir_send(int argc, char **argv, struct command *cmd, struct plugin *p _cleanup_free_ void *buf = NULL; __u32 result; __u32 dw12 = 0; - int ffd = STDIN_FILENO; + _cleanup_file_ int ffd = STDIN_FILENO; int err; struct config { @@ -6554,6 +6456,8 @@ static int copy_cmd(int argc, char **argv, struct command *cmd, struct plugin *p const char *d_sdlba = "64-bit addr of first destination logical block"; const char *d_slbas = "64-bit addr of first block per range (comma-separated list)"; const char *d_nlbs = "number of blocks per range (comma-separated list, zeroes-based values)"; + const char *d_snsids = "source namespace identifier per range (comma-separated list)"; + const char *d_sopts = "source options per range (comma-separated list)"; const char *d_lr = "limited retry"; const char *d_fua = "force unit access"; const char *d_prinfor = "protection information and check field (read part)"; @@ -6569,22 +6473,26 @@ static int copy_cmd(int argc, char **argv, struct command *cmd, struct plugin *p const char *d_format = "source range entry format"; _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; - uint16_t nr, nb, ns, nrts, natms, nats; - __u16 nlbs[128] = { 0 }; - __u64 slbas[128] = { 0 }; + __u16 nr, nb, ns, nrts, natms, nats, nids; + __u16 nlbs[256] = { 0 }; + __u64 slbas[256] = { 0 }; + __u32 snsids[256] = { 0 }; + __u16 sopts[256] = { 0 }; int err; union { - __u32 f0[128]; - __u64 f1[101]; + __u32 short_pi[256]; + __u64 long_pi[256]; } eilbrts; - __u32 elbatms[128] = { 0 }; - __u32 elbats[128] = { 0 }; + __u32 elbatms[256] = { 0 }; + __u32 elbats[256] = { 0 }; union { - struct nvme_copy_range f0[128]; - struct nvme_copy_range_f1 f1[101]; + struct nvme_copy_range f0[256]; + struct nvme_copy_range_f1 f1[256]; + struct nvme_copy_range_f2 f2[256]; + struct nvme_copy_range_f3 f3[256]; } *copy; struct config { @@ -6592,6 +6500,8 @@ static int copy_cmd(int argc, char **argv, struct command *cmd, struct plugin *p __u64 sdlba; char *slbas; char *nlbs; + char *snsids; + char *sopts; bool lr; bool fua; __u8 prinfow; @@ -6612,6 +6522,8 @@ static int copy_cmd(int argc, char **argv, struct command *cmd, struct plugin *p .sdlba = 0, .slbas = "", .nlbs = "", + .snsids = "", + .sopts = "", .lr = false, .fua = false, .prinfow = 0, @@ -6632,6 +6544,8 @@ static int copy_cmd(int argc, char **argv, struct command *cmd, struct plugin *p OPT_SUFFIX("sdlba", 'd', &cfg.sdlba, d_sdlba), OPT_LIST("slbs", 's', &cfg.slbas, d_slbas), OPT_LIST("blocks", 'b', &cfg.nlbs, d_nlbs), + OPT_LIST("snsids", 'N', &cfg.snsids, d_snsids), + OPT_LIST("sopts", 'O', &cfg.sopts, d_sopts), OPT_FLAG("limited-retry", 'l', &cfg.lr, d_lr), OPT_FLAG("force-unit-access", 'f', &cfg.fua, d_fua), OPT_BYTE("prinfow", 'p', &cfg.prinfow, d_prinfow), @@ -6652,13 +6566,15 @@ static int copy_cmd(int argc, char **argv, struct command *cmd, struct plugin *p nb = argconfig_parse_comma_sep_array_u16(cfg.nlbs, nlbs, ARRAY_SIZE(nlbs)); ns = argconfig_parse_comma_sep_array_u64(cfg.slbas, slbas, ARRAY_SIZE(slbas)); + nids = argconfig_parse_comma_sep_array_u32(cfg.snsids, snsids, ARRAY_SIZE(snsids)); + argconfig_parse_comma_sep_array_u16(cfg.sopts, sopts, ARRAY_SIZE(sopts)); - if (cfg.format == 0) { - nrts = argconfig_parse_comma_sep_array_u32(cfg.eilbrts, eilbrts.f0, - ARRAY_SIZE(eilbrts.f0)); - } else if (cfg.format == 1) { - nrts = argconfig_parse_comma_sep_array_u64(cfg.eilbrts, eilbrts.f1, - ARRAY_SIZE(eilbrts.f1)); + if (cfg.format == 0 || cfg.format == 2) { + nrts = argconfig_parse_comma_sep_array_u32(cfg.eilbrts, eilbrts.short_pi, + ARRAY_SIZE(eilbrts.short_pi)); + } else if (cfg.format == 1 || cfg.format == 3) { + nrts = argconfig_parse_comma_sep_array_u64(cfg.eilbrts, eilbrts.long_pi, + ARRAY_SIZE(eilbrts.long_pi)); } else { nvme_show_error("invalid format"); return -EINVAL; @@ -6668,7 +6584,16 @@ static int copy_cmd(int argc, char **argv, struct command *cmd, struct plugin *p nats = argconfig_parse_comma_sep_array_u32(cfg.elbats, elbats, ARRAY_SIZE(elbats)); nr = max(nb, max(ns, max(nrts, max(natms, nats)))); - if (!nr || nr > 128 || (cfg.format == 1 && nr > 101)) { + if (cfg.format == 2 || cfg.format == 3) { + if (nr != nids) { + nvme_show_error("formats 2 and 3 require source namespace ids for each source range"); + return -EINVAL; + } + } else if (nids) { + nvme_show_error("formats 0 and 1 do not support cross-namespace copy"); + return -EINVAL; + } + if (!nr || nr > 256) { nvme_show_error("invalid range"); return -EINVAL; } @@ -6686,9 +6611,15 @@ static int copy_cmd(int argc, char **argv, struct command *cmd, struct plugin *p return -ENOMEM; if (cfg.format == 0) - nvme_init_copy_range(copy->f0, nlbs, slbas, eilbrts.f0, elbatms, elbats, nr); + nvme_init_copy_range(copy->f0, nlbs, slbas, eilbrts.short_pi, elbatms, elbats, nr); else if (cfg.format == 1) - nvme_init_copy_range_f1(copy->f1, nlbs, slbas, eilbrts.f1, elbatms, elbats, nr); + nvme_init_copy_range_f1(copy->f1, nlbs, slbas, eilbrts.long_pi, elbatms, elbats, nr); + else if (cfg.format == 2) + nvme_init_copy_range_f2(copy->f2, snsids, nlbs, slbas, sopts, eilbrts.short_pi, elbatms, + elbats, nr); + else if (cfg.format == 3) + nvme_init_copy_range_f3(copy->f3, snsids, nlbs, slbas, sopts, eilbrts.long_pi, elbatms, + elbats, nr); struct nvme_copy_args args = { .args_size = sizeof(args), @@ -7039,7 +6970,7 @@ static int resv_report(int argc, char **argv, struct command *cmd, struct plugin if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -7099,16 +7030,17 @@ unsigned long long elapsed_utime(struct timeval start_time, static int submit_io(int opcode, char *command, const char *desc, int argc, char **argv) { struct timeval start_time, end_time; - void *buffer, *mbuffer = NULL; + void *buffer; + _cleanup_free_ void *mbuffer = NULL; int err = 0; - int dfd, mfd; - int flags = opcode & 1 ? O_RDONLY : O_WRONLY | O_CREAT; + _cleanup_file_ int dfd = -1, mfd = -1; + int flags; int mode = 0644; __u16 control = 0, nblocks = 0; __u32 dsmgmt = 0; - int logical_block_size = 0; + unsigned int logical_block_size = 0; unsigned long long buffer_size = 0, mbuffer_size = 0; - bool huge; + _cleanup_huge_ struct nvme_mem_huge mh = { 0, }; _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; _cleanup_free_ struct nvme_nvm_id_ns *nvm_ns = NULL; _cleanup_free_ struct nvme_id_ns *ns = NULL; @@ -7197,7 +7129,7 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char OPT_BYTE("dir-type", 'T', &cfg.dtype, dtype_for_write), OPT_SHRT("dir-spec", 'S', &cfg.dspec, dspec), OPT_BYTE("dsm", 'D', &cfg.dsmgmt, dsm), - OPT_FLAG("show-command", 'v', &cfg.show, show), + OPT_FLAG("show-command", 'V', &cfg.show, show), OPT_FLAG("dry-run", 'w', &cfg.dry_run, dry), OPT_FLAG("latency", 't', &cfg.latency, latency), OPT_FLAG("force", 0, &cfg.force, force)); @@ -7233,7 +7165,6 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char } } - dfd = mfd = opcode & 1 ? STDIN_FILENO : STDOUT_FILENO; if (cfg.prinfo > 0xf) return err; @@ -7254,6 +7185,14 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char dsmgmt |= ((__u32)cfg.dspec) << 16; } + if (opcode & 1) { + dfd = mfd = STDIN_FILENO; + flags = O_RDONLY; + } else { + dfd = mfd = STDOUT_FILENO; + flags = O_WRONLY | O_CREAT; + } + if (strlen(cfg.data)) { dfd = open(cfg.data, flags, mode); if (dfd < 0) { @@ -7266,39 +7205,40 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char mfd = open(cfg.metadata, flags, mode); if (mfd < 0) { nvme_show_perror(cfg.metadata); - err = -EINVAL; - goto close_dfd; + return -EINVAL; } } if (!cfg.data_size) { nvme_show_error("data size not provided"); - err = -EINVAL; - goto close_mfd; + return -EINVAL; } - if (nvme_get_logical_block_size(dev_fd(dev), cfg.namespace_id, &logical_block_size) < 0) - goto close_mfd; - ns = nvme_alloc(sizeof(*ns)); - if (!ns) { - err = -ENOMEM; - goto close_mfd; - } + if (!ns) + return -ENOMEM; err = nvme_cli_identify_ns(dev, cfg.namespace_id, ns); if (err > 0) { nvme_show_status(err); - goto close_mfd; + return err; } else if (err < 0) { nvme_show_error("identify namespace: %s", nvme_strerror(errno)); - goto close_mfd; + return err; } nvme_id_ns_flbas_to_lbaf_inuse(ns->flbas, &lba_index); + logical_block_size = 1 << ns->lbaf[lba_index].ds; ms = ns->lbaf[lba_index].ms; - if (ns->flbas & NVME_NS_FLBAS_META_EXT) - logical_block_size += ms; + if (NVME_FLBAS_META_EXT(ns->flbas)) { + /* + * No meta data is transferred for PRACT=1 and MD=8: + * 5.2.2.1 Protection Information and Write Commands + * 5.2.2.2 Protection Information and Read Commands + */ + if (!(cfg.prinfo == 0x1 && ms == 8)) + logical_block_size += ms; + } buffer_size = ((long long)cfg.block_count + 1) * logical_block_size; if (cfg.data_size < buffer_size) @@ -7306,23 +7246,24 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char else buffer_size = cfg.data_size; - /* Get the required block count. Note this is a zeroes based value. */ - nblocks = ((buffer_size + (logical_block_size - 1)) / logical_block_size) - 1; + if (argconfig_parse_seen(opts, "block-count")) { + /* Use the value provided */ + nblocks = cfg.block_count; + } else { + /* Get the required block count. Note this is a zeroes based value. */ + nblocks = ((buffer_size + (logical_block_size - 1)) / logical_block_size) - 1; - /* Update the data size based on the required block count */ - buffer_size = (nblocks + 1) * logical_block_size; - - buffer = nvme_alloc_huge(buffer_size, &huge); - if (!buffer) { - err = -ENOMEM; - goto close_mfd; + /* Update the data size based on the required block count */ + buffer_size = ((unsigned long long)nblocks + 1) * logical_block_size; } + buffer = nvme_alloc_huge(buffer_size, &mh); + if (!buffer) + return -ENOMEM; + nvm_ns = nvme_alloc(sizeof(*nvm_ns)); - if (!nvm_ns) { - err = -ENOMEM; - goto close_mfd; - } + if (!nvm_ns) + return -ENOMEM; if (cfg.metadata_size) { err = nvme_identify_ns_csi(dev_fd(dev), 1, 0, NVME_CSI_NVM, nvm_ns); @@ -7339,24 +7280,20 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char mbuffer_size = cfg.metadata_size; mbuffer = malloc(mbuffer_size); - if (!mbuffer) { - err = -ENOMEM; - goto free_buffer; - } + if (!mbuffer) + return -ENOMEM; memset(mbuffer, 0, mbuffer_size); } - if (invalid_tags(cfg.storage_tag, cfg.ref_tag, sts, pif)) { - err = -EINVAL; - goto free_buffer; - } + if (invalid_tags(cfg.storage_tag, cfg.ref_tag, sts, pif)) + return -EINVAL; if (opcode & 1) { err = read(dfd, (void *)buffer, cfg.data_size); if (err < 0) { err = -errno; nvme_show_error("failed to read data buffer from input file %s", strerror(errno)); - goto free_mbuffer; + return err; } } @@ -7365,7 +7302,7 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char if (err < 0) { err = -errno; nvme_show_error("failed to read meta-data buffer from input file %s", strerror(errno)); - goto free_mbuffer; + return err; } } @@ -7388,7 +7325,7 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char printf("sts : %02x\n", sts); } if (cfg.dry_run) - goto free_mbuffer; + return 0; struct nvme_io_args args = { .args_size = sizeof(args), @@ -7437,16 +7374,6 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char } } -free_mbuffer: - free(mbuffer); -free_buffer: - nvme_free_huge(buffer, huge); -close_mfd: - if (strlen(cfg.metadata)) - close(mfd); -close_dfd: - close(dfd); - return err; } @@ -7742,7 +7669,7 @@ static int get_lba_status(int argc, char **argv, struct command *cmd, if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -7813,7 +7740,7 @@ static int capacity_mgmt(int argc, char **argv, struct command *cmd, struct plug }; NVME_ARGS(opts, cfg, - OPT_BYTE("operation", 'o', &cfg.operation, operation), + OPT_BYTE("operation", 'O', &cfg.operation, operation), OPT_SHRT("element-id", 'i', &cfg.element_id, element_id), OPT_UINT("cap-lower", 'l', &cfg.dw11, cap_lower), OPT_UINT("cap-upper", 'u', &cfg.dw12, cap_upper)); @@ -8020,7 +7947,7 @@ static int lockdown_cmd(int argc, char **argv, struct command *cmd, struct plugi }; NVME_ARGS(opts, cfg, - OPT_BYTE("ofi", 'o', &cfg.ofi, ofi_desc), + OPT_BYTE("ofi", 'O', &cfg.ofi, ofi_desc), OPT_BYTE("ifc", 'f', &cfg.ifc, ifc_desc), OPT_BYTE("prhbt", 'p', &cfg.prhbt, prhbt_desc), OPT_BYTE("scp", 's', &cfg.scp, scp_desc), @@ -8118,13 +8045,15 @@ static int passthru(int argc, char **argv, bool admin, const char *wr = "set dataflow direction to send"; const char *prefill = "prefill buffers with known byte-value, default 0"; + _cleanup_huge_ struct nvme_mem_huge mh = { 0, }; _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; + _cleanup_file_ int dfd = -1, mfd = -1; int flags; int mode = 0644; - void *data = NULL, *mdata = NULL; - int err = 0, dfd, mfd; + void *data = NULL; + _cleanup_free_ void *mdata = NULL; + int err = 0; __u32 result; - bool huge = false; const char *cmd_name = NULL; struct timeval start_time, end_time; @@ -8156,7 +8085,7 @@ static int passthru(int argc, char **argv, bool admin, }; NVME_ARGS(opts, cfg, - OPT_BYTE("opcode", 'o', &cfg.opcode, opcode), + OPT_BYTE("opcode", 'O', &cfg.opcode, opcode), OPT_BYTE("flags", 'f', &cfg.flags, cflags), OPT_BYTE("prefill", 'p', &cfg.prefill, prefill), OPT_SHRT("rsvd", 'R', &cfg.rsvd, rsvd), @@ -8185,18 +8114,14 @@ static int passthru(int argc, char **argv, bool admin, if (err) return err; - if (cfg.opcode & 0x01) + if (cfg.opcode & 0x01) { cfg.write = true; - - if (cfg.opcode & 0x02) - cfg.read = true; - - if (cfg.write) { flags = O_RDONLY; dfd = mfd = STDIN_FILENO; } - if (cfg.read) { + if (cfg.opcode & 0x02) { + cfg.read = true; flags = O_WRONLY | O_CREAT; dfd = mfd = STDOUT_FILENO; } @@ -8213,23 +8138,20 @@ static int passthru(int argc, char **argv, bool admin, mfd = open(cfg.metadata, flags, mode); if (mfd < 0) { nvme_show_perror(cfg.metadata); - err = -EINVAL; - goto close_dfd; + return -EINVAL; } } if (cfg.metadata_len) { mdata = malloc(cfg.metadata_len); - if (!mdata) { - err = -ENOMEM; - goto close_mfd; - } + if (!mdata) + return -ENOMEM; if (cfg.write) { if (read(mfd, mdata, cfg.metadata_len) < 0) { err = -errno; nvme_show_perror("failed to read metadata write buffer"); - goto free_metadata; + return err; } } else { memset(mdata, cfg.prefill, cfg.metadata_len); @@ -8237,22 +8159,19 @@ static int passthru(int argc, char **argv, bool admin, } if (cfg.data_len) { - data = nvme_alloc_huge(cfg.data_len, &huge); - if (!data) { - err = -ENOMEM; - goto free_metadata; - } + data = nvme_alloc_huge(cfg.data_len, &mh); + if (!data) + return -ENOMEM; memset(data, cfg.prefill, cfg.data_len); if (!cfg.read && !cfg.write) { nvme_show_error("data direction not given"); - err = -EINVAL; - goto free_data; + return -EINVAL; } else if (cfg.write) { if (read(dfd, data, cfg.data_len) < 0) { err = -errno; nvme_show_error("failed to read write buffer %s", strerror(errno)); - goto free_data; + return err; } } } @@ -8277,7 +8196,7 @@ static int passthru(int argc, char **argv, bool admin, printf("timeout_ms : %08x\n", cfg.timeout); } if (cfg.dry_run) - goto free_data; + return 0; gettimeofday(&start_time, NULL); @@ -8319,16 +8238,6 @@ static int passthru(int argc, char **argv, bool admin, if (cfg.read) passthru_print_read_output(cfg, data, dfd, mdata, mfd, err); } -free_metadata: - free(mdata); -free_data: - nvme_free_huge(data, huge); -close_dfd: - if (strlen(cfg.input_file)) - close(dfd); -close_mfd: - if (cfg.metadata && strlen(cfg.metadata)) - close(mfd); return err; } @@ -8608,6 +8517,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl const char *secret = "Optional secret (in hexadecimal characters) to be used for the TLS key."; const char *hmac = "HMAC function to use for the retained key (1 = SHA-256, 2 = SHA-384)."; + const char *identity = "TLS identity version to use (0 = NVMe TCP 1.0c, 1 = NVMe TCP 2.0"; const char *hostnqn = "Host NQN for the retained key."; const char *subsysnqn = "Subsystem NQN for the retained key."; const char *keyring = "Keyring for the retained key."; @@ -8628,6 +8538,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl char *subsysnqn; char *secret; unsigned int hmac; + unsigned int identity; bool insert; }; @@ -8638,6 +8549,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl .subsysnqn = NULL, .secret = NULL, .hmac = 1, + .identity = 0, .insert = false, }; @@ -8648,19 +8560,34 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl OPT_STR("subsysnqn", 'c', &cfg.subsysnqn, subsysnqn), OPT_STR("secret", 's', &cfg.secret, secret), OPT_UINT("hmac", 'm', &cfg.hmac, hmac), + OPT_UINT("identity", 'I', &cfg.identity, identity), OPT_FLAG("insert", 'i', &cfg.insert, insert)); err = argconfig_parse(argc, argv, desc, opts); if (err) return err; - if (cfg.hmac < 1 || cfg.hmac > 3) { + if (cfg.hmac < 1 || cfg.hmac > 2) { nvme_show_error("Invalid HMAC identifier %u", cfg.hmac); return -EINVAL; } - if (cfg.insert && !cfg.subsysnqn) { - nvme_show_error("No subsystem NQN specified"); + if (cfg.identity > 1) { + nvme_show_error("Invalid TLS identity version %u", + cfg.identity); return -EINVAL; } + if (cfg.insert) { + if (!cfg.subsysnqn) { + nvme_show_error("No subsystem NQN specified"); + return -EINVAL; + } + if (!cfg.hostnqn) { + cfg.hostnqn = nvmf_hostnqn_from_file(); + if (!cfg.hostnqn) { + nvme_show_error("Failed to read host NQN"); + return -EINVAL; + } + } + } if (cfg.hmac == 2) key_len = 48; @@ -8679,7 +8606,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl nvme_show_error("Invalid secret '%s'", cfg.secret); return -EINVAL; } - if (i >= key_len) { + if (i >= key_len * 2) { fprintf(stderr, "Skipping excess secret bytes\n"); break; } @@ -8691,30 +8618,18 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl } } - if (cfg.hostnqn && !cfg.subsysnqn) { - nvme_show_error("Need to specify subsystem NQN to insert a TLS key"); - return -EINVAL; - } - if (cfg.subsysnqn) { - if (!cfg.hostnqn) { - cfg.hostnqn = nvmf_hostnqn_from_file(); - if (!cfg.hostnqn) { - nvme_show_error("Failed to read host NQN"); - return -EINVAL; - } - } - - tls_key = nvme_insert_tls_key(cfg.keyring, cfg.keytype, cfg.hostnqn, cfg.subsysnqn, - cfg.hmac, raw_secret, key_len); + if (cfg.insert) { + tls_key = nvme_insert_tls_key_versioned(cfg.keyring, + cfg.keytype, cfg.hostnqn, + cfg.subsysnqn, cfg.identity, + cfg.hmac, raw_secret, key_len); if (tls_key < 0) { nvme_show_error("Failed to insert key, error %d", errno); return -errno; } - if (cfg.insert) { - printf("Inserted TLS key %08x\n", (unsigned int)tls_key); - return 0; - } + 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; @@ -8733,10 +8648,12 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct { const char *desc = "Check a TLS key for NVMe PSK Interchange format.\n"; const char *keydata = "TLS key (in PSK Interchange format) to be validated."; + const char *identity = "TLS identity version to use (0 = NVMe TCP 1.0c, 1 = NVMe TCP 2.0)"; const char *hostnqn = "Host NQN for the retained key."; 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 retained key into the keyring."; unsigned char decoded_key[128]; unsigned int decoded_len; @@ -8745,11 +8662,13 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct int err = 0, hmac; long tls_key; struct config { - char *keyring; - char *keytype; - char *hostnqn; - char *subsysnqn; - char *keydata; + char *keyring; + char *keytype; + char *hostnqn; + char *subsysnqn; + char *keydata; + unsigned int identity; + bool insert; }; struct config cfg = { @@ -8758,6 +8677,8 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct .hostnqn = NULL, .subsysnqn = NULL, .keydata = NULL, + .identity = 0, + .insert = false, }; NVME_ARGS(opts, cfg, @@ -8765,7 +8686,9 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct OPT_STR("keytype", 't', &cfg.keytype, keytype), OPT_STR("hostnqn", 'n', &cfg.hostnqn, hostnqn), OPT_STR("subsysnqn", 'c', &cfg.subsysnqn, subsysnqn), - OPT_STR("keydata", 'd', &cfg.keydata, keydata)); + OPT_STR("keydata", 'd', &cfg.keydata, keydata), + OPT_UINT("identity", 'I', &cfg.identity, identity), + OPT_FLAG("insert", 'i', &cfg.insert, insert)); err = argconfig_parse(argc, argv, desc, opts); if (err) @@ -8775,6 +8698,11 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct nvme_show_error("No key data"); return -EINVAL; } + if (cfg.identity > 1) { + nvme_show_error("Invalid TLS identity version %u", + cfg.identity); + return -EINVAL; + } if (sscanf(cfg.keydata, "NVMeTLSkey-1:%02x:*s", &hmac) != 1) { nvme_show_error("Invalid key '%s'", cfg.keydata); @@ -8798,6 +8726,18 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct return -EINVAL; } + if (cfg.subsysnqn) { + if (cfg.insert && !cfg.hostnqn) { + cfg.hostnqn = nvmf_hostnqn_from_file(); + if (!cfg.hostnqn) { + nvme_show_error("Failed to read host NQN"); + return -EINVAL; + } + } + } else if (cfg.insert || cfg.identity == 1) { + 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); @@ -8818,23 +8758,28 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct nvme_show_error("CRC mismatch (key %08x, crc %08x)", key_crc, crc); return -EINVAL; } - if (cfg.subsysnqn) { - if (!cfg.hostnqn) { - cfg.hostnqn = nvmf_hostnqn_from_file(); - if (!cfg.hostnqn) { - nvme_show_error("Failed to read host NQN"); - return -EINVAL; - } - } - - tls_key = nvme_insert_tls_key(cfg.keyring, cfg.keytype, cfg.hostnqn, cfg.subsysnqn, - hmac, decoded_key, decoded_len); + if (cfg.insert) { + tls_key = nvme_insert_tls_key_versioned(cfg.keyring, + cfg.keytype, cfg.hostnqn, + cfg.subsysnqn, cfg.identity, + hmac, decoded_key, decoded_len); if (tls_key < 0) { nvme_show_error("Failed to insert key, error %d", errno); return -errno; } } else { - printf("Key is valid (HMAC %d, length %d, CRC %08x)\n", hmac, decoded_len, crc); + char *tls_id; + + tls_id = nvme_generate_tls_key_identity(cfg.hostnqn, + cfg.subsysnqn, cfg.identity, + hmac, decoded_key, decoded_len); + if (!tls_id) { + nvme_show_error("Failed to generated identity, error %d", + errno); + return -errno; + } + printf("%s\n", tls_id); + free(tls_id); } return 0; } @@ -8863,7 +8808,7 @@ static int show_topology_cmd(int argc, char **argv, struct command *command, str if (err) return err; - err = flags = validate_output_format(output_format_val); + err = validate_output_format(output_format_val, &flags); if (err < 0) { nvme_show_error("Invalid output format"); return err; @@ -8963,12 +8908,12 @@ static int nvme_mi(int argc, char **argv, __u8 admin_opcode, const char *desc) int mode = 0644; void *data = NULL; int err = 0; - bool send = admin_opcode == nvme_admin_nvme_mi_send ? true : false; - int fd = send ? STDIN_FILENO : STDOUT_FILENO; - int flags = send ? O_RDONLY : O_WRONLY | O_CREAT; + bool send; + _cleanup_file_ int fd = -1; + int flags; + _cleanup_huge_ struct nvme_mem_huge mh = { 0, }; _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; __u32 result; - bool huge = false; struct config { __u8 opcode; @@ -8991,7 +8936,7 @@ static int nvme_mi(int argc, char **argv, __u8 admin_opcode, const char *desc) }; NVME_ARGS(opts, cfg, - OPT_BYTE("opcode", 'o', &cfg.opcode, opcode), + OPT_BYTE("opcode", 'O', &cfg.opcode, opcode), OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_desired), OPT_UINT("data-len", 'l', &cfg.data_len, data_len), OPT_UINT("nmimt", 'm', &cfg.nmimt, nmimt), @@ -9003,6 +8948,16 @@ static int nvme_mi(int argc, char **argv, __u8 admin_opcode, const char *desc) if (err) return err; + if (admin_opcode == nvme_admin_nvme_mi_send) { + flags = O_RDONLY; + fd = STDIN_FILENO; + send = true; + } else { + flags = O_WRONLY | O_CREAT; + fd = STDOUT_FILENO; + send = false; + } + if (strlen(cfg.input_file)) { fd = open(cfg.input_file, flags, mode); if (fd < 0) { @@ -9012,16 +8967,15 @@ static int nvme_mi(int argc, char **argv, __u8 admin_opcode, const char *desc) } if (cfg.data_len) { - data = nvme_alloc_huge(cfg.data_len, &huge); - if (!data) { - err = -ENOMEM; - goto close_fd; - } + data = nvme_alloc_huge(cfg.data_len, &mh); + if (!data) + return -ENOMEM; + if (send) { if (read(fd, data, cfg.data_len) < 0) { err = -errno; nvme_show_error("failed to read write buffer %s", strerror(errno)); - goto free_data; + return err; } } } @@ -9047,12 +9001,6 @@ static int nvme_mi(int argc, char **argv, __u8 admin_opcode, const char *desc) } } -free_data: - nvme_free_huge(data, huge); -close_fd: - if (strlen(cfg.input_file)) - close(fd); - return err; } diff --git a/nvme.h b/nvme.h index 10a08f8..3915698 100644 --- a/nvme.h +++ b/nvme.h @@ -28,6 +28,7 @@ #include "plugin.h" #include "util/json.h" +#include "util/mem.h" #include "util/argconfig.h" #include "util/cleanup.h" @@ -101,23 +102,18 @@ int parse_and_open(struct nvme_dev **dev, int argc, char **argv, const char *des void dev_close(struct nvme_dev *dev); -static inline void cleanup_nvme_dev(struct nvme_dev **dev) -{ - if (*dev) - dev_close(*dev); -} +static inline DEFINE_CLEANUP_FUNC( + cleanup_nvme_dev, struct nvme_dev *, dev_close) #define _cleanup_nvme_dev_ __cleanup__(cleanup_nvme_dev) extern const char *output_format; -enum nvme_print_flags validate_output_format(const char *format); +int validate_output_format(const char *format, enum nvme_print_flags *flags); 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; -void *nvme_alloc_huge(size_t len, bool *huge); -void nvme_free_huge(void *p, bool huge); const char *nvme_strerror(int errnum); diff --git a/nvme.spec.in b/nvme.spec.in index fe4675a..3eab9ff 100644 --- a/nvme.spec.in +++ b/nvme.spec.in @@ -31,7 +31,7 @@ touch %{buildroot}@SYSCONFDIR@/nvme/hostid @SYSCONFDIR@/nvme/discovery.conf %ghost @SYSCONFDIR@/nvme/config.json @UDEVRULESDIR@/70-nvmf-autoconnect.rules -@UDEVRULESDIR@/71-nvmf-iopolicy-netapp.rules +@UDEVRULESDIR@/71-nvmf-netapp.rules @DRACUTRILESDIR@/70-nvmf-autoconnect.conf @SYSTEMDDIR@/nvmf-connect@.service @SYSTEMDDIR@/nvmefc-boot-connections.service diff --git a/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in b/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in index 621879a..92960cd 100644 --- a/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in +++ b/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in @@ -2,12 +2,13 @@ Description=Connect NVMe-oF subsystems automatically during boot ConditionPathExists=|@SYSCONFDIR@/nvme/config.json ConditionPathExists=|@SYSCONFDIR@/nvme/discovery.conf +Wants=modprobe@nvme_fabrics.service +After=modprobe@nvme_fabrics.service After=network-online.target Before=remote-fs-pre.target [Service] Type=oneshot -ExecStartPre=/sbin/modprobe nvme-fabrics ExecStart=@SBINDIR@/nvme connect-all --context=autoconnect [Install] diff --git a/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in b/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in new file mode 100644 index 0000000..820e6ce --- /dev/null +++ b/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in @@ -0,0 +1,14 @@ +# This unit is meant to be started by network management software +# after a network interface defined in the NBFT gets set up +[Unit] +Description=Connect NBFT-defined NVMe-oF subsystems automatically +ConditionPathExists=|/sys/firmware/acpi/tables/NBFT +ConditionPathExists=|/sys/firmware/acpi/tables/NBFT1 +Wants=modprobe@nvme_fabrics.service +After=modprobe@nvme_fabrics.service +After=network-online.target +Before=remote-fs-pre.target + +[Service] +Type=oneshot +ExecStart=@SBINDIR@/nvme connect-all --nbft diff --git a/nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in b/nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in new file mode 100644 index 0000000..344942b --- /dev/null +++ b/nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in @@ -0,0 +1,2 @@ +# Avoid renaming nbft$X interfaces +SUBSYSTEM=="net", ACTION!="remove", ENV{INTERFACE}=="nbft*", NAME:="%E{INTERFACE}" diff --git a/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in b/nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in similarity index 62% rename from nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in rename to nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in index 299fe22..99b6a8b 100644 --- a/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in +++ b/nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in @@ -1,3 +1,6 @@ # Enable round-robin for NetApp ONTAP and NetApp E-Series ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="NetApp ONTAP Controller", ATTR{iopolicy}="round-robin" ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="NetApp E-Series", ATTR{iopolicy}="round-robin" + +# Set ctrl_loss_tmo to -1 for NetApp ONTAP NVMe/TCP +ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*", ATTR{transport}=="tcp", ATTR{model}=="NetApp ONTAP Controller", ATTR{ctrl_loss_tmo}="-1" diff --git a/plugins/fdp/fdp.c b/plugins/fdp/fdp.c index 8539e18..2a221f8 100644 --- a/plugins/fdp/fdp.c +++ b/plugins/fdp/fdp.c @@ -56,7 +56,7 @@ static int fdp_configs(int argc, char **argv, struct command *cmd, if (err) return err; - err = flags = validate_output_format(cfg.output_format); + err = validate_output_format(cfg.output_format, &flags); if (flags < 0) goto out; @@ -137,7 +137,7 @@ static int fdp_usage(int argc, char **argv, struct command *cmd, struct plugin * if (err) return err; - err = flags = validate_output_format(cfg.output_format); + err = validate_output_format(cfg.output_format, &flags); if (flags < 0) goto out; @@ -208,7 +208,7 @@ static int fdp_stats(int argc, char **argv, struct command *cmd, struct plugin * if (err) return err; - err = flags = validate_output_format(cfg.output_format); + err = validate_output_format(cfg.output_format, &flags); if (flags < 0) goto out; @@ -269,7 +269,7 @@ static int fdp_events(int argc, char **argv, struct command *cmd, struct plugin if (err) return err; - err = flags = validate_output_format(cfg.output_format); + err = validate_output_format(cfg.output_format, &flags); if (flags < 0) goto out; @@ -328,7 +328,7 @@ static int fdp_status(int argc, char **argv, struct command *cmd, struct plugin if (err) return err; - err = flags = validate_output_format(cfg.output_format); + err = validate_output_format(cfg.output_format, &flags); if (flags < 0) goto out; diff --git a/plugins/huawei/huawei-nvme.c b/plugins/huawei/huawei-nvme.c index 82e190f..0272dea 100644 --- a/plugins/huawei/huawei-nvme.c +++ b/plugins/huawei/huawei-nvme.c @@ -296,7 +296,7 @@ static int huawei_list(int argc, char **argv, struct command *command, struct huawei_list_item *list_items; unsigned int i, n, ret; unsigned int huawei_num = 0; - int fmt; + enum nvme_print_flags fmt; const char *desc = "Retrieve basic information for the given huawei device"; struct config { char *output_format; @@ -315,9 +315,9 @@ static int huawei_list(int argc, char **argv, struct command *command, if (ret) return ret; - fmt = validate_output_format(cfg.output_format); - if (fmt != JSON && fmt != NORMAL) - return -EINVAL; + ret = validate_output_format(cfg.output_format, &fmt); + if (ret < 0 || (fmt != JSON && fmt != NORMAL)) + return ret; n = scandir("/dev", &devices, nvme_namespace_filter, alphasort); if (n <= 0) diff --git a/plugins/intel/intel-nvme.c b/plugins/intel/intel-nvme.c index 3b2f973..378ecc0 100644 --- a/plugins/intel/intel-nvme.c +++ b/plugins/intel/intel-nvme.c @@ -1086,7 +1086,7 @@ static int get_lat_stats_log(int argc, char **argv, struct command *cmd, struct }; err = nvme_get_features(&args); if (err) { - fprintf(stderr, "Quering thresholds failed. "); + fprintf(stderr, "Querying thresholds failed. "); nvme_show_status(err); goto close_dev; } diff --git a/plugins/memblaze/memblaze-nvme.c b/plugins/memblaze/memblaze-nvme.c index c0a70ee..b215125 100644 --- a/plugins/memblaze/memblaze-nvme.c +++ b/plugins/memblaze/memblaze-nvme.c @@ -646,7 +646,7 @@ static int glp_high_latency_show_bar(FILE *fdi, int print) } /* - * High latency log page definiton + * High latency log page definition * Total 32 bytes */ struct log_page_high_latency { @@ -1197,3 +1197,646 @@ static int mb_set_lat_stats(int argc, char **argv, dev_close(dev); return err; } + +// Global definitions + +static inline int K2C(int k) // KELVINS_2_CELSIUS +{ + return (k - 273); +}; + +// Global ID definitions + +enum { + // feature ids + FID_LATENCY_FEATURE = 0xd0, + + // log ids + LID_SMART_LOG_ADD = 0xca, + LID_LATENCY_STATISTICS = 0xd0, + LID_HIGH_LATENCY_LOG = 0xd1, + LID_PERFORMANCE_STATISTICS = 0xd2, +}; + +// smart-log-add + +struct smart_log_add_item { + uint32_t index; + char *attr; +}; + +struct __packed wear_level { + __le16 min; + __le16 max; + __le16 avg; +}; + +struct __packed smart_log_add_item_12 { + uint8_t id; + uint8_t rsvd[2]; + uint8_t norm; + uint8_t rsvd1; + union { + struct wear_level wear_level; // 0xad + struct temp_since_born { // 0xe7 + __le16 max; + __le16 min; + __le16 curr; + } temp_since_born; + struct power_consumption { // 0xe8 + __le16 max; + __le16 min; + __le16 curr; + } power_consumption; + struct temp_since_power_on { // 0xaf + __le16 max; + __le16 min; + __le16 curr; + } temp_since_power_on; + uint8_t raw[6]; + }; + uint8_t rsvd2; +}; + +struct __packed smart_log_add_item_10 { + uint8_t id; + uint8_t norm; + union { + struct wear_level wear_level; // 0xad + uint8_t raw[6]; + }; + uint8_t rsvd[2]; +}; + +struct smart_log_add { + union { + union { + struct 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; + struct smart_log_add_item_12 end_to_end_error_count; + struct smart_log_add_item_12 crc_error_count; + struct smart_log_add_item_12 timed_workload_media_wear; + struct smart_log_add_item_12 timed_workload_host_reads; + struct smart_log_add_item_12 timed_workload_timer; + struct smart_log_add_item_12 thermal_throttle_status; + struct smart_log_add_item_12 retry_buffer_overflow_counter; + struct smart_log_add_item_12 pll_lock_loss_count; + struct smart_log_add_item_12 nand_bytes_written; + struct smart_log_add_item_12 host_bytes_written; + struct smart_log_add_item_12 system_area_life_remaining; + struct smart_log_add_item_12 nand_bytes_read; + struct smart_log_add_item_12 temperature; + struct smart_log_add_item_12 power_consumption; + struct smart_log_add_item_12 power_on_temperature; + struct smart_log_add_item_12 power_loss_protection; + struct smart_log_add_item_12 read_fail_count; + struct smart_log_add_item_12 thermal_throttle_time; + struct smart_log_add_item_12 flash_error_media_count; + } v0; + + struct smart_log_add_item_12 v0_raw[22]; + }; + + union { + struct 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; + struct smart_log_add_item_12 end_to_end_error_count; + struct smart_log_add_item_12 crc_error_count; + struct smart_log_add_item_12 timed_workload_media_wear; + struct smart_log_add_item_12 timed_workload_host_reads; + struct smart_log_add_item_12 timed_workload_timer; + struct smart_log_add_item_12 thermal_throttle_status; + struct smart_log_add_item_12 lifetime_write_amplification; + struct smart_log_add_item_12 pll_lock_loss_count; + struct smart_log_add_item_12 nand_bytes_written; + struct smart_log_add_item_12 host_bytes_written; + struct smart_log_add_item_12 system_area_life_remaining; + struct smart_log_add_item_12 firmware_update_count; + struct smart_log_add_item_12 dram_cecc_count; + struct smart_log_add_item_12 dram_uecc_count; + struct smart_log_add_item_12 xor_pass_count; + 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 nand_bytes_read; + struct smart_log_add_item_12 temp_since_born; + struct smart_log_add_item_12 power_consumption; + struct smart_log_add_item_12 temp_since_bootup; + struct smart_log_add_item_12 thermal_throttle_time; + } v2; + + struct smart_log_add_item_12 v2_raw[27]; + }; + + union { + struct 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; + struct smart_log_add_item_10 ext_e2e_err_count; + struct smart_log_add_item_10 crc_err_count; + struct smart_log_add_item_10 nand_bytes_written; + struct smart_log_add_item_10 host_bytes_written; + struct smart_log_add_item_10 reallocated_sector_count; + struct smart_log_add_item_10 uncorrectable_sector_count; + struct smart_log_add_item_10 nand_uecc_detection; + struct smart_log_add_item_10 nand_xor_correction; + struct smart_log_add_item_10 gc_count; + struct smart_log_add_item_10 dram_uecc_detection_count; + struct smart_log_add_item_10 sram_uecc_detection_count; + struct smart_log_add_item_10 internal_raid_recovery_fail_count; + struct smart_log_add_item_10 inflight_cmds; + struct smart_log_add_item_10 internal_e2e_err_count; + struct smart_log_add_item_10 die_fail_count; + struct smart_log_add_item_10 wear_leveling_execution_count; + struct smart_log_add_item_10 read_disturb_count; + struct smart_log_add_item_10 data_retention_count; + struct smart_log_add_item_10 capacitor_health; + } v3; + + struct smart_log_add_item_10 v3_raw[24]; + }; + + uint8_t raw[512]; + }; +}; + +static void smart_log_add_v0_print(struct smart_log_add_item_12 *item, int item_count) +{ + static const struct smart_log_add_item items[0xff] = { + [0xab] = {0, "program_fail_count" }, + [0xac] = {1, "erase_fail_count" }, + [0xad] = {2, "wear_leveling_count" }, + [0xb8] = {3, "end_to_end_error_count" }, + [0xc7] = {4, "crc_error_count" }, + [0xe2] = {5, "timed_workload_media_wear" }, + [0xe3] = {6, "timed_workload_host_reads" }, + [0xe4] = {7, "timed_workload_timer" }, + [0xea] = {8, "thermal_throttle_status" }, + [0xf0] = {9, "retry_buffer_overflow_counter"}, + [0xf3] = {10, "pll_lock_loss_count" }, + [0xf4] = {11, "nand_bytes_written" }, + [0xf5] = {12, "host_bytes_written" }, + [0xf6] = {13, "system_area_life_remaining" }, + [0xfa] = {14, "nand_bytes_read" }, + [0xe7] = {15, "temperature" }, + [0xe8] = {16, "power_consumption" }, + [0xaf] = {17, "power_on_temperature" }, + [0xec] = {18, "power_loss_protection" }, + [0xf2] = {19, "read_fail_count" }, + [0xeb] = {20, "thermal_throttle_time" }, + [0xed] = {21, "flash_error_media_count" }, + }; + + for (int i = 0; i < item_count; i++, item++) { + if (item->id == 0) + continue; + + printf("%#-12" PRIx8 "%-36s%-12d", item->id, items[item->id].attr, item->norm); + 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)); + 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)); + 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)); + 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)); + break; + default: + printf("%" PRIu64 "\n", int48_to_long(item->raw)); + break; + } + } +} + +static void smart_log_add_v2_print(struct smart_log_add_item_12 *item, int item_count) +{ + static const struct smart_log_add_item items[0xff] = { + [0xab] = {0, "program_fail_count" }, + [0xac] = {1, "erase_fail_count" }, + [0xad] = {2, "wear_leveling_count" }, + [0xb8] = {3, "end_to_end_error_count" }, + [0xc7] = {4, "crc_error_count" }, + [0xe2] = {5, "timed_workload_media_wear" }, + [0xe3] = {6, "timed_workload_host_reads" }, + [0xe4] = {7, "timed_workload_timer" }, + [0xea] = {8, "thermal_throttle_status" }, + [0xf0] = {9, "lifetime_write_amplification"}, + [0xf3] = {10, "pll_lock_loss_count" }, + [0xf4] = {11, "nand_bytes_written" }, + [0xf5] = {12, "host_bytes_written" }, + [0xf6] = {13, "system_area_life_remaining" }, + [0xf9] = {14, "firmware_update_count" }, + [0xfa] = {15, "dram_cecc_count" }, + [0xfb] = {16, "dram_uecc_count" }, + [0xfc] = {17, "xor_pass_count" }, + [0xfd] = {18, "xor_fail_count" }, + [0xfe] = {19, "xor_invoked_count" }, + [0xe5] = {20, "inflight_read_io_cmd" }, + [0xe6] = {21, "flash_error_media_count" }, + [0xf8] = {22, "nand_bytes_read" }, + [0xe7] = {23, "temp_since_born" }, + [0xe8] = {24, "power_consumption" }, + [0xaf] = {25, "temp_since_bootup" }, + [0xeb] = {26, "thermal_throttle_time" }, + }; + + for (int i = 0; i < item_count; i++, item++) { + if (item->id == 0) + continue; + + printf("%#-12" PRIx8 "%-36s%-12d", item->id, items[item->id].attr, item->norm); + 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)); + 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)); + 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)); + 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)); + break; + default: + printf("%" PRIu64 "\n", int48_to_long(item->raw)); + break; + } + } +} + +static void smart_log_add_v3_print(struct smart_log_add_item_10 *item, int item_count) +{ + static const struct smart_log_add_item items[0xff] = { + [0xab] = {0, "program_fail_count" }, + [0xac] = {1, "erase_fail_count" }, + [0xad] = {2, "wear_leveling_count" }, + [0xb8] = {3, "ext_e2e_err_count" }, + [0xc7] = {4, "crc_err_count" }, + [0xf4] = {5, "nand_bytes_written" }, + [0xf5] = {6, "host_bytes_written" }, + [0xd0] = {7, "reallocated_sector_count" }, + [0xd1] = {8, "uncorrectable_sector_count" }, + [0xd2] = {9, "nand_uecc_detection" }, + [0xd3] = {10, "nand_xor_correction" }, + [0xd4] = {12, "gc_count" }, // 11 is reserved + [0xd5] = {13, "dram_uecc_detection_count" }, + [0xd6] = {14, "sram_uecc_detection_count" }, + [0xd7] = {15, "internal_raid_recovery_fail_count"}, + [0xd8] = {16, "inflight_cmds" }, + [0xd9] = {17, "internal_e2e_err_count" }, + [0xda] = {19, "die_fail_count" }, // 18 is reserved + [0xdb] = {20, "wear_leveling_execution_count" }, + [0xdc] = {21, "read_disturb_count" }, + [0xdd] = {22, "data_retention_count" }, + [0xde] = {23, "capacitor_health" }, + }; + + for (int i = 0; i < item_count; i++, item++) { + if (item->id == 0) + continue; + + printf("%#-12" PRIx8 "%-36s%-12d", item->id, items[item->id].attr, item->norm); + 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)); + break; + default: + printf("%" PRIu64 "\n", int48_to_long(item->raw)); + break; + } + } +} + +static void smart_log_add_print(struct smart_log_add *log, const char *devname) +{ + uint8_t version = log->raw[511]; + + printf("Version: %u\n", version); + printf("\n"); + printf("Additional Smart Log for NVMe device: %s\n", devname); + printf("\n"); + + printf("%-12s%-36s%-12s%s\n", "Id", "Key", "Normalized", "Raw"); + + 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)); + 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)); + 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)); + + case 1: + fprintf(stderr, "Version %d: N/A\n", version); + break; + default: + fprintf(stderr, "Version %d: Not supported yet\n", version); + break; + } +} + +static int mb_get_smart_log_add(int argc, char **argv, struct command *cmd, struct plugin *plugin) +{ + int err = 0; + + // 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()}; + + // Open device + + struct nvme_dev *dev = NULL; + + err = parse_and_open(&dev, argc, argv, cmd->help, opts); + if (err) + return err; + + // Get log + + struct smart_log_add log = {0}; + + 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); + else + d_raw((unsigned char *)&log, sizeof(struct smart_log_add)); + } else if (err > 0) { + nvme_show_status(err); + } else { + nvme_show_error("%s: %s", cmd->name, nvme_strerror(errno)); + } + + // Close device + + dev_close(dev); + return err; +} + +// performance-monitor + +struct latency_stats_bucket { + char *start_threshold; + char *end_threshold; +}; + +struct __packed latency_stats { + union { + struct latency_stats_v2_0 { + uint32_t minor_version; + uint32_t major_version; + uint32_t bucket_read_data[32]; + uint32_t rsvd[32]; + uint32_t bucket_write_data[32]; + uint32_t rsvd1[32]; + uint32_t bucket_trim_data[32]; + uint32_t rsvd2[32]; + uint8_t rsvd3[248]; + } v2_0; + uint8_t raw[1024]; + }; +}; + +struct __packed high_latency_log { + union { + struct high_latency_log_v1 { + uint32_t version; + struct high_latency_log_entry { + uint64_t timestamp; // ms + uint32_t latency; + uint32_t qid; + uint32_t opcode : 8; + uint32_t fuse : 2; + uint32_t psdt : 2; + uint32_t cid : 16; + uint32_t rsvd : 4; + uint32_t nsid; + uint64_t slba; + uint32_t nlb : 16; + uint32_t dtype : 8; + uint32_t pinfo : 4; + uint32_t fua : 1; + uint32_t lr : 1; + uint32_t rsvd1 : 2; + uint8_t rsvd2[28]; + } entries[1024]; + } v1; + uint8_t raw[4 + 1024 * 64]; + }; +}; + +struct __packed performance_stats { + union { + struct performance_stats_v1 { + uint8_t version; + uint8_t rsvd[3]; + struct performance_stats_timestamp { + uint8_t timestamp[6]; + struct performance_stats_entry { + uint16_t read_iops; // K IOPS + uint16_t read_bandwidth; // MiB + uint32_t read_latency; // us + uint32_t read_latency_max; // us + uint16_t write_iops; // K IOPS + uint16_t write_bandwidth; // MiB + uint32_t write_latency; // us + uint32_t write_latency_max; // us + } entries[3600]; + } timestamps[24]; + } v1; + uint8_t raw[4 + 24 * (6 + 3600 * 24)]; + }; +}; + +static int mb_set_latency_feature(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + int err = 0; + + // Get the configuration + + struct config { + uint32_t perf_monitor; + uint32_t cmd_mask; + uint32_t read_threshold; + uint32_t write_threshold; + uint32_t de_allocate_trim_threshold; + }; + + struct config cfg = {0}; + + 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"), + 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.)"), + 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"), + 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"), + 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"), + OPT_END()}; + + // Open device + + struct nvme_dev *dev = NULL; + + err = parse_and_open(&dev, argc, argv, cmd->help, opts); + if (err) + return err; + + + // Set feature + + uint32_t result = 0; + + struct nvme_set_features_args args = { + .args_size = sizeof(args), + .fd = dev_fd(dev), + .fid = FID_LATENCY_FEATURE, + .nsid = 0, + .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), + .cdw15 = 0, + .save = 0, + .uuidx = 0, + .data = NULL, + .data_len = 0, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .result = &result, + }; + + err = nvme_set_features(&args); + if (!err) + printf("%s have done successfully. result = %#" PRIx32 ".\n", cmd->name, result); + else if (err > 0) + nvme_show_status(err); + 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) +{ + int err = 0; + + // Get the configuration + + OPT_ARGS(opts) = { + OPT_END()}; + + // Open device + + struct nvme_dev *dev = NULL; + + err = parse_and_open(&dev, argc, argv, cmd->help, opts); + if (err) + return err; + + // Get feature + + uint32_t result = 0; + + err = nvme_get_features_simple(dev_fd(dev), FID_LATENCY_FEATURE, 0, &result); + if (!err) { + printf("%s have done successfully. result = %#" PRIx32 ".\n", cmd->name, result); + + printf("latency statistics enable status = %d\n", (result & (0x01 << 0)) >> 0); + printf("high latency enable status = %d\n", (result & (0x01 << 1)) >> 1); + printf("performance stat enable status = %d\n", (result & (0x01 << 2)) >> 2); + + printf("Monitor Read command = %d\n", (result & (0x01 << 4)) >> 4); + printf("Monitor Write command = %d\n", (result & (0x01 << 5)) >> 5); + printf("Monitor Trim command = %d\n", (result & (0x01 << 6)) >> 6); + + printf("Threshold for Read = %dms\n", (((result & (0xff << 8)) >> 8) + 1) * 10); + printf("Threshold for Write = %dms\n", (((result & (0xff << 16)) >> 16) + 1) * 10); + printf("Threshold for Trim = %dms\n", (((result & (0xff << 24)) >> 24) + 1) * 10); + } else if (err > 0) { + nvme_show_status(err); + } else { + nvme_show_error("%s: %s", cmd->name, nvme_strerror(errno)); + } + + // Close device + + dev_close(dev); + return err; +} diff --git a/plugins/memblaze/memblaze-nvme.h b/plugins/memblaze/memblaze-nvme.h index e214ca6..e25267b 100644 --- a/plugins/memblaze/memblaze-nvme.h +++ b/plugins/memblaze/memblaze-nvme.h @@ -18,6 +18,9 @@ PLUGIN(NAME("memblaze", "Memblaze vendor specific extensions", NVME_VERSION), 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) ) ); diff --git a/plugins/memblaze/memblaze-utils.h b/plugins/memblaze/memblaze-utils.h index dd89189..8914f95 100644 --- a/plugins/memblaze/memblaze-utils.h +++ b/plugins/memblaze/memblaze-utils.h @@ -34,7 +34,7 @@ #define RAISIN_SI_VD_THERMAL_THROTTLE_TIME_ID 0xEB #define RAISIN_SI_VD_FLASH_MEDIA_ERROR_ID 0xED -/* Raisin Addtional smart internal ID */ +/* Raisin Additional smart internal ID */ typedef enum { /* smart attr following intel */ @@ -154,7 +154,7 @@ struct nvme_p4_smart_log /** * change 512 to 4096. * because micron's getlogpage request,the size of many commands have changed to 4k. - * request size > user malloc size,casuing parameters that are closed in momery are dirty. + * request size > user malloc size,casuing parameters that are closed in memery are dirty. */ __u8 resv[SMART_INFO_NEW_SIZE - sizeof(struct nvme_p4_smart_log_item) * NR_SMART_ITEMS]; }; diff --git a/plugins/micron/micron-nvme.c b/plugins/micron/micron-nvme.c index 195c971..63a7a79 100644 --- a/plugins/micron/micron-nvme.c +++ b/plugins/micron/micron-nvme.c @@ -16,6 +16,7 @@ #include #include "linux/types.h" #include "nvme-print.h" +#include "util/cleanup.h" #define CREATE_CMD #include "micron-nvme.h" @@ -1767,10 +1768,10 @@ static void GetGenericLogs(int fd, const char *dir) struct nvme_firmware_slot fw_log; struct nvme_cmd_effects_log effects; struct nvme_persistent_event_log pevent_log; + _cleanup_huge_ struct nvme_mem_huge mh = { 0, }; void *pevent_log_info = NULL; __u32 log_len = 0; int err = 0; - bool huge = false; /* get self test log */ if (!nvme_get_log_device_self_test(fd, &self_test_log)) @@ -1799,17 +1800,17 @@ static void GetGenericLogs(int fd, const char *dir) } log_len = le64_to_cpu(pevent_log.tll); - pevent_log_info = nvme_alloc_huge(log_len, &huge); + pevent_log_info = nvme_alloc_huge(log_len, &mh); if (!pevent_log_info) { perror("could not alloc buffer for persistent event log page (ignored)!\n"); return; } + err = nvme_get_log_persistent_event(fd, NVME_PEVENT_LOG_READ, log_len, pevent_log_info); if (!err) WriteData((__u8 *)pevent_log_info, log_len, dir, "persistent_event_log.bin", "persistent event log"); - nvme_free_huge(pevent_log_info, huge); } static void GetNSIDDInfo(int fd, const char *dir, int nsid) @@ -2221,7 +2222,7 @@ static int display_fw_activate_entry(int entry_count, struct fw_activation_histo else sprintf(ptr, "| pass"); - /* replace all null charecters with spaces */ + /* replace all null characters with spaces */ ptr = formatted_entry; while (index < entry_size) { if (ptr[index] == '\0') @@ -2289,7 +2290,7 @@ static int micron_fw_activation_history(int argc, char **argv, struct command *c goto out; } - /* check if we have atleast one entry to print */ + /* check if we have at least one entry to print */ struct micron_fw_activation_history_table *table = (struct micron_fw_activation_history_table *)logC2; @@ -2696,7 +2697,7 @@ static int micron_ocp_smart_health_logs(int argc, char **argv, struct command *c /* check for models that support 0xC0 log */ if (eModel != M51CX) { - printf("Unsupported drive model for vs-smart-add-log commmand\n"); + printf("Unsupported drive model for vs-smart-add-log command\n"); err = -1; goto out; } diff --git a/plugins/nbft/nbft-plugin.c b/plugins/nbft/nbft-plugin.c index e8b3fed..2193ffb 100644 --- a/plugins/nbft/nbft-plugin.c +++ b/plugins/nbft/nbft-plugin.c @@ -543,7 +543,7 @@ int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin) if (ret) return ret; - ret = flags = validate_output_format(format); + ret = validate_output_format(format, &flags); if (ret < 0) return ret; diff --git a/plugins/ocp/meson.build b/plugins/ocp/meson.build index 405ee51..64447ff 100644 --- a/plugins/ocp/meson.build +++ b/plugins/ocp/meson.build @@ -1,7 +1,7 @@ sources += [ 'plugins/ocp/ocp-utils.c', 'plugins/ocp/ocp-nvme.c', - 'plugins/ocp/ocp-clear-fw-update-history.c', + 'plugins/ocp/ocp-clear-features.c', 'plugins/ocp/ocp-smart-extended-log.c', 'plugins/ocp/ocp-fw-activation-history.c', ] diff --git a/plugins/ocp/ocp-utils.c b/plugins/ocp/ocp-clear-features.c similarity index 62% copy from plugins/ocp/ocp-utils.c copy to plugins/ocp/ocp-clear-features.c index a37a58c..0f49584 100644 --- a/plugins/ocp/ocp-utils.c +++ b/plugins/ocp/ocp-clear-features.c @@ -2,36 +2,18 @@ /* * Copyright (c) 2022 Solidigm. * - * Author: leonardo.da.cunha@solidigm.com + * Authors: haro.panosyan@solidigm.com + * leonardo.da.cunha@solidigm.com */ #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 }; +static const __u8 OCP_FID_CLEAR_FW_ACTIVATION_HISTORY = 0xC1; +static const __u8 OCP_FID_CLEAR_PCIE_CORRECTABLE_ERROR_COUNTERS = 0xC3; -int ocp_get_uuid_index(struct nvme_dev *dev, int *index) -{ - struct nvme_id_uuid_list uuid_list; - int err = nvme_identify_uuid(dev_fd(dev), &uuid_list); - - *index = 0; - 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; -} - -int ocp_clear_feature(int argc, char **argv, const char *desc, const __u8 fid) +static int ocp_clear_feature(int argc, char **argv, const char *desc, const __u8 fid) { __u32 result = 0; __u32 clear = 1 << 31; @@ -93,3 +75,19 @@ close_dev: dev_close(dev); return err; } + +int ocp_clear_fw_update_history(int argc, char **argv, struct command *cmd, struct plugin *plugin) +{ + const char *desc = "OCP Clear Firmware Update History"; + + return ocp_clear_feature(argc, argv, desc, OCP_FID_CLEAR_FW_ACTIVATION_HISTORY); +} + +int ocp_clear_pcie_correctable_errors(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + const char *desc = "OCP Clear PCIe Correctable Error Counters"; + + return ocp_clear_feature(argc, argv, desc, + OCP_FID_CLEAR_PCIE_CORRECTABLE_ERROR_COUNTERS); +} diff --git a/plugins/ocp/ocp-clear-features.h b/plugins/ocp/ocp-clear-features.h new file mode 100644 index 0000000..99766dd --- /dev/null +++ b/plugins/ocp/ocp-clear-features.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (c) 2022 Solidigm. + * + * Authors: haro.panosyan@solidigm.com + * leonardo.da.cunha@solidigm.com + */ + +int ocp_clear_fw_update_history(int argc, char **argv, struct command *cmd, struct plugin *plugin); + +int ocp_clear_pcie_correctable_errors(int argc, char **argv, struct command *cmd, + struct plugin *plugin); diff --git a/plugins/ocp/ocp-clear-fw-update-history.c b/plugins/ocp/ocp-clear-fw-update-history.c deleted file mode 100644 index 6b256b1..0000000 --- a/plugins/ocp/ocp-clear-fw-update-history.c +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2022 Solidigm. - * - * Authors: haro.panosyan@solidigm.com - * leonardo.da.cunha@solidigm.com - */ - -#include -#include "ocp-utils.h" -#include "nvme-print.h" - -static const __u8 OCP_FID_CLEAR_FW_ACTIVATION_HISTORY = 0xC1; - -int ocp_clear_fw_update_history(int argc, char **argv, struct command *cmd, struct plugin *plugin) -{ - const char *desc = "OCP Clear Firmware Update History"; - - return ocp_clear_feature(argc, argv, desc, OCP_FID_CLEAR_FW_ACTIVATION_HISTORY); -} diff --git a/plugins/ocp/ocp-clear-fw-update-history.h b/plugins/ocp/ocp-clear-fw-update-history.h deleted file mode 100644 index cd0844c..0000000 --- a/plugins/ocp/ocp-clear-fw-update-history.h +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * Copyright (c) 2022 Solidigm. - * - * Authors: haro.panosyan@solidigm.com - * leonardo.da.cunha@solidigm.com - */ - -int ocp_clear_fw_update_history(int argc, char **argv, - struct command *cmd, struct plugin *plugin); diff --git a/plugins/ocp/ocp-fw-activation-history.c b/plugins/ocp/ocp-fw-activation-history.c index b067346..ad96c6b 100644 --- a/plugins/ocp/ocp-fw-activation-history.c +++ b/plugins/ocp/ocp-fw-activation-history.c @@ -207,16 +207,18 @@ int ocp_fw_activation_history_log(int argc, char **argv, struct command *cmd, } if (!err) { - const enum nvme_print_flags print_flag = validate_output_format(format); + enum nvme_print_flags print_flag; + + err = validate_output_format(format, &print_flag); + if (err < 0) { + fprintf(stderr, "Error: Invalid output format.\n"); + return err; + } if (print_flag == JSON) ocp_fw_activation_history_json(&fw_history); else if (print_flag == NORMAL) ocp_fw_activation_history_normal(&fw_history); - else { - fprintf(stderr, "Error: Invalid output format.\n"); - err = -EINVAL; - } } return err; diff --git a/plugins/ocp/ocp-nvme.c b/plugins/ocp/ocp-nvme.c index fdb6b50..53ae0f4 100644 --- a/plugins/ocp/ocp-nvme.c +++ b/plugins/ocp/ocp-nvme.c @@ -25,7 +25,7 @@ #include "nvme-print.h" #include "ocp-smart-extended-log.h" -#include "ocp-clear-fw-update-history.h" +#include "ocp-clear-features.h" #include "ocp-fw-activation-history.h" #define CREATE_CMD @@ -117,7 +117,6 @@ static int ocp_print_C3_log_normal(struct nvme_dev *dev, { char ts_buf[128]; int i, j; - int pos = 0; printf("-Latency Monitor/C3 Log Page Data-\n"); printf(" Controller : %s\n", dev->name); @@ -141,6 +140,8 @@ static int ocp_print_C3_log_normal(struct nvme_dev *dev, printf(" Active Threshold D %d ms\n", C3_ACTIVE_THRESHOLD_INCREMENT * le16_to_cpu(log_data->active_threshold_d+1)); + printf(" Active Latency Configuration 0x%x \n", + le16_to_cpu(log_data->active_latency_config)); printf(" Active Latency Minimum Window %d ms\n", C3_MINIMUM_WINDOW_INCREMENT * le16_to_cpu(log_data->active_latency_min_window)); @@ -177,14 +178,6 @@ static int ocp_print_C3_log_normal(struct nvme_dev *dev, printf("\n"); printf(" Read Write Deallocate/Trim\n"); - for (i = 0; i < C3_BUCKET_NUM; i++) { - printf(" Active Latency Mode: Bucket %d %27d %27d %27d\n", - i, - log_data->active_latency_config & (1 << pos), - log_data->active_latency_config & (1 << pos), - log_data->active_latency_config & (1 << pos)); - } - for (i = 0; i < C3_BUCKET_NUM; i++) { printf(" Active Bucket Counter: Bucket %d %27d %27d %27d\n", i, @@ -196,10 +189,10 @@ static int ocp_print_C3_log_normal(struct nvme_dev *dev, for (i = 0; i < C3_BUCKET_NUM; i++) { printf(" Active Latency Time Stamp: Bucket %d ", i); for (j = 2; j >= 0; j--) { - if (le64_to_cpu(log_data->active_latency_timestamp[i][j]) == -1) { + if (le64_to_cpu(log_data->active_latency_timestamp[3-i][j]) == -1) { printf(" N/A "); } else { - convert_ts(le64_to_cpu(log_data->active_latency_timestamp[i][j]), ts_buf); + convert_ts(le64_to_cpu(log_data->active_latency_timestamp[3-i][j]), ts_buf); printf("%s ", ts_buf); } } @@ -209,9 +202,9 @@ static int ocp_print_C3_log_normal(struct nvme_dev *dev, for (i = 0; i < C3_BUCKET_NUM; i++) { printf(" Active Measured Latency: Bucket %d %27d ms %27d ms %27d ms\n", i, - le16_to_cpu(log_data->active_measured_latency[i][READ-1]), - le16_to_cpu(log_data->active_measured_latency[i][WRITE-1]), - le16_to_cpu(log_data->active_measured_latency[i][TRIM-1])); + le16_to_cpu(log_data->active_measured_latency[3-i][READ-1]), + le16_to_cpu(log_data->active_measured_latency[3-i][WRITE-1]), + le16_to_cpu(log_data->active_measured_latency[3-i][TRIM-1])); } printf("\n"); @@ -226,10 +219,10 @@ static int ocp_print_C3_log_normal(struct nvme_dev *dev, for (i = 0; i < C3_BUCKET_NUM; i++) { printf(" Static Latency Time Stamp: Bucket %d ", i); for (j = 2; j >= 0; j--) { - if (le64_to_cpu(log_data->static_latency_timestamp[i][j]) == -1) { + if (le64_to_cpu(log_data->static_latency_timestamp[3-i][j]) == -1) { printf(" N/A "); } else { - convert_ts(le64_to_cpu(log_data->static_latency_timestamp[i][j]), ts_buf); + convert_ts(le64_to_cpu(log_data->static_latency_timestamp[3-i][j]), ts_buf); printf("%s ", ts_buf); } } @@ -239,9 +232,9 @@ static int ocp_print_C3_log_normal(struct nvme_dev *dev, for (i = 0; i < C3_BUCKET_NUM; i++) { printf(" Static Measured Latency: Bucket %d %27d ms %27d ms %27d ms\n", i, - le16_to_cpu(log_data->static_measured_latency[i][READ-1]), - le16_to_cpu(log_data->static_measured_latency[i][WRITE-1]), - le16_to_cpu(log_data->static_measured_latency[i][TRIM-1])); + le16_to_cpu(log_data->static_measured_latency[3-i][READ-1]), + le16_to_cpu(log_data->static_measured_latency[3-i][WRITE-1]), + le16_to_cpu(log_data->static_measured_latency[3-i][TRIM-1])); } return 0; @@ -253,7 +246,6 @@ static void ocp_print_C3_log_json(struct ssd_latency_monitor_log *log_data) char ts_buf[128]; char buf[128]; int i, j; - int pos = 0; char *operation[3] = {"Trim", "Write", "Read"}; root = json_create_object(); @@ -278,19 +270,8 @@ static void ocp_print_C3_log_json(struct ssd_latency_monitor_log *log_data) json_object_add_value_uint(root, "Active Threshold D", C3_ACTIVE_THRESHOLD_INCREMENT * le16_to_cpu(log_data->active_threshold_d + 1)); - - for (i = 0; i < C3_BUCKET_NUM; i++) { - struct json_object *bucket; - - bucket = json_create_object(); - sprintf(buf, "Active Latency Mode: Bucket %d", i); - for (j = 2; j >= 0; j--) { - json_object_add_value_uint(bucket, operation[j], - log_data->active_latency_config & (1 << pos)); - } - json_object_add_value_object(root, buf, bucket); - } - + json_object_add_value_uint(root, "Active Latency Configuration", + le16_to_cpu(log_data->active_latency_config)); json_object_add_value_uint(root, "Active Latency Minimum Window", C3_MINIMUM_WINDOW_INCREMENT * le16_to_cpu(log_data->active_latency_min_window)); @@ -313,10 +294,10 @@ static void ocp_print_C3_log_json(struct ssd_latency_monitor_log *log_data) bucket = json_create_object(); sprintf(buf, "Active Latency Time Stamp: Bucket %d", i); for (j = 2; j >= 0; j--) { - if (le64_to_cpu(log_data->active_latency_timestamp[i][j]) == -1) { + if (le64_to_cpu(log_data->active_latency_timestamp[3-i][j]) == -1) { json_object_add_value_string(bucket, operation[j], "NA"); } else { - convert_ts(le64_to_cpu(log_data->active_latency_timestamp[i][j]), ts_buf); + convert_ts(le64_to_cpu(log_data->active_latency_timestamp[3-i][j]), ts_buf); json_object_add_value_string(bucket, operation[j], ts_buf); } } @@ -330,7 +311,7 @@ static void ocp_print_C3_log_json(struct ssd_latency_monitor_log *log_data) sprintf(buf, "Active Measured Latency: Bucket %d", i); for (j = 2; j >= 0; j--) { json_object_add_value_uint(bucket, operation[j], - le16_to_cpu(log_data->active_measured_latency[i][j])); + le16_to_cpu(log_data->active_measured_latency[3-i][j])); } json_object_add_value_object(root, buf, bucket); } @@ -356,10 +337,10 @@ static void ocp_print_C3_log_json(struct ssd_latency_monitor_log *log_data) bucket = json_create_object(); sprintf(buf, "Static Latency Time Stamp: Bucket %d", i); for (j = 2; j >= 0; j--) { - if (le64_to_cpu(log_data->static_latency_timestamp[i][j]) == -1) { + if (le64_to_cpu(log_data->static_latency_timestamp[3-i][j]) == -1) { json_object_add_value_string(bucket, operation[j], "NA"); } else { - convert_ts(le64_to_cpu(log_data->static_latency_timestamp[i][j]), ts_buf); + convert_ts(le64_to_cpu(log_data->static_latency_timestamp[3-i][j]), ts_buf); json_object_add_value_string(bucket, operation[j], ts_buf); } } @@ -373,7 +354,7 @@ static void ocp_print_C3_log_json(struct ssd_latency_monitor_log *log_data) sprintf(buf, "Static Measured Latency: Bucket %d", i); for (j = 2; j >= 0; j--) { json_object_add_value_uint(bucket, operation[j], - le16_to_cpu(log_data->static_measured_latency[i][j])); + le16_to_cpu(log_data->static_measured_latency[3-i][j])); } json_object_add_value_object(root, buf, bucket); } @@ -416,15 +397,15 @@ static void ocp_print_C3_log_json(struct ssd_latency_monitor_log *log_data) static int get_c3_log_page(struct nvme_dev *dev, char *format) { struct ssd_latency_monitor_log *log_data; - int ret = 0; - int fmt = -1; + enum nvme_print_flags fmt; + int ret; __u8 *data; int i; - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR : OCP : invalid output format\n"); - return fmt; + return ret; } data = malloc(sizeof(__u8) * C3_LATENCY_MON_LOG_BUF_LEN); @@ -481,6 +462,9 @@ static int get_c3_log_page(struct nvme_dev *dev, char *format) case JSON: ocp_print_C3_log_json(log_data); break; + default: + fprintf(stderr, "unhandled output format\n"); + } } else { fprintf(stderr, @@ -707,7 +691,7 @@ static int eol_plp_failure_mode_get(struct nvme_dev *dev, const __u32 nsid, nvme_select_to_string(sel), eol_plp_failure_mode_to_string(result)); if (sel == NVME_GET_FEATURES_SEL_SUPPORTED) - nvme_show_select_result(result); + nvme_show_select_result(fid, result); } else { nvme_show_error("Could not get feature: %#0*x.", fid ? 4 : 2, fid); } @@ -847,6 +831,31 @@ struct telemetry_initiated_log { __u8 ReasonIdentifier[128]; }; +struct telemetry_data_area_1 { + __le16 major_version; + __le16 minor_version; + __u8 reserved1[4]; + __le64 timestamp; + __u8 log_page_guid[16]; + __u8 no_of_tps_supp; + __u8 tps; + __u8 reserved2[6]; + __le16 sls; + __u8 reserved3[8]; + __le16 fw_revision; + __u8 reserved4[32]; + __le16 da1_stat_start; + __le16 da1_stat_size; + __le16 da2_stat_start; + __le16 da2_stat_size; + __u8 reserved5[32]; + __u8 event_fifo_da[16]; + __le64 event_fifo_start[16]; + __le64 event_fifo_size[16]; + __u8 reserved6[80]; + __u8 smart_health_info[512]; + __u8 smart_health_info_extended[512]; +}; static void get_serial_number(struct nvme_id_ctrl *ctrl, char *sn) { int i; @@ -913,6 +922,144 @@ static void print_telemetry_header(struct telemetry_initiated_log *logheader, printf("===============================================\n\n"); } } +static int get_telemetry_data(struct nvme_dev *dev, __u32 ns, __u8 tele_type, + __u32 data_len, void *data, __u8 nLSP, __u8 nRAE, + __u64 offset) +{ + struct nvme_passthru_cmd cmd = { + .opcode = nvme_admin_get_log_page, + .nsid = ns, + .addr = (__u64)(uintptr_t) data, + .data_len = data_len, + }; + __u32 numd = (data_len >> 2) - 1; + __u16 numdu = numd >> 16; + __u16 numdl = numd & 0xffff; + cmd.cdw10 = tele_type | (nLSP & 0x0F) << 8 | (nRAE & 0x01) << 15 | (numdl & 0xFFFF) << 16; + cmd.cdw11 = numdu; + cmd.cdw12 = offset; + cmd.cdw13 = 0; + cmd.cdw14 = 0; + return nvme_submit_admin_passthru(dev_fd(dev), &cmd, NULL); +} +static void print_telemetry_data_area_1(struct telemetry_data_area_1 *da1, + int tele_type) +{ + if (da1) { + unsigned int i = 0; + if (tele_type == TELEMETRY_TYPE_HOST) + printf("============ Telemetry Host Data area 1 ============\n"); + else + printf("========= Telemetry Controller Data area 1 =========\n"); + printf("Major Version : 0x%x\n", le16_to_cpu(da1->major_version)); + printf("Minor Version : 0x%x\n", le16_to_cpu(da1->minor_version)); + for (i = 0; i < 4; i++) + printf("reserved1 : 0x%x\n", da1->reserved1[i]); + printf("Timestamp : %"PRIu64"\n", le64_to_cpu(da1->timestamp)); + for (i = 15; i >= 0; i--) + printf("%x", da1->log_page_guid[i]); + printf("Number Telemetry Profiles Supported : 0x%x\n", da1->no_of_tps_supp); + printf("Telemetry Profile Selected (TPS) : 0x%x\n", da1->tps); + for (i = 0; i < 6; i++) + printf("reserved2 : 0x%x\n", da1->reserved2[i]); + printf("Telemetry String Log Size (SLS) : 0x%x\n", le16_to_cpu(da1->sls)); + for (i = 0; i < 8; i++) + printf("reserved3 : 0x%x\n", da1->reserved3[i]); + printf("Firmware Revision : 0x%x\n", le16_to_cpu(da1->fw_revision)); + for (i = 0; i < 32; i++) + printf("reserved4 : 0x%x\n", da1->reserved4[i]); + printf("Data Area 1 Statistic Start : 0x%x\n", le16_to_cpu(da1->da1_stat_start)); + printf("Data Area 1 Statistic Size : 0x%x\n", le16_to_cpu(da1->da1_stat_size)); + printf("Data Area 2 Statistic Start : 0x%x\n", le16_to_cpu(da1->da2_stat_start)); + printf("Data Area 2 Statistic Size : 0x%x\n", le16_to_cpu(da1->da2_stat_size)); + for (i = 0; i < 32; i++) + printf("reserved5 : 0x%x\n", da1->reserved5[i]); + for (i = 0; i < 17; i++){ + printf("Event FIFO %d Data Area : 0x%x\n", i, da1->event_fifo_da[i]); + printf("Event FIFO %d Start : %"PRIu64"\n", i, le64_to_cpu(da1->event_fifo_start[i])); + printf("Event FIFO %d Size : %"PRIu64"\n", i, le64_to_cpu(da1->event_fifo_size[i])); + } + for (i = 0; i < 80; i++) + printf("reserved6 : 0x%x\n", da1->reserved6[i]); + for (i = 0; i < 512; i++){ + printf("SMART / Health Information : 0x%x\n", da1->smart_health_info[i]); + printf("SMART / Health Information Extended : 0x%x\n", da1->smart_health_info_extended[i]); + } + printf("===============================================\n\n"); + } +} +static void print_telemetry_da1_stat(__u8 *da1_stat, int tele_type, __u16 buf_size) +{ + if (da1_stat) { + unsigned int i = 0; + if (tele_type == TELEMETRY_TYPE_HOST) + printf("============ Telemetry Host Data area 1 Statistics ============\n"); + else + printf("========= Telemetry Controller Data area 1 Statistics =========\n"); + while((i + 8) < buf_size) { + printf("Statistics Identifier : 0x%x\n", (da1_stat[i] | da1_stat[i+1] << 8)); + printf("Statistics info : 0x%x\n", da1_stat[i+2]); + printf("NS info : 0x%x\n", da1_stat[i+3]); + printf("Statistic Data Size : 0x%x\n", (da1_stat[i+4] | da1_stat[i+5] << 8)); + printf("Reserved : 0x%x\n", (da1_stat[i+6] | da1_stat[i+7] << 8)); + i = 8 + ((da1_stat[i+4] | da1_stat[i+5] << 8) * 4); + } + printf("===============================================\n\n"); + } +} +static void print_telemetry_da1_fifo(__u8 *da1_fifo, int tele_type, __u16 buf_size) +{ + if (da1_fifo) { + unsigned int i = 0; + if (tele_type == TELEMETRY_TYPE_HOST) + printf("============ Telemetry Host Data area 1 FIFO ============\n"); + else + printf("========= Telemetry Controller Data area 1 FIFO =========\n"); + while((i + 4) < buf_size) { + printf("Debug Event Class Type : 0x%x\n", da1_fifo[i]); + printf("Event ID : 0x%x\n", (da1_fifo[i+1] | da1_fifo[i+2] << 8)); + printf("Event Data Size : 0x%x\n", da1_fifo[3]); + i = 4 + ((da1_fifo[3]) * 4); + } + printf("===============================================\n\n"); + } +} +static void print_telemetry_da2_stat(__u8 *da1_stat, int tele_type, __u16 buf_size) +{ + if (da1_stat) { + unsigned int i = 0; + if (tele_type == TELEMETRY_TYPE_HOST) + printf("============ Telemetry Host Data area 1 Statistics ============\n"); + else + printf("========= Telemetry Controller Data area 1 Statistics =========\n"); + while((i + 8) < buf_size) { + printf("Statistics Identifier : 0x%x\n", (da1_stat[i] | da1_stat[i+1] << 8)); + printf("Statistics info : 0x%x\n", da1_stat[i+2]); + printf("NS info : 0x%x\n", da1_stat[i+3]); + printf("Statistic Data Size : 0x%x\n", (da1_stat[i+4] | da1_stat[i+5] << 8)); + printf("Reserved : 0x%x\n", (da1_stat[i+6] | da1_stat[i+7] << 8)); + i = 8 + ((da1_stat[i+4] | da1_stat[i+5] << 8) * 4); + } + printf("===============================================\n\n"); + } +} +static void print_telemetry_da2_fifo(__u8 *da1_fifo, int tele_type, __u16 buf_size) +{ + if (da1_fifo) { + unsigned int i = 0; + if (tele_type == TELEMETRY_TYPE_HOST) + printf("============ Telemetry Host Data area 1 Statistics ============\n"); + else + printf("========= Telemetry Controller Data area 1 Statistics =========\n"); + while((i + 4) < buf_size) { + printf("Debug Event Class Type : 0x%x\n", da1_fifo[i]); + printf("Event ID : 0x%x\n", (da1_fifo[i+1] | da1_fifo[i+2] << 8)); + printf("Event Data Size : 0x%x\n", da1_fifo[3]); + i = 4 + ((da1_fifo[3]) * 4); + } + printf("===============================================\n\n"); + } +} static int extract_dump_get_log(struct nvme_dev *dev, char *featurename, char *filename, char *sn, int dumpsize, int transfersize, __u32 nsid, __u8 log_id, @@ -1000,9 +1147,12 @@ static int get_telemetry_dump(struct nvme_dev *dev, char *filename, char *sn, { __u32 err = 0, nsid = 0; __u8 lsp = 0, rae = 0; + unsigned int i = 0; char data[TELEMETRY_TRANSFER_SIZE] = { 0 }; + char data1[1536] = { 0 }; char *featurename = 0; struct telemetry_initiated_log *logheader = (struct telemetry_initiated_log *)data; + struct telemetry_data_area_1 *da1 = (struct telemetry_data_area_1 *)data1; __u64 offset = 0, size = 0; char dumpname[FILE_NAME_SIZE] = { 0 }; @@ -1029,6 +1179,43 @@ static int get_telemetry_dump(struct nvme_dev *dev, char *filename, char *sn, if (header_print) print_telemetry_header(logheader, tele_type); + err = get_telemetry_data(dev, nsid, tele_type, 1536, + (void *)data1, lsp, rae, 512); + if (err) + return err; + print_telemetry_data_area_1(da1, tele_type); + char *da1_stat = calloc((da1->da1_stat_size * 4), sizeof(char)); + err = get_telemetry_data(dev, nsid, tele_type, (da1->da1_stat_size) * 4, + (void *)da1_stat, lsp, rae, (da1->da1_stat_start) * 4); + if (err) + return err; + print_telemetry_da1_stat((void *)da1_stat, tele_type, (da1->da1_stat_size) * 4); + for (i = 0; i < 17 ; i++){ + if (da1->event_fifo_da[i] == 1){ + char *da1_fifo = calloc((da1->event_fifo_size[i]) * 4, sizeof(char)); + err = get_telemetry_data(dev, nsid, tele_type, (da1->event_fifo_size[i]) * 4, + (void *)da1_stat, lsp, rae, (da1->event_fifo_start[i]) * 4); + if (err) + return err; + print_telemetry_da1_fifo((void *)da1_fifo, tele_type, (da1->event_fifo_size[i]) * 4); + } + } + char *da2_stat = calloc((da1->da2_stat_size * 4), sizeof(char)); + err = get_telemetry_data(dev, nsid, tele_type, (da1->da2_stat_size) * 4, + (void *)da2_stat, lsp, rae, (da1->da2_stat_start) * 4); + if (err) + return err; + print_telemetry_da2_stat((void *)da2_stat, tele_type, (da1->da2_stat_size) * 4); + for (i = 0; i < 17 ; i++){ + if (da1->event_fifo_da[i] == 2){ + char *da1_fifo = calloc((da1->event_fifo_size[i]) * 4, sizeof(char)); + err = get_telemetry_data(dev, nsid, tele_type, (da1->event_fifo_size[i]) * 4, + (void *)da1_stat, lsp, rae, (da1->event_fifo_start[i]) * 4); + if (err) + return err; + print_telemetry_da2_fifo((void *)da1_fifo, tele_type, (da1->event_fifo_size[i]) * 4); + } + } switch (data_area) { case 1: @@ -1324,17 +1511,17 @@ static void ocp_print_c5_log_binary(struct unsupported_requirement_log *log_data static int get_c5_log_page(struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; + enum nvme_print_flags fmt; + int ret; __u8 *data; int i; struct unsupported_requirement_log *log_data; int j; - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR : OCP : invalid output format\n"); - return fmt; + return ret; } data = (__u8 *)malloc(sizeof(__u8) * C5_UNSUPPORTED_REQS_LEN); @@ -1386,6 +1573,8 @@ static int get_c5_log_page(struct nvme_dev *dev, char *format) case BINARY: ocp_print_c5_log_binary(log_data); break; + default: + break; } } else { fprintf(stderr, "ERROR : OCP : Unable to read C3 data from buffer\n"); @@ -1548,16 +1737,16 @@ static void ocp_print_c1_log_binary(struct ocp_error_recovery_log_page *log_data static int get_c1_log_page(struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; + struct ocp_error_recovery_log_page *log_data; + enum nvme_print_flags fmt; + int ret; __u8 *data; int i, j; - struct ocp_error_recovery_log_page *log_data; - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR : OCP : invalid output format\n"); - return fmt; + return ret; } data = (__u8 *)malloc(sizeof(__u8) * C1_ERROR_RECOVERY_LOG_BUF_LEN); @@ -1609,6 +1798,8 @@ static int get_c1_log_page(struct nvme_dev *dev, char *format) case BINARY: ocp_print_c1_log_binary(log_data); break; + default: + break; } } else { fprintf(stderr, "ERROR : OCP : Unable to read C1 data from buffer\n"); @@ -1762,16 +1953,16 @@ static void ocp_print_c4_log_binary(struct ocp_device_capabilities_log_page *log static int get_c4_log_page(struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; + struct ocp_device_capabilities_log_page *log_data; + enum nvme_print_flags fmt; + int ret; __u8 *data; int i, j; - struct ocp_device_capabilities_log_page *log_data; - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR : OCP : invalid output format\n"); - return fmt; + return ret; } data = (__u8 *)malloc(sizeof(__u8) * C4_DEV_CAP_REQ_LEN); @@ -1823,6 +2014,8 @@ static int get_c4_log_page(struct nvme_dev *dev, char *format) case BINARY: ocp_print_c4_log_binary(log_data); break; + default: + break; } } else { fprintf(stderr, "ERROR : OCP : Unable to read C4 data from buffer\n"); @@ -1964,9 +2157,794 @@ static int set_dssd_power_state_feature(int argc, char **argv, struct command *c /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -/// Misc +/// plp_health_check_interval -static const __u8 OCP_FID_CLEAR_PCIE_CORRECTABLE_ERROR_COUNTERS = 0xC3; +static int set_plp_health_check_interval(int argc, char **argv, struct command *cmd, + 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; +} + +static int get_plp_health_check_interval(int argc, char **argv, struct command *cmd, + 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; +} + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/// Telemetry String Log Format Log Page (LID : C9h) + +/* C9 Telemetry String Log Format Log Page */ +#define C9_GUID_LENGTH 16 +#define C9_TELEMETRY_STRING_LOG_ENABLE_OPCODE 0xC9 +#define C9_TELEMETRY_STR_LOG_LEN 432 +#define C9_TELEMETRY_STR_LOG_SIST_OFST 431 + +/** + * struct telemetry_str_log_format - Telemetry String Log Format + * @log_page_version: indicates the version of the mapping this log page uses + * Shall be set to 01h. + * @reserved1: Reserved. + * @log_page_guid: Shall be set to B13A83691A8F408B9EA495940057AA44h. + * @sls: Shall be set to the number of DWORDS in the String Log. + * @reserved2: reserved. + * @sits: shall be set to the number of DWORDS in the Statistics + * Identifier String Table + * @ests: Shall be set to the number of DWORDS from byte 0 of this + * log page to the start of the Event String Table + * @estsz: shall be set to the number of DWORDS in the Event String Table + * @vu_eve_sts: Shall be set to the number of DWORDS from byte 0 of this + * log page to the start of the VU Event String Table + * @vu_eve_st_sz: shall be set to the number of DWORDS in the VU Event String Table + * @ascts: the number of DWORDS from byte 0 of this log page until the ASCII Table Starts. + * @asctsz: the number of DWORDS in the ASCII Table + * @fifo1: FIFO 0 ASCII String + * @fifo2: FIFO 1 ASCII String + * @fifo3: FIFO 2 ASCII String + * @fifo4: FIFO 3 ASCII String + * @fif05: FIFO 4 ASCII String + * @fifo6: FIFO 5 ASCII String + * @fifo7: FIFO 6 ASCII String + * @fifo8: FIFO 7 ASCII String + * @fifo9: FIFO 8 ASCII String + * @fifo10: FIFO 9 ASCII String + * @fif011: FIFO 10 ASCII String + * @fif012: FIFO 11 ASCII String + * @fifo13: FIFO 12 ASCII String + * @fif014: FIFO 13 ASCII String + * @fif015: FIFO 14 ASCII String + * @fif016: FIFO 15 ASCII String + * @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]; +}; + +/* + * struct statistics_id_str_table_entry - Statistics Identifier String Table Entry + * @vs_si: Shall be set the Vendor Unique Statistic Identifier number. + * @reserved1: Reserved + * @ascii_id_len: Shall be set the number of ASCII Characters that are valid. + * @ascii_id_ofst: Shall be set to the offset from DWORD 0/Byte 0 of the Start + * of the ASCII Table to the first character of the string for + * this Statistic Identifier string.. + * @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; +}; + +/* + * struct event_id_str_table_entry - Event Identifier String Table Entry + * @deb_eve_class: Shall be set the Debug Class. + * @ei: Shall be set to the Event Identifier + * @ascii_id_len: Shall be set the number of ASCII Characters that are valid. + * @ascii_id_ofst: This is the offset from DWORD 0/ Byte 0 of the start of the + * ASCII table to the ASCII data for this identifier + * @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; +}; + +/* + * struct vu_event_id_str_table_entry - VU Event Identifier String Table Entry + * @deb_eve_class: Shall be set the Debug Class. + * @vu_ei: Shall be set to the VU Event Identifier + * @ascii_id_len: Shall be set the number of ASCII Characters that are valid. + * @ascii_id_ofst: This is the offset from DWORD 0/ Byte 0 of the start of the + * ASCII table to the ASCII data for this identifier + * @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; +}; + +/* 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); + + +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; +} + +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; +} + +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); +} + +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; + 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; +} + +static int ocp_telemetry_str_log_format(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + struct nvme_dev *dev; + int ret = 0; + const char *desc = "Retrieve telemetry string log format"; + + struct config { + char *output_format; + }; + + struct config cfg = { + .output_format = "normal", + }; + + 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 = 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); + + return ret; +} + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/// Misc static int clear_fw_update_history(int argc, char **argv, struct command *cmd, struct plugin *plugin) @@ -1980,14 +2958,10 @@ static int smart_add_log(int argc, char **argv, struct command *cmd, return ocp_smart_add_log(argc, argv, cmd, plugin); } -static int clear_pcie_corectable_error_counters(int argc, char **argv, - struct command *cmd, +static int clear_pcie_correctable_error_counters(int argc, char **argv, struct command *cmd, struct plugin *plugin) { - const char *desc = "OCP Clear PCIe Correctable Error Counters"; - - return ocp_clear_feature(argc, argv, desc, - OCP_FID_CLEAR_PCIE_CORRECTABLE_ERROR_COUNTERS); + return ocp_clear_pcie_correctable_errors(argc, argv, cmd, plugin); } static int fw_activation_history_log(int argc, char **argv, struct command *cmd, diff --git a/plugins/ocp/ocp-nvme.h b/plugins/ocp/ocp-nvme.h index dda4ffe..95539b0 100644 --- a/plugins/ocp/ocp-nvme.h +++ b/plugins/ocp/ocp-nvme.h @@ -21,12 +21,15 @@ PLUGIN(NAME("ocp", "OCP cloud SSD extensions", NVME_VERSION), ENTRY("internal-log", "Retrieve and save internal device telemetry log", ocp_telemetry_log) ENTRY("clear-fw-activate-history", "Clear firmware update history log", clear_fw_update_history) ENTRY("eol-plp-failure-mode", "Define EOL or PLP circuitry failure mode.", eol_plp_failure_mode) - ENTRY("clear-pcie-correctable-error-counters", "Clear PCIe correctable error counters", clear_pcie_corectable_error_counters) + ENTRY("clear-pcie-correctable-errors", "Clear PCIe correctable error counters", clear_pcie_correctable_error_counters) ENTRY("fw-activate-history", "Get firmware activation history log", fw_activation_history_log) ENTRY("unsupported-reqs-log", "Get Unsupported Requirements Log Page", ocp_unsupported_requirements_log) ENTRY("error-recovery-log", "Retrieve Error Recovery Log Page", ocp_error_recovery_log) ENTRY("device-capability-log", "Get Device capabilities Requirements Log Page", ocp_device_capabilities_log) ENTRY("set-dssd-power-state-feature", "Get Device capabilities Requirements Log Page", set_dssd_power_state_feature) + 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) ) ); diff --git a/plugins/ocp/ocp-smart-extended-log.c b/plugins/ocp/ocp-smart-extended-log.c index c989d34..0d8ba81 100644 --- a/plugins/ocp/ocp-smart-extended-log.c +++ b/plugins/ocp/ocp-smart-extended-log.c @@ -252,15 +252,15 @@ static void ocp_print_C0_log_json(void *data) static int get_c0_log_page(int fd, char *format) { + enum nvme_print_flags fmt; __u8 *data; int i; - int ret = 0; - int fmt = -1; + int ret; - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR : OCP : invalid output format\n"); - return fmt; + return ret; } data = malloc(sizeof(__u8) * C0_SMART_CLOUD_ATTR_LEN); @@ -307,6 +307,8 @@ static int get_c0_log_page(int fd, char *format) case JSON: ocp_print_C0_log_json(data); break; + default: + break; } } else { fprintf(stderr, "ERROR : OCP : Unable to read C0 data from buffer\n"); diff --git a/plugins/ocp/ocp-utils.c b/plugins/ocp/ocp-utils.c index a37a58c..1257b30 100644 --- a/plugins/ocp/ocp-utils.c +++ b/plugins/ocp/ocp-utils.c @@ -30,66 +30,3 @@ int ocp_get_uuid_index(struct nvme_dev *dev, int *index) } return err; } - -int ocp_clear_feature(int argc, char **argv, const char *desc, const __u8 fid) -{ - __u32 result = 0; - __u32 clear = 1 << 31; - struct nvme_dev *dev; - int uuid_index = 0; - bool uuid = true; - int err; - - OPT_ARGS(opts) = { - 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 (opts[0].seen) - uuid = false; - - if (uuid) { - /* OCP 2.0 requires UUID index support */ - err = ocp_get_uuid_index(dev, &uuid_index); - if (err || !uuid_index) { - fprintf(stderr, "ERROR: No OCP UUID index found\n"); - goto close_dev; - } - } - - struct nvme_set_features_args args = { - .result = &result, - .data = NULL, - .args_size = sizeof(args), - .fd = dev_fd(dev), - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .nsid = 0, - .cdw11 = clear, - .cdw12 = 0, - .cdw13 = 0, - .cdw15 = 0, - .data_len = 0, - .save = 0, - .uuidx = uuid_index, - .fid = fid, - }; - - err = nvme_set_features(&args); - - if (err == 0) - printf("Success : %s\n", desc); - else if (err > 0) - nvme_show_status(err); - else - printf("Fail : %s\n", desc); -close_dev: - /* Redundant close() to make static code analysis happy */ - close(dev->direct.fd); - dev_close(dev); - return err; -} diff --git a/plugins/ocp/ocp-utils.h b/plugins/ocp/ocp-utils.h index a962169..d02bea9 100644 --- a/plugins/ocp/ocp-utils.h +++ b/plugins/ocp/ocp-utils.h @@ -10,11 +10,9 @@ /** * ocp_get_uuid_index() - Get OCP UUID index * @dev: nvme device - * @index: integer ponter to here to save the index + * @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. */ int ocp_get_uuid_index(struct nvme_dev *dev, int *index); - -int ocp_clear_feature(int argc, char **argv, const char *desc, const __u8 fid); diff --git a/plugins/scaleflux/sfx-nvme.c b/plugins/scaleflux/sfx-nvme.c index e7f3b99..f752d5d 100644 --- a/plugins/scaleflux/sfx-nvme.c +++ b/plugins/scaleflux/sfx-nvme.c @@ -21,6 +21,7 @@ #include "linux/types.h" #include "nvme-wrap.h" #include "nvme-print.h" +#include "util/cleanup.h" #define CREATE_CMD #include "sfx-nvme.h" @@ -881,7 +882,7 @@ static int change_sanity_check(int fd, __u64 trg_in_4k, int *shrink) if (trg_in_4k < provisoned_cap_4k || trg_in_4k > ((__u64)provisoned_cap_4k * 4)) { fprintf(stderr, - "WARNING: Only support 1.0~4.0 x provisoned capacity!\n"); + "WARNING: Only support 1.0~4.0 x provisioned capacity!\n"); if (trg_in_4k < provisoned_cap_4k) fprintf(stderr, "WARNING: The target capacity is less than 1.0 x provisioned capacity!\n"); @@ -924,7 +925,7 @@ static int change_sanity_check(int fd, __u64 trg_in_4k, int *shrink) * * @param str, prompt string * - * @return 0, cancled; 1 confirmed + * @return 0, canceled; 1 confirmed */ static int sfx_confirm_change(const char *str) { @@ -936,7 +937,7 @@ static int sfx_confirm_change(const char *str) fprintf(stderr, "Confirm Y/y, Others cancel:\n"); confirm = (unsigned char)fgetc(stdin); if (confirm != 'y' && confirm != 'Y') { - fprintf(stderr, "Cancled.\n"); + fprintf(stderr, "Canceled.\n"); return 0; } fprintf(stderr, "Sending operation ...\n"); @@ -1349,12 +1350,12 @@ static int nvme_dump_evtlog(struct nvme_dev *dev, __u32 namespace_id, __u32 stor { struct nvme_persistent_event_log *pevent; void *pevent_log_info; + _cleanup_huge_ struct nvme_mem_huge mh = { 0, }; __u8 lsp_base; __u32 offset = 0; __u32 length = 0; __u32 log_len; __u32 single_len; - bool huge; int err = 0; FILE *fd = NULL; struct nvme_get_log_args args = { @@ -1410,7 +1411,7 @@ static int nvme_dump_evtlog(struct nvme_dev *dev, __u32 namespace_id, __u32 stor if (log_len % 4) log_len = (log_len / 4 + 1) * 4; - pevent_log_info = nvme_alloc_huge(single_len, &huge); + pevent_log_info = nvme_alloc_huge(single_len, &mh); if (!pevent_log_info) { err = -ENOMEM; goto free_pevent; @@ -1420,7 +1421,7 @@ static int nvme_dump_evtlog(struct nvme_dev *dev, __u32 namespace_id, __u32 stor if (!fd) { fprintf(stderr, "Failed to open %s file to write\n", file); err = ENOENT; - goto free; + goto free_pevent; } args.lsp = lsp_base + NVME_PEVENT_LOG_READ; @@ -1453,8 +1454,8 @@ static int nvme_dump_evtlog(struct nvme_dev *dev, __u32 namespace_id, __u32 stor printf("\nDump-evtlog: Success\n"); if (parse) { - nvme_free_huge(pevent_log_info, huge); - pevent_log_info = nvme_alloc_huge(log_len, &huge); + nvme_free_huge(&mh); + pevent_log_info = nvme_alloc_huge(log_len, &mh); if (!pevent_log_info) { fprintf(stderr, "Failed to alloc enough memory 0x%x to parse evtlog\n", log_len); err = -ENOMEM; @@ -1466,7 +1467,7 @@ static int nvme_dump_evtlog(struct nvme_dev *dev, __u32 namespace_id, __u32 stor if (!fd) { fprintf(stderr, "Failed to open %s file to read\n", file); err = ENOENT; - goto free; + goto free_pevent; } if (fread(pevent_log_info, 1, log_len, fd) != log_len) { fprintf(stderr, "Failed to read evtlog to buffer\n"); @@ -1478,8 +1479,6 @@ static int nvme_dump_evtlog(struct nvme_dev *dev, __u32 namespace_id, __u32 stor close_fd: fclose(fd); -free: - nvme_free_huge(pevent_log_info, huge); free_pevent: free(pevent); ret: diff --git a/plugins/seagate/seagate-nvme.c b/plugins/seagate/seagate-nvme.c index 0f4f59d..887e5bc 100644 --- a/plugins/seagate/seagate-nvme.c +++ b/plugins/seagate/seagate-nvme.c @@ -926,7 +926,7 @@ static int vs_smart_log(int argc, char **argv, struct command *cmd, struct plugi /** * Here we should identify if the drive is a Panthor or Jaguar. * Here we need to extract the model no from ctrl-id abd use it - * to deternine drive family. + * to determine drive family. */ err = nvme_identify_ctrl(dev_fd(dev), &ctrl); @@ -1299,7 +1299,7 @@ static void print_stx_vs_fw_activate_history(stx_fw_activ_history_log_page fwAct char buf[80]; if (fwActivHis.numValidFwActHisEnt > 0) { - printf("\n\nSeagate FW Activation Histry :\n"); + printf("\n\nSeagate FW Activation History :\n"); printf("%-9s %-21s %-7s %-13s %-9s %-5s %-15s %-9s\n", "Counter ", " Timestamp ", " PCC ", "Previous FW ", "New FW ", "Slot", "Commit Action", "Result"); for (i = 0; i < fwActivHis.numValidFwActHisEnt; i++) { @@ -1406,7 +1406,7 @@ static int stx_vs_fw_activate_history(int argc, char **argv, struct command *cmd } if (strcmp(cfg.output_format, "json")) - printf("Seagate FW Activation Histry Information :\n"); + printf("Seagate FW Activation History Information :\n"); err = nvme_get_log_simple(dev_fd(dev), 0xC2, sizeof(fwActivHis), &fwActivHis); if (!err) { diff --git a/plugins/solidigm/meson.build b/plugins/solidigm/meson.build index 84495a1..052afa1 100644 --- a/plugins/solidigm/meson.build +++ b/plugins/solidigm/meson.build @@ -8,6 +8,9 @@ sources += [ 'plugins/solidigm/solidigm-telemetry.c', 'plugins/solidigm/solidigm-internal-logs.c', 'plugins/solidigm/solidigm-market-log.c', + 'plugins/solidigm/solidigm-temp-stats.c', + 'plugins/solidigm/solidigm-get-drive-info.c', + 'plugins/solidigm/solidigm-ocp-version.c', ] subdir('solidigm-telemetry') diff --git a/plugins/solidigm/solidigm-garbage-collection.c b/plugins/solidigm/solidigm-garbage-collection.c index b26d754..a37e9c5 100644 --- a/plugins/solidigm/solidigm-garbage-collection.c +++ b/plugins/solidigm/solidigm-garbage-collection.c @@ -68,6 +68,7 @@ static void vu_gc_log_show(struct garbage_control_collection_log *payload, const int solidigm_get_garbage_collection_log(int argc, char **argv, struct command *cmd, struct plugin *plugin) { const char *desc = "Get and parse Solidigm vendor specific garbage collection event log."; + enum nvme_print_flags flags; struct nvme_dev *dev; int err; __u8 uuid_index; @@ -89,9 +90,8 @@ int solidigm_get_garbage_collection_log(int argc, char **argv, struct command *c if (err) return err; - enum nvme_print_flags flags = validate_output_format(cfg.output_format); - - if (flags == -EINVAL) { + err = validate_output_format(cfg.output_format, &flags); + if (err) { fprintf(stderr, "Invalid output format '%s'\n", cfg.output_format); dev_close(dev); return -EINVAL; diff --git a/plugins/solidigm/solidigm-get-drive-info.c b/plugins/solidigm/solidigm-get-drive-info.c new file mode 100644 index 0000000..21f59bb --- /dev/null +++ b/plugins/solidigm/solidigm-get-drive-info.c @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2023 Solidigm. + * + * Authors: leonardo.da.cunha@solidigm.com + */ + +#include +#include "nvme-print.h" +#include "nvme-wrap.h" +#include "common.h" + +int sldgm_get_drive_info(int argc, char **argv, struct command *cmd, struct plugin *plugin) +{ + _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; + const char *desc = "Get drive HW information"; + const char *FTL_unit_size_str = "FTL_unit_size"; + char *output_format = "normal"; + enum nvme_print_flags flags; + nvme_root_t r; + nvme_ctrl_t c; + nvme_ns_t n; + struct nvme_id_ns ns = { 0 }; + __u8 flbaf_inUse; + __u16 lba_size; + __u16 ftl_unit_size; + int err; + + OPT_ARGS(opts) = { + OPT_FMT("output-format", 'o', &output_format, "normal|json"), + OPT_END() + }; + + err = parse_and_open(&dev, argc, argv, desc, opts); + if (err) + return err; + + err = validate_output_format(output_format, &flags); + if ((err < 0) || !(flags == NORMAL || flags == JSON)) { + nvme_show_error("Invalid output format"); + return err; + } + + r = nvme_scan(NULL); + c = nvme_scan_ctrl(r, dev->name); + n = c ? nvme_ctrl_first_ns(c) : nvme_scan_namespace(dev->name); + if (!n) { + nvme_show_error("solidigm-vs-drive-info: drive missing namespace"); + return -EINVAL; + } + + err = nvme_ns_identify(n, &ns); + if (err) { + nvme_show_error("identify namespace: %s", nvme_strerror(errno)); + return err; + } + + if (!(ns.nsfeat & 0x10)) { + nvme_show_error("solidigm-vs-drive-info: performance options not available"); + return -EINVAL; + } + + nvme_id_ns_flbas_to_lbaf_inuse(ns.flbas, &flbaf_inUse); + lba_size = 1 << ns.lbaf[flbaf_inUse].ds; + ftl_unit_size = (le16_to_cpu(ns.npwg) + 1) * lba_size / 1024; + + if (flags == JSON) { + struct json_object *root = json_create_object(); + + json_object_add_value_int(root, FTL_unit_size_str, ftl_unit_size); + json_print_object(root, NULL); + printf("\n"); + json_free_object(root); + } else { + printf("%s: %d\n", FTL_unit_size_str, ftl_unit_size); + } + + return err; +} diff --git a/plugins/solidigm/solidigm-util.h b/plugins/solidigm/solidigm-get-drive-info.h similarity index 58% copy from plugins/solidigm/solidigm-util.h copy to plugins/solidigm/solidigm-get-drive-info.h index 3a18501..ffc1bd2 100644 --- a/plugins/solidigm/solidigm-util.h +++ b/plugins/solidigm/solidigm-get-drive-info.h @@ -5,6 +5,4 @@ * Author: leonardo.da.cunha@solidigm.com */ -#include "nvme.h" - -__u8 solidigm_get_vu_uuid_index(struct nvme_dev *dev); +int sldgm_get_drive_info(int argc, char **argv, struct command *cmd, struct plugin *plugin); diff --git a/plugins/solidigm/solidigm-internal-logs.c b/plugins/solidigm/solidigm-internal-logs.c index 4730443..236652a 100644 --- a/plugins/solidigm/solidigm-internal-logs.c +++ b/plugins/solidigm/solidigm-internal-logs.c @@ -19,6 +19,7 @@ #include "libnvme.h" #include "plugin.h" #include "nvme-print.h" +#include "solidigm-util.h" #define DWORD_SIZE 4 @@ -427,7 +428,8 @@ static int dump_telemetry(struct nvme_dev *dev, struct config cfg, enum telemetr int err = 0, output; __u8 *buffer = NULL; size_t bytes_remaining = 0; - int data_area = NVME_TELEMETRY_DA_3; + enum nvme_telemetry_da da; + size_t max_data_tx; char file_path[PATH_MAX]; char *log_name; @@ -444,6 +446,12 @@ static int dump_telemetry(struct nvme_dev *dev, struct config cfg, enum telemetr default: return -EINVAL; } + err = nvme_get_telemetry_max(dev_fd(dev), &da, &max_data_tx); + if (err) + return err; + + if (max_data_tx > DRIVER_MAX_TX_256K) + max_data_tx = DRIVER_MAX_TX_256K; sprintf(file_path, "%s_%s.bin", cfg.file_prefix, log_name); output = open(file_path, O_WRONLY | O_CREAT | O_TRUNC, 0644); @@ -452,16 +460,16 @@ static int dump_telemetry(struct nvme_dev *dev, struct config cfg, enum telemetr switch (ttype) { case HOSTGENNEW: - err = nvme_get_new_host_telemetry(dev_fd(dev), &log, - data_area, &log_size); + err = nvme_get_telemetry_log(dev_fd(dev), true, false, false, max_data_tx, da, + &log, &log_size); break; case HOSTGENOLD: - err = nvme_get_host_telemetry(dev_fd(dev), &log, - data_area, &log_size); + err = nvme_get_telemetry_log(dev_fd(dev), false, false, false, max_data_tx, da, + &log, &log_size); break; case CONTROLLER: - err = nvme_get_ctrl_telemetry(dev_fd(dev), true, &log, - data_area, &log_size); + err = nvme_get_telemetry_log(dev_fd(dev), false, true, true, max_data_tx, da, &log, + &log_size); break; } @@ -546,42 +554,42 @@ int solidigm_get_internal_log(int argc, char **argv, struct command *command, if (err == 0) log_count++; else if (err < 0) - perror("Assert log"); + perror("Error retrieving Assert log"); } if (all || !strcmp(cfg.type, "EVENT")) { err = dump_event_logs(dev, cfg); if (err == 0) log_count++; else if (err < 0) - perror("Eventt log"); + perror("Error retrieving Event log"); } if (all || !strcmp(cfg.type, "NLOG")) { err = dump_nlogs(dev, cfg, -1); if (err == 0) log_count++; else if (err < 0) - perror("Nlog"); + perror("Error retrieving Nlog"); } if (all || !strcmp(cfg.type, "CONTROLLERINITTELEMETRY")) { err = dump_telemetry(dev, cfg, CONTROLLER); if (err == 0) log_count++; else if (err < 0) - perror("Telemetry Controller Initated"); + perror("Error retrieving Telemetry Controller Initiated"); } if (all || !strcmp(cfg.type, "HOSTINITTELEMETRYNOGEN")) { err = dump_telemetry(dev, cfg, HOSTGENOLD); if (err == 0) log_count++; else if (err < 0) - perror("Previously existing Telemetry Host Initated"); + perror("Error retrieving previously existing Telemetry Host Initiated"); } if (all || !strcmp(cfg.type, "HOSTINITTELEMETRY")) { err = dump_telemetry(dev, cfg, HOSTGENNEW); if (err == 0) log_count++; else if (err < 0) - perror("Telemetry Host Initated"); + perror("Error retrieving Telemetry Host Initiated"); } if (log_count == 0) { diff --git a/plugins/solidigm/solidigm-latency-tracking.c b/plugins/solidigm/solidigm-latency-tracking.c index 481a831..66f3c56 100644 --- a/plugins/solidigm/solidigm-latency-tracking.c +++ b/plugins/solidigm/solidigm-latency-tracking.c @@ -411,8 +411,8 @@ int solidigm_get_latency_tracking_log(int argc, char **argv, struct command *cmd lt.fd = dev_fd(dev); - lt.print_flags = validate_output_format(lt.cfg.output_format); - if (lt.print_flags == -EINVAL) { + err = validate_output_format(lt.cfg.output_format, <.print_flags); + if (err < 0) { fprintf(stderr, "Invalid output format '%s'\n", lt.cfg.output_format); dev_close(dev); return -EINVAL; diff --git a/plugins/solidigm/solidigm-log-page-dir.c b/plugins/solidigm/solidigm-log-page-dir.c index 111a433..bf272f8 100644 --- a/plugins/solidigm/solidigm-log-page-dir.c +++ b/plugins/solidigm/solidigm-log-page-dir.c @@ -100,38 +100,13 @@ static struct lid_dir *get_standard_lids(struct nvme_supported_log_pages *suppor static struct lid_dir standard_dir = { 0 }; init_lid_dir(&standard_dir); - standard_dir.lid[0x00].str = "Supported Log Pages"; - standard_dir.lid[0x01].str = "Error Information"; - standard_dir.lid[0x02].str = "SMART / Health Information"; - standard_dir.lid[0x03].str = "Firmware Slot Information"; - standard_dir.lid[0x04].str = "Changed Namespace List"; - standard_dir.lid[0x05].str = "Commands Supported and Effects"; - standard_dir.lid[0x06].str = "Device Self Test"; - standard_dir.lid[0x07].str = "Telemetry Host-Initiated"; - standard_dir.lid[0x08].str = "Telemetry Controller-Initiated"; - standard_dir.lid[0x09].str = "Endurance Group Information"; - standard_dir.lid[0x0A].str = "Predictable Latency Per NVM Set"; - standard_dir.lid[0x0B].str = "Predictable Latency Event Aggregate"; - standard_dir.lid[0x0C].str = "Asymmetric Namespace Access"; - standard_dir.lid[0x0D].str = "Persistent Event Log"; - standard_dir.lid[0x0E].str = "Predictable Latency Event Aggregate"; - standard_dir.lid[0x0F].str = "Endurance Group Event Aggregate"; - standard_dir.lid[0x10].str = "Media Unit Status"; - standard_dir.lid[0x11].str = "Supported Capacity Configuration List"; - standard_dir.lid[0x12].str = "Feature Identifiers Supported and Effects"; - standard_dir.lid[0x13].str = "NVMe-MI Commands Supported and Effects"; - standard_dir.lid[0x14].str = "Command and Feature lockdown"; - standard_dir.lid[0x15].str = "Boot Partition"; - standard_dir.lid[0x16].str = "Rotational Media Information"; - standard_dir.lid[0x70].str = "Discovery"; - standard_dir.lid[0x80].str = "Reservation Notification"; - standard_dir.lid[0x81].str = "Sanitize Status"; for (int lid = 0; lid < NVME_LOG_SUPPORTED_LOG_PAGES_MAX; lid++) { if (!supported->lid_support[lid] || lid >= MIN_VENDOR_LID) continue; standard_dir.lid[lid].supported = true; + standard_dir.lid[lid].str = nvme_log_to_string(lid); } return &standard_dir; @@ -158,6 +133,14 @@ static struct lid_dir *get_solidigm_lids(struct nvme_supported_log_pages *suppor 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[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"; + solidigm_dir.lid[0xF6].str = "Vt Histo Get Log Page"; + solidigm_dir.lid[0xF9].str = "Workload Tracker Get Log Page"; + solidigm_dir.lid[0xFD].str = "Garbage Control Collection Log Page"; + solidigm_dir.lid[0xFE].str = "Latency Outlier Log Page"; update_vendor_lid_supported(supported, &solidigm_dir); @@ -281,15 +264,18 @@ int solidigm_get_log_page_directory_log(int argc, char **argv, struct command *c } if (!err) { - const enum nvme_print_flags print_flag = validate_output_format(format); + enum nvme_print_flags print_flag; + + err = validate_output_format(format, &print_flag); + if (err < 0) { + fprintf(stderr, "Error: Invalid output format specified: %s.\n", format); + return err; + } if (print_flag == NORMAL) { supported_log_pages_normal(lid_dirs); } else if (print_flag == JSON) { supported_log_pages_json(lid_dirs); - } else { - fprintf(stderr, "Error: Invalid output format specified: %s.\n", format); - err = -EINVAL; } } diff --git a/plugins/solidigm/solidigm-nvme.c b/plugins/solidigm/solidigm-nvme.c index b0db1ea..3fb86f5 100644 --- a/plugins/solidigm/solidigm-nvme.c +++ b/plugins/solidigm/solidigm-nvme.c @@ -18,8 +18,11 @@ #include "solidigm-telemetry.h" #include "solidigm-log-page-dir.h" #include "solidigm-market-log.h" +#include "solidigm-temp-stats.h" +#include "solidigm-get-drive-info.h" +#include "solidigm-ocp-version.h" -#include "plugins/ocp/ocp-clear-fw-update-history.h" +#include "plugins/ocp/ocp-clear-features.h" #include "plugins/ocp/ocp-smart-extended-log.h" #include "plugins/ocp/ocp-fw-activation-history.h" @@ -59,6 +62,12 @@ static int clear_fw_update_history(int argc, char **argv, struct command *cmd, return ocp_clear_fw_update_history(argc, argv, cmd, plugin); } +static int clear_pcie_correctable_error_counters(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + return ocp_clear_pcie_correctable_errors(argc, argv, cmd, plugin); +} + static int smart_cloud(int argc, char **argv, struct command *cmd, struct plugin *plugin) { @@ -82,3 +91,19 @@ static int get_market_log(int argc, char **argv, struct command *cmd, { return sldgm_get_market_log(argc, argv, cmd, plugin); } + +static int get_temp_stats_log(int argc, char **argv, struct command *cmd, struct plugin *plugin) +{ + return sldgm_get_temp_stats_log(argc, argv, cmd, plugin); +} + +static int get_drive_info(int argc, char **argv, struct command *cmd, struct plugin *plugin) +{ + return sldgm_get_drive_info(argc, argv, cmd, plugin); +} + +static int get_cloud_SSDplugin_version(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + return sldgm_ocp_version(argc, argv, cmd, plugin); +} diff --git a/plugins/solidigm/solidigm-nvme.h b/plugins/solidigm/solidigm-nvme.h index 69b63e5..a984a38 100644 --- a/plugins/solidigm/solidigm-nvme.h +++ b/plugins/solidigm/solidigm-nvme.h @@ -13,7 +13,7 @@ #include "cmd.h" -#define SOLIDIGM_PLUGIN_VERSION "0.14" +#define SOLIDIGM_PLUGIN_VERSION "1.0" PLUGIN(NAME("solidigm", "Solidigm vendor specific extensions", SOLIDIGM_PLUGIN_VERSION), COMMAND_LIST( @@ -25,9 +25,13 @@ PLUGIN(NAME("solidigm", "Solidigm vendor specific extensions", SOLIDIGM_PLUGIN_V ENTRY("market-log", "Retrieve Market Log", get_market_log) ENTRY("latency-tracking-log", "Enable/Retrieve Latency tracking Log", get_latency_tracking_log) ENTRY("parse-telemetry-log", "Parse Telemetry Log binary", get_telemetry_log) + ENTRY("clear-pcie-correctable-errors ", "Clear PCIe Correctable Error Counters (redirects to ocp plug-in)", clear_pcie_correctable_error_counters) ENTRY("clear-fw-activate-history", "Clear firmware update history log (redirects to ocp plug-in)", clear_fw_update_history) ENTRY("vs-fw-activate-history", "Get firmware activation history log (redirects to ocp plug-in)", fw_activation_history) ENTRY("log-page-directory", "Retrieve log page directory", get_log_page_directory_log) + ENTRY("temp-stats", "Retrieve Temperature Statistics log", get_temp_stats_log) + ENTRY("vs-drive-info", "Retrieve drive information", get_drive_info) + ENTRY("cloud-SSDplugin-version", "Prints plug-in OCP version", get_cloud_SSDplugin_version) ) ); diff --git a/plugins/solidigm/solidigm-ocp-version.c b/plugins/solidigm/solidigm-ocp-version.c new file mode 100644 index 0000000..4048cc1 --- /dev/null +++ b/plugins/solidigm/solidigm-ocp-version.c @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2023 Solidigm. + * + * Author: leonardo.da.cunha@solidigm.com + */ + +#include +#include "nvme.h" + +int sldgm_ocp_version(int argc, char **argv, struct command *cmd, struct plugin *plugin) +{ + const char *desc = "Prints OCP extensions version of Solidigm plugin"; + + OPT_ARGS(opts) = { + OPT_END() + }; + + int err = argconfig_parse(argc, argv, desc, opts); + + if (!err) + printf("1.0\n"); + + return err; +} diff --git a/plugins/solidigm/solidigm-util.h b/plugins/solidigm/solidigm-ocp-version.h similarity index 59% copy from plugins/solidigm/solidigm-util.h copy to plugins/solidigm/solidigm-ocp-version.h index 3a18501..d79452c 100644 --- a/plugins/solidigm/solidigm-util.h +++ b/plugins/solidigm/solidigm-ocp-version.h @@ -5,6 +5,4 @@ * Author: leonardo.da.cunha@solidigm.com */ -#include "nvme.h" - -__u8 solidigm_get_vu_uuid_index(struct nvme_dev *dev); +int sldgm_ocp_version(int argc, char **argv, struct command *cmd, struct plugin *plugin); diff --git a/plugins/solidigm/solidigm-smart.c b/plugins/solidigm/solidigm-smart.c index e3d468a..62245fa 100644 --- a/plugins/solidigm/solidigm-smart.c +++ b/plugins/solidigm/solidigm-smart.c @@ -69,15 +69,17 @@ static char *id_to_name(__u8 id) case 0xE2: return "media_wear_percentage"; case 0xE3: - return "host_reads"; + return "timed_work_load_host_reads"; case 0xE4: - return "timed_work_load"; + return "timed_work_load_timer"; case 0xE5: return "read_commands_in_flight_counter"; case 0xE6: return "write_commands_in_flight_counter"; case 0xEA: return "thermal_throttle_status"; + case 0xEE: + return "re_sku_count"; case 0xF0: return "retry_buffer_overflow_counter"; case 0xF3: @@ -220,11 +222,11 @@ int solidigm_get_additional_smart_log(int argc, char **argv, struct command *cmd if (err) return err; - flags = validate_output_format(cfg.output_format); - if (flags == -EINVAL) { + err = validate_output_format(cfg.output_format, &flags); + if (err < 0) { fprintf(stderr, "Invalid output format '%s'\n", cfg.output_format); dev_close(dev); - return flags; + return err; } uuid_index = solidigm_get_vu_uuid_index(dev); diff --git a/plugins/solidigm/solidigm-telemetry.c b/plugins/solidigm/solidigm-telemetry.c index 472284a..2bebccc 100644 --- a/plugins/solidigm/solidigm-telemetry.c +++ b/plugins/solidigm/solidigm-telemetry.c @@ -22,6 +22,7 @@ #include "solidigm-telemetry/header.h" #include "solidigm-telemetry/config.h" #include "solidigm-telemetry/data-area.h" +#include "solidigm-util.h" static int read_file2buffer(char *file_name, char **buffer, size_t *length) { @@ -71,7 +72,7 @@ int solidigm_get_telemetry_log(int argc, char **argv, struct command *cmd, struc struct config cfg = { .host_gen = 1, .ctrl_init = false, - .data_area = 3, + .data_area = -1, .cfg_file = NULL, .is_input_file = false, }; @@ -90,6 +91,10 @@ int solidigm_get_telemetry_log(int argc, char **argv, struct command *cmd, struc if (err) goto ret; + /* When not selected on the command line, get minimum data area required */ + if (cfg.data_area == -1) + cfg.data_area = cfg.cfg_file ? 3 : 1; + if (cfg.is_input_file) { if (optind >= argc) { err = errno = EINVAL; @@ -138,19 +143,23 @@ int solidigm_get_telemetry_log(int argc, char **argv, struct command *cmd, struc } if (!cfg.is_input_file) { - if (cfg.ctrl_init) - err = nvme_get_ctrl_telemetry(dev_fd(dev), true, - &tl.log, cfg.data_area, - &tl.log_size); - else if (cfg.host_gen) - err = nvme_get_new_host_telemetry(dev_fd(dev), &tl.log, - cfg.data_area, - &tl.log_size); - else - err = nvme_get_host_telemetry(dev_fd(dev), &tl.log, - cfg.data_area, - &tl.log_size); + size_t max_data_tx; + err = nvme_get_telemetry_max(dev_fd(dev), NULL, &max_data_tx); + if (err < 0) { + SOLIDIGM_LOG_WARNING("identify_ctrl: %s", + nvme_strerror(errno)); + goto close_fd; + } else if (err > 0) { + nvme_show_status(err); + SOLIDIGM_LOG_WARNING("Failed to acquire identify ctrl %d!", err); + goto close_fd; + } + if (max_data_tx > DRIVER_MAX_TX_256K) + max_data_tx = DRIVER_MAX_TX_256K; + + err = nvme_get_telemetry_log(dev_fd(dev), cfg.host_gen, cfg.ctrl_init, true, + max_data_tx, cfg.data_area, &tl.log, &tl.log_size); if (err < 0) { SOLIDIGM_LOG_WARNING("get-telemetry-log: %s", nvme_strerror(errno)); diff --git a/plugins/solidigm/solidigm-telemetry/config.c b/plugins/solidigm/solidigm-telemetry/config.c index cc2a8bb..eceeede 100644 --- a/plugins/solidigm/solidigm-telemetry/config.c +++ b/plugins/solidigm/solidigm-telemetry/config.c @@ -9,7 +9,7 @@ #include #include "config.h" -// max 16 bit unsigned integer nummber 65535 +// max 16 bit unsigned integer number 65535 #define MAX_16BIT_NUM_AS_STRING_SIZE 6 #define OBJ_NAME_PREFIX "UID_" diff --git a/plugins/solidigm/solidigm-telemetry/data-area.c b/plugins/solidigm/solidigm-telemetry/data-area.c index 0cfa56c..14d612b 100644 --- a/plugins/solidigm/solidigm-telemetry/data-area.c +++ b/plugins/solidigm/solidigm-telemetry/data-area.c @@ -57,7 +57,7 @@ static bool telemetry_log_get_value(const struct telemetry_log *tl, char err_msg[MAX_WARNING_SIZE]; snprintf(err_msg, MAX_WARNING_SIZE, - "Value crossing 64 bit, byte aligned bounday, not supported. size_bit=%u, offset_bit_from_byte=%u.", + "Value crossing 64 bit, byte aligned boundary, not supported. size_bit=%u, offset_bit_from_byte=%u.", size_bit, offset_bit_from_byte); *val_obj = json_object_new_string(err_msg); diff --git a/plugins/solidigm/solidigm-temp-stats.c b/plugins/solidigm/solidigm-temp-stats.c new file mode 100644 index 0000000..85a3c37 --- /dev/null +++ b/plugins/solidigm/solidigm-temp-stats.c @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2023 Solidigm. + * + * Author: leonardo.da.cunha@solidigm.com + */ + +#include + +#include "common.h" +#include "nvme-print.h" +#include "solidigm-util.h" + +#define SLDGM_TEMP_STATS_LID 0xC5 + +struct temp_stats { + __le64 curr; + __le64 last_overtemp; + __le64 life_overtemp; + __le64 highest_temp; + __le64 lowest_temp; + __u8 rsvd[40]; + __le64 max_operating_temp; + __le64 min_operating_temp; + __le64 est_offset; +}; + +static void show_temp_stats(struct temp_stats *stats) +{ + printf("Current temperature : %"PRIu64"\n", le64_to_cpu(stats->curr)); + printf("Last critical overtemp flag : %"PRIu64"\n", le64_to_cpu(stats->last_overtemp)); + printf("Life critical overtemp flag : %"PRIu64"\n", le64_to_cpu(stats->life_overtemp)); + printf("Highest temperature : %"PRIu64"\n", le64_to_cpu(stats->highest_temp)); + printf("Lowest temperature : %"PRIu64"\n", le64_to_cpu(stats->lowest_temp)); + printf("Max operating temperature : %"PRIu64"\n", le64_to_cpu(stats->max_operating_temp)); + printf("Min operating temperature : %"PRIu64"\n", le64_to_cpu(stats->min_operating_temp)); + printf("Estimated offset : %"PRIu64"\n", le64_to_cpu(stats->est_offset)); +} + +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; + __u8 uuid_idx; + int err; + + const char *desc = "Get/show Temperature Statistics log."; + const char *raw = "dump output in binary format"; + struct config { + bool raw_binary; + }; + + struct config cfg = { + .raw_binary = false, + }; + + OPT_ARGS(opts) = { + OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw), + OPT_END() + }; + + err = parse_and_open(&dev, argc, argv, desc, opts); + if (err) + return err; + + uuid_idx = solidigm_get_vu_uuid_index(dev); + + struct nvme_get_log_args args = { + .lpo = 0, + .result = NULL, + .log = buffer, + .args_size = sizeof(args), + .fd = dev_fd(dev), + .uuidx = uuid_idx, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .lid = SLDGM_TEMP_STATS_LID, + .len = sizeof(buffer), + .nsid = NVME_NSID_ALL, + .csi = NVME_CSI_NVM, + .lsi = NVME_LOG_LSI_NONE, + .lsp = NVME_LOG_LSP_NONE, + .rae = false, + .ot = false, + }; + + 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 (!cfg.raw_binary) + show_temp_stats((struct temp_stats *) buffer); + else + d_raw(buffer, sizeof(struct temp_stats)); + } 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.h b/plugins/solidigm/solidigm-temp-stats.h similarity index 57% copy from plugins/solidigm/solidigm-util.h copy to plugins/solidigm/solidigm-temp-stats.h index 3a18501..58d5a86 100644 --- a/plugins/solidigm/solidigm-util.h +++ b/plugins/solidigm/solidigm-temp-stats.h @@ -5,6 +5,4 @@ * Author: leonardo.da.cunha@solidigm.com */ -#include "nvme.h" - -__u8 solidigm_get_vu_uuid_index(struct nvme_dev *dev); +int sldgm_get_temp_stats_log(int argc, char **argv, struct command *cmd, struct plugin *plugin); diff --git a/plugins/solidigm/solidigm-util.h b/plugins/solidigm/solidigm-util.h index 3a18501..fa5032f 100644 --- a/plugins/solidigm/solidigm-util.h +++ b/plugins/solidigm/solidigm-util.h @@ -7,4 +7,6 @@ #include "nvme.h" +#define DRIVER_MAX_TX_256K (256 * 1024) + __u8 solidigm_get_vu_uuid_index(struct nvme_dev *dev); diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c index ae57e85..d663131 100644 --- a/plugins/wdc/wdc-nvme.c +++ b/plugins/wdc/wdc-nvme.c @@ -36,6 +36,7 @@ #include "libnvme.h" #include "plugin.h" #include "linux/types.h" +#include "util/cleanup.h" #include "util/types.h" #include "nvme-print.h" @@ -84,6 +85,7 @@ #define WDC_NVME_SN560_DEV_ID_2 0x2713 #define WDC_NVME_SN560_DEV_ID_3 0x2714 #define WDC_NVME_SN861_DEV_ID 0x2750 +#define WDC_NVME_SN861_DEV_ID_1 0x2751 /* This id's are no longer supported, delete ?? */ #define WDC_NVME_SN550_DEV_ID 0x2708 @@ -148,6 +150,8 @@ #define WDC_DRIVE_CAP_OCP_C4_LOG_PAGE 0x0000004000000000 #define WDC_DRIVE_CAP_OCP_C5_LOG_PAGE 0x0000008000000000 #define WDC_DRIVE_CAP_DEVICE_WAF 0x0000010000000000 +#define WDC_DRIVE_CAP_SET_LATENCY_MONITOR 0x0000020000000000 + #define WDC_DRIVE_CAP_SMART_LOG_MASK (WDC_DRIVE_CAP_C0_LOG_PAGE | \ WDC_DRIVE_CAP_C1_LOG_PAGE | \ WDC_DRIVE_CAP_CA_LOG_PAGE | \ @@ -163,6 +167,7 @@ WDC_DRIVE_CAP_DUI | \ WDC_DRIVE_CAP_DUI_DATA | \ WDC_SN730B_CAP_VUC_LOG) + /* SN730 Get Log Capabilities */ #define SN730_NVME_GET_LOG_OPCODE 0xc2 #define SN730_GET_FULL_LOG_LENGTH 0x00080009 @@ -302,8 +307,8 @@ #define WDC_NVME_GET_STAT_PERF_INTERVAL_LIFETIME 0x0F /* C2 Log Page */ -#define WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_OPCODE 0xC2 -#define WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_OPCODE_C8 0xC8 +#define WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID 0xC2 +#define WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID_C8 0xC8 #define WDC_C2_LOG_BUF_LEN 0x1000 #define WDC_C2_LOG_PAGES_SUPPORTED_ID 0x08 #define WDC_C2_CUSTOMER_ID_ID 0x15 @@ -368,12 +373,12 @@ static __u8 wdc_lat_mon_guid[WDC_C3_GUID_LENGTH] = { #define NVME_LOG_PERSISTENT_EVENT 0x0D #define WDC_LOG_ID_C0 0xC0 #define WDC_LOG_ID_C1 0xC1 -#define WDC_LOG_ID_C2 WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_OPCODE +#define WDC_LOG_ID_C2 WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID #define WDC_LOG_ID_C3 0xC3 #define WDC_LOG_ID_C4 0xC4 #define WDC_LOG_ID_C5 0xC5 #define WDC_LOG_ID_C6 0xC6 -#define WDC_LOG_ID_C8 WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_OPCODE_C8 +#define WDC_LOG_ID_C8 WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID_C8 #define WDC_LOG_ID_CA WDC_NVME_GET_DEVICE_INFO_LOG_OPCODE #define WDC_LOG_ID_CB WDC_NVME_GET_FW_ACT_HISTORY_LOG_ID #define WDC_LOG_ID_D0 WDC_NVME_GET_VU_SMART_LOG_OPCODE @@ -447,6 +452,12 @@ static __u8 wdc_lat_mon_guid[WDC_C3_GUID_LENGTH] = { #define WDC_ENC_CRASH_DUMP_ID 0xE4 #define WDC_ENC_LOG_DUMP_ID 0xE2 +/* OCP Log Page Directory Data Structure */ +#define BYTE_TO_BIT(byte) ((byte) * 8) + +/* Set latency monitor feature */ +#define NVME_FEAT_OCP_LATENCY_MONITOR 0xC5 + enum _NVME_FEATURES_SELECT { FS_CURRENT = 0, FS_DEFAULT = 1, @@ -474,6 +485,27 @@ enum NVME_FEATURE_IDENTIFIERS { FID_RESERVATION_PERSISTENCE = 0x83 }; +/* WDC UUID value */ +const uint8_t WDC_UUID[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0xb9, 0x8c, 0x52, 0x0c, 0x4c, + 0x5a, 0x15, 0xab, 0xe6, 0x33, 0x29, 0x9a, 0x70, 0xdf, 0xd0 +}; + +/* WDC_UUID value for SN640_3 devices */ +const uint8_t WDC_UUID_SN640_3[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 +}; + +/* UUID field with value of 0 indicates end of UUID List*/ +const uint8_t UUID_END[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + enum WDC_DRIVE_ESSENTIAL_TYPE { WDC_DE_TYPE_IDENTIFY = 0x1, WDC_DE_TYPE_SMARTATTRIBUTEDUMP = 0x2, @@ -657,6 +689,67 @@ enum { SCAO_LPG = 496, /* Log page GUID */ }; +struct ocp_bad_nand_block_count { + __u64 raw : 48; + __u16 normalized : 16; +}; + +struct ocp_e2e_correction_count { + __u32 detected; + __u32 corrected; +}; + +struct ocp_user_data_erase_count { + __u32 maximum; + __u32 minimum; +}; + +struct ocp_thermal_status { + __u8 num_events; + __u8 current_status; +}; + +struct __packed ocp_dssd_specific_ver { + __u8 errata_ver; + __u16 point_ver; + __u16 minor_ver; + __u8 major_ver; +}; + +struct ocp_cloud_smart_log { + __u8 physical_media_units_written[16]; + __u8 physical_media_units_read[16]; + struct ocp_bad_nand_block_count bad_user_nand_blocks; + struct ocp_bad_nand_block_count bad_system_nand_blocks; + __u64 xor_recovery_count; + __u64 uncorrectable_read_error_count; + __u64 soft_ecc_error_count; + struct ocp_e2e_correction_count e2e_correction_counts; + __u8 system_data_percent_used; + __u64 refresh_counts : 56; + struct ocp_user_data_erase_count user_data_erase_counts; + struct ocp_thermal_status thermal_status; + struct ocp_dssd_specific_ver dssd_specific_ver; + __u64 pcie_correctable_error_count; + __u32 incomplete_shutdowns; + __u8 rsvd116[4]; + __u8 percent_free_blocks; + __u8 rsvd121[7]; + __u16 capacitor_health; + __u8 nvme_errata_ver; + __u8 rsvd131[5]; + __u64 unaligned_io; + __u64 security_version_number; + __u64 total_nuse; + __u8 plp_start_count[16]; + __u8 endurance_estimate[16]; + __u64 pcie_link_retraining_cnt; + __u64 power_state_change_cnt; + __u8 rsvd208[286]; + __u16 log_page_version; + __u8 log_page_guid[16]; +}; + static __u8 scao_guid[WDC_C0_GUID_LENGTH] = { 0xC5, 0xAF, 0x10, 0x28, 0xEA, 0xBF, 0xF2, 0xA4, 0x9C, 0x4F, 0x6F, 0x7C, 0xC9, 0x14, 0xD5, 0xAF @@ -794,6 +887,46 @@ static struct NVME_VU_DE_LOGPAGE_LIST deVULogPagesList[] = { { NVME_DE_LOGPAGE_C0, 0xC0, 512, "0xc0"} }; +enum { + WDC_NVME_ADMIN_VUC_OPCODE_D2 = 0xD2, + WDC_VUC_SUBOPCODE_VS_DRIVE_INFO_D2 = 0x0000010A, + WDC_VUC_SUBOPCODE_LOG_PAGE_DIR_D2 = 0x00000105, +}; + +enum { + NVME_LOG_NS_BASE = 0x80, + NVME_LOG_VS_BASE = 0xC0, +}; + +/*drive_info struct*/ +struct ocp_drive_info { + __u32 hw_revision; + __u32 ftl_unit_size; +}; + +/*get log page directory struct*/ +struct log_page_directory { + __u64 supported_lid_bitmap; + __u64 rsvd; + __u64 supported_ns_lid_bitmap; + __u64 supported_vs_lid_bitmap; +}; + +/*set latency monitor feature */ +struct __packed feature_latency_monitor { + __u16 active_bucket_timer_threshold; + __u8 active_threshold_a; + __u8 active_threshold_b; + __u8 active_threshold_c; + __u8 active_threshold_d; + __u16 active_latency_config; + __u8 active_latency_minimum_window; + __u16 debug_log_trigger_enable; + __u8 discard_debug_log; + __u8 latency_monitor_feature_enable; + __u8 reserved[4083]; +}; + static int wdc_get_serial_name(struct nvme_dev *dev, char *file, size_t len, const char *suffix); static int wdc_create_log_file(char *file, __u8 *drive_log_data, __u32 drive_log_length); static int wdc_do_clear_dump(struct nvme_dev *dev, __u8 opcode, __u32 cdw12); @@ -1229,7 +1362,7 @@ struct __packed wdc_fw_act_history_log_format_c2 { struct __packed wdc_ocp_C4_dev_cap_log { __le16 num_pcie_ports; /* 0000 - Number of PCI Express Ports */ __le16 oob_mgmt_support; /* 0002 - OOB Management Interfaces Supported */ - __le16 wrt_zeros_support; /* 0004 - Write Zeros Commmand Support */ + __le16 wrt_zeros_support; /* 0004 - Write Zeros Command Support */ __le16 sanitize_support; /* 0006 - Sanitize Command Support */ __le16 dsm_support; /* 0008 - Dataset Management Command Support */ __le16 wrt_uncor_support; /* 0010 - Write Uncorrectable Command Support */ @@ -1269,6 +1402,21 @@ static __u8 wdc_ocp_c5_guid[WDC_OCP_C5_GUID_LENGTH] = { 0x2F, 0x72, 0x9C, 0x0 #define WDC_REASON_ID_ENTRY_LEN 128 #define WDC_REASON_ID_PATH_NAME "/usr/local/nvmecli" +const char *log_page_name[256] = { + [NVME_LOG_LID_ERROR] = "Error Information", + [NVME_LOG_LID_SMART] = "SMART / Health Information", + [NVME_LOG_LID_FW_SLOT] = "Firmware Slot Information", + [NVME_LOG_LID_CHANGED_NS] = "Changed Namespace List", + [NVME_LOG_LID_CMD_EFFECTS] = "Command Supported and Effects", + [NVME_LOG_LID_TELEMETRY_HOST] = "Telemetry Host-Initiated", + [NVME_LOG_LID_TELEMETRY_CTRL] = "Telemetry Controller-Initiated", + [NVME_LOG_LID_SANITIZE] = "Sanitize Status", + [WDC_LOG_ID_C0] = "Extended SMART Information", + [WDC_LOG_ID_C2] = "Firmware Activation History", + [WDC_LOG_ID_C3] = "Latency Monitor", + [WDC_LOG_ID_C4] = "Device Capabilities", + [WDC_LOG_ID_C5] = "Unsupported Requirements", +}; static double safe_div_fp(double numerator, double denominator) { @@ -1368,6 +1516,60 @@ static int wdc_get_vendor_id(struct nvme_dev *dev, uint32_t *vendor_id) return ret; } +static bool wdc_is_sn861(__u32 device_id) +{ + if ((device_id == WDC_NVME_SN861_DEV_ID) || + (device_id == WDC_NVME_SN861_DEV_ID_1)) + return true; + else + return false; +} + + +static bool wdc_is_sn640(__u32 device_id) +{ + if ((device_id == WDC_NVME_SN640_DEV_ID) || + (device_id == WDC_NVME_SN640_DEV_ID_1) || + (device_id == WDC_NVME_SN640_DEV_ID_2)) + return true; + else + return false; +} + +static bool wdc_is_sn640_3(__u32 device_id) +{ + if (device_id == WDC_NVME_SN640_DEV_ID_3) + return true; + else + return false; +} + +static bool wdc_is_sn650_u2(__u32 device_id) +{ + if (device_id == WDC_NVME_SN650_DEV_ID_3) + return true; + else + return false; +} + +static bool wdc_is_sn650_e1l(__u32 device_id) +{ + if (device_id == WDC_NVME_SN650_DEV_ID_4) + return true; + else + return false; +} + +static bool needs_c2_log_page_check(__u32 device_id) +{ + if ((wdc_is_sn640(device_id)) || + (wdc_is_sn650_u2(device_id)) || + (wdc_is_sn650_e1l(device_id))) + return true; + else + return false; +} + static bool wdc_check_power_of_2(int num) { return num && (!(num & (num-1))); @@ -1549,7 +1751,7 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) WDC_DEV_CAP_LOG_ID)) capabilities |= WDC_DRIVE_CAP_OCP_C4_LOG_PAGE; - /* verify the 0xC5 (OCP Unsupported Requirments) log page is supported */ + /* verify the 0xC5 (OCP Unsupported Requirements) log page is supported */ if (wdc_nvme_check_supported_log_page(r, dev, WDC_UNSUPPORTED_REQS_LOG_ID)) capabilities |= WDC_DRIVE_CAP_OCP_C5_LOG_PAGE; @@ -1638,7 +1840,7 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) if (wdc_nvme_check_supported_log_page(r, dev, WDC_DEV_CAP_LOG_ID)) capabilities |= WDC_DRIVE_CAP_OCP_C4_LOG_PAGE; - /* verify the 0xC5 (OCP Unsupported Requirments) log page is supported */ + /* verify the 0xC5 (OCP Unsupported Requirements) log page is supported */ if (wdc_nvme_check_supported_log_page(r, dev, WDC_UNSUPPORTED_REQS_LOG_ID)) capabilities |= WDC_DRIVE_CAP_OCP_C5_LOG_PAGE; @@ -1668,16 +1870,22 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) break; case WDC_NVME_SN861_DEV_ID: - capabilities |= (WDC_DRIVE_CAP_C0_LOG_PAGE | WDC_DRIVE_CAP_OCP_C1_LOG_PAGE | - WDC_DRIVE_CAP_C3_LOG_PAGE | WDC_DRIVE_CAP_OCP_C4_LOG_PAGE | - WDC_DRIVE_CAP_OCP_C5_LOG_PAGE); - - capabilities |= (WDC_DRIVE_CAP_CAP_DIAG | WDC_DRIVE_CAP_INTERNAL_LOG | - WDC_DRIVE_CAP_DRIVE_STATUS | WDC_DRIVE_CAP_CLEAR_ASSERT | - WDC_DRIVE_CAP_RESIZE | WDC_DRIVE_CAP_FW_ACTIVATE_HISTORY | - WDC_DRVIE_CAP_DISABLE_CTLR_TELE_LOG | - WDC_DRIVE_CAP_REASON_ID); - + fallthrough; + case WDC_NVME_SN861_DEV_ID_1: + capabilities |= (WDC_DRIVE_CAP_C0_LOG_PAGE | + WDC_DRIVE_CAP_C3_LOG_PAGE | + WDC_DRIVE_CAP_CA_LOG_PAGE | + WDC_DRIVE_CAP_OCP_C4_LOG_PAGE | + WDC_DRIVE_CAP_OCP_C5_LOG_PAGE | + WDC_DRIVE_CAP_INTERNAL_LOG | + WDC_DRIVE_CAP_FW_ACTIVATE_HISTORY_C2 | + WDC_DRIVE_CAP_VU_FID_CLEAR_PCIE | + WDC_DRIVE_CAP_VU_FID_CLEAR_FW_ACT_HISTORY | + WDC_DRIVE_CAP_INFO | + WDC_DRIVE_CAP_CLOUD_SSD_VERSION | + WDC_DRIVE_CAP_LOG_PAGE_DIR | + WDC_DRIVE_CAP_SET_LATENCY_MONITOR); + break; default: capabilities = 0; } @@ -1970,7 +2178,7 @@ bool wdc_get_dev_mng_log_entry(__u32 log_length, __u32 entry_id, remaining_len = 0; valid_log = false; - /* The struture is invalid, so any match that was found is invalid. */ + /* The structure is invalid, so any match that was found is invalid. */ *p_p_found_log_entry = NULL; } else { /* Structure must have at least one valid entry to be considered valid */ @@ -1994,33 +2202,25 @@ bool wdc_get_dev_mng_log_entry(__u32 log_length, __u32 entry_id, return valid_log; } -static bool get_dev_mgment_cbs_data(nvme_root_t r, struct nvme_dev *dev, - __u8 log_id, void **cbs_data) +static bool get_dev_mgmt_log_page_lid_data(struct nvme_dev *dev, + void **cbs_data, + __u8 lid, + __u8 log_id, + __u8 uuid_ix) { - int ret = -1; void *data; struct wdc_c2_log_page_header *hdr_ptr; struct wdc_c2_log_subpage_header *sph; __u32 length = 0; + int ret = 0; bool found = false; - __u8 uuid_ix = 1; - __u8 lid = 0; - *cbs_data = NULL; - __u32 device_id, read_vendor_id; - - ret = wdc_get_pci_ids(r, dev, &device_id, &read_vendor_id); - if (device_id == WDC_NVME_ZN350_DEV_ID || device_id == WDC_NVME_ZN350_DEV_ID_1) { - lid = WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_OPCODE_C8; - uuid_ix = 0; - } else { - lid = WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_OPCODE; - } data = (__u8 *)malloc(sizeof(__u8) * WDC_C2_LOG_BUF_LEN); if (!data) { fprintf(stderr, "ERROR: WDC: malloc: %s\n", strerror(errno)); return false; } + memset(data, 0, sizeof(__u8) * WDC_C2_LOG_BUF_LEN); /* get the log page length */ @@ -2043,7 +2243,9 @@ static bool get_dev_mgment_cbs_data(nvme_root_t r, struct nvme_dev *dev, }; ret = nvme_get_log(&args_len); if (ret) { - fprintf(stderr, "ERROR: WDC: Unable to get 0x%x Log Page length, ret = 0x%x\n", lid, ret); + fprintf(stderr, + "ERROR: WDC: Unable to get 0x%x Log Page length with uuid %d, ret = 0x%x\n", + lid, uuid_ix, ret); goto end; } @@ -2056,54 +2258,12 @@ static bool get_dev_mgment_cbs_data(nvme_root_t r, struct nvme_dev *dev, data = calloc(length, sizeof(__u8)); if (!data) { fprintf(stderr, "ERROR: WDC: malloc: %s\n", strerror(errno)); - return false; - } - } - - /* get the log page data */ - struct nvme_get_log_args args_data = { - .args_size = sizeof(args_data), - .fd = dev_fd(dev), - .lid = lid, - .nsid = 0xFFFFFFFF, - .lpo = 0, - .lsp = NVME_LOG_LSP_NONE, - .lsi = 0, - .rae = false, - .uuidx = uuid_ix, - .csi = NVME_CSI_NVM, - .ot = false, - .len = length, - .log = data, - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .result = NULL, - }; - ret = nvme_get_log(&args_data); - - if (ret) { - fprintf(stderr, "ERROR: WDC: Unable to read 0x%x Log Page data, ret = 0x%x\n", lid, ret); - goto end; - } - - /* Check the log data to see if the WD version of log page ID's is found */ - - length = sizeof(struct wdc_c2_log_page_header); - hdr_ptr = (struct wdc_c2_log_page_header *)data; - sph = (struct wdc_c2_log_subpage_header *)(data + length); - found = wdc_get_dev_mng_log_entry(le32_to_cpu(hdr_ptr->length), log_id, hdr_ptr, &sph); - if (found) { - *cbs_data = calloc(le32_to_cpu(sph->length), sizeof(__u8)); - if (!*cbs_data) { - fprintf(stderr, "ERROR: WDC: calloc: %s\n", strerror(errno)); goto end; } - memcpy((void *)*cbs_data, (void *)&sph->data, le32_to_cpu(sph->length)); - } else { - /* not found with uuid = 1 try with uuid = 0 */ - uuid_ix = 0; - /* get the log page data */ - struct nvme_get_log_args args = { - .args_size = sizeof(args), + + /* get the log page data with the increased length */ + struct nvme_get_log_args args_data = { + .args_size = sizeof(args_data), .fd = dev_fd(dev), .lid = lid, .nsid = 0xFFFFFFFF, @@ -2114,34 +2274,118 @@ static bool get_dev_mgment_cbs_data(nvme_root_t r, struct nvme_dev *dev, .uuidx = uuid_ix, .csi = NVME_CSI_NVM, .ot = false, - .len = le32_to_cpu(hdr_ptr->length), + .len = length, .log = data, .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, .result = NULL, }; - ret = nvme_get_log(&args); + ret = nvme_get_log(&args_data); - hdr_ptr = (struct wdc_c2_log_page_header *)data; - sph = (struct wdc_c2_log_subpage_header *)(data + length); - found = wdc_get_dev_mng_log_entry(le32_to_cpu(hdr_ptr->length), log_id, hdr_ptr, &sph); - if (found) { - *cbs_data = calloc(le32_to_cpu(sph->length), sizeof(__u8)); - if (!*cbs_data) { - fprintf(stderr, "ERROR: WDC: calloc: %s\n", strerror(errno)); - goto end; - } - memcpy((void *)*cbs_data, (void *)&sph->data, le32_to_cpu(sph->length)); - } else { - /* WD version not found */ - fprintf(stderr, "ERROR: WDC: Unable to find correct version of page 0x%x, entry id = %d\n", lid, log_id); + if (ret) { + fprintf(stderr, + "ERROR: WDC: Unable to read 0x%x Log Page data with uuid %d, ret = 0x%x\n", + lid, uuid_ix, ret); + goto end; } } + /* Check the log data to see if the WD version of log page ID's is found */ + length = sizeof(struct wdc_c2_log_page_header); + hdr_ptr = (struct wdc_c2_log_page_header *)data; + sph = (struct wdc_c2_log_subpage_header *)(data + length); + found = wdc_get_dev_mng_log_entry(le32_to_cpu(hdr_ptr->length), log_id, hdr_ptr, &sph); + if (found) { + *cbs_data = calloc(le32_to_cpu(sph->length), sizeof(__u8)); + if (!*cbs_data) { + fprintf(stderr, "ERROR: WDC: calloc: %s\n", strerror(errno)); + found = false; + goto end; + } + memcpy((void *)*cbs_data, (void *)&sph->data, le32_to_cpu(sph->length)); + } else { + fprintf(stderr, "ERROR: WDC: C2 log id 0x%x not found with uuid index %d\n", + log_id, uuid_ix); + } + end: free(data); return found; } +static bool get_dev_mgment_cbs_data(nvme_root_t r, struct nvme_dev *dev, + __u8 log_id, void **cbs_data) +{ + int ret = -1; + bool found = false; + __u8 uuid_ix = 0; + __u8 lid = 0; + *cbs_data = NULL; + __u32 device_id, read_vendor_id; + bool uuid_present = false; + int index = 0, uuid_index = 0; + struct nvme_id_uuid_list uuid_list; + + ret = wdc_get_pci_ids(r, dev, &device_id, &read_vendor_id); + if (ret == 0) { + if (device_id == WDC_NVME_ZN350_DEV_ID || device_id == WDC_NVME_ZN350_DEV_ID_1) { + lid = WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID_C8; + uuid_ix = 0; + } else { + lid = WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID; + } + } else { + fprintf(stderr, "ERROR: WDC: get pci ids: %d\n", ret); + return false; + } + + typedef struct nvme_id_uuid_list_entry *uuid_list_entry; + + memset(&uuid_list, 0, sizeof(struct nvme_id_uuid_list)); + if (wdc_CheckUuidListSupport(dev, &uuid_list)) { + uuid_list_entry uuid_list_entry_ptr = (uuid_list_entry)&uuid_list.entry[0]; + + while (index <= NVME_ID_UUID_LIST_MAX && + !wdc_UuidEqual(uuid_list_entry_ptr, (uuid_list_entry)UUID_END)) { + + if (wdc_UuidEqual(uuid_list_entry_ptr, + (uuid_list_entry)WDC_UUID)) { + uuid_present = true; + break; + } else if (wdc_UuidEqual(uuid_list_entry_ptr, + (uuid_list_entry)WDC_UUID_SN640_3) && + wdc_is_sn640_3(device_id)) { + uuid_present = true; + break; + } + index++; + uuid_list_entry_ptr = (uuid_list_entry)&uuid_list.entry[index]; + } + if (uuid_present) + 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; + } + + 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); + + found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid, log_id, uuid_ix); + } + + return found; +} + static bool wdc_nvme_check_supported_log_page(nvme_root_t r, struct nvme_dev *dev, __u8 log_id) { int i; @@ -3385,6 +3629,102 @@ free_buf: return ret; } +static int dump_internal_logs(struct nvme_dev *dev, char *dir_name, int verbose) +{ + char file_path[128]; + void *telemetry_log; + const size_t bs = 512; + struct nvme_telemetry_log *hdr; + size_t full_size, offset = bs; + int err, output; + + if (verbose) + printf("NVMe Telemetry log...\n"); + + hdr = malloc(bs); + telemetry_log = malloc(bs); + if (!hdr || !telemetry_log) { + fprintf(stderr, "Failed to allocate %zu bytes for log: %s\n", bs, strerror(errno)); + err = -ENOMEM; + goto free_mem; + } + memset(hdr, 0, bs); + + sprintf(file_path, "%s/telemetry.bin", dir_name); + output = open(file_path, O_WRONLY | O_CREAT | O_TRUNC, 0666); + if (output < 0) { + fprintf(stderr, "Failed to open output file %s: %s!\n", file_path, strerror(errno)); + err = output; + goto free_mem; + } + + struct nvme_get_log_args args = { + .lpo = 0, + .result = NULL, + .log = hdr, + .args_size = sizeof(args), + .fd = dev_fd(dev), + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .lid = NVME_LOG_LID_TELEMETRY_HOST, + .len = bs, + .nsid = NVME_NSID_ALL, + .csi = NVME_CSI_NVM, + .lsi = NVME_LOG_LSI_NONE, + .lsp = NVME_LOG_TELEM_HOST_LSP_CREATE, + .uuidx = NVME_UUID_NONE, + .rae = true, + .ot = false, + }; + + err = nvme_get_log(&args); + if (err < 0) + perror("get-telemetry-log"); + else if (err > 0) { + nvme_show_status(err); + fprintf(stderr, "Failed to acquire telemetry header %d!\n", err); + goto close_output; + } + + err = write(output, (void *)hdr, bs); + if (err != bs) { + fprintf(stderr, "Failed to flush all data to file!\n"); + goto close_output; + } + + full_size = (le16_to_cpu(hdr->dalb3) * bs) + offset; + + while (offset != full_size) { + args.log = telemetry_log; + args.lpo = offset; + args.lsp = NVME_LOG_LSP_NONE; + err = nvme_get_log(&args); + if (err < 0) { + perror("get-telemetry-log"); + break; + } else if (err > 0) { + fprintf(stderr, "Failed to acquire full telemetry log!\n"); + nvme_show_status(err); + break; + } + + err = write(output, (void *)telemetry_log, bs); + if (err != bs) { + fprintf(stderr, "Failed to flush all data to file!\n"); + break; + } + err = 0; + offset += bs; + } + +close_output: + close(output); +free_mem: + free(hdr); + free(telemetry_log); + + return err; +} + static int wdc_vs_internal_fw_log(int argc, char **argv, struct command *command, struct plugin *plugin) { @@ -3397,6 +3737,7 @@ static int wdc_vs_internal_fw_log(int argc, char **argv, struct command *command char *type = "Telemetry type - NONE, HOST, or CONTROLLER. Currently only supported on the SN530, SN640, SN730, SN740, SN810, SN840 and ZN350 devices."; char *verbose = "Display more debug messages."; char f[PATH_MAX] = {0}; + char fb[PATH_MAX/2] = {0}; char fileSuffix[PATH_MAX] = {0}; struct nvme_dev *dev; nvme_root_t r; @@ -3405,6 +3746,9 @@ static int wdc_vs_internal_fw_log(int argc, char **argv, struct command *command UtilsTimeInfo timeInfo; __u8 timeStamp[MAX_PATH_LEN]; __u64 capabilities = 0; + __u32 device_id, read_vendor_id; + char file_path[PATH_MAX/2] = {0}; + char cmd_buf[PATH_MAX] = {0}; int ret = -1; struct config { @@ -3453,72 +3797,149 @@ static int wdc_vs_internal_fw_log(int argc, char **argv, struct command *command goto out; } - if (cfg.file) { - int verify_file; + ret = wdc_get_pci_ids(r, dev, &device_id, &read_vendor_id); - /* verify the passed in file name and path is valid before getting the dump data */ - verify_file = open(cfg.file, O_WRONLY | O_CREAT | O_TRUNC, 0666); - if (verify_file < 0) { - fprintf(stderr, "ERROR: WDC: open: %s\n", strerror(errno)); - goto out; + if (!wdc_is_sn861(device_id)) { + if (cfg.file) { + int verify_file; + + /* verify file name and path is valid before getting dump data */ + verify_file = open(cfg.file, O_WRONLY | O_CREAT | O_TRUNC, 0666); + if (verify_file < 0) { + fprintf(stderr, "ERROR: WDC: open: %s\n", strerror(errno)); + goto out; + } + close(verify_file); + strncpy(f, cfg.file, PATH_MAX - 1); + } else { + wdc_UtilsGetTime(&timeInfo); + memset(timeStamp, 0, sizeof(timeStamp)); + wdc_UtilsSnprintf((char *)timeStamp, MAX_PATH_LEN, + "%02u%02u%02u_%02u%02u%02u", timeInfo.year, + timeInfo.month, timeInfo.dayOfMonth, + timeInfo.hour, timeInfo.minute, + timeInfo.second); + snprintf(fileSuffix, PATH_MAX, "_internal_fw_log_%s", (char *)timeStamp); + + ret = wdc_get_serial_name(dev, f, PATH_MAX, fileSuffix); + if (ret) { + fprintf(stderr, "ERROR: WDC: failed to generate file name\n"); + goto out; + } } - close(verify_file); - strncpy(f, cfg.file, PATH_MAX - 1); - } else { - wdc_UtilsGetTime(&timeInfo); - memset(timeStamp, 0, sizeof(timeStamp)); - wdc_UtilsSnprintf((char *)timeStamp, MAX_PATH_LEN, "%02u%02u%02u_%02u%02u%02u", - timeInfo.year, timeInfo.month, timeInfo.dayOfMonth, - timeInfo.hour, timeInfo.minute, timeInfo.second); - snprintf(fileSuffix, PATH_MAX, "_internal_fw_log_%s", (char *)timeStamp); - ret = wdc_get_serial_name(dev, f, PATH_MAX, fileSuffix); - if (ret) { - fprintf(stderr, "ERROR: WDC: failed to generate file name\n"); - goto out; + if (!cfg.file) { + if (strlen(f) > PATH_MAX - 5) { + fprintf(stderr, "ERROR: WDC: file name overflow\n"); + ret = -1; + goto out; + } + strcat(f, ".bin"); } - } + fprintf(stderr, "%s: filename = %s\n", __func__, f); - if (!cfg.file) { - if (strlen(f) > PATH_MAX - 5) { - fprintf(stderr, "ERROR: WDC: file name overflow\n"); + if (cfg.data_area) { + if (cfg.data_area > 5 || cfg.data_area < 1) { + fprintf(stderr, "ERROR: WDC: Data area must be 1-5\n"); + ret = -1; + goto out; + } + } + + if (!cfg.type || !strcmp(cfg.type, "NONE") || !strcmp(cfg.type, "none")) { + telemetry_type = WDC_TELEMETRY_TYPE_NONE; + data_area = 0; + } else if (!strcmp(cfg.type, "HOST") || !strcmp(cfg.type, "host")) { + telemetry_type = WDC_TELEMETRY_TYPE_HOST; + telemetry_data_area = cfg.data_area; + } else if (!strcmp(cfg.type, "CONTROLLER") || !strcmp(cfg.type, "controller")) { + telemetry_type = WDC_TELEMETRY_TYPE_CONTROLLER; + telemetry_data_area = cfg.data_area; + } else { + fprintf(stderr, + "ERROR: WDC: Invalid type - Must be NONE, HOST or CONTROLLER\n"); ret = -1; goto out; } - strcat(f, ".bin"); - } - fprintf(stderr, "%s: filename = %s\n", __func__, f); + } else { + if (cfg.file) { + strncpy(fb, cfg.file, PATH_MAX/2 - 8); + } else { + wdc_UtilsGetTime(&timeInfo); + memset(timeStamp, 0, sizeof(timeStamp)); + wdc_UtilsSnprintf((char *)timeStamp, MAX_PATH_LEN, + "%02u%02u%02u_%02u%02u%02u", timeInfo.year, + timeInfo.month, timeInfo.dayOfMonth, + timeInfo.hour, timeInfo.minute, + timeInfo.second); + snprintf(fileSuffix, PATH_MAX, "_internal_fw_log_%s", (char *)timeStamp); - if (cfg.data_area) { - if (cfg.data_area > 5 || cfg.data_area < 1) { - fprintf(stderr, "ERROR: WDC: Data area must be 1-5\n"); + ret = wdc_get_serial_name(dev, fb, PATH_MAX/2 - 7, fileSuffix); + if (ret) { + fprintf(stderr, "ERROR: WDC: failed to generate file name\n"); + goto out; + } + + if (strlen(fb) > PATH_MAX/2 - 7) { + fprintf(stderr, "ERROR: WDC: file name overflow\n"); + ret = -1; + goto out; + } + } + fprintf(stderr, "%s: filename = %s.tar.gz\n", __func__, fb); + + + memset(file_path, 0, sizeof(file_path)); + if (snprintf(file_path, PATH_MAX/2 - 8, "%s.tar.gz", fb) >= PATH_MAX/2 - 8) { + fprintf(stderr, "File path is too long!\n"); ret = -1; goto out; } - } - - if (!cfg.type || !strcmp(cfg.type, "NONE") || !strcmp(cfg.type, "none")) { - telemetry_type = WDC_TELEMETRY_TYPE_NONE; - data_area = 0; - } else if (!strcmp(cfg.type, "HOST") || !strcmp(cfg.type, "host")) { - telemetry_type = WDC_TELEMETRY_TYPE_HOST; - telemetry_data_area = cfg.data_area; - } else if (!strcmp(cfg.type, "CONTROLLER") || !strcmp(cfg.type, "controller")) { - telemetry_type = WDC_TELEMETRY_TYPE_CONTROLLER; - telemetry_data_area = cfg.data_area; - } else { - fprintf(stderr, "ERROR: WDC: Invalid type - Must be NONE, HOST or CONTROLLER\n"); - ret = -1; - goto out; + if (access(file_path, F_OK) != -1) { + fprintf(stderr, "Output file already exists!\n"); + ret = -EEXIST; + goto out; + } } capabilities = wdc_get_drive_capabilities(r, dev); if ((capabilities & WDC_DRIVE_CAP_INTERNAL_LOG) == WDC_DRIVE_CAP_INTERNAL_LOG) { - if (!telemetry_data_area) - telemetry_data_area = 3; /* Set the default DA to 3 if not specified */ + if (!wdc_is_sn861(device_id)) { + /* Set the default DA to 3 if not specified */ + if (!telemetry_data_area) + telemetry_data_area = 3; - ret = wdc_do_cap_diag(r, dev, f, xfer_size, - telemetry_type, telemetry_data_area); + ret = wdc_do_cap_diag(r, dev, f, xfer_size, + telemetry_type, telemetry_data_area); + } else { + if (cfg.verbose) + printf("Creating temp directory...\n"); + + ret = mkdir(fb, 0666); + if (ret) { + fprintf(stderr, "Failed to create directory!\n"); + goto out; + } + + ret = dump_internal_logs(dev, fb, cfg.verbose); + if (ret < 0) + perror("vs-internal-log"); + + if (cfg.verbose) + printf("Archiving...\n"); + + if (snprintf(cmd_buf, PATH_MAX, + "tar --remove-files -czf %s %s", + file_path, fb) >= PATH_MAX) { + fprintf(stderr, "Command buffer is too long!\n"); + ret = -1; + goto out; + } + + ret = system(cmd_buf); + if (ret) + fprintf(stderr, "Failed to create an archive file!\n"); + } goto out; } if ((capabilities & WDC_DRIVE_CAP_DUI) == WDC_DRIVE_CAP_DUI) { @@ -4374,7 +4795,7 @@ static void wdc_print_dev_cap_log_normal(struct wdc_ocp_C4_dev_cap_log *log_data printf(" Minimum DSSD Power State : 0x%x\n", le16_to_cpu(log_data->min_dssd_ps)); for (j = 0; j < WDC_OCP_C4_NUM_PS_DESCR; j++) - printf(" DSSD Power State %d Desriptor : 0x%x\n", j, log_data->dssd_ps_descr[j]); + printf(" DSSD Power State %d Descriptor : 0x%x\n", j, log_data->dssd_ps_descr[j]); printf(" Log Page Version : 0x%x\n", le16_to_cpu(log_data->log_page_version)); printf(" Log page GUID : 0x"); @@ -5018,7 +5439,9 @@ static void wdc_get_commit_action_bin(__u8 commit_action_type, char *action_bin) } -static void wdc_print_fw_act_history_log_normal(__u8 *data, int num_entries, __u32 cust_id, __u32 vendor_id) +static void wdc_print_fw_act_history_log_normal(__u8 *data, int num_entries, + __u32 cust_id, __u32 vendor_id, + __u32 device_id) { int i, j; char previous_fw[9]; @@ -5032,7 +5455,9 @@ static void wdc_print_fw_act_history_log_normal(__u8 *data, int num_entries, __u 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) { + if (cust_id == WDC_CUSTOMER_ID_0x1005 || + vendor_id == WDC_NVME_SNDK_VID || + wdc_is_sn861(device_id)) { printf(" Power on Hour Power Cycle Previous New\n"); printf(" Entry hh:mm:ss Count Firmware Firmware Slot Action Result\n"); printf(" ----- ----------------- ----------------- --------- --------- ----- ------ -------\n"); @@ -5091,6 +5516,26 @@ static void wdc_print_fw_act_history_log_normal(__u8 *data, int num_entries, __u (int)((timestamp/1000)%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)); @@ -5189,7 +5634,9 @@ static void wdc_print_fw_act_history_log_normal(__u8 *data, int num_entries, __u } } -static void wdc_print_fw_act_history_log_json(__u8 *data, int num_entries, __u32 cust_id, __u32 vendor_id) +static void wdc_print_fw_act_history_log_json(__u8 *data, int num_entries, + __u32 cust_id, __u32 vendor_id, + __u32 device_id) { struct json_object *root = json_create_object(); int i, j; @@ -5198,11 +5645,13 @@ static void wdc_print_fw_act_history_log_json(__u8 *data, int num_entries, __u32 char commit_action_bin[8]; char fail_str[32]; char time_str[11]; + char ext_time_str[20]; 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 *)ext_time_str, 0, 20); memset((void *)fail_str, 0, 11); char *null_fw = "--------"; __u16 oldestEntryIdx = 0, entryIdx = 0; @@ -5254,6 +5703,17 @@ static void wdc_print_fw_act_history_log_json(__u8 *data, int num_entries, __u32 sprintf((char *)time_str, "%04d:%02d:%02d", (int)((timestamp/(3600*1000))%24), (int)((timestamp/(1000*60))%60), (int)((timestamp/1000)%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)); @@ -6083,7 +6543,7 @@ static void wdc_print_smart_cloud_attr_C0_normal(void *data) (uint16_t)le16_to_cpu(*(uint16_t *)&log_data[SCAO_CPH])); printf(" Unaligned I/O : %"PRIu64"\n", (uint64_t)le64_to_cpu(*(uint64_t *)&log_data[SCAO_UIO])); - printf(" Securqity Version Number : %"PRIu64"\n", + printf(" Security Version Number : %"PRIu64"\n", (uint64_t)le64_to_cpu(*(uint64_t *)&log_data[SCAO_SVN])); printf(" NUSE Namespace utilization : %"PRIu64"\n", (uint64_t)le64_to_cpu(*(uint64_t *)&log_data[SCAO_NUSE])); @@ -6477,17 +6937,19 @@ static int wdc_get_c0_log_page_sn(nvme_root_t r, struct nvme_dev *dev, int uuid_ static int wdc_get_c0_log_page(nvme_root_t r, struct nvme_dev *dev, char *format, int uuid_index, __u32 namespace_id) { - int ret = 0; - int fmt = -1; - __u8 *data; uint32_t device_id, read_vendor_id; + enum nvme_print_flags fmt; + int ret; + __u8 *data; + __u8 log_id; + __u32 length; if (!wdc_check_device(r, dev)) return -1; - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - return fmt; + return ret; } ret = wdc_get_pci_ids(r, dev, &device_id, &read_vendor_id); @@ -6507,6 +6969,16 @@ static int wdc_get_c0_log_page(nvme_root_t r, struct nvme_dev *dev, char *format 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: @@ -6518,18 +6990,63 @@ static int wdc_get_c0_log_page(nvme_root_t r, struct nvme_dev *dev, char *format case WDC_NVME_SN650_DEV_ID_4: fallthrough; case WDC_NVME_SN655_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: - fallthrough; - case WDC_NVME_SN861_DEV_ID: - ret = wdc_get_c0_log_page_sn(r, dev, uuid_index, format, namespace_id, fmt); + if (uuid_index == 0) { + log_id = WDC_NVME_GET_SMART_CLOUD_ATTR_LOG_ID; + length = WDC_NVME_SMART_CLOUD_ATTR_LEN; + } else { + log_id = WDC_NVME_GET_EOL_STATUS_LOG_OPCODE; + length = WDC_NVME_EOL_STATUS_LOG_LEN; + } + + data = (__u8 *)malloc(sizeof(__u8) * length); + if (!data) { + fprintf(stderr, "ERROR: WDC: malloc: %s\n", strerror(errno)); + return -1; + } + + if (namespace_id == NVME_NSID_ALL) { + ret = nvme_get_nsid(dev_fd(dev), &namespace_id); + if (ret < 0) + namespace_id = NVME_NSID_ALL; + } + + /* Get the 0xC0 log data */ + struct nvme_get_log_args args = { + .args_size = sizeof(args), + .fd = dev_fd(dev), + .lid = log_id, + .nsid = namespace_id, + .lpo = 0, + .lsp = NVME_LOG_LSP_NONE, + .lsi = 0, + .rae = false, + .uuidx = uuid_index, + .csi = NVME_CSI_NVM, + .ot = false, + .len = length, + .log = data, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .result = NULL, + }; + ret = nvme_get_log(&args); + + if (strcmp(format, "json")) + nvme_show_status(ret); + + if (!ret) { + /* parse the data */ + if (uuid_index == 0) + wdc_print_c0_cloud_attr_log(data, fmt); + else + wdc_print_c0_eol_log(data, fmt); + } else { + fprintf(stderr, "ERROR: WDC: Unable to read C0 Log Page data "); + fprintf(stderr, "with uuid index %d\n", uuid_index); + ret = -1; + } + free(data); break; + case WDC_NVME_ZN350_DEV_ID: fallthrough; case WDC_NVME_ZN350_DEV_ID_1: @@ -6711,7 +7228,9 @@ static int wdc_print_d0_log(struct wdc_ssd_d0_smart_log *perf, int fmt) return 0; } -static int wdc_print_fw_act_history_log(__u8 *data, int num_entries, int fmt, __u32 cust_id, __u32 vendor_id) +static int wdc_print_fw_act_history_log(__u8 *data, int num_entries, int fmt, + __u32 cust_id, __u32 vendor_id, + __u32 device_id) { if (!data) { fprintf(stderr, "ERROR: WDC: Invalid buffer to read fw activate history entries\n"); @@ -6720,10 +7239,12 @@ static int wdc_print_fw_act_history_log(__u8 *data, int num_entries, int fmt, __ switch (fmt) { case NORMAL: - wdc_print_fw_act_history_log_normal(data, num_entries, cust_id, vendor_id); + wdc_print_fw_act_history_log_normal(data, num_entries, cust_id, + vendor_id, device_id); break; case JSON: - wdc_print_fw_act_history_log_json(data, num_entries, cust_id, vendor_id); + wdc_print_fw_act_history_log_json(data, num_entries, cust_id, + vendor_id, device_id); break; } return 0; @@ -6731,19 +7252,19 @@ static int wdc_print_fw_act_history_log(__u8 *data, int num_entries, int fmt, __ static int wdc_get_ca_log_page(nvme_root_t r, struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; - __u8 *data; - struct wdc_ssd_ca_perf_stats *perf; uint32_t read_device_id, read_vendor_id; + struct wdc_ssd_ca_perf_stats *perf; + enum nvme_print_flags fmt; __u32 cust_id; + __u8 *data; + int ret; if (!wdc_check_device(r, dev)) return -1; - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - return fmt; + return ret; } /* verify the 0xCA log page is supported */ @@ -6867,23 +7388,24 @@ static int wdc_get_ca_log_page(nvme_root_t r, struct nvme_dev *dev, char *format static int wdc_get_c1_log_page(nvme_root_t r, struct nvme_dev *dev, char *format, uint8_t interval) { - int ret = 0; - int fmt = -1; + struct wdc_log_page_subpage_header *sph; + struct wdc_ssd_perf_stats *perf; + struct wdc_log_page_header *l; + enum nvme_print_flags fmt; + int total_subpages; + int skip_cnt = 4; __u8 *data; __u8 *p; int i; - int skip_cnt = 4; - int total_subpages; - struct wdc_log_page_header *l; - struct wdc_log_page_subpage_header *sph; - struct wdc_ssd_perf_stats *perf; + int ret; if (!wdc_check_device(r, dev)) return -1; - fmt = validate_output_format(format); - if (fmt < 0) { + + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - return fmt; + return ret; } if (interval < 1 || interval > 15) { @@ -6925,18 +7447,19 @@ static int wdc_get_c1_log_page(nvme_root_t r, struct nvme_dev *dev, static int wdc_get_c3_log_page(nvme_root_t r, struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; - __u8 *data; - int i; struct wdc_ssd_latency_monitor_log *log_data; + enum nvme_print_flags fmt; + __u8 *data; + int ret; + int i; if (!wdc_check_device(r, dev)) return -1; - fmt = validate_output_format(format); - if (fmt < 0) { + + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - return fmt; + return ret; } data = (__u8 *)malloc(sizeof(__u8) * WDC_LATENCY_MON_LOG_BUF_LEN); @@ -6996,18 +7519,19 @@ out: static int wdc_get_ocp_c1_log_page(nvme_root_t r, struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; - __u8 *data; - int i; struct wdc_ocp_c1_error_recovery_log *log_data; + enum nvme_print_flags fmt; + __u8 *data; + int ret; + int i; if (!wdc_check_device(r, dev)) return -1; - fmt = validate_output_format(format); - if (fmt < 0) { + + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - return fmt; + return ret; } data = (__u8 *)malloc(sizeof(__u8) * WDC_ERROR_REC_LOG_BUF_LEN); @@ -7066,18 +7590,19 @@ out: static int wdc_get_ocp_c4_log_page(nvme_root_t r, struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; - __u8 *data; - int i; struct wdc_ocp_C4_dev_cap_log *log_data; + enum nvme_print_flags fmt; + __u8 *data; + int ret; + int i; if (!wdc_check_device(r, dev)) return -1; - fmt = validate_output_format(format); - if (fmt < 0) { + + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - return fmt; + return ret; } data = (__u8 *)malloc(sizeof(__u8) * WDC_DEV_CAP_LOG_BUF_LEN); @@ -7135,18 +7660,19 @@ out: static int wdc_get_ocp_c5_log_page(nvme_root_t r, struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; + struct wdc_ocp_C5_unsupported_reqs *log_data; + enum nvme_print_flags fmt; + int ret; __u8 *data; int i; - struct wdc_ocp_C5_unsupported_reqs *log_data; if (!wdc_check_device(r, dev)) return -1; - fmt = validate_output_format(format); - if (fmt < 0) { + + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - return fmt; + return ret; } data = (__u8 *)malloc(sizeof(__u8) * WDC_UNSUPPORTED_REQS_LOG_BUF_LEN); @@ -7204,17 +7730,18 @@ out: static int wdc_get_d0_log_page(nvme_root_t r, struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; - __u8 *data; struct wdc_ssd_d0_smart_log *perf; + enum nvme_print_flags fmt; + int ret = 0; + __u8 *data; if (!wdc_check_device(r, dev)) return -1; - fmt = validate_output_format(format); - if (fmt < 0) { + + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - return fmt; + return ret; } /* verify the 0xD0 log page is supported */ @@ -7249,6 +7776,235 @@ static int wdc_get_d0_log_page(nvme_root_t r, struct nvme_dev *dev, char *format return ret; } +static long double le_to_float(__u8 *data, int byte_len) +{ + long double result = 0; + int i; + + for (i = 0; i < byte_len; i++) { + result *= 256; + result += data[15 - i]; + } + + return result; +} + +static void stringify_log_page_guid(__u8 *guid, char *buf) +{ + char *ptr = buf; + int i; + + memset(buf, 0, sizeof(char) * 19); + + ptr += sprintf(ptr, "0x"); + for (i = 0; i < 16; i++) + ptr += sprintf(ptr, "%x", guid[15 - i]); +} + +static const char *const cloud_smart_log_thermal_status[] = { + [0x00] = "unthrottled", + [0x01] = "first_level", + [0x02] = "second_level", + [0x03] = "third_level", +}; + +static const char *stringify_cloud_smart_log_thermal_status(__u8 status) +{ + if (status < ARRAY_SIZE(cloud_smart_log_thermal_status) && + cloud_smart_log_thermal_status[status]) + return cloud_smart_log_thermal_status[status]; + return "unrecognized"; +} + +static void show_cloud_smart_log_json(struct ocp_cloud_smart_log *log) +{ + struct json_object *root; + struct json_object *bad_user_nand_blocks; + struct json_object *bad_system_nand_blocks; + struct json_object *e2e_correction_counts; + struct json_object *user_data_erase_counts; + struct json_object *thermal_status; + struct json_object *dssd_specific_ver; + char buf[2 * sizeof(log->log_page_guid) + 3]; + + bad_user_nand_blocks = json_create_object(); + json_object_add_value_uint(bad_user_nand_blocks, "normalized", + le16_to_cpu(log->bad_user_nand_blocks.normalized)); + json_object_add_value_uint(bad_user_nand_blocks, "raw", + le64_to_cpu(log->bad_user_nand_blocks.raw)); + + bad_system_nand_blocks = json_create_object(); + json_object_add_value_uint(bad_system_nand_blocks, "normalized", + le16_to_cpu(log->bad_system_nand_blocks.normalized)); + json_object_add_value_uint(bad_system_nand_blocks, "raw", + le64_to_cpu(log->bad_system_nand_blocks.raw)); + + e2e_correction_counts = json_create_object(); + json_object_add_value_uint(e2e_correction_counts, "corrected", + le32_to_cpu(log->e2e_correction_counts.corrected)); + json_object_add_value_uint(e2e_correction_counts, "detected", + le32_to_cpu(log->e2e_correction_counts.detected)); + + user_data_erase_counts = json_create_object(); + json_object_add_value_uint(user_data_erase_counts, "minimum", + le32_to_cpu(log->user_data_erase_counts.minimum)); + json_object_add_value_uint(user_data_erase_counts, "maximum", + le32_to_cpu(log->user_data_erase_counts.maximum)); + + thermal_status = json_create_object(); + json_object_add_value_string(thermal_status, "current_status", + stringify_cloud_smart_log_thermal_status(log->thermal_status.current_status)); + json_object_add_value_uint(thermal_status, "num_events", + log->thermal_status.num_events); + + dssd_specific_ver = json_create_object(); + json_object_add_value_uint(dssd_specific_ver, "major_ver", + log->dssd_specific_ver.major_ver); + json_object_add_value_uint(dssd_specific_ver, "minor_ver", + le16_to_cpu(log->dssd_specific_ver.minor_ver)); + json_object_add_value_uint(dssd_specific_ver, "point_ver", + le16_to_cpu(log->dssd_specific_ver.point_ver)); + json_object_add_value_uint(dssd_specific_ver, "errata_ver", + log->dssd_specific_ver.errata_ver); + + root = json_create_object(); + json_object_add_value_uint64(root, "physical_media_units_written", + le_to_float(log->physical_media_units_written, 16)); + json_object_add_value_uint64(root, "physical_media_units_read", + le_to_float(log->physical_media_units_read, 16)); + json_object_add_value_object(root, "bad_user_nand_blocks", + bad_user_nand_blocks); + json_object_add_value_object(root, "bad_system_nand_blocks", + bad_system_nand_blocks); + json_object_add_value_uint(root, "xor_recovery_count", + le64_to_cpu(log->xor_recovery_count)); + json_object_add_value_uint(root, "uncorrectable_read_error_count", + le64_to_cpu(log->uncorrectable_read_error_count)); + json_object_add_value_uint(root, "soft_ecc_error_count", + le64_to_cpu(log->soft_ecc_error_count)); + json_object_add_value_object(root, "e2e_correction_counts", + e2e_correction_counts); + json_object_add_value_uint(root, "system_data_percent_used", + log->system_data_percent_used); + json_object_add_value_uint(root, "refresh_counts", + le64_to_cpu(log->refresh_counts)); + json_object_add_value_object(root, "user_data_erase_counts", + user_data_erase_counts); + json_object_add_value_object(root, "thermal_status", thermal_status); + json_object_add_value_object(root, "dssd_specific_ver", + dssd_specific_ver); + json_object_add_value_uint(root, "pcie_correctable_error_count", + le64_to_cpu(log->pcie_correctable_error_count)); + json_object_add_value_uint(root, "incomplete_shutdowns", + le32_to_cpu(log->incomplete_shutdowns)); + json_object_add_value_uint(root, "percent_free_blocks", + log->percent_free_blocks); + json_object_add_value_uint(root, "capacitor_health", + le16_to_cpu(log->capacitor_health)); + sprintf(buf, "%c", log->nvme_errata_ver); + json_object_add_value_string(root, "nvme_errata_version", buf); + json_object_add_value_uint(root, "unaligned_io", + le64_to_cpu(log->unaligned_io)); + json_object_add_value_uint(root, "security_version_number", + le64_to_cpu(log->security_version_number)); + json_object_add_value_uint(root, "total_nuse", + le64_to_cpu(log->total_nuse)); + json_object_add_value_uint64(root, "plp_start_count", + le_to_float(log->plp_start_count, 16)); + json_object_add_value_uint64(root, "endurance_estimate", + le_to_float(log->endurance_estimate, 16)); + json_object_add_value_uint(root, "pcie_link_retraining_count", + le64_to_cpu(log->pcie_link_retraining_cnt)); + json_object_add_value_uint(root, "power_state_change_count", + le64_to_cpu(log->power_state_change_cnt)); + json_object_add_value_uint(root, "log_page_version", + le16_to_cpu(log->log_page_version)); + stringify_log_page_guid(log->log_page_guid, buf); + json_object_add_value_string(root, "log_page_guid", buf); + + json_print_object(root, NULL); + printf("\n"); + json_free_object(root); +} + +static void show_cloud_smart_log_normal(struct ocp_cloud_smart_log *log, struct nvme_dev *dev) +{ + char buf[2 * sizeof(log->log_page_guid) + 3]; + + printf("Smart Extended Log for NVME device:%s\n", dev->name); + printf("Physical Media Units Written : %'.0Lf\n", + le_to_float(log->physical_media_units_written, 16)); + printf("Physical Media Units Read : %'.0Lf\n", + le_to_float(log->physical_media_units_read, 16)); + printf("Bad User NAND Blocks (Normalized) : %" PRIu16 "%%\n", + le16_to_cpu(log->bad_user_nand_blocks.normalized)); + printf("Bad User NAND Blocks (Raw) : %" PRIu64 "\n", + le64_to_cpu(log->bad_user_nand_blocks.raw)); + printf("Bad System NAND Blocks (Normalized) : %" PRIu16 "%%\n", + le16_to_cpu(log->bad_system_nand_blocks.normalized)); + printf("Bad System NAND Blocks (Raw) : %" PRIu64 "\n", + le64_to_cpu(log->bad_system_nand_blocks.raw)); + printf("XOR Recovery Count : %" PRIu64 "\n", + le64_to_cpu(log->xor_recovery_count)); + printf("Uncorrectable Read Error Count : %" PRIu64 "\n", + le64_to_cpu(log->uncorrectable_read_error_count)); + printf("Soft ECC Error Count : %" PRIu64 "\n", + le64_to_cpu(log->soft_ecc_error_count)); + printf("End to End Correction Counts (Corrected) : %" PRIu32 "\n", + le32_to_cpu(log->e2e_correction_counts.corrected)); + printf("End to End Correction Counts (Detected) : %" PRIu32 "\n", + le32_to_cpu(log->e2e_correction_counts.detected)); + printf("System Data %% Used : %" PRIu8 "%%\n", + log->system_data_percent_used); + printf("Refresh Counts : %" PRIu64 "\n", + le64_to_cpu(log->refresh_counts)); + printf("User Data Erase Counts (Minimum) : %" PRIu32 "\n", + le32_to_cpu(log->user_data_erase_counts.minimum)); + printf("User Data Erase Counts (Maximum) : %" PRIu32 "\n", + le32_to_cpu(log->user_data_erase_counts.maximum)); + printf("Thermal Throttling Status (Current Status) : %s\n", + stringify_cloud_smart_log_thermal_status(log->thermal_status.current_status)); + printf("Thermal Throttling Status (Number of Events) : %" PRIu8 "\n", + log->thermal_status.num_events); + printf("NVMe Major Version : %" PRIu8 "\n", + log->dssd_specific_ver.major_ver); + printf(" Minor Version : %" PRIu16 "\n", + le16_to_cpu(log->dssd_specific_ver.minor_ver)); + printf(" Point Version : %" PRIu16 "\n", + le16_to_cpu(log->dssd_specific_ver.point_ver)); + printf(" Errata Version : %" PRIu8 "\n", + log->dssd_specific_ver.errata_ver); + printf("PCIe Correctable Error Count : %" PRIu64 "\n", + le64_to_cpu(log->pcie_correctable_error_count)); + printf("Incomplete Shutdowns : %" PRIu32 "\n", + le32_to_cpu(log->incomplete_shutdowns)); + printf("%% Free Blocks : %" PRIu8 "%%\n", + log->percent_free_blocks); + printf("Capacitor Health : %" PRIu16 "%%\n", + le16_to_cpu(log->capacitor_health)); + printf("NVMe Errata Version : %c\n", + log->nvme_errata_ver); + printf("Unaligned IO : %" PRIu64 "\n", + le64_to_cpu(log->unaligned_io)); + printf("Security Version Number : %" PRIu64 "\n", + le64_to_cpu(log->security_version_number)); + printf("Total NUSE : %" PRIu64 "\n", + le64_to_cpu(log->total_nuse)); + printf("PLP Start Count : %'.0Lf\n", + le_to_float(log->plp_start_count, 16)); + printf("Endurance Estimate : %'.0Lf\n", + le_to_float(log->endurance_estimate, 16)); + printf("PCIe Link Retraining Count : %" PRIu64 "\n", + le64_to_cpu(log->pcie_link_retraining_cnt)); + printf("Power State Change Count : %" PRIu64 "\n", + le64_to_cpu(log->power_state_change_cnt)); + printf("Log Page Version : %" PRIu16 "\n", + le16_to_cpu(log->log_page_version)); + stringify_log_page_guid(log->log_page_guid, buf); + printf("Log Page GUID : %s\n", buf); + printf("\n\n"); +} + static int wdc_vs_smart_add_log(int argc, char **argv, struct command *command, struct plugin *plugin) { @@ -7257,6 +8013,7 @@ static int wdc_vs_smart_add_log(int argc, char **argv, struct command *command, const char *log_page_version = "Log Page Version: 0 = vendor, 1 = WDC"; const char *log_page_mask = "Log Page Mask, comma separated list: 0xC0, 0xC1, 0xCA, 0xD0"; const char *namespace_id = "desired namespace id"; + enum nvme_print_flags fmt; struct nvme_dev *dev; nvme_root_t r; int ret = 0; @@ -7264,6 +8021,7 @@ static int wdc_vs_smart_add_log(int argc, char **argv, struct command *command, int page_mask = 0, num, i; int log_page_list[16]; __u64 capabilities = 0; + __u32 device_id, read_vendor_id; struct config { uint8_t interval; @@ -7283,7 +8041,7 @@ static int wdc_vs_smart_add_log(int argc, char **argv, struct command *command, OPT_ARGS(opts) = { OPT_UINT("interval", 'i', &cfg.interval, interval), - OPT_FMT("output-format", 'o', &cfg.output_format, "Output Format: normal|json"), + OPT_FMT("output-format", 'o', &cfg.output_format, output_format), OPT_BYTE("log-page-version", 'l', &cfg.log_page_version, log_page_version), OPT_LIST("log-page-mask", 'p', &cfg.log_page_mask, log_page_mask), OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_id), @@ -7331,8 +8089,9 @@ static int wdc_vs_smart_add_log(int argc, char **argv, struct command *command, if (!page_mask) fprintf(stderr, "ERROR: WDC: Unknown log page mask - %s\n", cfg.log_page_mask); - capabilities = wdc_get_drive_capabilities(r, dev); + ret = wdc_get_pci_ids(r, dev, &device_id, &read_vendor_id); + capabilities = wdc_get_drive_capabilities(r, dev); if (!(capabilities & WDC_DRIVE_CAP_SMART_LOG_MASK)) { fprintf(stderr, "ERROR: WDC: unsupported device for this command\n"); ret = -1; @@ -7342,13 +8101,56 @@ static int wdc_vs_smart_add_log(int argc, char **argv, struct command *command, if (((capabilities & WDC_DRIVE_CAP_C0_LOG_PAGE) == WDC_DRIVE_CAP_C0_LOG_PAGE) && (page_mask & WDC_C0_PAGE_MASK)) { /* Get 0xC0 log page if possible. */ - ret = wdc_get_c0_log_page(r, dev, cfg.output_format, - uuid_index, cfg.namespace_id); - if (ret) - fprintf(stderr, "ERROR: WDC: Failure reading the C0 Log Page, ret = %d\n", ret); + if (!wdc_is_sn861(device_id)) { + ret = wdc_get_c0_log_page(r, dev, cfg.output_format, + uuid_index, cfg.namespace_id); + if (ret) + fprintf(stderr, + "ERROR: WDC: Failure reading the C0 Log Page, ret = %d\n", + ret); + } else { + struct ocp_cloud_smart_log log; + char buf[2 * sizeof(log.log_page_guid) + 3]; + + ret = validate_output_format(output_format, &fmt); + if (ret < 0) { + fprintf(stderr, "Invalid output format: %s\n", cfg.output_format); + goto out; + } + + ret = nvme_get_log_simple(dev_fd(dev), + WDC_NVME_GET_SMART_CLOUD_ATTR_LOG_ID, + sizeof(log), &log); + if (!ret) { + char *ptr = buf; + int i; + __u8 *guid = log.log_page_guid; + + memset(buf, 0, sizeof(char) * 19); + + ptr += sprintf(ptr, "0x"); + for (i = 0; i < 16; i++) + ptr += sprintf(ptr, "%x", guid[15 - i]); + if (strcmp(buf, "0xafd514c97c6f4f9ca4f2bfea2810afc5")) + fprintf(stderr, "Invalid GUID: %s\n", buf); + else { + if (fmt == BINARY) + d_raw((unsigned char *)&log, sizeof(log)); + else if (fmt == JSON) + show_cloud_smart_log_json(&log); + else + show_cloud_smart_log_normal(&log, dev); + } + } else if (ret > 0) { + nvme_show_status(ret); + } else { + perror("vs-smart-add-log"); + } + } } if (((capabilities & (WDC_DRIVE_CAP_CA_LOG_PAGE)) == (WDC_DRIVE_CAP_CA_LOG_PAGE)) && - (page_mask & WDC_CA_PAGE_MASK)) { + (page_mask & WDC_CA_PAGE_MASK) && + (!wdc_is_sn861(device_id))) { /* Get the CA Log Page */ ret = wdc_get_ca_log_page(r, dev, cfg.output_format); if (ret) @@ -7381,10 +8183,11 @@ static int wdc_vs_cloud_log(int argc, char **argv, struct command *command, { const char *desc = "Retrieve Cloud Log Smart/Health Information"; const char *namespace_id = "desired namespace id"; + enum nvme_print_flags fmt; __u64 capabilities = 0; struct nvme_dev *dev; - int ret, fmt = -1; nvme_root_t r; + int ret; __u8 *data; struct config { @@ -7425,14 +8228,13 @@ static int wdc_vs_cloud_log(int argc, char **argv, struct command *command, nvme_show_status(ret); if (!ret) { - fmt = validate_output_format(cfg.output_format); - if (fmt < 0) { + ret = validate_output_format(cfg.output_format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC %s: invalid output format\n", __func__); - ret = fmt; + } else { + /* parse the data */ + wdc_print_ext_smart_cloud_log(data, fmt); } - - /* parse the data */ - wdc_print_ext_smart_cloud_log(data, fmt); } else { fprintf(stderr, "ERROR: WDC: Unable to read C0 Log Page V1 data\n"); ret = -1; @@ -7452,9 +8254,10 @@ static int wdc_vs_hw_rev_log(int argc, char **argv, struct command *command, { const char *desc = "Retrieve Hardware Revision Log Information"; const char *namespace_id = "desired namespace id"; + enum nvme_print_flags fmt; __u64 capabilities = 0; struct nvme_dev *dev; - int ret, fmt = -1; + int ret; __u8 *data = NULL; nvme_root_t r; @@ -7494,10 +8297,9 @@ static int wdc_vs_hw_rev_log(int argc, char **argv, struct command *command, nvme_show_status(ret); if (!ret) { - fmt = validate_output_format(cfg.output_format); - if (fmt < 0) { + ret = validate_output_format(cfg.output_format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC %s: invalid output format\n", __func__); - ret = fmt; goto free_buf; } @@ -7513,6 +8315,8 @@ static int wdc_vs_hw_rev_log(int argc, char **argv, struct command *command, case JSON: wdc_print_hw_rev_log_json(data); break; + default: + break; } } else { fprintf(stderr, "ERROR: WDC: Unable to read Hardware Revision Log Page data\n"); @@ -7535,11 +8339,11 @@ static int wdc_vs_device_waf(int argc, char **argv, struct command *command, const char *desc = "Retrieve Device Write Amplication Factor"; const char *namespace_id = "desired namespace id"; struct nvme_smart_log smart_log; + enum nvme_print_flags fmt; struct nvme_dev *dev; __u8 *data; nvme_root_t r; int ret = 0; - int fmt = -1; __u64 capabilities = 0; struct __packed wdc_nvme_ext_smart_log * ext_smart_log_ptr; long double data_units_written = 0, @@ -7615,10 +8419,9 @@ static int wdc_vs_device_waf(int argc, char **argv, struct command *command, if (strcmp(cfg.output_format, "json")) nvme_show_status(ret); - fmt = validate_output_format(cfg.output_format); - if (fmt < 0) { + ret = validate_output_format(cfg.output_format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC %s: invalid output format\n", __func__); - ret = fmt; goto out; } @@ -7950,7 +8753,7 @@ static int wdc_drive_status(int argc, char **argv, struct command *command, /* verify the 0xC2 Device Manageability log page is supported */ if (wdc_nvme_check_supported_log_page(r, dev, - WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_OPCODE) == false) { + WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID) == false) { fprintf(stderr, "ERROR: WDC: 0xC2 Log Page not supported\n"); ret = -1; goto out; @@ -8092,18 +8895,18 @@ out: static int wdc_get_fw_act_history(nvme_root_t r, struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; - __u8 *data; struct wdc_fw_act_history_log_hdr *fw_act_history_hdr; + enum nvme_print_flags fmt; + int ret; + __u8 *data; if (!wdc_check_device(r, dev)) return -1; - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - return fmt; + return ret; } /* verify the FW Activate History log page is supported */ @@ -8135,7 +8938,7 @@ static int wdc_get_fw_act_history(nvme_root_t r, struct nvme_dev *dev, if ((fw_act_history_hdr->num_entries > 0) && (fw_act_history_hdr->num_entries <= WDC_MAX_NUM_ACT_HIST_ENTRIES)) { ret = wdc_print_fw_act_history_log(data, fw_act_history_hdr->num_entries, - fmt, 0, 0); + fmt, 0, 0, 0); } else if (!fw_act_history_hdr->num_entries) { fprintf(stderr, "INFO: WDC: No FW Activate History entries found.\n"); ret = 0; @@ -8173,21 +8976,21 @@ static __u32 wdc_get_fw_cust_id(nvme_root_t r, struct nvme_dev *dev) static int wdc_get_fw_act_history_C2(nvme_root_t r, struct nvme_dev *dev, char *format) { - int ret = 0; - int fmt = -1; - __u8 *data; - __u32 cust_id; struct wdc_fw_act_history_log_format_c2 *fw_act_history_log; __u32 tot_entries = 0, num_entries = 0; __u32 vendor_id = 0, device_id = 0; + __u32 cust_id = 0; + enum nvme_print_flags fmt; + __u8 *data; + int ret; if (!wdc_check_device(r, dev)) return -1; - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - return fmt; + return ret; } ret = wdc_get_pci_ids(r, dev, &device_id, &vendor_id); @@ -8214,15 +9017,20 @@ static int wdc_get_fw_act_history_C2(nvme_root_t r, struct nvme_dev *dev, if (tot_entries > 0) { /* get the FW customer 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; + 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); + 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; @@ -9584,10 +10392,104 @@ static const char *nvme_log_id_to_string(__u8 log_id) } } +static void __json_log_page_directory(struct log_page_directory *directory) +{ + __u32 bitmap_idx; + __u8 log_id; + struct json_object *root; + struct json_object *entries; + + root = json_create_object(); + + entries = json_create_array(); + json_object_add_value_array(root, "Entries", entries); + + for (bitmap_idx = 0; bitmap_idx < BYTE_TO_BIT(sizeof(__u64)); bitmap_idx++) { + log_id = bitmap_idx; + if (!log_page_name[log_id]) + continue; + if (directory->supported_lid_bitmap & (1ULL << bitmap_idx)) { + struct json_object *json_entry = json_create_object(); + + json_object_add_value_uint(json_entry, "Log ID", log_id); + json_object_add_value_string(json_entry, "Log Page Name", + log_page_name[log_id]); + + json_array_add_value_object(entries, json_entry); + } + } + + for (bitmap_idx = 0; bitmap_idx < BYTE_TO_BIT(sizeof(__u64)); bitmap_idx++) { + log_id = NVME_LOG_NS_BASE + bitmap_idx; + if (!log_page_name[log_id]) + continue; + if (directory->supported_ns_lid_bitmap & (1ULL << bitmap_idx)) { + struct json_object *json_entry = json_create_object(); + + json_object_add_value_uint(json_entry, "Log ID", log_id); + json_object_add_value_string(json_entry, "Log Page Name", + log_page_name[log_id]); + + json_array_add_value_object(entries, json_entry); + } + } + + for (bitmap_idx = 0; bitmap_idx < BYTE_TO_BIT(sizeof(__u64)); bitmap_idx++) { + log_id = NVME_LOG_VS_BASE + bitmap_idx; + if (!log_page_name[log_id]) + continue; + if (directory->supported_vs_lid_bitmap & (1ULL << bitmap_idx)) { + struct json_object *json_entry = json_create_object(); + + json_object_add_value_uint(json_entry, "Log ID", log_id); + json_object_add_value_string(json_entry, "Log Page Name", + log_page_name[log_id]); + + json_array_add_value_object(entries, json_entry); + } + } + + json_print_object(root, NULL); + printf("\n"); + json_free_object(root); +} + + +static void __show_log_page_directory(struct log_page_directory *directory) +{ + __u32 bitmap_idx; + __u8 log_id; + + for (bitmap_idx = 0; bitmap_idx < BYTE_TO_BIT(sizeof(__u64)); bitmap_idx++) { + if (directory->supported_lid_bitmap & (1ULL << bitmap_idx)) { + log_id = bitmap_idx; + if (log_page_name[log_id]) + printf("0x%02X: %s\n", log_id, log_page_name[log_id]); + } + } + + for (bitmap_idx = 0; bitmap_idx < BYTE_TO_BIT(sizeof(__u64)); bitmap_idx++) { + if (directory->supported_ns_lid_bitmap & (1ULL << bitmap_idx)) { + log_id = NVME_LOG_NS_BASE + bitmap_idx; + if (log_page_name[log_id]) + printf("0x%02X: %s\n", log_id, log_page_name[log_id]); + } + } + + for (bitmap_idx = 0; bitmap_idx < BYTE_TO_BIT(sizeof(__u64)); bitmap_idx++) { + if (directory->supported_vs_lid_bitmap & (1ULL << bitmap_idx)) { + log_id = NVME_LOG_VS_BASE + bitmap_idx; + if (log_page_name[log_id]) + printf("0x%02X: %s\n", log_id, log_page_name[log_id]); + } + } +} + static int wdc_log_page_directory(int argc, char **argv, struct command *command, struct plugin *plugin) { const char *desc = "Retrieve Log Page Directory."; + enum nvme_print_flags fmt; struct nvme_dev *dev; int ret = 0; nvme_root_t r; @@ -9596,6 +10498,8 @@ static int wdc_log_page_directory(int argc, char **argv, struct command *command int i; __u8 log_id = 0; __u32 device_id, read_vendor_id; + bool uuid_supported = false; + struct nvme_id_uuid_list uuid_list; struct config { char *output_format; @@ -9614,13 +10518,12 @@ static int wdc_log_page_directory(int argc, char **argv, struct command *command if (ret) return ret; - ret = validate_output_format(cfg.output_format); + ret = validate_output_format(cfg.output_format, &fmt); if (ret < 0) { fprintf(stderr, "%s: ERROR: WDC: invalid output format\n", __func__); dev_close(dev); return ret; } - ret = 0; r = nvme_scan(NULL); capabilities = wdc_get_drive_capabilities(r, dev); @@ -9629,54 +10532,110 @@ static int wdc_log_page_directory(int argc, char **argv, struct command *command fprintf(stderr, "ERROR: WDC: unsupported device for this command\n"); ret = -1; } else { + + memset(&uuid_list, 0, sizeof(struct nvme_id_uuid_list)); + if (wdc_CheckUuidListSupport(dev, &uuid_list)) + uuid_supported = true; + + if (uuid_supported) + fprintf(stderr, "WDC: UUID lists supported\n"); + else + fprintf(stderr, "WDC: UUID lists NOT supported\n"); + + ret = wdc_get_pci_ids(r, dev, &device_id, &read_vendor_id); - log_id = (device_id == WDC_NVME_ZN350_DEV_ID || device_id == WDC_NVME_ZN350_DEV_ID_1) ? - WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_OPCODE_C8 : WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_OPCODE; - /* verify the 0xC2 Device Manageability log page is supported */ - if (wdc_nvme_check_supported_log_page(r, dev, log_id) == false) { - fprintf(stderr, "%s: ERROR: WDC: 0x%x Log Page not supported\n", __func__, log_id); - ret = -1; - goto out; - } + log_id = (device_id == WDC_NVME_ZN350_DEV_ID || + device_id == WDC_NVME_ZN350_DEV_ID_1) ? + WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID_C8 : + WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID; - if (get_dev_mgment_cbs_data(r, dev, WDC_C2_LOG_PAGES_SUPPORTED_ID, (void *)&cbs_data)) { - if (cbs_data) { - printf("Log Page Directory\n"); - /* print the supported pages */ - if (!strcmp(cfg.output_format, "normal")) { - for (i = 0; i < le32_to_cpu(cbs_data->length); i++) - printf("0x%x - %s\n", cbs_data->data[i], - nvme_log_id_to_string(cbs_data->data[i])); - } else if (!strcmp(cfg.output_format, "binary")) { - d((__u8 *)cbs_data->data, le32_to_cpu(cbs_data->length), 16, - 1); - } else if (!strcmp(cfg.output_format, "json")) { - struct json_object *root = json_create_object(); + if (!wdc_is_sn861(device_id)) { + /* verify the 0xC2 Device Manageability log page is supported */ + if (wdc_nvme_check_supported_log_page(r, dev, log_id) == false) { + fprintf(stderr, + "%s: ERROR: WDC: 0x%x Log Page not supported\n", + __func__, log_id); + ret = -1; + goto out; + } - for (i = 0; i < le32_to_cpu(cbs_data->length); i++) - json_object_add_value_int(root, - nvme_log_id_to_string(cbs_data->data[i]), - cbs_data->data[i]); + if (!get_dev_mgment_cbs_data(r, dev, + WDC_C2_LOG_PAGES_SUPPORTED_ID, + (void *)&cbs_data)) { + fprintf(stderr, + "%s: ERROR: WDC: 0xC2 Log Page entry ID 0x%x not found\n", + __func__, WDC_C2_LOG_PAGES_SUPPORTED_ID); + ret = -1; + goto out; + } + if (!cbs_data) { + fprintf(stderr, "%s: ERROR: WDC: NULL_data ptr\n", __func__); + ret = -1; + goto out; + } + printf("Log Page Directory\n"); + /* print the supported pages */ + if (!strcmp(cfg.output_format, "normal")) { + for (i = 0; i < le32_to_cpu(cbs_data->length); i++) + printf("0x%x - %s\n", cbs_data->data[i], + nvme_log_id_to_string(cbs_data->data[i])); + } else if (!strcmp(cfg.output_format, "binary")) { + d((__u8 *)cbs_data->data, + le32_to_cpu(cbs_data->length), 16, 1); + } else if (!strcmp(cfg.output_format, "json")) { + struct json_object *root = json_create_object(); - json_print_object(root, NULL); - printf("\n"); - json_free_object(root); - } else { - fprintf(stderr, - "%s: ERROR: WDC: Invalid format, format = %s\n", - __func__, cfg.output_format); + for (i = 0; i < le32_to_cpu(cbs_data->length); i++) { + json_object_add_value_int(root, + nvme_log_id_to_string(cbs_data->data[i]), + cbs_data->data[i]); } - free(cbs_data); + json_print_object(root, NULL); + printf("\n"); + json_free_object(root); } else { - fprintf(stderr, "%s: ERROR: WDC: NULL_data ptr\n", __func__); + fprintf(stderr, + "%s: ERROR: WDC: Invalid format, format = %s\n", + __func__, cfg.output_format); } + + free(cbs_data); } else { - fprintf(stderr, "%s: ERROR: WDC: 0xC2 Log Page entry ID 0x%x not found\n", - __func__, WDC_C2_LOG_PAGES_SUPPORTED_ID); + struct log_page_directory *dir; + void *data = NULL; + __u32 result; + + if (posix_memalign(&data, getpagesize(), 512)) { + fprintf(stderr, + "can not allocate log page directory payload\n"); + ret = ENOMEM; + goto out; + } + + dir = (struct log_page_directory *)data; + ret = nvme_admin_passthru(dev_fd(dev), WDC_NVME_ADMIN_VUC_OPCODE_D2, 0, 0, + 0, 0, 0, 8, + 0, WDC_VUC_SUBOPCODE_LOG_PAGE_DIR_D2, 0, 0, 0, + 32, data, 0, NULL, + 0, &result); + + if (!ret) { + switch (fmt) { + case BINARY: + d_raw((unsigned char *)data, 32); + break; + case JSON: + __json_log_page_directory(dir); + break; + default: + __show_log_page_directory(dir); + } + } else { + fprintf(stderr, "NVMe Status:%s(%x)\n", + nvme_status_to_string(ret, false), ret); + } } - - } out: @@ -10190,22 +11149,21 @@ static void wdc_print_pcie_stats_json(struct wdc_vs_pcie_stats *pcie_stats) static int wdc_do_vs_nand_stats_sn810_2(struct nvme_dev *dev, char *format) { - int ret; - int fmt = -1; + enum nvme_print_flags fmt; uint8_t *data = NULL; + int ret; data = NULL; ret = nvme_get_ext_smart_cloud_log(dev_fd(dev), &data, 0, NVME_NSID_ALL); if (ret) { - fprintf(stderr, "ERROR: WDC: %s : Failed to retreive NAND stats\n", __func__); + fprintf(stderr, "ERROR: WDC: %s : Failed to retrieve NAND stats\n", __func__); goto out; } else { - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: %s : invalid output format\n", __func__); - ret = fmt; goto out; } @@ -10217,6 +11175,8 @@ static int wdc_do_vs_nand_stats_sn810_2(struct nvme_dev *dev, char *format) case JSON: wdc_print_ext_smart_cloud_log_json(data, WDC_SCA_V1_NAND_STATS); break; + default: + break; } } @@ -10228,10 +11188,10 @@ out: static int wdc_do_vs_nand_stats(struct nvme_dev *dev, char *format) { - int ret; - int fmt = -1; + enum nvme_print_flags fmt; uint8_t *output = NULL; __u16 version = 0; + int ret; output = (uint8_t *)calloc(WDC_NVME_NAND_STATS_SIZE, sizeof(uint8_t)); if (!output) { @@ -10243,13 +11203,12 @@ static int wdc_do_vs_nand_stats(struct nvme_dev *dev, char *format) ret = nvme_get_log_simple(dev_fd(dev), WDC_NVME_NAND_STATS_LOG_ID, WDC_NVME_NAND_STATS_SIZE, (void *)output); if (ret) { - fprintf(stderr, "ERROR: WDC: %s : Failed to retreive NAND stats\n", __func__); + fprintf(stderr, "ERROR: WDC: %s : Failed to retrieve NAND stats\n", __func__); goto out; } else { - fmt = validate_output_format(format); - if (fmt < 0) { + ret = validate_output_format(format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - ret = fmt; goto out; } @@ -10263,6 +11222,8 @@ static int wdc_do_vs_nand_stats(struct nvme_dev *dev, char *format) case JSON: wdc_print_nand_stats_json(version, output); break; + default: + break; } } @@ -10351,14 +11312,14 @@ static int wdc_vs_pcie_stats(int argc, char **argv, struct command *command, struct plugin *plugin) { const char *desc = "Retrieve PCIE statistics."; + enum nvme_print_flags fmt; struct nvme_dev *dev; - int ret = 0; nvme_root_t r; + int ret; __u64 capabilities = 0; - int fmt = -1; + _cleanup_huge_ struct nvme_mem_huge mh = { 0, }; struct wdc_vs_pcie_stats *pcieStatsPtr = NULL; int pcie_stats_size = sizeof(struct wdc_vs_pcie_stats); - bool huge; struct config { char *output_format; @@ -10377,16 +11338,14 @@ static int wdc_vs_pcie_stats(int argc, char **argv, struct command *command, if (ret) return ret; - r = nvme_scan(NULL); - fmt = validate_output_format(cfg.output_format); - if (fmt < 0) { + ret = validate_output_format(cfg.output_format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - ret = fmt; goto out; } - pcieStatsPtr = nvme_alloc_huge(pcie_stats_size, &huge); + pcieStatsPtr = nvme_alloc_huge(pcie_stats_size, &mh); if (!pcieStatsPtr) { fprintf(stderr, "ERROR: WDC: PCIE Stats alloc: %s\n", strerror(errno)); ret = -1; @@ -10413,12 +11372,11 @@ static int wdc_vs_pcie_stats(int argc, char **argv, struct command *command, case JSON: wdc_print_pcie_stats_json(pcieStatsPtr); break; + default: + break; } } } - - nvme_free_huge(pcieStatsPtr, huge); - out: nvme_free_tree(r); dev_close(dev); @@ -10429,6 +11387,7 @@ static int wdc_vs_drive_info(int argc, char **argv, struct command *command, struct plugin *plugin) { const char *desc = "Send a vs-drive-info command."; + enum nvme_print_flags fmt; nvme_root_t r; uint64_t capabilities = 0; struct nvme_dev *dev; @@ -10442,12 +11401,14 @@ static int wdc_vs_drive_info(int argc, char **argv, __u8 *data = NULL; __u32 ftl_unit_size = 0, tcg_dev_ownership = 0; __u16 boot_spec_major = 0, boot_spec_minor = 0; - int fmt = -1; struct json_object *root = NULL; char formatter[41] = { 0 }; char rev_str[16] = { 0 }; uint32_t read_device_id = -1, read_vendor_id = -1; struct __packed wdc_nvme_ext_smart_log * ext_smart_log_ptr = NULL; + struct ocp_drive_info info; + __u32 data_len = 0; + unsigned int num_dwords = 0; struct config { char *output_format; @@ -10466,11 +11427,11 @@ static int wdc_vs_drive_info(int argc, char **argv, if (ret) return ret; - fmt = validate_output_format(cfg.output_format); - if (fmt < 0) { + ret = validate_output_format(cfg.output_format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC %s invalid output format\n", __func__); dev_close(dev); - return fmt; + return ret; } /* get the id ctrl data used to fill in drive info below */ @@ -10516,13 +11477,13 @@ static int wdc_vs_drive_info(int argc, char **argv, rev = (double)(cpu_to_le32(result) & 0x0000ffff); if (fmt == NORMAL) { - printf("Drive HW Revison: %4.1f\n", (.1 * rev)); + printf("Drive HW Revision: %4.1f\n", (.1 * rev)); printf("FTL Unit Size: 0x%x KB\n", size); printf("Customer SN: %-.*s\n", (int)sizeof(ctrl.sn), &ctrl.sn[0]); } else if (fmt == JSON) { root = json_create_object(); sprintf(rev_str, "%4.1f", (.1 * rev)); - json_object_add_value_string(root, "Drive HW Revison", rev_str); + json_object_add_value_string(root, "Drive HW Revision", rev_str); json_object_add_value_int(root, "FTL Unit Size", le16_to_cpu(size)); wdc_StrFormat(formatter, sizeof(formatter), &ctrl.sn[0], sizeof(ctrl.sn)); @@ -10624,6 +11585,52 @@ static int wdc_vs_drive_info(int argc, char **argv, json_free_object(root); } + break; + case WDC_NVME_SN861_DEV_ID: + fallthrough; + case WDC_NVME_SN861_DEV_ID_1: + data_len = sizeof(info); + num_dwords = data_len / 4; + if (data_len % 4 != 0) + num_dwords += 1; + + ret = nvme_admin_passthru(dev_fd(dev), + WDC_NVME_ADMIN_VUC_OPCODE_D2, + 0, 0, 0, 0, 0, num_dwords, 0, + WDC_VUC_SUBOPCODE_VS_DRIVE_INFO_D2, + 0, 0, 0, data_len, &info, 0, + NULL, 0, NULL); + + if (!ret) { + __u16 hw_rev_major, hw_rev_minor; + + hw_rev_major = le32_to_cpu(info.hw_revision) / 10; + hw_rev_minor = le32_to_cpu(info.hw_revision) % 10; + if (fmt == NORMAL) { + printf("HW Revision : %" PRIu32 ".%" PRIu32 "\n", + hw_rev_major, hw_rev_minor); + printf("FTL Unit Size : %" PRIu32 "\n", + le32_to_cpu(info.ftl_unit_size)); + } else if (fmt == JSON) { + char buf[20]; + + root = json_create_object(); + + memset((void *)buf, 0, 20); + sprintf(buf, "%" PRIu32 ".%" PRIu32, + hw_rev_major, hw_rev_minor); + + json_object_add_value_string(root, + "hw_revision", buf); + json_object_add_value_uint(root, + "ftl_unit_size", + le32_to_cpu(info.ftl_unit_size)); + + json_print_object(root, NULL); + printf("\n"); + json_free_object(root); + } + } break; default: fprintf(stderr, "ERROR: WDC: unsupported device for this command\n"); @@ -10648,12 +11655,13 @@ static int wdc_vs_temperature_stats(int argc, char **argv, const char *desc = "Send a vs-temperature-stats command."; struct nvme_smart_log smart_log; struct nvme_id_ctrl id_ctrl; + enum nvme_print_flags fmt; struct nvme_dev *dev; nvme_root_t r; uint64_t capabilities = 0; __u32 hctm_tmt; int temperature, temp_tmt1, temp_tmt2; - int ret, fmt = -1; + int ret; struct config { char *output_format; @@ -10673,10 +11681,9 @@ static int wdc_vs_temperature_stats(int argc, char **argv, return ret; r = nvme_scan(NULL); - fmt = validate_output_format(cfg.output_format); - if (fmt < 0) { + ret = validate_output_format(cfg.output_format, &fmt); + if (ret < 0) { fprintf(stderr, "ERROR: WDC: invalid output format\n"); - ret = fmt; goto out; } @@ -10858,6 +11865,8 @@ static int wdc_capabilities(int argc, char **argv, struct command *command, stru capabilities & WDC_DRIVE_CAP_HW_REV_LOG_PAGE ? "Supported" : "Not Supported"); printf("vs-device_waf : %s\n", capabilities & WDC_DRIVE_CAP_DEVICE_WAF ? "Supported" : "Not Supported"); + printf("set-latency-monitor-feature : %s\n", + capabilities & WDC_DRIVE_CAP_SET_LATENCY_MONITOR ? "Supported" : "Not Supported"); printf("capabilities : Supported\n"); nvme_free_tree(r); dev_close(dev); @@ -11228,3 +12237,159 @@ static int wdc_enc_get_nic_log(struct nvme_dev *dev, __u8 log_id, __u32 xfer_siz free(dump_data); return ret; } + +//------------------------------------------------------------------------------------ +// Description: set latency monitor feature +// +int wdc_set_latency_monitor_feature(int argc, char **argv, struct command *cmd, + struct plugin *plugin) +{ + const char *desc = "Set Latency Monitor feature."; + + uint64_t capabilities = 0; + struct nvme_dev *dev; + nvme_root_t r; + int ret; + __u32 result; + struct feature_latency_monitor buf = {0,}; + + const char *active_bucket_timer_threshold = + "This is the value that loads the Active Bucket Timer Threshold."; + const char *active_threshold_a = + "This is the value that loads into the Active Threshold A."; + const char *active_threshold_b = + "This is the value that loads into the Active Threshold B."; + const char *active_threshold_c = + "This is the value that loads into the Active Threshold C."; + const char *active_threshold_d = + "This is the value that loads into the Active Threshold D."; + const char *active_latency_config = + "This is the value that loads into the Active Latency Configuration."; + const char *active_latency_minimum_window = + "This is the value that loads into the Active Latency Minimum Window."; + const char *debug_log_trigger_enable = + "This is the value that loads into the Debug Log Trigger Enable."; + const char *discard_debug_log = "Discard Debug Log."; + const char *latency_monitor_feature_enable = "Latency Monitor Feature Enable."; + + struct config { + __u16 active_bucket_timer_threshold; + __u8 active_threshold_a; + __u8 active_threshold_b; + __u8 active_threshold_c; + __u8 active_threshold_d; + __u16 active_latency_config; + __u8 active_latency_minimum_window; + __u16 debug_log_trigger_enable; + __u8 discard_debug_log; + __u8 latency_monitor_feature_enable; + }; + + struct config cfg = { + .active_bucket_timer_threshold = 0x7E0, + .active_threshold_a = 0x5, + .active_threshold_b = 0x13, + .active_threshold_c = 0x1E, + .active_threshold_d = 0x2E, + .active_latency_config = 0xFFF, + .active_latency_minimum_window = 0xA, + .debug_log_trigger_enable = 0, + .discard_debug_log = 0, + .latency_monitor_feature_enable = 0x7, + }; + + OPT_ARGS(opts) = { + OPT_UINT("active_bucket_timer_threshold", 't', + &cfg.active_bucket_timer_threshold, + active_bucket_timer_threshold), + OPT_UINT("active_threshold_a", 'a', &cfg.active_threshold_a, + active_threshold_a), + OPT_UINT("active_threshold_b", 'b', &cfg.active_threshold_b, + active_threshold_b), + OPT_UINT("active_threshold_c", 'c', &cfg.active_threshold_c, + active_threshold_c), + OPT_UINT("active_threshold_d", 'd', &cfg.active_threshold_d, + active_threshold_d), + OPT_UINT("active_latency_config", 'f', + &cfg.active_latency_config, active_latency_config), + OPT_UINT("active_latency_minimum_window", 'w', + &cfg.active_latency_minimum_window, + active_latency_minimum_window), + OPT_UINT("debug_log_trigger_enable", 'r', + &cfg.debug_log_trigger_enable, debug_log_trigger_enable), + OPT_UINT("discard_debug_log", 'l', &cfg.discard_debug_log, + discard_debug_log), + OPT_UINT("latency_monitor_feature_enable", 'e', + &cfg.latency_monitor_feature_enable, + latency_monitor_feature_enable), + OPT_END() + }; + + ret = parse_and_open(&dev, argc, argv, desc, opts); + + if (ret < 0) + return ret; + + /* get capabilities */ + r = nvme_scan(NULL); + wdc_check_device(r, dev); + capabilities = wdc_get_drive_capabilities(r, dev); + + if (!(capabilities & WDC_DRIVE_CAP_SET_LATENCY_MONITOR)) { + fprintf(stderr, "ERROR: WDC: unsupported device for this command\n"); + return -1; + } + + memset(&buf, 0, sizeof(struct feature_latency_monitor)); + + buf.active_bucket_timer_threshold = cfg.active_bucket_timer_threshold; + buf.active_threshold_a = cfg.active_threshold_a; + buf.active_threshold_b = cfg.active_threshold_b; + buf.active_threshold_c = cfg.active_threshold_c; + buf.active_threshold_d = cfg.active_threshold_d; + buf.active_latency_config = cfg.active_latency_config; + buf.active_latency_minimum_window = cfg.active_latency_minimum_window; + buf.debug_log_trigger_enable = cfg.debug_log_trigger_enable; + buf.discard_debug_log = cfg.discard_debug_log; + buf.latency_monitor_feature_enable = cfg.latency_monitor_feature_enable; + + struct nvme_set_features_args args = { + .args_size = sizeof(args), + .fd = dev_fd(dev), + .fid = NVME_FEAT_OCP_LATENCY_MONITOR, + .nsid = 0, + .cdw12 = 0, + .save = 1, + .data_len = sizeof(struct feature_latency_monitor), + .data = (void *)&buf, + .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, + .result = &result, + }; + + ret = nvme_set_features(&args); + + if (ret < 0) { + perror("set-feature"); + } else if (!ret) { + printf("NVME_FEAT_OCP_LATENCY_MONITOR: 0x%02x\n", + NVME_FEAT_OCP_LATENCY_MONITOR); + printf("active bucket timer threshold: 0x%x\n", + buf.active_bucket_timer_threshold); + printf("active threshold a: 0x%x\n", buf.active_threshold_a); + printf("active threshold b: 0x%x\n", buf.active_threshold_b); + printf("active threshold c: 0x%x\n", buf.active_threshold_c); + printf("active threshold d: 0x%x\n", buf.active_threshold_d); + printf("active latency config: 0x%x\n", buf.active_latency_config); + printf("active latency minimum window: 0x%x\n", + buf.active_latency_minimum_window); + printf("debug log trigger enable: 0x%x\n", + buf.debug_log_trigger_enable); + printf("discard debug log: 0x%x\n", buf.discard_debug_log); + printf("latency monitor feature enable: 0x%x\n", + buf.latency_monitor_feature_enable); + } else if (ret > 0) + fprintf(stderr, "NVMe Status:%s(%x)\n", + nvme_status_to_string(ret, false), ret); + + return ret; +} diff --git a/plugins/wdc/wdc-nvme.h b/plugins/wdc/wdc-nvme.h index cdd9615..f3f28a7 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.3.1" +#define WDC_PLUGIN_VERSION "2.3.5" #include "cmd.h" PLUGIN(NAME("wdc", "Western Digital vendor specific extensions", WDC_PLUGIN_VERSION), @@ -17,34 +17,72 @@ PLUGIN(NAME("wdc", "Western Digital vendor specific extensions", WDC_PLUGIN_VERS ENTRY("id-ctrl", "WDC identify controller", wdc_id_ctrl) ENTRY("purge", "WDC Purge", wdc_purge) ENTRY("purge-monitor", "WDC Purge Monitor", wdc_purge_monitor) - ENTRY("vs-internal-log", "WDC Internal Firmware Log", wdc_vs_internal_fw_log) + ENTRY("vs-internal-log", "WDC Internal Firmware Log", + wdc_vs_internal_fw_log) ENTRY("vs-nand-stats", "WDC NAND Statistics", wdc_vs_nand_stats) - ENTRY("vs-smart-add-log", "WDC Additional Smart Log", wdc_vs_smart_add_log) - ENTRY("clear-pcie-correctable-errors", "WDC Clear PCIe Correctable Error Count", wdc_clear_pcie_correctable_errors) - ENTRY("drive-essentials", "WDC Drive Essentials", wdc_drive_essentials) - ENTRY("get-drive-status", "WDC Get Drive Status", wdc_drive_status) - ENTRY("clear-assert-dump", "WDC Clear Assert Dump", wdc_clear_assert_dump) + ENTRY("vs-smart-add-log", "WDC Additional Smart Log", + wdc_vs_smart_add_log) + ENTRY("clear-pcie-correctable-errors", + "WDC Clear PCIe Correctable Error Count", + wdc_clear_pcie_correctable_errors) + ENTRY("drive-essentials", "WDC Drive Essentials", + wdc_drive_essentials) + ENTRY("get-drive-status", "WDC Get Drive Status", + wdc_drive_status) + ENTRY("clear-assert-dump", "WDC Clear Assert Dump", + wdc_clear_assert_dump) ENTRY("drive-resize", "WDC Drive Resize", wdc_drive_resize) - ENTRY("vs-fw-activate-history", "WDC Get FW Activate History", wdc_vs_fw_activate_history) - ENTRY("clear-fw-activate-history", "WDC Clear FW Activate History", wdc_clear_fw_activate_history) + ENTRY("vs-fw-activate-history", "WDC Get FW Activate History", + wdc_vs_fw_activate_history) + ENTRY("clear-fw-activate-history", + "WDC Clear FW Activate History", + wdc_clear_fw_activate_history) ENTRY("enc-get-log", "WDC Get Enclosure Log", wdc_enc_get_log) - ENTRY("vs-telemetry-controller-option", "WDC Enable/Disable Controller Initiated Telemetry Log", wdc_vs_telemetry_controller_option) - ENTRY("vs-error-reason-identifier", "WDC Telemetry Reason Identifier", wdc_reason_identifier) - ENTRY("log-page-directory", "WDC Get Log Page Directory", wdc_log_page_directory) - ENTRY("namespace-resize", "WDC NamespaceDrive Resize", wdc_namespace_resize) + ENTRY("vs-telemetry-controller-option", + "WDC Enable/Disable Controller Initiated Telemetry Log", + wdc_vs_telemetry_controller_option) + ENTRY("vs-error-reason-identifier", + "WDC Telemetry Reason Identifier", + wdc_reason_identifier) + ENTRY("log-page-directory", "WDC Get Log Page Directory", + wdc_log_page_directory) + ENTRY("namespace-resize", "WDC NamespaceDrive Resize", + wdc_namespace_resize) ENTRY("vs-drive-info", "WDC Get Drive Info", wdc_vs_drive_info) - ENTRY("vs-temperature-stats", "WDC Get Temperature Stats", wdc_vs_temperature_stats) - ENTRY("capabilities", "WDC Device Capabilities", wdc_capabilities) - ENTRY("cloud-SSD-plugin-version", "WDC Cloud SSD Plugin Version", wdc_cloud_ssd_plugin_version) - ENTRY("vs-pcie-stats", "WDC VS PCIE Statistics", wdc_vs_pcie_stats) - ENTRY("get-latency-monitor-log", "WDC Get Latency Monitor Log Page", wdc_get_latency_monitor_log) - ENTRY("get-error-recovery-log", "WDC Get Error Recovery Log Page", wdc_get_error_recovery_log) - ENTRY("get-dev-capabilities-log", "WDC Get Device Capabilities Log Page", wdc_get_dev_capabilities_log) - ENTRY("get-unsupported-reqs-log", "WDC Get Unsupported Requirements Log Page", wdc_get_unsupported_reqs_log) - ENTRY("cloud-boot-SSD-version", "WDC Get the Cloud Boot SSD Version", wdc_cloud_boot_SSD_version) - ENTRY("vs-cloud-log", "WDC Get the Cloud Log Page", wdc_vs_cloud_log) - ENTRY("vs-hw-rev-log", "WDC Get the Hardware Revision Log Page", wdc_vs_hw_rev_log) - ENTRY("vs-device-waf", "WDC Calculate Device Write Amplication Factor", wdc_vs_device_waf) + ENTRY("vs-temperature-stats", "WDC Get Temperature Stats", + wdc_vs_temperature_stats) + ENTRY("capabilities", "WDC Device Capabilities", + wdc_capabilities) + ENTRY("cloud-SSD-plugin-version", + "WDC Cloud SSD Plugin Version", + wdc_cloud_ssd_plugin_version) + ENTRY("vs-pcie-stats", "WDC VS PCIE Statistics", + wdc_vs_pcie_stats) + ENTRY("get-latency-monitor-log", + "WDC Get Latency Monitor Log Page", + wdc_get_latency_monitor_log) + ENTRY("get-error-recovery-log", + "WDC Get Error Recovery Log Page", + wdc_get_error_recovery_log) + ENTRY("get-dev-capabilities-log", + "WDC Get Device Capabilities Log Page", + wdc_get_dev_capabilities_log) + ENTRY("get-unsupported-reqs-log", + "WDC Get Unsupported Requirements Log Page", + wdc_get_unsupported_reqs_log) + ENTRY("cloud-boot-SSD-version", + "WDC Get the Cloud Boot SSD Version", + wdc_cloud_boot_SSD_version) + ENTRY("vs-cloud-log", "WDC Get the Cloud Log Page", + wdc_vs_cloud_log) + ENTRY("vs-hw-rev-log", "WDC Get the Hardware Revision Log Page", + wdc_vs_hw_rev_log) + ENTRY("vs-device-waf", + "WDC Calculate Device Write Amplication Factor", + wdc_vs_device_waf) + ENTRY("set-latency-monitor-feature", + "WDC set Latency Monitor feature", + wdc_set_latency_monitor_feature) ) ); diff --git a/plugins/wdc/wdc-utils.c b/plugins/wdc/wdc-utils.c index 3b60772..be2ef06 100644 --- a/plugins/wdc/wdc-utils.c +++ b/plugins/wdc/wdc-utils.c @@ -24,6 +24,9 @@ #include #include #include +#include "nvme.h" +#include "libnvme.h" +#include "nvme-print.h" #include "wdc-utils.h" int wdc_UtilsSnprintf(char *buffer, unsigned int sizeOfBuffer, const char *format, ...) @@ -133,8 +136,8 @@ end: /** * Compares the strings ignoring their cases. * - * @param pcSrc Points to a null terminated string for comapring. - * @param pcDst Points to a null terminated string for comapring. + * @param pcSrc Points to a null terminated string for comparing. + * @param pcDst Points to a null terminated string for comparing. * * @returns zero if the string matches or * 1 if the pcSrc string is lexically higher than pcDst or @@ -162,3 +165,42 @@ void wdc_StrFormat(char *formatter, size_t fmt_sz, char *tofmt, size_t tofmtsz) } } +bool wdc_CheckUuidListSupport(struct nvme_dev *dev, struct nvme_id_uuid_list *uuid_list) +{ + int err; + struct nvme_id_ctrl ctrl; + + memset(&ctrl, 0, sizeof(struct nvme_id_ctrl)); + err = nvme_identify_ctrl(dev_fd(dev), &ctrl); + if (err) { + fprintf(stderr, "ERROR: WDC: nvme_identify_ctrl() failed 0x%x\n", err); + return false; + } + + if ((ctrl.ctratt & NVME_CTRL_CTRATT_UUID_LIST) == NVME_CTRL_CTRATT_UUID_LIST) { + err = nvme_identify_uuid(dev_fd(dev), uuid_list); + if (!err) + return true; + else if (err > 0) + nvme_show_status(err); + else + nvme_show_error("identify UUID list: %s", nvme_strerror(errno)); + } + + return false; +} + +bool wdc_UuidEqual(struct nvme_id_uuid_list_entry *entry1, struct nvme_id_uuid_list_entry *entry2) +{ + int i; + + for (i = 0; i < 16; i++) { + if (entry1->uuid[i] != entry2->uuid[i]) + break; + } + + if (i == 16) + return true; + else + return false; +} diff --git a/plugins/wdc/wdc-utils.h b/plugins/wdc/wdc-utils.h index 83b208e..3fc47ca 100644 --- a/plugins/wdc/wdc-utils.h +++ b/plugins/wdc/wdc-utils.h @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -76,4 +77,5 @@ int wdc_UtilsStrCompare(char *pcSrc, char *pcDst); int wdc_UtilsCreateDir(char *path); int wdc_WriteToFile(char *fileName, char *buffer, unsigned int bufferLen); void wdc_StrFormat(char *formatter, size_t fmt_sz, char *tofmt, size_t tofmtsz); - +bool wdc_CheckUuidListSupport(struct nvme_dev *dev, struct nvme_id_uuid_list *uuid_list); +bool wdc_UuidEqual(struct nvme_id_uuid_list_entry *entry1, struct nvme_id_uuid_list_entry *entry2); diff --git a/plugins/ymtc/ymtc-nvme.c b/plugins/ymtc/ymtc-nvme.c index 1f99a64..5568c80 100644 --- a/plugins/ymtc/ymtc-nvme.c +++ b/plugins/ymtc/ymtc-nvme.c @@ -54,7 +54,7 @@ static int show_ymtc_smart_log(struct nvme_dev *dev, __u32 nsid, /* Table Title */ printf("Additional Smart Log for NVME device:%s namespace-id:%x\n", dev->name, nsid); - /* Clumn Name*/ + /* Column Name*/ printf("key normalized raw\n"); /* 00 SI_VD_PROGRAM_FAIL */ get_ymtc_smart_info(smart, SI_VD_PROGRAM_FAIL, nm, raw); diff --git a/plugins/ymtc/ymtc-utils.h b/plugins/ymtc/ymtc-utils.h index 39f79cb..e9a3572 100644 --- a/plugins/ymtc/ymtc-utils.h +++ b/plugins/ymtc/ymtc-utils.h @@ -34,7 +34,7 @@ typedef unsigned char u8; #define SI_VD_THERMAL_THROTTLE_TIME_ID 0xEB #define SI_VD_FLASH_MEDIA_ERROR_ID 0xED -/* Addtional smart internal ID */ +/* Additional smart internal ID */ typedef enum { /* smart attr following intel */ diff --git a/plugins/zns/zns.c b/plugins/zns/zns.c index 7b1b191..a7a3766 100644 --- a/plugins/zns/zns.c +++ b/plugins/zns/zns.c @@ -12,6 +12,7 @@ #include "nvme.h" #include "libnvme.h" #include "nvme-print.h" +#include "util/cleanup.h" #define CREATE_CMD #include "zns.h" @@ -135,8 +136,8 @@ static int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *pl if (err) return errno; - err = flags = validate_output_format(cfg.output_format); - if (flags < 0) + err = validate_output_format(cfg.output_format, &flags); + if (err < 0) goto close_dev; err = nvme_zns_identify_ctrl(dev_fd(dev), &ctrl); @@ -188,8 +189,8 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug if (err) return errno; - flags = validate_output_format(cfg.output_format); - if (flags < 0) + err = validate_output_format(cfg.output_format, &flags); + if (err < 0) goto close_dev; if (cfg.vendor_specific) flags |= VS; @@ -560,7 +561,7 @@ static int set_zone_desc(int argc, char **argv, struct command *cmd, struct plug const char *desc = "Set Zone Descriptor Extension\n"; const char *zslba = "starting LBA of the zone for this command"; const char *zrwaa = "Allocate Zone Random Write Area to zone"; - const char *data = "optional file for zone extention data (default stdin)"; + const char *data = "optional file for zone extension data (default stdin)"; const char *timeout = "timeout value, in milliseconds"; int ffd = STDIN_FILENO, err; @@ -603,7 +604,7 @@ static int set_zone_desc(int argc, char **argv, struct command *cmd, struct plug if (!data_len || data_len < 0) { fprintf(stderr, - "zone format does not provide descriptor extention\n"); + "zone format does not provide descriptor extension\n"); errno = EINVAL; err = -1; goto close_dev; @@ -765,8 +766,8 @@ static int zone_mgmt_recv(int argc, char **argv, struct command *cmd, struct plu if (err) return errno; - flags = validate_output_format(cfg.output_format); - if (flags < 0) + err = validate_output_format(cfg.output_format, &flags); + if (err < 0) goto close_dev; if (!cfg.namespace_id) { @@ -833,8 +834,8 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi int zdes = 0, err = -1; struct nvme_dev *dev; __u32 report_size; - bool huge = false; struct nvme_zone_report *report, *buff; + _cleanup_huge_ struct nvme_mem_huge mh = { 0, }; unsigned int nr_zones_chunks = 1024, /* 1024 entries * 64 bytes per entry = 64k byte transfer */ nr_zones_retrieved = 0, @@ -846,7 +847,7 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi struct nvme_id_ns id_ns; uint8_t lbaf; __le64 zsze; - struct json_object *zone_list = 0; + struct json_object *zone_list = NULL; struct config { char *output_format; @@ -880,8 +881,8 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi if (err) return errno; - flags = validate_output_format(cfg.output_format); - if (flags < 0) + err = validate_output_format(cfg.output_format, &flags); + if (err < 0) goto close_dev; if (cfg.verbose) flags |= VERBOSE; @@ -949,7 +950,7 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi log_len = sizeof(struct nvme_zone_report) + ((sizeof(struct nvme_zns_desc) * nr_zones_chunks) + (nr_zones_chunks * zdes)); report_size = log_len; - report = nvme_alloc_huge(report_size, &huge); + report = nvme_alloc_huge(report_size, &mh); if (!report) { perror("alloc"); err = -ENOMEM; @@ -957,10 +958,8 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi } offset = cfg.zslba; - if (flags & JSON) - zone_list = json_create_array(); - else - printf("nr_zones: %"PRIu64"\n", (uint64_t)le64_to_cpu(total_nr_zones)); + + nvme_zns_start_zone_list(total_nr_zones, &zone_list, flags); while (nr_zones_retrieved < nr_zones) { if (nr_zones_retrieved >= nr_zones) @@ -989,15 +988,7 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi offset = le64_to_cpu(report->entries[nr_zones_chunks-1].zslba) + zsze; } - if (flags & JSON) { - struct print_ops *ops; - - ops = nvme_get_json_print_ops(flags); - if (ops) - ops->zns_finish_zone_list(total_nr_zones, zone_list); - } - - nvme_free_huge(report, huge); + nvme_zns_finish_zone_list(total_nr_zones, zone_list, flags); free_buff: free(buff); @@ -1256,8 +1247,8 @@ static int changed_zone_list(int argc, char **argv, struct command *cmd, struct if (err) return errno; - flags = validate_output_format(cfg.output_format); - if (flags < 0) + err = validate_output_format(cfg.output_format, &flags); + if (err < 0) goto close_dev; if (!cfg.namespace_id) { diff --git a/plugins/zns/zns.h b/plugins/zns/zns.h index 77bfdd6..43c4ecd 100644 --- a/plugins/zns/zns.h +++ b/plugins/zns/zns.h @@ -15,7 +15,7 @@ PLUGIN(NAME("zns", "Zoned Namespace Command Set", NVME_VERSION), ENTRY("report-zones", "Report zones associated to a Zoned Namespace", report_zones) ENTRY("reset-zone", "Reset one or more zones", reset_zone) ENTRY("close-zone", "Close one or more zones", close_zone) - ENTRY("finish-zone", "Finishe one or more zones", finish_zone) + ENTRY("finish-zone", "Finish one or more zones", finish_zone) ENTRY("open-zone", "Open one or more zones", open_zone) ENTRY("offline-zone", "Offline one or more zones", offline_zone) ENTRY("set-zone-desc", "Attach zone descriptor extension data to a zone", set_zone_desc) diff --git a/scripts/build.sh b/scripts/build.sh index 07b7aa8..470f39a 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -17,7 +17,7 @@ usage() { echo "configs with meson:" echo " [default] default settings" echo " fallback download all dependencies" - echo " and build them as shared libaries" + echo " and build them as shared libraries" echo " cross use cross toolchain to build" echo " coverage build coverage report" echo " appimage build AppImage target" @@ -59,6 +59,7 @@ CONFIG=${1:-"default"} cd "$(git rev-parse --show-toplevel)" || exit 1 BUILDDIR="$(pwd)/.build-ci" +TOOLDIR="$(pwd)/.build-tools" fn_exists() { declare -F "$1" > /dev/null; } @@ -136,44 +137,56 @@ install_meson_appimage() { } tools_build_samurai() { - mkdir -p "${BUILDDIR}"/build-tools - git clone --depth 1 https://github.com/michaelforney/samurai.git \ - "${BUILDDIR}/build-tools/samurai" - pushd "${BUILDDIR}/build-tools/samurai" || exit 1 + if [ ! -d "${TOOLDIR}"/samurai ]; then + git clone --depth 1 https://github.com/michaelforney/samurai.git \ + "${TOOLDIR}/samurai" + fi + if [[ -f "${TOOLDIR}/samurai/samu" ]]; then + return + fi + + pushd "${TOOLDIR}/samurai" || exit 1 CC="${CC}" make - SAMU="${BUILDDIR}/build-tools/samurai/samu" - popd || exit 1 } tools_build_muon() { - mkdir -p "${BUILDDIR}"/build-tools - git clone --depth 1 https://git.sr.ht/~lattis/muon \ - "${BUILDDIR}/build-tools/muon" - pushd "${BUILDDIR}/build-tools/muon" || exit 1 + if [ ! -d "${TOOLDIR}/muon" ]; then + git clone --depth 1 https://git.sr.ht/~lattis/muon \ + "${TOOLDIR}/muon" + fi - CC="${CC}" ninja="${SAMU}" ./bootstrap.sh stage1 + if [[ -f "${TOOLDIR}/build-muon/muon" ]]; then + return + fi + + pushd "${TOOLDIR}/muon" || exit 1 + + CC="${CC}" CFLAGS="${CFLAGS} -std=c99" ninja="${SAMU}" ./bootstrap.sh stage1 CC="${CC}" ninja="${SAMU}" stage1/muon setup \ - -Dprefix="${BUILDDIR}/build-tools" \ - -Dlibcurl=enabled \ - -Dlibarchive=enabled \ - -Dlibpkgconf=enabled \ + -Dprefix="${TOOLDIR}" \ -Ddocs=disabled \ -Dsamurai=disabled \ - "${BUILDDIR}/build-tools/.build-muon" - "${SAMU}" -C "${BUILDDIR}/build-tools/.build-muon" + -Dbestline=disabled \ + "${TOOLDIR}/build-muon" + "${SAMU}" -C "${TOOLDIR}/build-muon" MUON="${BUILDDIR}/build-tools/.build-muon/muon" - # "${MUON}" -C "${BUILDDIR}/build-tools/.build-muon" test + # "${TOOLDIR}/build-muon/muon" \ + # -C "${TOOLDIR}/build-muon" test popd || exit 1 } config_muon_default() { - CC="${CC}" CFLAGS="${CFLAGS} -static" \ - ninja="${SAMU}" "${MUON}" setup \ + # wrap_mode=forcefallback depends on git being available + + CC="${CC}" CFLAGS="${CFLAGS}" ninja="${SAMU}" \ + "${MUON}" setup \ + -Ddefault_library=static \ + -Dc_link_args="-static" \ -Dwrap_mode=forcefallback \ -Dlibnvme:json-c=disabled \ -Dlibnvme:python=disabled \ @@ -192,22 +205,25 @@ test_muon() { ldd "${BUILDDIR}/nvme" 2>&1 | grep 'not a dynamic executable' || exit 1 } -rm -rf "${BUILDDIR}" - if [[ "${BUILDTOOL}" == "muon" ]]; then - if ! which samu ; then + SAMU="$(which samu 2> /dev/null)" || true + if [[ -z "${SAMU}" ]]; then tools_build_samurai - else - SAMU="$(which samu)" + SAMU="${TOOLDIR}/samurai/samu" fi - if ! which muon ; then + MUON="$(which muon 2> /dev/null)" || true + if [[ -z "${MUON}" ]]; then tools_build_muon - else - MUON="$(which muon)" + MUON="${TOOLDIR}/build-muon/muon" fi fi +echo "samu: ${SAMU}" +echo "muon: ${MUON}" + +rm -rf "${BUILDDIR}" + config_"${BUILDTOOL}"_"${CONFIG}" fn_exists "build_${BUILDTOOL}_${CONFIG}" && "build_${BUILDTOOL}_${CONFIG}" || build_"${BUILDTOOL}" fn_exists "test_${BUILDTOOL}_${CONFIG}" && "test_${BUILDTOOL}_${CONFIG}" || test_"${BUILDTOOL}" diff --git a/scripts/release.sh b/scripts/release.sh index dad3f25..d2cbb08 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -60,7 +60,7 @@ cd "$(git rev-parse --show-toplevel)" || exit 1 if [[ -f subprojects/libnvme.wrap ]]; then git -C subprojects/libnvme fetch --all - # extract the vesion string from libnvme by using the ref + # extract the version string from libnvme by using the ref # defined in libnvme.wrap. libnvme_ref=$(sed -n "s/revision = \([0-9a-z]\+\)/\1/p" subprojects/libnvme.wrap) libnvme_VERSION=$(git -C subprojects/libnvme describe "${libnvme_ref}") @@ -94,7 +94,7 @@ if [ -d "Documentation" ]; then elif [ -d "doc" ]; then doc_dir="doc" else - echo "documenation directory not found" + echo "documentation directory not found" exit 1 fi diff --git a/subprojects/json-c.wrap b/subprojects/json-c.wrap index ce9ff51..569f78e 100644 --- a/subprojects/json-c.wrap +++ b/subprojects/json-c.wrap @@ -1,12 +1,13 @@ [wrap-file] -directory = json-c-0.16 -source_url = https://s3.amazonaws.com/json-c_releases/releases/json-c-0.16.tar.gz -source_filename = json-c-0.16.tar.gz -source_hash = 8e45ac8f96ec7791eaf3bb7ee50e9c2100bbbc87b8d0f1d030c5ba8a0288d96b -patch_filename = json-c_0.16-3_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/json-c_0.16-3/get_patch -patch_hash = 6e712826ba1e6e1b6d21c6157a764984fedc6b594c9f92443498b972b6377a94 -wrapdb_version = 0.16-3 +directory = json-c-0.17 +source_url = https://s3.amazonaws.com/json-c_releases/releases/json-c-0.17.tar.gz +source_filename = json-c-0.17.tar.gz +source_hash = 7550914d58fb63b2c3546f3ccfbe11f1c094147bd31a69dcd23714d7956159e6 +patch_filename = json-c_0.17-2_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/json-c_0.17-2/get_patch +patch_hash = c1a9a7e2ea6bed89a59e13a5684be25899a5a510963154c4450c5a492b8f3984 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/json-c_0.17-2/json-c-0.17.tar.gz +wrapdb_version = 0.17-2 [provide] json-c = json_c_dep diff --git a/subprojects/libnvme.wrap b/subprojects/libnvme.wrap index 0b9475b..4ba4f09 100644 --- a/subprojects/libnvme.wrap +++ b/subprojects/libnvme.wrap @@ -1,6 +1,6 @@ [wrap-git] url = https://github.com/linux-nvme/libnvme.git -revision = 37a803cf77e224f66d86b1e1d9e74a15f55ea600 +revision = f38b1d72e5077c827a3fdf8989dcc2dae70701d1 [provide] libnvme = libnvme_dep diff --git a/tests/meson.build b/tests/meson.build index 90f1a68..f8c6aa2 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -95,5 +95,5 @@ if autopep8.found() and isort.found() command : [python, linter_script, 'format'], ) else - message('autopep8 or isort not found. Python formating disabled') + message('autopep8 or isort not found. Python formatting disabled') endif diff --git a/tests/nvme_attach_detach_ns_test.py b/tests/nvme_attach_detach_ns_test.py index 07c118f..075f211 100644 --- a/tests/nvme_attach_detach_ns_test.py +++ b/tests/nvme_attach_detach_ns_test.py @@ -64,7 +64,7 @@ class TestNVMeAttachDetachNSCmd(TestNVMe): Post Section for TestNVMeAttachDetachNSCmd - Create primary namespace. - - Atttach it to controller. + - Attach it to controller. - Call super class's destructor. """ self.assertEqual(self.create_and_validate_ns(self.default_nsid, diff --git a/tests/nvme_copy_test.py b/tests/nvme_copy_test.py index d84a6d2..a547231 100644 --- a/tests/nvme_copy_test.py +++ b/tests/nvme_copy_test.py @@ -4,56 +4,110 @@ # # Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. # -# Author: Arunpandian J +# Authors: Arunpandian J +# Joy Gu """ NVMe Copy Testcase:- 1. Issue copy command on set of block; shall pass. + 2. If cross-namespace copy formats are supported, enable and test + cross-namespace copy formats. """ +import subprocess + from nvme_test import TestNVMe class TestNVMeCopy(TestNVMe): """ - Represents NVMe Verify testcase. + Represents NVMe Copy testcase. - Attributes: - - start_block : starting block of to verify operation. - - range : Range of blocks for DSM operation. - - slbs : 64-bit addr of first block per range + - ocfs : optional copy formats supported + - host_behavior_data : host behavior support data to restore during teardown - test_log_dir : directory for logs, temp files. """ def setUp(self): """ Pre Section for TestNVMeCopy """ super().setUp() - self.start_block = 0 - self.range = 1 - self.slbs = 1 - self.namespace = 1 + print("\nSetting up test...") + self.ocfs = self.get_ocfs() + cross_namespace_copy = self.ocfs & 0xc + if cross_namespace_copy: + # get host behavior support data + get_features_cmd = ["nvme", "get-feature", self.ctrl, "--feature-id=0x16", "--data-len=512", "-b"] + print("Running command:", " ".join(get_features_cmd)) + self.host_behavior_data = subprocess.check_output(get_features_cmd) + # enable cross-namespace copy formats + if self.host_behavior_data[4] & cross_namespace_copy: + # skip if already enabled + print("Cross-namespace copy already enabled, skipping set-features") + self.host_behavior_data = None + else: + data = self.host_behavior_data[:4] + cross_namespace_copy.to_bytes(2, 'little') + self.host_behavior_data[6:] + set_features_cmd = ["nvme", "set-feature", self.ctrl, "--feature-id=0x16", "--data-len=512"] + print("Running command:", " ".join(set_features_cmd)) + proc = subprocess.Popen(set_features_cmd, + stdout=subprocess.PIPE, + stdin=subprocess.PIPE) + proc.communicate(input=data) + self.assertEqual(proc.returncode, 0, "Failed to enable cross-namespace copy formats") + get_ns_id_cmd = ["nvme", "get-ns-id", self.ns1] + print("Running command:", " ".join(get_ns_id_cmd)) + output = subprocess.check_output(get_ns_id_cmd) + self.ns1_nsid = int(output.decode().strip().split(':')[-1]) self.setup_log_dir(self.__class__.__name__) def tearDown(self): """ Post Section for TestNVMeCopy """ + print("Tearing down test...") + if self.host_behavior_data: + # restore saved host behavior support data + set_features_cmd = ["nvme", "set-feature", self.ctrl, "--feature-id=0x16", "--data-len=512"] + print("Running command:", " ".join(set_features_cmd)) + proc = subprocess.Popen(set_features_cmd, + stdout=subprocess.PIPE, + stdin=subprocess.PIPE) + proc.communicate(input=self.host_behavior_data) super().tearDown() - def copy(self): + def copy(self, sdlba, blocks, slbs, **kwargs): """ Wrapper for nvme copy - Args: - - None + - sdlba : destination logical block address + - blocks : number of logical blocks (0-based) + - slbs : source range logical block address + - descriptor_format : copy descriptor format (optional) + - snsids : source namespace id (optional) + - sopts : source options (optional) - Returns: - - return code for nvme copy command. + - None """ - copy_cmd = "nvme copy " + self.ctrl + \ - " --namespace-id=" + str(self.namespace) + \ - " --sdlba=" + str(self.start_block) + \ - " --blocks=" + str(self.range) + \ - " --slbs=" + str(self.range) - return self.exec_cmd(copy_cmd) + # skip if descriptor format not supported (default format is 0) + desc_format = kwargs.get("descriptor_format", 0) + if not self.ocfs & (1 << desc_format): + print(f"Skip copy because descriptor format {desc_format} is not supported") + return + # build copy command + copy_cmd = f"nvme copy {self.ns1} --format={desc_format} --sdlba={sdlba} --blocks={blocks} --slbs={slbs}" + if "snsids" in kwargs: + copy_cmd += f" --snsids={kwargs['snsids']}" + if "sopts" in kwargs: + copy_cmd += f" --sopts={kwargs['sopts']}" + # run and assert success + print("Running command:", copy_cmd) + self.assertEqual(self.exec_cmd(copy_cmd), 0) def test_copy(self): """ Testcase main """ - self.assertEqual(self.copy(), 0) + print("Running test...") + self.copy(0, 1, 2, descriptor_format=0) + self.copy(0, 1, 2, descriptor_format=1) + self.copy(0, 1, 2, descriptor_format=2, snsids=self.ns1_nsid) + self.copy(0, 1, 2, descriptor_format=2, snsids=self.ns1_nsid, sopts=0) + self.copy(0, 1, 2, descriptor_format=3, snsids=self.ns1_nsid) + self.copy(0, 1, 2, descriptor_format=3, snsids=self.ns1_nsid, sopts=0) diff --git a/tests/nvme_create_max_ns_test.py b/tests/nvme_create_max_ns_test.py index 5179711..bda93e1 100644 --- a/tests/nvme_create_max_ns_test.py +++ b/tests/nvme_create_max_ns_test.py @@ -66,7 +66,7 @@ class TestNVMeCreateMaxNS(TestNVMe): Post Section for TestNVMeAttachDetachNSCmd - Create primary namespace. - - Atttach it to controller. + - Attach it to controller. - Call super class's destructor. """ self.assertEqual(self.create_and_validate_ns(self.default_nsid, diff --git a/tests/nvme_format_test.py b/tests/nvme_format_test.py index 68e5a2f..40635c1 100644 --- a/tests/nvme_format_test.py +++ b/tests/nvme_format_test.py @@ -81,7 +81,7 @@ class TestNVMeFormatCmd(TestNVMe): Post Section for TestNVMeFormatCmd - Create primary namespace. - - Atttach it to controller. + - Attach it to controller. - Call super class's destructor. """ self.assertEqual(self.create_and_validate_ns(self.default_nsid, diff --git a/tests/nvme_get_features_test.py b/tests/nvme_get_features_test.py index 784f2be..974fc34 100644 --- a/tests/nvme_get_features_test.py +++ b/tests/nvme_get_features_test.py @@ -47,7 +47,7 @@ class TestNVMeGetMandatoryFeatures(TestNVMe): - Attributes: - feature_id_list : list of the mandatory features. - get_vector_list_cmd : vector list collection for 09h. - - vector_list_len : numer of the interrupt vectors. + - vector_list_len : number of the interrupt vectors. """ def setUp(self): diff --git a/tests/nvme_test.py b/tests/nvme_test.py index d5eca18..0df3dac 100644 --- a/tests/nvme_test.py +++ b/tests/nvme_test.py @@ -39,7 +39,7 @@ from nvme_test_logger import TestNVMeLogger class TestNVMe(unittest.TestCase): """ - Represents a testcase, each testcase shuold inherit this + Represents a testcase, each testcase should inherit this class or appropriate subclass which is a child of this class. Common utility functions used in various testcases. @@ -58,11 +58,13 @@ class TestNVMe(unittest.TestCase): self.ctrl = "XXX" self.ns1 = "XXX" self.test_log_dir = "XXX" + self.do_validate_pci_device = True self.default_nsid = 0x1 self.config_file = 'tests/config.json' self.load_config() - self.validate_pci_device() + if self.do_validate_pci_device: + self.validate_pci_device() def tearDown(self): """ Post Section for TestNVMe. """ @@ -70,7 +72,7 @@ class TestNVMe(unittest.TestCase): shutil.rmtree(self.log_dir, ignore_errors=True) def validate_pci_device(self): - """ Validate underlaying device belogs to pci subsystem. + """ Validate underlying device belongs to pci subsystem. - Args: - None - Returns: @@ -93,6 +95,7 @@ class TestNVMe(unittest.TestCase): self.ctrl = config['controller'] self.ns1 = config['ns1'] self.log_dir = config['log_dir'] + self.do_validate_pci_device = config.get('do_validate_pci_device', self.do_validate_pci_device) self.clear_log_dir = False if self.clear_log_dir is True: @@ -162,7 +165,7 @@ class TestNVMe(unittest.TestCase): return ctrl_id def get_ns_list(self): - """ Wrapper for extrating the namespace list. + """ Wrapper for extracting the namespace list. - Args: - None - Returns: @@ -181,7 +184,7 @@ class TestNVMe(unittest.TestCase): return ns_list def get_max_ns(self): - """ Wrapper for extracting maximum number of namspaces supported. + """ Wrapper for extracting maximum number of namespaces supported. - Args: - None - Returns: @@ -228,6 +231,19 @@ class TestNVMe(unittest.TestCase): print(ncap) return int(ncap) + def get_ocfs(self): + """ Wrapper for extracting optional copy formats supported + - Args: + - None + - Returns: + - Optional Copy Formats Supported + """ + pattern = re.compile(r'^ocfs\s*: 0x[0-9a-fA-F]+$') + output = subprocess.check_output(["nvme", "id-ctrl", self.ctrl], encoding='utf-8') + ocfs_line = next(line for line in output.splitlines() if pattern.match(line)) + ocfs = ocfs_line.split(":")[1].strip() + return int(ocfs, 16) + def get_format(self): """ Wrapper for extracting format. - Args: diff --git a/util/cleanup.c b/util/cleanup.c deleted file mode 100644 index d6ac7c6..0000000 --- a/util/cleanup.c +++ /dev/null @@ -1,5 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -#include -#include "cleanup.h" - -DEFINE_CLEANUP_FUNC(cleanup_charp, char *, free); diff --git a/util/cleanup.h b/util/cleanup.h index 9227856..ee9b120 100644 --- a/util/cleanup.h +++ b/util/cleanup.h @@ -5,6 +5,8 @@ #include #include +#include "util/mem.h" + #define __cleanup__(fn) __attribute__((cleanup(fn))) #define DECLARE_CLEANUP_FUNC(name, type) \ @@ -17,17 +19,17 @@ DECLARE_CLEANUP_FUNC(name, type) \ free_fn(*__p); \ } -DECLARE_CLEANUP_FUNC(cleanup_charp, char *); - static inline void freep(void *p) { free(*(void**) p); } #define _cleanup_free_ __cleanup__(freep) +#define _cleanup_huge_ __cleanup__(nvme_free_huge) + static inline void close_file(int *f) { - if (*f >= 0) + if (*f > STDERR_FILENO) close(*f); } #define _cleanup_file_ __cleanup__(close_file) diff --git a/util/mem.c b/util/mem.c new file mode 100644 index 0000000..d2be46e --- /dev/null +++ b/util/mem.c @@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#include +#include +#include +#include +#include + +#include "mem.h" + +#include "common.h" + +#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) +#define HUGE_MIN 0x80000 + +void *nvme_alloc(size_t len) +{ + void *p; + + len = ROUND_UP(len, 0x1000); + if (posix_memalign((void *)&p, getpagesize(), len)) + return NULL; + + memset(p, 0, len); + return p; +} + +void *nvme_realloc(void *p, size_t len) +{ + size_t old_len = malloc_usable_size(p); + + void *result = nvme_alloc(len); + + if (p) { + memcpy(result, p, min(old_len, len)); + free(p); + } + + return result; +} + +void *nvme_alloc_huge(size_t len, struct nvme_mem_huge *mh) +{ + memset(mh, 0, sizeof(*mh)); + + len = ROUND_UP(len, 0x1000); + + /* + * For smaller allocation we just use posix_memalign and hope the kernel + * is able to convert to a contiguous memory region. + */ + if (len < HUGE_MIN) { + mh->p = nvme_alloc(len); + if (!mh->p) + return NULL; + mh->posix_memalign = true; + mh->len = len; + return mh->p; + } + + /* + * Larger allocation will almost certainly fail with the small + * allocation approach. Instead try pre-allocating memory from the + * HugeTLB pool. + * + * https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt + */ + mh->p = mmap(NULL, len, PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE | MAP_HUGETLB, -1, 0); + if (mh->p != MAP_FAILED) { + mh->len = len; + return mh->p; + } + + /* + * And if mmap fails because the pool is empty, try to use + * posix_memalign/madvise as fallback with a 2MB aligmnent in order to + * fullfil the request. This gives the kernel a chance to try to claim + * some huge pages. This might still fail though. + */ + len = ROUND_UP(len, 0x200000); + if (posix_memalign(&mh->p, 0x200000, len)) + return NULL; + mh->posix_memalign = true; + mh->len = len; + + memset(mh->p, 0, mh->len); + + if (madvise(mh->p, mh->len, MADV_HUGEPAGE) < 0) { + nvme_free_huge(mh); + return NULL; + } + + return mh->p; +} + +void nvme_free_huge(struct nvme_mem_huge *mh) + +{ + if (!mh || mh->len == 0) + return; + + if (mh->posix_memalign) + free(mh->p); + else + munmap(mh->p, mh->len); + + mh->len = 0; + mh->p = NULL; +} diff --git a/util/mem.h b/util/mem.h new file mode 100644 index 0000000..d13eb3a --- /dev/null +++ b/util/mem.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef MEM_H_ +#define MEM_H_ + +#include +#include + +void *nvme_alloc(size_t len); +void *nvme_realloc(void *p, size_t len); + +struct nvme_mem_huge { + size_t len; + bool posix_memalign; /* p has been allocated using posix_memalign */ + void *p; +}; + +void *nvme_alloc_huge(size_t len, struct nvme_mem_huge *mh); +void nvme_free_huge(struct nvme_mem_huge *mh); + +#endif /* MEM_H_ */ diff --git a/util/meson.build b/util/meson.build index f149d03..dfc683b 100644 --- a/util/meson.build +++ b/util/meson.build @@ -3,8 +3,8 @@ sources += [ 'util/argconfig.c', 'util/base64.c', - 'util/cleanup.c', 'util/crc32.c', + 'util/mem.c', 'util/suffix.c', 'util/types.c', ]