]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: add endurance group event configuration feature
authorGollu Appalanaidu <anaidu.gollu@samsung.com>
Sun, 21 Feb 2021 11:12:28 +0000 (16:42 +0530)
committerKeith Busch <kbusch@kernel.org>
Mon, 22 Feb 2021 19:18:42 +0000 (12:18 -0700)
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
linux/nvme.h
nvme-print.c

index 3318ea2eb74212cde59be464809669b33874b106..1e5660ee9b4f068cd8f4ede769cdd2ee36ae593a 100644 (file)
@@ -1239,6 +1239,7 @@ enum nvme_feat {
        NVME_FEAT_PLM_WINDOW    = 0x14,
        NVME_FEAT_HOST_BEHAVIOR = 0x16,
        NVME_FEAT_SANITIZE      = 0x17,
+      NVME_FEAT_ENDURANCE     = 0x18,
        NVME_FEAT_IOCS_PROFILE  = 0x19,
        NVME_FEAT_SW_PROGRESS   = 0x80,
        NVME_FEAT_HOST_ID       = 0x81,
index b3d33a90f69c9c9e4ef04eedd6826768625630b9..512edb43913db138a648406300f1f5fd90311cfd 100755 (executable)
@@ -4767,6 +4767,7 @@ const char *nvme_feature_to_string(enum nvme_feat feature)
        case NVME_FEAT_RRL:             return "Read Recovery Level";
        case NVME_FEAT_PLM_CONFIG:      return "Predicatable Latency Mode Config";
        case NVME_FEAT_PLM_WINDOW:      return "Predicatable Latency Mode Window";
+      case NVME_FEAT_ENDURANCE:       return "Enduarance Event Group Configuration";
        case NVME_FEAT_IOCS_PROFILE:    return "I/O Command Set Profile";
        case NVME_FEAT_SW_PROGRESS:     return "Software Progress";
        case NVME_FEAT_HOST_ID:         return "Host Identifier";
@@ -5360,6 +5361,10 @@ void nvme_feature_show_fields(enum nvme_feat fid, unsigned int result, unsigned
        case NVME_FEAT_PLM_WINDOW:
                printf("\tWindow Select: %s", nvme_plm_window(result));
                break;
+      case NVME_FEAT_ENDURANCE:
+              printf("\tEndurance Group Identifier (ENDGID): %u\n", result & 0xffff);
+              printf("\tEndurance Group Critical Warnings  : %u\n", (result >> 16) & 0xff);
+              break;
        case NVME_FEAT_IOCS_PROFILE:
                printf("\tI/O Command Set Profile: %s\n", result & 0x1 ? "True":"False");
                break;