From 6eefa91302b4373a2d5daf15fc42b84e9d019d21 Mon Sep 17 00:00:00 2001 From: jeff-lien-wdc Date: Fri, 10 Jan 2025 16:10:39 -0600 Subject: [PATCH 1/2] sandisk: Add sandisk plugin Add new plugin to support sandisk drives. Signed-off-by: jeff-lien-wdc --- plugins/meson.build | 2 + plugins/sandisk/sandisk-nvme.c | 307 ++++++++++++++++++ plugins/sandisk/sandisk-nvme.h | 81 +++++ plugins/sandisk/sandisk-utils.c | 534 ++++++++++++++++++++++++++++++++ plugins/sandisk/sandisk-utils.h | 192 ++++++++++++ plugins/wdc/wdc-nvme-cmds.h | 121 ++++++++ plugins/wdc/wdc-nvme.c | 198 ++++++++++++ 7 files changed, 1435 insertions(+) create mode 100644 plugins/sandisk/sandisk-nvme.c create mode 100644 plugins/sandisk/sandisk-nvme.h create mode 100644 plugins/sandisk/sandisk-utils.c create mode 100644 plugins/sandisk/sandisk-utils.h create mode 100644 plugins/wdc/wdc-nvme-cmds.h diff --git a/plugins/meson.build b/plugins/meson.build index 3f49bf2764..e7398a5f05 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -22,6 +22,8 @@ sources += [ 'plugins/nbft/nbft-plugin.c', 'plugins/netapp/netapp-nvme.c', 'plugins/nvidia/nvidia-nvme.c', + 'plugins/sandisk/sandisk-nvme.c', + 'plugins/sandisk/sandisk-utils.c', 'plugins/scaleflux/sfx-nvme.c', 'plugins/seagate/seagate-nvme.c', 'plugins/shannon/shannon-nvme.c', diff --git a/plugins/sandisk/sandisk-nvme.c b/plugins/sandisk/sandisk-nvme.c new file mode 100644 index 0000000000..b867ea21cd --- /dev/null +++ b/plugins/sandisk/sandisk-nvme.c @@ -0,0 +1,307 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Sandisk Corporation or its affiliates. + * + * Author: Jeff Lien + * Brandon Paupore + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "nvme.h" +#include "libnvme.h" +#include "plugin.h" +#include "linux/types.h" +#include "util/cleanup.h" +#include "util/types.h" +#include "nvme-print.h" + +#define CREATE_CMD +#include "sandisk-nvme.h" +#include "sandisk-utils.h" +#include "plugins/wdc/wdc-nvme-cmds.h" + + +static int sndk_vs_internal_fw_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_internal_fw_log(argc, argv, command, plugin); +} + +static int sndk_vs_nand_stats(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_nand_stats(argc, argv, command, plugin); +} + +static int sndk_vs_smart_add_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_smart_add_log(argc, argv, command, plugin); +} + +static int sndk_clear_pcie_correctable_errors(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_clear_pcie_correctable_errors(argc, argv, command, plugin); +} + +static int sndk_drive_status(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_drive_status(argc, argv, command, plugin); +} + +static int sndk_clear_assert_dump(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_clear_assert_dump(argc, argv, command, plugin); +} + +static int sndk_drive_resize(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_drive_resize(argc, argv, command, plugin); +} + +static int sndk_vs_fw_activate_history(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_fw_activate_history(argc, argv, command, plugin); +} + +static int sndk_clear_fw_activate_history(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_clear_fw_activate_history(argc, argv, command, plugin); +} + +static int sndk_vs_telemetry_controller_option(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_telemetry_controller_option(argc, argv, command, plugin); +} + +static int sndk_reason_identifier(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_reason_identifier(argc, argv, command, plugin); +} + +static int sndk_log_page_directory(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_log_page_directory(argc, argv, command, plugin); +} + +static int sndk_namespace_resize(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_namespace_resize(argc, argv, command, plugin); +} + +static int sndk_vs_drive_info(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_drive_info(argc, argv, command, plugin); +} + +static int sndk_capabilities(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + const char *desc = "Send a capabilities command."; + uint64_t capabilities = 0; + struct nvme_dev *dev; + nvme_root_t r; + int ret; + + OPT_ARGS(opts) = { + OPT_END() + }; + + ret = parse_and_open(&dev, argc, argv, desc, opts); + if (ret) + return ret; + + /* get capabilities */ + r = nvme_scan(NULL); + sndk_check_device(r, dev); + capabilities = sndk_get_drive_capabilities(r, dev); + + /* print command and supported status */ + printf("Sandisk Plugin Capabilities for NVME device:%s\n", dev->name); + printf("vs-internal-log : %s\n", + capabilities & SNDK_DRIVE_CAP_INTERNAL_LOG_MASK ? "Supported" : "Not Supported"); + printf("vs-nand-stats : %s\n", + capabilities & SNDK_DRIVE_CAP_NAND_STATS ? "Supported" : "Not Supported"); + printf("vs-smart-add-log : %s\n", + capabilities & SNDK_DRIVE_CAP_SMART_LOG_MASK ? "Supported" : "Not Supported"); + printf("--C0 Log Page : %s\n", + capabilities & SNDK_DRIVE_CAP_C0_LOG_PAGE ? "Supported" : "Not Supported"); + printf("--C1 Log Page : %s\n", + capabilities & SNDK_DRIVE_CAP_C1_LOG_PAGE ? "Supported" : "Not Supported"); + printf("--C3 Log Page : %s\n", + capabilities & SNDK_DRIVE_CAP_C3_LOG_PAGE ? "Supported" : "Not Supported"); + printf("--CA Log Page : %s\n", + capabilities & SNDK_DRIVE_CAP_CA_LOG_PAGE ? "Supported" : "Not Supported"); + printf("--D0 Log Page : %s\n", + capabilities & SNDK_DRIVE_CAP_D0_LOG_PAGE ? "Supported" : "Not Supported"); + printf("clear-pcie-correctable-errors : %s\n", + capabilities & SNDK_DRIVE_CAP_CLEAR_PCIE_MASK ? "Supported" : "Not Supported"); + printf("get-drive-status : %s\n", + capabilities & SNDK_DRIVE_CAP_DRIVE_STATUS ? "Supported" : "Not Supported"); + printf("drive-resize : %s\n", + capabilities & SNDK_DRIVE_CAP_RESIZE ? "Supported" : "Not Supported"); + printf("vs-fw-activate-history : %s\n", + capabilities & SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY_MASK ? "Supported" : + "Not Supported"); + printf("clear-fw-activate-history : %s\n", + capabilities & SNDK_DRIVE_CAP_CLEAR_FW_ACT_HISTORY_MASK ? "Supported" : + "Not Supported"); + printf("vs-telemetry-controller-option: %s\n", + capabilities & SNDK_DRIVE_CAP_DISABLE_CTLR_TELE_LOG ? "Supported" : "Not Supported"); + printf("vs-error-reason-identifier : %s\n", + capabilities & SNDK_DRIVE_CAP_REASON_ID ? "Supported" : "Not Supported"); + printf("log-page-directory : %s\n", + capabilities & SNDK_DRIVE_CAP_LOG_PAGE_DIR ? "Supported" : "Not Supported"); + printf("namespace-resize : %s\n", + capabilities & SNDK_DRIVE_CAP_NS_RESIZE ? "Supported" : "Not Supported"); + printf("vs-drive-info : %s\n", + capabilities & SNDK_DRIVE_CAP_INFO ? "Supported" : "Not Supported"); + printf("vs-temperature-stats : %s\n", + capabilities & SNDK_DRIVE_CAP_TEMP_STATS ? "Supported" : "Not Supported"); + printf("cloud-SSD-plugin-version : %s\n", + capabilities & SNDK_DRIVE_CAP_CLOUD_SSD_VERSION ? "Supported" : "Not Supported"); + printf("vs-pcie-stats : %s\n", + capabilities & SNDK_DRIVE_CAP_PCIE_STATS ? "Supported" : "Not Supported"); + printf("get-error-recovery-log : %s\n", + capabilities & SNDK_DRIVE_CAP_OCP_C1_LOG_PAGE ? "Supported" : "Not Supported"); + printf("get-dev-capabilities-log : %s\n", + capabilities & SNDK_DRIVE_CAP_OCP_C4_LOG_PAGE ? "Supported" : "Not Supported"); + printf("get-unsupported-reqs-log : %s\n", + capabilities & SNDK_DRIVE_CAP_OCP_C5_LOG_PAGE ? "Supported" : "Not Supported"); + printf("get-latency-monitor-log : %s\n", + capabilities & SNDK_DRIVE_CAP_C3_LOG_PAGE ? "Supported" : "Not Supported"); + printf("cloud-boot-SSD-version : %s\n", + capabilities & SNDK_DRIVE_CAP_CLOUD_BOOT_SSD_VERSION ? "Supported" : + "Not Supported"); + printf("vs-cloud-log : %s\n", + capabilities & SNDK_DRIVE_CAP_CLOUD_LOG_PAGE ? "Supported" : "Not Supported"); + printf("vs-hw-rev-log : %s\n", + capabilities & SNDK_DRIVE_CAP_HW_REV_LOG_PAGE ? "Supported" : "Not Supported"); + printf("vs-device_waf : %s\n", + capabilities & SNDK_DRIVE_CAP_DEVICE_WAF ? "Supported" : "Not Supported"); + printf("set-latency-monitor-feature : %s\n", + capabilities & SNDK_DRIVE_CAP_SET_LATENCY_MONITOR ? "Supported" : "Not Supported"); + printf("capabilities : Supported\n"); + nvme_free_tree(r); + dev_close(dev); + + return 0; +} + +static int sndk_cloud_ssd_plugin_version(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_cloud_ssd_plugin_version(argc, argv, command, plugin); +} + +static int sndk_vs_pcie_stats(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_pcie_stats(argc, argv, command, plugin); +} + +static int sndk_get_latency_monitor_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_get_latency_monitor_log(argc, argv, command, plugin); +} + +static int sndk_get_error_recovery_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_get_error_recovery_log(argc, argv, command, plugin); +} + +static int sndk_get_dev_capabilities_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_get_dev_capabilities_log(argc, argv, command, plugin); +} + +static int sndk_get_unsupported_reqs_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_get_unsupported_reqs_log(argc, argv, command, plugin); +} + +static int sndk_cloud_boot_SSD_version(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_cloud_boot_SSD_version(argc, argv, command, plugin); +} + +static int sndk_vs_cloud_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_cloud_log(argc, argv, command, plugin); +} + +static int sndk_vs_hw_rev_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_hw_rev_log(argc, argv, command, plugin); +} + +static int sndk_vs_device_waf(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_device_waf(argc, argv, command, plugin); +} + +static int sndk_set_latency_monitor_feature(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_set_latency_monitor_feature(argc, argv, command, plugin); +} + +static int sndk_vs_temperature_stats(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_vs_temperature_stats(argc, argv, command, plugin); +} diff --git a/plugins/sandisk/sandisk-nvme.h b/plugins/sandisk/sandisk-nvme.h new file mode 100644 index 0000000000..8079d38287 --- /dev/null +++ b/plugins/sandisk/sandisk-nvme.h @@ -0,0 +1,81 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#undef CMD_INC_FILE +#define CMD_INC_FILE plugins/sandisk/sandisk-nvme + +#if !defined(SANDISK_NVME) || defined(CMD_HEADER_MULTI_READ) +#define SANDISK_NVME + +#define SANDISK_PLUGIN_VERSION "2.12.0" +#include "cmd.h" + +PLUGIN(NAME("sandisk", "Sandisk vendor specific extensions", SANDISK_PLUGIN_VERSION), + COMMAND_LIST( + ENTRY("vs-internal-log", "Sandisk Internal Firmware Log", + sndk_vs_internal_fw_log) + ENTRY("vs-nand-stats", "Sandisk NAND Statistics", sndk_vs_nand_stats) + ENTRY("vs-smart-add-log", "Sandisk Additional Smart Log", + sndk_vs_smart_add_log) + ENTRY("clear-pcie-correctable-errors", + "Sandisk Clear PCIe Correctable Error Count", + sndk_clear_pcie_correctable_errors) + ENTRY("get-drive-status", "Sandisk Get Drive Status", + sndk_drive_status) + ENTRY("clear-assert-dump", "Sandisk Clear Assert Dump", + sndk_clear_assert_dump) + ENTRY("drive-resize", "Sandisk Drive Resize", sndk_drive_resize) + ENTRY("vs-fw-activate-history", "Sandisk Get FW Activate History", + sndk_vs_fw_activate_history) + ENTRY("clear-fw-activate-history", + "Sandisk Clear FW Activate History", + sndk_clear_fw_activate_history) + ENTRY("vs-telemetry-controller-option", + "Sandisk Enable/Disable Controller Initiated Telemetry Log", + sndk_vs_telemetry_controller_option) + ENTRY("vs-error-reason-identifier", + "Sandisk Telemetry Reason Identifier", + sndk_reason_identifier) + ENTRY("log-page-directory", "Sandisk Get Log Page Directory", + sndk_log_page_directory) + ENTRY("namespace-resize", "Sandisk NamespaceDrive Resize", + sndk_namespace_resize) + ENTRY("vs-drive-info", "Sandisk Get Drive Info", sndk_vs_drive_info) + ENTRY("vs-temperature-stats", "Sandisk Get Temperature Stats", + sndk_vs_temperature_stats) + ENTRY("capabilities", "Sandisk Device Capabilities", + sndk_capabilities) + ENTRY("cloud-SSD-plugin-version", + "Sandisk Cloud SSD Plugin Version", + sndk_cloud_ssd_plugin_version) + ENTRY("vs-pcie-stats", "Sandisk VS PCIE Statistics", + sndk_vs_pcie_stats) + ENTRY("get-latency-monitor-log", + "Sandisk Get Latency Monitor Log Page", + sndk_get_latency_monitor_log) + ENTRY("get-error-recovery-log", + "Sandisk Get Error Recovery Log Page", + sndk_get_error_recovery_log) + ENTRY("get-dev-capabilities-log", + "Sandisk Get Device Capabilities Log Page", + sndk_get_dev_capabilities_log) + ENTRY("get-unsupported-reqs-log", + "Sandisk Get Unsupported Requirements Log Page", + sndk_get_unsupported_reqs_log) + ENTRY("cloud-boot-SSD-version", + "Sandisk Get the Cloud Boot SSD Version", + sndk_cloud_boot_SSD_version) + ENTRY("vs-cloud-log", "Sandisk Get the Cloud Log Page", + sndk_vs_cloud_log) + ENTRY("vs-hw-rev-log", "Sandisk Get the Hardware Revision Log Page", + sndk_vs_hw_rev_log) + ENTRY("vs-device-waf", + "Sandisk Calculate Device Write Amplication Factor", + sndk_vs_device_waf) + ENTRY("set-latency-monitor-feature", + "Sandisk set Latency Monitor feature", + sndk_set_latency_monitor_feature) + ) +); + +#endif + +#include "define_cmd.h" diff --git a/plugins/sandisk/sandisk-utils.c b/plugins/sandisk/sandisk-utils.c new file mode 100644 index 0000000000..fdc05eadaf --- /dev/null +++ b/plugins/sandisk/sandisk-utils.c @@ -0,0 +1,534 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Sandisk Corporation or its affiliates. + * + * Author: Jeff Lien + * Brandon Paupore + */ + +#include +#include +#include +#include +#include +#include "nvme.h" +#include "libnvme.h" +#include "nvme-print.h" +#include "sandisk-utils.h" +#include "plugins/wdc/wdc-nvme-cmds.h" + + +int sndk_get_pci_ids(nvme_root_t r, struct nvme_dev *dev, + uint32_t *device_id, uint32_t *vendor_id) +{ + char vid[256], did[256], id[32]; + nvme_ctrl_t c = NULL; + nvme_ns_t n = NULL; + int fd, ret; + + c = nvme_scan_ctrl(r, dev->name); + if (c) { + snprintf(vid, sizeof(vid), "%s/device/vendor", + nvme_ctrl_get_sysfs_dir(c)); + snprintf(did, sizeof(did), "%s/device/device", + nvme_ctrl_get_sysfs_dir(c)); + nvme_free_ctrl(c); + } else { + n = nvme_scan_namespace(dev->name); + if (!n) { + fprintf(stderr, "Unable to find %s\n", dev->name); + return -1; + } + + snprintf(vid, sizeof(vid), "%s/device/device/vendor", + nvme_ns_get_sysfs_dir(n)); + snprintf(did, sizeof(did), "%s/device/device/device", + nvme_ns_get_sysfs_dir(n)); + nvme_free_ns(n); + } + + fd = open(vid, O_RDONLY); + if (fd < 0) { + fprintf(stderr, "ERROR: SNDK: %s : Open vendor file failed\n", __func__); + return -1; + } + + ret = read(fd, id, 32); + close(fd); + + if (ret < 0) { + fprintf(stderr, "%s: Read of pci vendor id failed\n", __func__); + return -1; + } + id[ret < 32 ? ret : 31] = '\0'; + if (id[strlen(id) - 1] == '\n') + id[strlen(id) - 1] = '\0'; + + *vendor_id = strtol(id, NULL, 0); + ret = 0; + + fd = open(did, O_RDONLY); + if (fd < 0) { + fprintf(stderr, "ERROR: SNDK: %s : Open device file failed\n", __func__); + return -1; + } + + ret = read(fd, id, 32); + close(fd); + + if (ret < 0) { + fprintf(stderr, "ERROR: SNDK: %s: Read of pci device id failed\n", __func__); + return -1; + } + id[ret < 32 ? ret : 31] = '\0'; + if (id[strlen(id) - 1] == '\n') + id[strlen(id) - 1] = '\0'; + + *device_id = strtol(id, NULL, 0); + return 0; +} + +int sndk_get_vendor_id(struct nvme_dev *dev, uint32_t *vendor_id) +{ + int ret; + struct nvme_id_ctrl ctrl; + + memset(&ctrl, 0, sizeof(struct nvme_id_ctrl)); + ret = nvme_identify_ctrl(dev_fd(dev), &ctrl); + if (ret) { + fprintf(stderr, "ERROR: SNDK: nvme_identify_ctrl() failed 0x%x\n", ret); + return -1; + } + + *vendor_id = (uint32_t) ctrl.vid; + + return ret; +} + +bool sndk_check_device(nvme_root_t r, struct nvme_dev *dev) +{ + int ret; + bool supported; + uint32_t read_device_id = -1, read_vendor_id = -1; + + ret = sndk_get_pci_ids(r, dev, &read_device_id, &read_vendor_id); + if (ret < 0) { + /* Use the identify nvme command to get vendor id due to NVMeOF device. */ + if (sndk_get_vendor_id(dev, &read_vendor_id) < 0) + return false; + } + + supported = false; + + if (read_vendor_id == SNDK_NVME_SNDK_VID || + read_vendor_id == SNDK_NVME_WDC_VID) + supported = true; + else + fprintf(stderr, + "ERROR: SNDK: unsupported Sandisk device, Vendor ID = 0x%x, Device ID = 0x%x\n", + read_vendor_id, read_device_id); + + return supported; +} + +__u64 sndk_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev) +{ + __u64 capabilities = 0; + + int ret; + uint32_t read_device_id = -1, read_vendor_id = -1; + __u32 cust_id; + + ret = sndk_get_pci_ids(r, dev, &read_device_id, &read_vendor_id); + if (ret < 0) { + if (sndk_get_vendor_id(dev, &read_vendor_id) < 0) + return capabilities; + } + + /* + * Below check condition is added due in NVMeOF device + * We aren't able to read the device_id in this case + * so we can only use the vendor_id + */ + if (read_device_id == -1 && read_vendor_id != -1) { + capabilities = sndk_get_enc_drive_capabilities(r, dev); + return capabilities; + } + + switch (read_vendor_id) { + case SNDK_NVME_WDC_VID: + switch (read_device_id) { + case SNDK_NVME_SN630_DEV_ID: + case SNDK_NVME_SN630_DEV_ID_1: + capabilities = (SNDK_DRIVE_CAP_INTERNAL_LOG | + SNDK_DRIVE_CAP_DRIVE_STATUS | + SNDK_DRIVE_CAP_CLEAR_ASSERT | + SNDK_DRIVE_CAP_RESIZE | + SNDK_DRIVE_CAP_CLEAR_PCIE); + /* verify the 0xCA log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_DEVICE_INFO_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_CA_LOG_PAGE; + + /* verify the 0xD0 log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_VU_SMART_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_D0_LOG_PAGE; + break; + + case SNDK_NVME_SN640_DEV_ID: + case SNDK_NVME_SN640_DEV_ID_1: + case SNDK_NVME_SN640_DEV_ID_2: + case SNDK_NVME_SN640_DEV_ID_3: + /* verify the 0xC0 log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_SMART_CLOUD_ATTR_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_C0_LOG_PAGE; + + capabilities |= (SNDK_DRIVE_CAP_INTERNAL_LOG | + SNDK_DRIVE_CAP_DRIVE_STATUS | + SNDK_DRIVE_CAP_CLEAR_ASSERT | + SNDK_DRIVE_CAP_RESIZE | + SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY | + SNDK_DRIVE_CAP_DISABLE_CTLR_TELE_LOG | + SNDK_DRIVE_CAP_REASON_ID | + SNDK_DRIVE_CAP_LOG_PAGE_DIR); + + /* verify the 0xC1 (OCP Error Recovery) log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_ERROR_REC_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_OCP_C1_LOG_PAGE; + + /* verify the 0xC3 (OCP Latency Monitor) log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_LATENCY_MON_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_C3_LOG_PAGE; + + /* verify the 0xC4 (OCP Device Capabilities) log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_DEV_CAP_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_OCP_C4_LOG_PAGE; + + /* verify the 0xC5 (OCP Unsupported Requirements) log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_UNSUPPORTED_REQS_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_OCP_C5_LOG_PAGE; + + /* verify the 0xCA log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_DEVICE_INFO_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_CA_LOG_PAGE; + + /* verify the 0xD0 log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_VU_SMART_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_D0_LOG_PAGE; + + cust_id = run_wdc_get_fw_cust_id(r, dev); + if (cust_id == SNDK_INVALID_CUSTOMER_ID) { + fprintf(stderr, "%s: ERROR: SNDK: invalid customer id\n", __func__); + return -1; + } + + if ((cust_id == SNDK_CUSTOMER_ID_0x1004) || + (cust_id == SNDK_CUSTOMER_ID_0x1008) || + (cust_id == SNDK_CUSTOMER_ID_0x1005) || + (cust_id == SNDK_CUSTOMER_ID_0x1304)) + capabilities |= (SNDK_DRIVE_CAP_VU_FID_CLEAR_FW_ACT_HISTORY | + SNDK_DRIVE_CAP_VU_FID_CLEAR_PCIE | + SNDK_DRIVE_CAP_INFO | + SNDK_DRIVE_CAP_CLOUD_SSD_VERSION); + else + capabilities |= (SNDK_DRIVE_CAP_CLEAR_FW_ACT_HISTORY | + SNDK_DRIVE_CAP_CLEAR_PCIE); + + break; + + case SNDK_NVME_SN840_DEV_ID: + case SNDK_NVME_SN840_DEV_ID_1: + /* verify the 0xC0 log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_EOL_STATUS_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_C0_LOG_PAGE; + + capabilities |= (SNDK_DRIVE_CAP_INTERNAL_LOG | + SNDK_DRIVE_CAP_DRIVE_STATUS | + SNDK_DRIVE_CAP_CLEAR_ASSERT | + SNDK_DRIVE_CAP_RESIZE | + SNDK_DRIVE_CAP_CLEAR_PCIE | + SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY | + SNDK_DRIVE_CAP_CLEAR_FW_ACT_HISTORY | + SNDK_DRIVE_CAP_DISABLE_CTLR_TELE_LOG | + SNDK_DRIVE_CAP_REASON_ID | + SNDK_DRIVE_CAP_LOG_PAGE_DIR); + + /* verify the 0xCA log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_DEVICE_INFO_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_CA_LOG_PAGE; + + /* verify the 0xD0 log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_VU_SMART_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_D0_LOG_PAGE; + break; + + case SNDK_NVME_SN650_DEV_ID: + case SNDK_NVME_SN650_DEV_ID_1: + case SNDK_NVME_SN650_DEV_ID_2: + case SNDK_NVME_SN650_DEV_ID_3: + case SNDK_NVME_SN650_DEV_ID_4: + case SNDK_NVME_SN655_DEV_ID: + case SNDK_NVME_SN655_DEV_ID_1: + /* verify the 0xC0 log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_SMART_CLOUD_ATTR_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_C0_LOG_PAGE; + + /* verify the 0xC1 (OCP Error Recovery) log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_ERROR_REC_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_OCP_C1_LOG_PAGE; + + /* verify the 0xC3 (OCP Latency Monitor) log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_LATENCY_MON_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_C3_LOG_PAGE; + + /* verify the 0xC4 (OCP Device Capabilities) log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_DEV_CAP_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_OCP_C4_LOG_PAGE; + + /* verify the 0xC5 (OCP Unsupported Requirements) log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_UNSUPPORTED_REQS_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_OCP_C5_LOG_PAGE; + + capabilities |= (SNDK_DRIVE_CAP_INTERNAL_LOG | + SNDK_DRIVE_CAP_DRIVE_STATUS | + SNDK_DRIVE_CAP_CLEAR_ASSERT | + SNDK_DRIVE_CAP_RESIZE | + SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY | + SNDK_DRIVE_CAP_DISABLE_CTLR_TELE_LOG | + SNDK_DRIVE_CAP_REASON_ID | + SNDK_DRIVE_CAP_LOG_PAGE_DIR); + + cust_id = run_wdc_get_fw_cust_id(r, dev); + if (cust_id == SNDK_INVALID_CUSTOMER_ID) { + fprintf(stderr, "%s: ERROR: SNDK: invalid customer id\n", __func__); + return -1; + } + + if ((cust_id == SNDK_CUSTOMER_ID_0x1004) || + (cust_id == SNDK_CUSTOMER_ID_0x1008) || + (cust_id == SNDK_CUSTOMER_ID_0x1005) || + (cust_id == SNDK_CUSTOMER_ID_0x1304)) + capabilities |= (SNDK_DRIVE_CAP_VU_FID_CLEAR_FW_ACT_HISTORY | + SNDK_DRIVE_CAP_VU_FID_CLEAR_PCIE | + SNDK_DRIVE_CAP_INFO | + SNDK_DRIVE_CAP_CLOUD_SSD_VERSION); + else + capabilities |= (SNDK_DRIVE_CAP_CLEAR_FW_ACT_HISTORY | + SNDK_DRIVE_CAP_CLEAR_PCIE); + + break; + + case SNDK_NVME_SN861_DEV_ID: + case SNDK_NVME_SN861_DEV_ID_1: + case SNDK_NVME_SN861_DEV_ID_2: + capabilities |= (SNDK_DRIVE_CAP_C0_LOG_PAGE | + SNDK_DRIVE_CAP_C3_LOG_PAGE | + SNDK_DRIVE_CAP_CA_LOG_PAGE | + SNDK_DRIVE_CAP_OCP_C4_LOG_PAGE | + SNDK_DRIVE_CAP_OCP_C5_LOG_PAGE | + SNDK_DRIVE_CAP_INTERNAL_LOG | + SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY_C2 | + SNDK_DRIVE_CAP_VU_FID_CLEAR_PCIE | + SNDK_DRIVE_CAP_VU_FID_CLEAR_FW_ACT_HISTORY | + SNDK_DRIVE_CAP_INFO | + SNDK_DRIVE_CAP_CLOUD_SSD_VERSION | + SNDK_DRIVE_CAP_LOG_PAGE_DIR | + SNDK_DRIVE_CAP_DRIVE_STATUS | + SNDK_DRIVE_CAP_SET_LATENCY_MONITOR); + break; + + case SNDK_NVME_SNTMP_DEV_ID: + capabilities |= (SNDK_DRIVE_CAP_C0_LOG_PAGE | + SNDK_DRIVE_CAP_C3_LOG_PAGE | + SNDK_DRIVE_CAP_CA_LOG_PAGE | + SNDK_DRIVE_CAP_OCP_C4_LOG_PAGE | + SNDK_DRIVE_CAP_OCP_C5_LOG_PAGE | + SNDK_DRIVE_CAP_DUI | + SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY_C2 | + SNDK_DRIVE_CAP_VU_FID_CLEAR_PCIE | + SNDK_DRIVE_CAP_VU_FID_CLEAR_FW_ACT_HISTORY | + SNDK_DRIVE_CAP_INFO | + SNDK_DRIVE_CAP_CLOUD_SSD_VERSION | + SNDK_DRIVE_CAP_LOG_PAGE_DIR | + SNDK_DRIVE_CAP_DRIVE_STATUS | + SNDK_DRIVE_CAP_SET_LATENCY_MONITOR); + break; + + default: + capabilities = 0; + } + break; + + case SNDK_NVME_SNDK_VID: + switch (read_device_id) { + case SNDK_NVME_SN520_DEV_ID: + case SNDK_NVME_SN520_DEV_ID_1: + case SNDK_NVME_SN520_DEV_ID_2: + case SNDK_NVME_SN810_DEV_ID: + capabilities = SNDK_DRIVE_CAP_DUI_DATA; + break; + + case SNDK_NVME_SN820CL_DEV_ID: + capabilities = SNDK_DRIVE_CAP_DUI_DATA | + SNDK_DRIVE_CAP_CLOUD_BOOT_SSD_VERSION | + SNDK_DRIVE_CAP_CLOUD_LOG_PAGE | + SNDK_DRIVE_CAP_C0_LOG_PAGE | + SNDK_DRIVE_CAP_HW_REV_LOG_PAGE | + SNDK_DRIVE_CAP_INFO | + SNDK_DRIVE_CAP_VU_FID_CLEAR_PCIE | + SNDK_DRIVE_CAP_NAND_STATS | + SNDK_DRIVE_CAP_DEVICE_WAF | + SNDK_DRIVE_CAP_TEMP_STATS; + break; + + case SNDK_NVME_SN720_DEV_ID: + capabilities = SNDK_DRIVE_CAP_DUI_DATA | + SNDK_DRIVE_CAP_NAND_STATS | + SNDK_DRIVE_CAP_NS_RESIZE; + break; + + case SNDK_NVME_SN730_DEV_ID: + capabilities = SNDK_DRIVE_CAP_DUI | + SNDK_DRIVE_CAP_NAND_STATS | + SNDK_DRIVE_CAP_INFO | + SNDK_DRIVE_CAP_TEMP_STATS | + SNDK_DRIVE_CAP_VUC_CLEAR_PCIE | + SNDK_DRIVE_CAP_PCIE_STATS; + break; + + case SNDK_NVME_SN530_DEV_ID_1: + case SNDK_NVME_SN530_DEV_ID_2: + case SNDK_NVME_SN530_DEV_ID_3: + case SNDK_NVME_SN530_DEV_ID_4: + case SNDK_NVME_SN530_DEV_ID_5: + case SNDK_NVME_SN350_DEV_ID: + case SNDK_NVME_SN570_DEV_ID: + case SNDK_NVME_SN850X_DEV_ID: + case SNDK_NVME_SN5000_DEV_ID_1: + case SNDK_NVME_SN5000_DEV_ID_2: + case SNDK_NVME_SN5000_DEV_ID_3: + case SNDK_NVME_SN5000_DEV_ID_4: + case SNDK_NVME_SN7000S_DEV_ID_1: + case SNDK_NVME_SN7150_DEV_ID_1: + case SNDK_NVME_SN7150_DEV_ID_2: + case SNDK_NVME_SN7150_DEV_ID_3: + case SNDK_NVME_SN7150_DEV_ID_4: + case SNDK_NVME_SN7150_DEV_ID_5: + case SNDK_NVME_SN7100_DEV_ID_1: + case SNDK_NVME_SN7100_DEV_ID_2: + case SNDK_NVME_SN7100_DEV_ID_3: + case SNDK_NVME_SN8000S_DEV_ID: + case SNDK_NVME_SN5100S_DEV_ID_1: + case SNDK_NVME_SN5100S_DEV_ID_2: + case SNDK_NVME_SN5100S_DEV_ID_3: + case SNDK_NVME_SN740_DEV_ID: + case SNDK_NVME_SN740_DEV_ID_1: + case SNDK_NVME_SN740_DEV_ID_2: + case SNDK_NVME_SN740_DEV_ID_3: + case SNDK_NVME_SN340_DEV_ID: + capabilities = SNDK_DRIVE_CAP_DUI; + break; + + case SNDK_NVME_ZN350_DEV_ID: + case SNDK_NVME_ZN350_DEV_ID_1: + capabilities = SNDK_DRIVE_CAP_DUI_DATA | + SNDK_DRIVE_CAP_VU_FID_CLEAR_PCIE | + SNDK_DRIVE_CAP_C0_LOG_PAGE | + SNDK_DRIVE_CAP_VU_FID_CLEAR_FW_ACT_HISTORY | + SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY_C2 | + SNDK_DRIVE_CAP_INFO | + SNDK_DRIVE_CAP_CLOUD_SSD_VERSION | + SNDK_DRIVE_CAP_LOG_PAGE_DIR; + break; + + default: + capabilities = 0; + } + break; + default: + capabilities = 0; + } + + return capabilities; +} + +__u64 sndk_get_enc_drive_capabilities(nvme_root_t r, + struct nvme_dev *dev) +{ + int ret; + uint32_t read_vendor_id; + __u64 capabilities = 0; + __u32 cust_id; + + ret = sndk_get_vendor_id(dev, &read_vendor_id); + if (ret < 0) + return capabilities; + + switch (read_vendor_id) { + case SNDK_NVME_WDC_VID: + capabilities = (SNDK_DRIVE_CAP_INTERNAL_LOG | + SNDK_DRIVE_CAP_DRIVE_STATUS | + SNDK_DRIVE_CAP_CLEAR_ASSERT | + SNDK_DRIVE_CAP_RESIZE); + + /* verify the 0xC3 log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_LATENCY_MON_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_C3_LOG_PAGE; + + /* verify the 0xCB log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_FW_ACT_HISTORY_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY; + + /* verify the 0xCA log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_DEVICE_INFO_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_CA_LOG_PAGE; + + /* verify the 0xD0 log page is supported */ + if (run_wdc_nvme_check_supported_log_page(r, dev, + SNDK_NVME_GET_VU_SMART_LOG_ID)) + capabilities |= SNDK_DRIVE_CAP_D0_LOG_PAGE; + + cust_id = run_wdc_get_fw_cust_id(r, dev); + if (cust_id == SNDK_INVALID_CUSTOMER_ID) { + fprintf(stderr, "%s: ERROR: SNDK: invalid customer id\n", __func__); + return -1; + } + + if ((cust_id == SNDK_CUSTOMER_ID_0x1004) || + (cust_id == SNDK_CUSTOMER_ID_0x1008) || + (cust_id == SNDK_CUSTOMER_ID_0x1005) || + (cust_id == SNDK_CUSTOMER_ID_0x1304)) + capabilities |= (SNDK_DRIVE_CAP_VU_FID_CLEAR_FW_ACT_HISTORY | + SNDK_DRIVE_CAP_VU_FID_CLEAR_PCIE); + else + capabilities |= (SNDK_DRIVE_CAP_CLEAR_FW_ACT_HISTORY | + SNDK_DRIVE_CAP_CLEAR_PCIE); + + break; + default: + capabilities = 0; + } + + return capabilities; +} + + diff --git a/plugins/sandisk/sandisk-utils.h b/plugins/sandisk/sandisk-utils.h new file mode 100644 index 0000000000..afbc018c3a --- /dev/null +++ b/plugins/sandisk/sandisk-utils.h @@ -0,0 +1,192 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (c) 2025 Sandisk Corporation or its affiliates. + * + * Author: Jeff Lien + * Brandon Paupore + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/* Device Config */ +#define SNDK_NVME_WDC_VID 0x1b96 +#define SNDK_NVME_SNDK_VID 0x15b7 + +#define SNDK_NVME_SN630_DEV_ID 0x2200 +#define SNDK_NVME_SN630_DEV_ID_1 0x2201 +#define SNDK_NVME_SN840_DEV_ID 0x2300 +#define SNDK_NVME_SN840_DEV_ID_1 0x2500 +#define SNDK_NVME_SN640_DEV_ID 0x2400 +#define SNDK_NVME_SN640_DEV_ID_1 0x2401 +#define SNDK_NVME_SN640_DEV_ID_2 0x2402 +#define SNDK_NVME_SN640_DEV_ID_3 0x2404 +#define SNDK_NVME_SN650_DEV_ID 0x2700 +#define SNDK_NVME_SN650_DEV_ID_1 0x2701 +#define SNDK_NVME_SN650_DEV_ID_2 0x2702 +#define SNDK_NVME_SN650_DEV_ID_3 0x2720 +#define SNDK_NVME_SN650_DEV_ID_4 0x2721 +#define SNDK_NVME_SN655_DEV_ID 0x2722 +#define SNDK_NVME_SN655_DEV_ID_1 0x2723 +#define SNDK_NVME_SN861_DEV_ID 0x2750 +#define SNDK_NVME_SN861_DEV_ID_1 0x2751 +#define SNDK_NVME_SN861_DEV_ID_2 0x2752 +#define SNDK_NVME_SNTMP_DEV_ID 0x2761 + +#define SNDK_NVME_SN520_DEV_ID 0x5003 +#define SNDK_NVME_SN520_DEV_ID_1 0x5004 +#define SNDK_NVME_SN520_DEV_ID_2 0x5005 + +#define SNDK_NVME_SN530_DEV_ID_1 0x5007 +#define SNDK_NVME_SN530_DEV_ID_2 0x5008 +#define SNDK_NVME_SN530_DEV_ID_3 0x5009 +#define SNDK_NVME_SN530_DEV_ID_4 0x500b +#define SNDK_NVME_SN530_DEV_ID_5 0x501d + +#define SNDK_NVME_SN350_DEV_ID 0x5019 + +#define SNDK_NVME_SN570_DEV_ID 0x501A + +#define SNDK_NVME_SN850X_DEV_ID 0x5030 + +#define SNDK_NVME_SN5000_DEV_ID_1 0x5034 +#define SNDK_NVME_SN5000_DEV_ID_2 0x5035 +#define SNDK_NVME_SN5000_DEV_ID_3 0x5036 +#define SNDK_NVME_SN5000_DEV_ID_4 0x504A + +#define SNDK_NVME_SN7000S_DEV_ID_1 0x5039 + +#define SNDK_NVME_SN7150_DEV_ID_1 0x503b +#define SNDK_NVME_SN7150_DEV_ID_2 0x503c +#define SNDK_NVME_SN7150_DEV_ID_3 0x503d +#define SNDK_NVME_SN7150_DEV_ID_4 0x503e +#define SNDK_NVME_SN7150_DEV_ID_5 0x503f + +#define SNDK_NVME_SN7100_DEV_ID_1 0x5043 +#define SNDK_NVME_SN7100_DEV_ID_2 0x5044 +#define SNDK_NVME_SN7100_DEV_ID_3 0x5045 + +#define SNDK_NVME_SN8000S_DEV_ID 0x5049 + +#define SNDK_NVME_SN720_DEV_ID 0x5002 +#define SNDK_NVME_SN730_DEV_ID 0x5006 +#define SNDK_NVME_SN740_DEV_ID 0x5015 +#define SNDK_NVME_SN740_DEV_ID_1 0x5016 +#define SNDK_NVME_SN740_DEV_ID_2 0x5017 +#define SNDK_NVME_SN740_DEV_ID_3 0x5025 +#define SNDK_NVME_SN340_DEV_ID 0x500d +#define SNDK_NVME_ZN350_DEV_ID 0x5010 +#define SNDK_NVME_ZN350_DEV_ID_1 0x5018 +#define SNDK_NVME_SN810_DEV_ID 0x5011 +#define SNDK_NVME_SN820CL_DEV_ID 0x5037 + +#define SNDK_NVME_SN5100S_DEV_ID_1 0x5061 +#define SNDK_NVME_SN5100S_DEV_ID_2 0x5062 +#define SNDK_NVME_SN5100S_DEV_ID_3 0x5063 + +#define SNDK_DRIVE_CAP_INTERNAL_LOG 0x0000000000000001 +#define SNDK_DRIVE_CAP_C1_LOG_PAGE 0x0000000000000002 +#define SNDK_DRIVE_CAP_CA_LOG_PAGE 0x0000000000000004 +#define SNDK_DRIVE_CAP_D0_LOG_PAGE 0x0000000000000008 +#define SNDK_DRIVE_CAP_DRIVE_STATUS 0x0000000000000010 +#define SNDK_DRIVE_CAP_CLEAR_ASSERT 0x0000000000000020 +#define SNDK_DRIVE_CAP_CLEAR_PCIE 0x0000000000000040 +#define SNDK_DRIVE_CAP_RESIZE 0x0000000000000080 +#define SNDK_DRIVE_CAP_NAND_STATS 0x0000000000000100 +#define SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY 0x0000000000000200 +#define SNDK_DRIVE_CAP_CLEAR_FW_ACT_HISTORY 0x0000000000000400 +#define SNDK_DRIVE_CAP_DISABLE_CTLR_TELE_LOG 0x0000000000000800 +#define SNDK_DRIVE_CAP_REASON_ID 0x0000000000001000 +#define SNDK_DRIVE_CAP_LOG_PAGE_DIR 0x0000000000002000 +#define SNDK_DRIVE_CAP_NS_RESIZE 0x0000000000004000 +#define SNDK_DRIVE_CAP_INFO 0x0000000000008000 +#define SNDK_DRIVE_CAP_C0_LOG_PAGE 0x0000000000010000 +#define SNDK_DRIVE_CAP_TEMP_STATS 0x0000000000020000 +#define SNDK_DRIVE_CAP_VUC_CLEAR_PCIE 0x0000000000040000 +#define SNDK_DRIVE_CAP_VU_FID_CLEAR_PCIE 0x0000000000080000 +#define SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY_C2 0x0000000000100000 +#define SNDK_DRIVE_CAP_VU_FID_CLEAR_FW_ACT_HISTORY 0x0000000000200000 +#define SNDK_DRIVE_CAP_CLOUD_SSD_VERSION 0x0000000000400000 +#define SNDK_DRIVE_CAP_PCIE_STATS 0x0000000000800000 +#define SNDK_DRIVE_CAP_HW_REV_LOG_PAGE 0x0000000001000000 +#define SNDK_DRIVE_CAP_C3_LOG_PAGE 0x0000000002000000 +#define SNDK_DRIVE_CAP_CLOUD_BOOT_SSD_VERSION 0x0000000004000000 +#define SNDK_DRIVE_CAP_CLOUD_LOG_PAGE 0x0000000008000000 +#define SNDK_DRIVE_CAP_DUI_DATA 0x0000000010000000 +#define SNDK_DRIVE_CAP_VUC_LOG 0x0000000020000000 +#define SNDK_DRIVE_CAP_DUI 0x0000000040000000 +#define SNDK_DRIVE_CAP_OCP_C1_LOG_PAGE 0x0000000080000000 +#define SNDK_DRIVE_CAP_OCP_C4_LOG_PAGE 0x0000000100000000 +#define SNDK_DRIVE_CAP_OCP_C5_LOG_PAGE 0x0000000200000000 +#define SNDK_DRIVE_CAP_DEVICE_WAF 0x0000000400000000 +#define SNDK_DRIVE_CAP_SET_LATENCY_MONITOR 0x0000000800000000 + +#define SNDK_DRIVE_CAP_SMART_LOG_MASK (SNDK_DRIVE_CAP_C0_LOG_PAGE | \ + SNDK_DRIVE_CAP_C1_LOG_PAGE | \ + SNDK_DRIVE_CAP_CA_LOG_PAGE | \ + SNDK_DRIVE_CAP_D0_LOG_PAGE) +#define SNDK_DRIVE_CAP_CLEAR_PCIE_MASK (SNDK_DRIVE_CAP_CLEAR_PCIE | \ + SNDK_DRIVE_CAP_VUC_CLEAR_PCIE | \ + SNDK_DRIVE_CAP_VU_FID_CLEAR_PCIE) +#define SNDK_DRIVE_CAP_INTERNAL_LOG_MASK (SNDK_DRIVE_CAP_INTERNAL_LOG | \ + SNDK_DRIVE_CAP_DUI | \ + SNDK_DRIVE_CAP_DUI_DATA | \ + SNDK_DRIVE_CAP_VUC_LOG) +#define SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY_MASK (SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY | \ + SNDK_DRIVE_CAP_FW_ACTIVATE_HISTORY_C2) +#define SNDK_DRIVE_CAP_CLEAR_FW_ACT_HISTORY_MASK (SNDK_DRIVE_CAP_CLEAR_FW_ACT_HISTORY | \ + SNDK_DRIVE_CAP_VU_FID_CLEAR_FW_ACT_HISTORY) + +/* Vendor defined Log Page IDs */ +#define SNDK_NVME_GET_SMART_CLOUD_ATTR_LOG_ID 0xC0 +#define SNDK_NVME_GET_EOL_STATUS_LOG_ID 0xC0 +#define SNDK_ERROR_REC_LOG_ID 0xC1 +#define SNDK_NVME_GET_FW_ACT_HISTORY_C2_LOG_ID 0xC2 +#define SNDK_LATENCY_MON_LOG_ID 0xC3 +#define SNDK_DEV_CAP_LOG_ID 0xC4 +#define SNDK_UNSUPPORTED_REQS_LOG_ID 0xC5 + +#define SNDK_NVME_GET_DEVICE_INFO_LOG_ID 0xCA +#define SNDK_NVME_GET_FW_ACT_HISTORY_LOG_ID 0xCB +#define SNDK_NVME_GET_VU_SMART_LOG_ID 0xD0 + +/* Customer ID's */ +#define SNDK_CUSTOMER_ID_GN 0x0001 +#define SNDK_CUSTOMER_ID_GD 0x0101 +#define SNDK_CUSTOMER_ID_BD 0x1009 + +#define SNDK_CUSTOMER_ID_0x1004 0x1004 +#define SNDK_CUSTOMER_ID_0x1005 0x1005 +#define SNDK_CUSTOMER_ID_0x1008 0x1008 +#define SNDK_CUSTOMER_ID_0x1304 0x1304 +#define SNDK_INVALID_CUSTOMER_ID -1 + +int sndk_get_pci_ids(nvme_root_t r, + struct nvme_dev *dev, + uint32_t *device_id, + uint32_t *vendor_id); + +int sndk_get_vendor_id(struct nvme_dev *dev, + uint32_t *vendor_id); + +bool sndk_check_device(nvme_root_t r, + struct nvme_dev *dev); + +__u64 sndk_get_drive_capabilities(nvme_root_t r, + struct nvme_dev *dev); + +__u64 sndk_get_enc_drive_capabilities(nvme_root_t r, + struct nvme_dev *dev); + diff --git a/plugins/wdc/wdc-nvme-cmds.h b/plugins/wdc/wdc-nvme-cmds.h new file mode 100644 index 0000000000..305e35e5c2 --- /dev/null +++ b/plugins/wdc/wdc-nvme-cmds.h @@ -0,0 +1,121 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (c) 2025 Western Digital Corporation or its affiliates. + * + * Author: Jeff Lien , + */ + +int run_wdc_cloud_ssd_plugin_version(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_vs_internal_fw_log(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_vs_nand_stats(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_vs_smart_add_log(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_clear_pcie_correctable_errors(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_drive_status(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_clear_assert_dump(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_drive_resize(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_vs_fw_activate_history(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_clear_fw_activate_history(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_vs_telemetry_controller_option(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_reason_identifier(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_log_page_directory(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_namespace_resize(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_vs_drive_info(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_cloud_ssd_plugin_version(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_vs_pcie_stats(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_get_latency_monitor_log(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_get_error_recovery_log(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_get_dev_capabilities_log(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_get_unsupported_reqs_log(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_cloud_boot_SSD_version(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_vs_cloud_log(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_vs_hw_rev_log(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_vs_device_waf(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +int run_wdc_set_latency_monitor_feature(int argc, char **argv, + struct command *cmd, + struct plugin *plugin); + +int run_wdc_vs_temperature_stats(int argc, char **argv, + struct command *command, + struct plugin *plugin); + +bool run_wdc_nvme_check_supported_log_page(nvme_root_t r, + struct nvme_dev *dev, + __u8 log_id); + +__u32 run_wdc_get_fw_cust_id(nvme_root_t r, + struct nvme_dev *dev); diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c index f1e12c48b5..76e10cdf9b 100644 --- a/plugins/wdc/wdc-nvme.c +++ b/plugins/wdc/wdc-nvme.c @@ -43,6 +43,7 @@ #define CREATE_CMD #include "wdc-nvme.h" #include "wdc-utils.h" +#include "wdc-nvme-cmds.h" #define WRITE_SIZE (sizeof(__u8) * 4096) @@ -12625,3 +12626,200 @@ int wdc_set_latency_monitor_feature(int argc, char **argv, struct command *cmd, return ret; } + +/* + * Externally available functions used to call the WDC Plugin commands + */ +int run_wdc_cloud_ssd_plugin_version(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_cloud_ssd_plugin_version(argc, argv, command, plugin); +} + +int run_wdc_vs_internal_fw_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_internal_fw_log(argc, argv, command, plugin); +} + +int run_wdc_vs_nand_stats(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_nand_stats(argc, argv, command, plugin); +} + +int run_wdc_vs_smart_add_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_smart_add_log(argc, argv, command, plugin); +} + +int run_wdc_clear_pcie_correctable_errors(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_clear_pcie_correctable_errors(argc, argv, command, plugin); +} + +int run_wdc_drive_status(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_drive_status(argc, argv, command, plugin); +} + +int run_wdc_clear_assert_dump(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_clear_assert_dump(argc, argv, command, plugin); +} + +int run_wdc_drive_resize(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_drive_resize(argc, argv, command, plugin); +} + +int run_wdc_vs_fw_activate_history(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_fw_activate_history(argc, argv, command, plugin); +} + +int run_wdc_clear_fw_activate_history(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_clear_fw_activate_history(argc, argv, command, plugin); +} + +int run_wdc_vs_telemetry_controller_option(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_telemetry_controller_option(argc, argv, command, plugin); +} + +int run_wdc_reason_identifier(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_reason_identifier(argc, argv, command, plugin); +} + +int run_wdc_log_page_directory(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_log_page_directory(argc, argv, command, plugin); +} + +int run_wdc_namespace_resize(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_namespace_resize(argc, argv, command, plugin); +} + +int run_wdc_vs_drive_info(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_drive_info(argc, argv, command, plugin); +} + +int run_wdc_vs_pcie_stats(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_pcie_stats(argc, argv, command, plugin); +} + +int run_wdc_get_latency_monitor_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_get_latency_monitor_log(argc, argv, command, plugin); +} + +int run_wdc_get_error_recovery_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_get_error_recovery_log(argc, argv, command, plugin); +} + +int run_wdc_get_dev_capabilities_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_get_dev_capabilities_log(argc, argv, command, plugin); +} + +int run_wdc_get_unsupported_reqs_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_get_unsupported_reqs_log(argc, argv, command, plugin); +} + +int run_wdc_cloud_boot_SSD_version(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_cloud_boot_SSD_version(argc, argv, command, plugin); +} + +int run_wdc_vs_cloud_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_cloud_log(argc, argv, command, plugin); +} + +int run_wdc_vs_hw_rev_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_hw_rev_log(argc, argv, command, plugin); +} + +int run_wdc_vs_device_waf(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_device_waf(argc, argv, command, plugin); +} + +int run_wdc_set_latency_monitor_feature(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_set_latency_monitor_feature(argc, argv, command, plugin); +} + +int run_wdc_vs_temperature_stats(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_vs_temperature_stats(argc, argv, command, plugin); +} + +__u32 run_wdc_get_fw_cust_id(nvme_root_t r, struct nvme_dev *dev) +{ + return wdc_get_fw_cust_id(r, dev); +} + +bool run_wdc_nvme_check_supported_log_page(nvme_root_t r, + struct nvme_dev *dev, + __u8 log_id) +{ + return wdc_nvme_check_supported_log_page(r, dev, log_id); +} From 2a786bde09c704500e44a837d297457c5bea7d79 Mon Sep 17 00:00:00 2001 From: jeff-lien-wdc Date: Thu, 13 Feb 2025 14:25:33 -0600 Subject: [PATCH 2/2] sndk: Add documentation for Sandisk plugin commands Add documentation files for new Sandisk plugin commands. Signed-off-by: jeff-lien-wdc --- Documentation/cmd-plugins.txt | 81 ++++++++++++ Documentation/meson.build | 27 ++++ Documentation/nvme-sndk-capabilities.txt | 32 +++++ Documentation/nvme-sndk-clear-assert-dump.txt | 38 ++++++ .../nvme-sndk-clear-fw-activate-history.txt | 37 ++++++ ...vme-sndk-clear-pcie-correctable-errors.txt | 39 ++++++ .../nvme-sndk-cloud-SSD-plugin-version.txt | 33 +++++ .../nvme-sndk-cloud-boot-SSD-version.txt | 33 +++++ Documentation/nvme-sndk-drive-resize.txt | 42 +++++++ .../nvme-sndk-get-dev-capabilities-log.txt | 47 +++++++ Documentation/nvme-sndk-get-drive-status.txt | 60 +++++++++ .../nvme-sndk-get-error-recovery-log.txt | 48 +++++++ .../nvme-sndk-get-latency-monitor-log.txt | 42 +++++++ .../nvme-sndk-get-unsupported-reqs-log.txt | 48 +++++++ .../nvme-sndk-log-page-directory.txt | 43 +++++++ Documentation/nvme-sndk-namespace-resize.txt | 56 +++++++++ .../nvme-sndk-set-latency-monitor-feature.txt | 118 +++++++++++++++++ Documentation/nvme-sndk-vs-cloud-log.txt | 52 ++++++++ Documentation/nvme-sndk-vs-device-waf.txt | 53 ++++++++ Documentation/nvme-sndk-vs-drive-info.txt | 47 +++++++ .../nvme-sndk-vs-error-reason-identifier.txt | 56 +++++++++ .../nvme-sndk-vs-fw-activate-history.txt | 75 +++++++++++ Documentation/nvme-sndk-vs-hw-rev-log.txt | 51 ++++++++ Documentation/nvme-sndk-vs-internal-log.txt | 119 ++++++++++++++++++ Documentation/nvme-sndk-vs-nand-stats.txt | 45 +++++++ Documentation/nvme-sndk-vs-pcie-stats.txt | 45 +++++++ Documentation/nvme-sndk-vs-smart-add-log.txt | 107 ++++++++++++++++ ...me-sndk-vs-telemetry-controller-option.txt | 65 ++++++++++ .../nvme-sndk-vs-temperature-stats.txt | 78 ++++++++++++ plugins/sandisk/sandisk-nvme.h | 2 +- 30 files changed, 1618 insertions(+), 1 deletion(-) create mode 100644 Documentation/nvme-sndk-capabilities.txt create mode 100644 Documentation/nvme-sndk-clear-assert-dump.txt create mode 100644 Documentation/nvme-sndk-clear-fw-activate-history.txt create mode 100644 Documentation/nvme-sndk-clear-pcie-correctable-errors.txt create mode 100644 Documentation/nvme-sndk-cloud-SSD-plugin-version.txt create mode 100644 Documentation/nvme-sndk-cloud-boot-SSD-version.txt create mode 100644 Documentation/nvme-sndk-drive-resize.txt create mode 100644 Documentation/nvme-sndk-get-dev-capabilities-log.txt create mode 100644 Documentation/nvme-sndk-get-drive-status.txt create mode 100644 Documentation/nvme-sndk-get-error-recovery-log.txt create mode 100644 Documentation/nvme-sndk-get-latency-monitor-log.txt create mode 100644 Documentation/nvme-sndk-get-unsupported-reqs-log.txt create mode 100644 Documentation/nvme-sndk-log-page-directory.txt create mode 100644 Documentation/nvme-sndk-namespace-resize.txt create mode 100644 Documentation/nvme-sndk-set-latency-monitor-feature.txt create mode 100644 Documentation/nvme-sndk-vs-cloud-log.txt create mode 100644 Documentation/nvme-sndk-vs-device-waf.txt create mode 100644 Documentation/nvme-sndk-vs-drive-info.txt create mode 100644 Documentation/nvme-sndk-vs-error-reason-identifier.txt create mode 100644 Documentation/nvme-sndk-vs-fw-activate-history.txt create mode 100644 Documentation/nvme-sndk-vs-hw-rev-log.txt create mode 100644 Documentation/nvme-sndk-vs-internal-log.txt create mode 100644 Documentation/nvme-sndk-vs-nand-stats.txt create mode 100644 Documentation/nvme-sndk-vs-pcie-stats.txt create mode 100644 Documentation/nvme-sndk-vs-smart-add-log.txt create mode 100644 Documentation/nvme-sndk-vs-telemetry-controller-option.txt create mode 100644 Documentation/nvme-sndk-vs-temperature-stats.txt diff --git a/Documentation/cmd-plugins.txt b/Documentation/cmd-plugins.txt index ee774088c1..687b1ca8ff 100644 --- a/Documentation/cmd-plugins.txt +++ b/Documentation/cmd-plugins.txt @@ -55,6 +55,87 @@ linknvme:nvme-netapp-ontapdevices[1]:: linknvme:nvme-netapp-smdevices[1]:: Display information for each NVMe path to an E-Series volume +linknvme:nvme-sndk-capabilities[1]:: + Display Sandisk plugin command capabilities + +linknvme:nvme-sndk-clear-assert-dump[1]:: + Clears the assert dump (if present) + +linknvme:nvme-sndk-clear-fw-activate-history[1]:: + Clears the firmware activate history table + +linknvme:nvme-sndk-clear-pcie-correctable-errors[1]:: + Clears the pcie correctable errors returned in the smart-log-add command + +linknvme:nvme-sndk-cloud-SSD-plugin-version[1]:: + Display Sandisk plugin Cloud SSD Plugin Version + +linknvme:nvme-sndk-cloud-boot-SSD-version[1]:: + Display Sandisk Cloud Boot SSD Version + +linknvme:nvme-sndk-drive-resize[1]:: + Send NVMe Sandisk Resize Vendor Unique Command + +linknvme:nvme-sndk-get-drive-status[1]:: + Send the NVMe Sandisk get-drive-status command + +linknvme:nvme-sndk-get-dev-capabilities-log[1]:: + Display device capabilities og page data in human readable format + +linknvme:nvme-sndk-get-error-recovery-log[1]:: + Display error recovery log page data in human readable format + +linknvme:nvme-sndk-get-latency-monitor-log[1]:: + Display latency monitor log page data in human readable format + +linknvme:nvme-sndk-get-unsupported-reqs-log[1]:: + Display unsupported requirements log page data in human readable format + +linknvme:nvme-sndk-log-page-directory[1]:: + Retrieves the list of Log IDs supported by the drive + +linknvme:nvme-sndk-namespace-resize[1]:: + Resizes the device's namespace + +linknvme:nvme-sndk-set-latency-monitor-feature[1]:: + Set Latency Monitor feature + +linknvme:nvme-sndk-vs-cloud-log[1]:: + Display the cloud log page + +linknvme:nvme-sndk-vs-device-waf[1]:: + Display calculated device Write Amplication Factor + +linknvme:nvme-sndk-vs-drive-info[1]:: + Send the NVMe Sandisk vs-drive-info command + +linknvme:nvme-sndk-vs-error-reason-identifier[1]:: + Retrieve Sandisk device's telemetry log error reason identifier field + +linknvme:nvme-sndk-vs-fw-activate-history[1]:: + Execute NVMe Sandisk vs-fw-activate-history Vendor Unique Command + +linknvme:nvme-sndk-vs-hw-rev-log[1]:: + Display hardware revision log page + +linknvme:nvme-sndk-vs-internal-log[1]:: + Retrieve Sandisk device's internal firmware log and save to file + +linknvme:nvme-sndk-vs-nand-stats[1]:: + Send NVMe Sandisk vs-nand-stats Vendor Unique Command + +linknvme:nvme-sndk-vs-pcie-stats[1]:: + Send the NVMe Sandisk vs-pcie-stats command + +linknvme:nvme-sndk-vs-smart-add-log[1]:: + Send NVMe Sandisk smart add log Vendor Unique Command + +linknvme:nvme-sndk-vs-telemetry-controller-option[1]:: + Disable/Enable the controller initiated option of the telemetry log page + +linknvme:nvme-sndk-vs-temperature-stats[1]:: + Display temperature-related statistics + linknvme:nvme-toshiba-clear-pcie-correctable-errors[1]:: Reset the PCIe correctable errors count to zero diff --git a/Documentation/meson.build b/Documentation/meson.build index e81db8c902..25be2f8be8 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -144,6 +144,33 @@ adoc_sources = [ 'nvme-show-regs', 'nvme-show-topology', 'nvme-smart-log', + 'nvme-sndk-capabilities', + 'nvme-sndk-clear-assert-dump', + 'nvme-sndk-clear-fw-activate-history', + 'nvme-sndk-clear-pcie-correctable-errors', + 'nvme-sndk-cloud-SSD-plugin-version', + 'nvme-sndk-cloud-boot-SSD-version', + 'nvme-sndk-drive-resize', + 'nvme-sndk-get-drive-status', + 'nvme-sndk-get-dev-capabilities-log', + 'nvme-sndk-get-error-recovery-log', + 'nvme-sndk-get-latency-monitor-log', + 'nvme-sndk-get-unsupported-reqs-log', + 'nvme-sndk-log-page-directory', + 'nvme-sndk-namespace-resize', + 'nvme-sndk-set-latency-monitor-feature', + 'nvme-sndk-vs-cloud-log', + 'nvme-sndk-vs-device-waf', + 'nvme-sndk-vs-drive-info', + 'nvme-sndk-vs-error-reason-identifier', + 'nvme-sndk-vs-fw-activate-history', + 'nvme-sndk-vs-hw-rev-log', + 'nvme-sndk-vs-internal-log', + 'nvme-sndk-vs-nand-stats', + 'nvme-sndk-vs-pcie-stats', + 'nvme-sndk-vs-smart-add-log', + 'nvme-sndk-vs-telemetry-controller-option', + 'nvme-sndk-vs-temperature-stats', 'nvme-solidigm-clear-fw-activate-history', 'nvme-solidigm-clear-pcie-correctable-errors', 'nvme-solidigm-cloud-SSDplugin-version', diff --git a/Documentation/nvme-sndk-capabilities.txt b/Documentation/nvme-sndk-capabilities.txt new file mode 100644 index 0000000000..00fc2adabc --- /dev/null +++ b/Documentation/nvme-sndk-capabilities.txt @@ -0,0 +1,32 @@ +nvme-sndk-capabilities(1) +========================= + +NAME +---- +nvme-sndk-capabilities - Display sndk device command capabilities + +SYNOPSIS +-------- +[verse] +'nvme sndk capabilities' + +DESCRIPTION +----------- + +For the NVMe device given, displays list of commands and support status. + +The parameter is mandatory NVMe character device (ex: /dev/nvme0). + +On success it returns 0, error code otherwise. + +EXAMPLES +-------- +* Displays the capabilities for the device: ++ +------------ +# nvme sndk capabilities /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-clear-assert-dump.txt b/Documentation/nvme-sndk-clear-assert-dump.txt new file mode 100644 index 0000000000..9a6d4d06ae --- /dev/null +++ b/Documentation/nvme-sndk-clear-assert-dump.txt @@ -0,0 +1,38 @@ +nvme-sndk-clear-assert-dump(1) +============================== + +NAME +---- +nvme-sndk-clear-assert-dump - Clears the assert dump (if present). + +SYNOPSIS +-------- +[verse] +'nvme sndk clear-assert-dump' + +DESCRIPTION +----------- +For the NVMe device given, sends the sndk vendor unique clear assert +dump command. + +The parameter is mandatory and must be the NVMe character +device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this feature. +The command will not be executed on devices that don't support it. + +OPTIONS +------- +None + +EXAMPLES +-------- +* Clears the assert dump (if present): ++ +------------ +# nvme sndk clear-assert-dump /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite diff --git a/Documentation/nvme-sndk-clear-fw-activate-history.txt b/Documentation/nvme-sndk-clear-fw-activate-history.txt new file mode 100644 index 0000000000..7a447d9fe9 --- /dev/null +++ b/Documentation/nvme-sndk-clear-fw-activate-history.txt @@ -0,0 +1,37 @@ +nvme-sndk-clear-fw-activate-history(1) +====================================== + +NAME +---- +nvme-sndk-clear-fw-activate-history - Clears the firmware activate history table. + +SYNOPSIS +-------- +[verse] +'nvme sndk clear-fw-activate-history' + +DESCRIPTION +----------- +For the NVMe device given, sends the sndk vendor unique clear fw activate +history command. + +The parameter is mandatory and must be the NVMe character device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this feature. +Results for any other device are undefined. + +OPTIONS +------- +None + +EXAMPLES +-------- +* Clears the firmware activate history table: ++ +------------ +# nvme sndk clear-fw-activate-history /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite diff --git a/Documentation/nvme-sndk-clear-pcie-correctable-errors.txt b/Documentation/nvme-sndk-clear-pcie-correctable-errors.txt new file mode 100644 index 0000000000..281848574e --- /dev/null +++ b/Documentation/nvme-sndk-clear-pcie-correctable-errors.txt @@ -0,0 +1,39 @@ +nvme-sndk-clear-pcie-correctable-errors(1) +========================================== + +NAME +---- +nvme-sndk-clear-pcie-correctable-errors - Clears the pcie correctable errors field returned in the smart-log-add command. + +SYNOPSIS +-------- +[verse] +'nvme sndk clear-pcie-correctable-errors' + +DESCRIPTION +----------- +For the NVMe device given, sends the sndk vendor unique clear pcie +correctable errors command. + +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 Sandisk devices supporting this feature. +Results for any other device are undefined. + +OPTIONS +------- +None + +EXAMPLES +-------- +* Clears the PCIe Correctable Error Count field returned in the smart-log-add command: ++ +------------ +# nvme sndk clear-pcie-correctable-errors /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite diff --git a/Documentation/nvme-sndk-cloud-SSD-plugin-version.txt b/Documentation/nvme-sndk-cloud-SSD-plugin-version.txt new file mode 100644 index 0000000000..380d7bc1db --- /dev/null +++ b/Documentation/nvme-sndk-cloud-SSD-plugin-version.txt @@ -0,0 +1,33 @@ +nvme-sndk-cloud-SSD-plugin-version(1) +===================================== + +NAME +---- +nvme-sndk-cloud-SSD-plugin-version - Display sndk plugin Cloud SSD Plugin Version + +SYNOPSIS +-------- +[verse] +'nvme sndk cloud-SSD-plugin-version' + +DESCRIPTION +----------- + +For the NVMe device given, this command displays the current Cloud SSD +Plugin Version (if supported by the device). + +The parameter is mandatory NVMe character device (ex: /dev/nvme0). + +On success it returns 0, error code otherwise. + +EXAMPLES +-------- +* Displays the cloud ssd plugin version for the device: ++ +------------ +# nvme sndk cloud-SSD-plugin-version /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-cloud-boot-SSD-version.txt b/Documentation/nvme-sndk-cloud-boot-SSD-version.txt new file mode 100644 index 0000000000..8859735823 --- /dev/null +++ b/Documentation/nvme-sndk-cloud-boot-SSD-version.txt @@ -0,0 +1,33 @@ +nvme-sndk-cloud-boot-SSD-version(1) +=================================== + +NAME +---- +nvme-sndk-cloud-boot-SSD-version - Display sndk plugin Cloud Boot SSD Version + +SYNOPSIS +-------- +[verse] +'nvme sndk cloud-boot-SSD-version' + +DESCRIPTION +----------- + +For the NVMe device given, this command displays the current Cloud Hyperscale +Boot Version (if supported by the device). + +The parameter is mandatory NVMe character device (ex: /dev/nvme0). + +On success it returns 0, error code otherwise. + +EXAMPLES +-------- +* Displays the cloud boot ssd version for the device: ++ +------------ +# nvme sndk cloud-boot-SSD-version /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-drive-resize.txt b/Documentation/nvme-sndk-drive-resize.txt new file mode 100644 index 0000000000..1485338017 --- /dev/null +++ b/Documentation/nvme-sndk-drive-resize.txt @@ -0,0 +1,42 @@ +nvme-sndk-drive-resize(1) +========================= + +NAME +---- +nvme-sndk-drive-resize - Send NVMe sndk Resize Vendor Unique Command, +return result. + +SYNOPSIS +-------- +[verse] +'nvme sndk drive-resize' [--size= | -s ] + +DESCRIPTION +----------- +For the NVMe device given, sends a Vendor Unique sndk Resize command. + +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 Sandisk devices supporting this feature. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-s :: +--size=:: + The new size (in GB) to resize the drive to. + +EXAMPLES +-------- +* Has the program issue sndk Resize Vendor Unique Command : ++ +------------ +# nvme sndk drive-resize /dev/nvme0n1 --size=100 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-get-dev-capabilities-log.txt b/Documentation/nvme-sndk-get-dev-capabilities-log.txt new file mode 100644 index 0000000000..c0a8cdd60d --- /dev/null +++ b/Documentation/nvme-sndk-get-dev-capabilities-log.txt @@ -0,0 +1,47 @@ +nvme-sndk-get-dev-capabilities-log(1) +===================================== + +NAME +---- +nvme-sndk-get-dev-capabilities-log - Send NVMe sndk get-dev-capabilities-log +plugin command, return parsed log output + +SYNOPSIS +-------- +[verse] +'nvme sndk get-dev-capabilities-log' [--output-format= | -o ] + +DESCRIPTION +----------- +For the NVMe device given, send a sndk plugin get-dev-capabilities-log command +and output the device capabilities log data. The --output-format option will +format the output as specified. + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this log page. +Results for any other device are undefined. + +On success it returns the parsed device capabilities log page data, error +code otherwise. + +OPTIONS +------- +-o :: +--output-format=:: + Set the reporting format to 'normal', or + 'json'. Only one output format can be used at a time. + Default is normal. + +EXAMPLES +-------- +* Has the program issue sndk get-dev-capabilities-log plugin command : ++ +------------ +# nvme sndk get-dev-capabilities-log /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-get-drive-status.txt b/Documentation/nvme-sndk-get-drive-status.txt new file mode 100644 index 0000000000..b6dee8055d --- /dev/null +++ b/Documentation/nvme-sndk-get-drive-status.txt @@ -0,0 +1,60 @@ +nvme-sndk-get-drive-status(1) +============================= + +NAME +---- +nvme-sndk-get-drive-status - Send the NVMe sndk get-drive-status command, return +result + +SYNOPSIS +-------- +[verse] +'nvme sndk get-drive-status' + +DESCRIPTION +----------- +For the NVMe device given, send the unique sndk get-drive-status command and +provide the additional drive status information. + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this feature. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +Output Explanation +------------------ +[cols="2*", frame="topbot", align="center", options="header"] +|=== +|Field |Description + +|*Percent Life Used.* +|The percentage of drive function used. + +|*EOL (End of Life) Status* +|The 3 possible states are : Normal, Read Only, or End of Life. + +|*Assert Dump Status* +|The 2 possible states are : Present or Not Present. + +|*Thermal Throttling Status* +|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. + +|=== + +EXAMPLES +-------- +* Has the program issue sndk get-drive-status command : ++ +------------ +# nvme sndk get-drive-status /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-get-error-recovery-log.txt b/Documentation/nvme-sndk-get-error-recovery-log.txt new file mode 100644 index 0000000000..7e027d364d --- /dev/null +++ b/Documentation/nvme-sndk-get-error-recovery-log.txt @@ -0,0 +1,48 @@ +nvme-sndk-get-error-recovery-log(1) +=================================== + +NAME +---- +nvme-sndk-get-error-recovery-log - Send NVMe sndk get-error-recovery-log plugin +command, return parsed log output. + +SYNOPSIS +-------- +[verse] +'nvme sndk get-error-recovery-log' [--output-format= +-o ] + +DESCRIPTION +----------- +For the NVMe device given, send a sndk plugin get-error-recovery-log command +and output the error recovery log data. The --output-format option will format +the output as specified. + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this log page. +Results for any other device are undefined. + +On success it returns the parsed error recovery log page data, error +code otherwise. + +OPTIONS +------- +-o :: +--output-format=:: + Set the reporting format to 'normal', or + 'json'. Only one output format can be used at a time. + Default is normal. + +EXAMPLES +-------- +* Has the program issue sndk get-error-recovery-log plugin command : ++ +------------ +# nvme sndk get-error-recovery-log /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-get-latency-monitor-log.txt b/Documentation/nvme-sndk-get-latency-monitor-log.txt new file mode 100644 index 0000000000..f9333cc3fc --- /dev/null +++ b/Documentation/nvme-sndk-get-latency-monitor-log.txt @@ -0,0 +1,42 @@ +nvme-sndk-get-latency-monitor-log(1) +==================================== + +NAME +---- +nvme-sndk-get-latency-monitor-log - Display latency monitor log page data in human readable format + +SYNOPSIS +-------- +[verse] +'nvme sndk get-latency-monitor-log' [--output-format= -o ] + +DESCRIPTION +----------- + +For the NVMe device given, latency monitor log page data. + +The parameter is mandatory NVMe character device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this log page. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-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. + +EXAMPLES +-------- +* Displays the get latency monitor log for the device: ++ +------------ +# nvme sndk get-latency-monitor-log /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-get-unsupported-reqs-log.txt b/Documentation/nvme-sndk-get-unsupported-reqs-log.txt new file mode 100644 index 0000000000..b3ec3447ed --- /dev/null +++ b/Documentation/nvme-sndk-get-unsupported-reqs-log.txt @@ -0,0 +1,48 @@ +nvme-sndk-get-unsupported-reqs-log(1) +===================================== + +NAME +---- +nvme-sndk-get-unsupported-reqs-log - Send NVMe sndk get-unsupported-reqs-log +plugin command, return parsed log output + +SYNOPSIS +-------- +[verse] +'nvme sndk get-unsupported-reqs-log' [--output-format= +-o ] + +DESCRIPTION +----------- +For the NVMe device given, send a sndk plugin get-unsupported-reqs-log command +and output the unsupported requirements log data. The --output-format option +will format the output as specified. + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this log page. +Results for any other device are undefined. + +On success it returns the parsed unsupported requirements log page data, error +code otherwise. + +OPTIONS +------- +-o :: +--output-format=:: + Set the reporting format to 'normal', or + 'json'. Only one output format can be used at a time. + Default is normal. + +EXAMPLES +-------- +* Has the program issue sndk get-unsupported-reqs-log plugin command : ++ +------------ +# nvme sndk get-unsupported-reqs-log /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-log-page-directory.txt b/Documentation/nvme-sndk-log-page-directory.txt new file mode 100644 index 0000000000..52db8fa1b3 --- /dev/null +++ b/Documentation/nvme-sndk-log-page-directory.txt @@ -0,0 +1,43 @@ +nvme-sndk-log-page-directory(1) +=============================== + +NAME +---- +nvme-sndk-log-page-directory - Retrieves the list of Log IDs supported by the drive + +SYNOPSIS +-------- +[verse] +'nvme sndk log-page-directory' [--output-format= -o ] + +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 +specified. + +The parameter is mandatory and must be the NVMe character device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this feature. +Results for any other device are undefined. + +On success it returns the log page directory information, 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. The default is normal. + +EXAMPLES +-------- +* sndk log-page-directory example command : ++ +------------ +# nvme sndk log-page-directory /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-namespace-resize.txt b/Documentation/nvme-sndk-namespace-resize.txt new file mode 100644 index 0000000000..b632b19fc2 --- /dev/null +++ b/Documentation/nvme-sndk-namespace-resize.txt @@ -0,0 +1,56 @@ +nvme-sndk-namespace-resize(1) +============================= + +NAME +---- +nvme-sndk-namespace-resize - Resizes the device's namespace. + +SYNOPSIS +-------- +[verse] +'nvme sndk namespace-resize' [--nsid=, -n ] + [--op_option=, -o ] + +DESCRIPTION +----------- + +For the NVMe device given, sends the sndk Vendor Specific Command that modifies +the namespace size reported the device. + +The parameter is mandatory NVMe character device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this feature. +Results for any other device are undefined. + +OPTIONS +------- +-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 + +EXAMPLES +-------- +* Resizes namespace 1 to 50% of the original TNVMCAP reported value: ++ +------------ +# nvme sndk namespace-resize /dev/nvme0 -n 1 -o 3 +------------ +* Resizes namespace 2 to 7% of the original TNVMCAP reported value: ++ +------------ +# nvme sndk namespace-resize /dev/nvme0 --namespace-id=2 --op-option=1 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-set-latency-monitor-feature.txt b/Documentation/nvme-sndk-set-latency-monitor-feature.txt new file mode 100644 index 0000000000..142af08483 --- /dev/null +++ b/Documentation/nvme-sndk-set-latency-monitor-feature.txt @@ -0,0 +1,118 @@ +nvme-sndk-set-latency-monitor-feature(1) +======================================== + +NAME +---- +nvme-sndk-set-latency-monitor-feature - Set NVMe sndk latency monitor feature options + +SYNOPSIS +-------- +[verse] +'nvme sndk 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 sndk latency monitor feature options enabled with default value values: ++ +------------ +# nvme sndk set-latency-monitor-feature /dev/nvme0 -e 1 +------------ +* Set NVMe sndk latency monitor feature options disabled with default value values: ++ +------------ +# nvme sndk set-latency-monitor-feature /dev/nvme0 -e 0 +------------ +* Set NVMe sndk latency monitor feature options enabled with specific values: ++ +------------ +# nvme sndk 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-sndk-vs-cloud-log.txt b/Documentation/nvme-sndk-vs-cloud-log.txt new file mode 100644 index 0000000000..0537f6601a --- /dev/null +++ b/Documentation/nvme-sndk-vs-cloud-log.txt @@ -0,0 +1,52 @@ +nvme-sndk-vs-cloud-log(1) +========================= + +NAME +---- +nvme-sndk-vs-cloud-log - Send NVMe sndk vs-cloud-log Vendor Unique Command, return result + +SYNOPSIS +-------- +[verse] +'nvme sndk vs-cloud-log' [--output-format= -o ] + [--namespace-id= | -n ] + +DESCRIPTION +----------- +For the NVMe device given, send a Vendor Unique sndk vs-cloud-log command and +provide the smart/health log. + +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 Sandisk devices supporting this feature. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-o :: +--output-format=:: + Set the reporting format to 'normal', or + 'json'. Only one output format can be used at a time. + Default is normal. + +-n :: +--namespace-id=:: + Sets the command's nsid value to the given nsid. Defaults to + 0xffffffff if not given. This option may not affect anything + depending on the log page, which may or may not be specific to + a namespace. + +EXAMPLES +-------- +* Has the program issue sndk vs-cloud-log Vendor Unique Command : ++ +------------ +# nvme sndk vs-cloud-log /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-vs-device-waf.txt b/Documentation/nvme-sndk-vs-device-waf.txt new file mode 100644 index 0000000000..06360bab77 --- /dev/null +++ b/Documentation/nvme-sndk-vs-device-waf.txt @@ -0,0 +1,53 @@ +nvme-sndk-vs-device-waf(1) +========================== + +NAME +---- +nvme-sndk-vs-device-waf - Calculates the device write amplification factor and +prints both TLC and SLC results + +SYNOPSIS +-------- +[verse] +'nvme sndk vs-device-waf' [--output-format= -o ] + [--namespace-id= | -n ] + +DESCRIPTION +----------- +For the NVMe device given, calculates the device TLC and SLC write +amplification factor. + +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 Sandisk devices supporting this feature. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-o :: +--output-format=:: + Set the reporting format to 'normal', or + 'json'. Only one output format can be used at a time. + Default is normal. + +-n :: +--namespace-id=:: + Sets the command's nsid value to the given nsid. Defaults to + 0xffffffff if not given. This option may not affect anything + depending on the log page, which may or may not be specific to + a namespace. + +EXAMPLES +-------- +* Has the program issue sndk vs-device-waf plugin Command : ++ +------------ +# nvme sndk vs-device-waf /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-vs-drive-info.txt b/Documentation/nvme-sndk-vs-drive-info.txt new file mode 100644 index 0000000000..64f7876eee --- /dev/null +++ b/Documentation/nvme-sndk-vs-drive-info.txt @@ -0,0 +1,47 @@ +nvme-sndk-vs-drive-info(1) +========================== + +NAME +---- +nvme-sndk-vs-drive-info - Send the NVMe sndk vs-drive-info command, return result + +SYNOPSIS +-------- +[verse] +'nvme sndk vs-drive-info' + +DESCRIPTION +----------- +For the NVMe device given, send the unique sndk vs-drive-info command and +provide the additional drive information. + +The parameter is mandatory and must be the NVMe character +device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this feature. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +Output Explanation +------------------ +There are several different fields returned from this command depending +on the drive: + +Drive HW Revision + +FTL Unit Size + +Customer Serial Number + +HyperScale Boot Version + +TCG Device Ownership + +EXAMPLE +-------- +# nvme sndk vs-drive-info /dev/nvme0 + +NVME +---- +Part of the nvme-user suite. diff --git a/Documentation/nvme-sndk-vs-error-reason-identifier.txt b/Documentation/nvme-sndk-vs-error-reason-identifier.txt new file mode 100644 index 0000000000..e6b50c33da --- /dev/null +++ b/Documentation/nvme-sndk-vs-error-reason-identifier.txt @@ -0,0 +1,56 @@ +nvme-sndk-vs-error-reason-identifier(1) +======================================= + +NAME +---- +nvme-sndk-vs-error-reason-identifier - Retrieve sndk device's telemetry log error reason identifier field + +SYNOPSIS +-------- +[verse] +'nvme sndk vs-error-reason-identifier' [--log-id=, -i ] [--file=, -o ] + +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. + +The parameter is mandatory and must be the NVMe character device (ex: /dev/nvme0). + +This will only work on Sandisk devices supporting this feature. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-i :: +--log-id=:: + 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 + +-o :: +--output-file=:: + Output file; defaults to "_error_reason_identifier_host__