From: Gollu Appalanaidu Date: Sun, 21 Feb 2021 12:04:16 +0000 (+0530) Subject: nvme-print: show feat fields for FID = {0x17,0x12} and refactoring X-Git-Tag: v1.14~75 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f62a3c41cd7fcbc9a47960071807494a5509c4ac;p=users%2Fsagi%2Fnvme-cli.git nvme-print: show feat fields for FID = {0x17,0x12} and refactoring Showing Sanitize Config (FID = 0x17) and Read Recovery Level Config (RRL) (FID = 0x12) feature fields. Refactor the FID = 0x0 and non-defined/reserved FIDs response. Signed-off-by: Gollu Appalanaidu --- diff --git a/nvme-print.c b/nvme-print.c index 512edb43..8340b325 100755 --- a/nvme-print.c +++ b/nvme-print.c @@ -4748,7 +4748,7 @@ void nvme_show_sanitize_log(struct nvme_sanitize_log_page *sanitize, const char *nvme_feature_to_string(enum nvme_feat feature) { switch (feature) { - case NVME_FEAT_NONE: return "None"; + case NVME_FEAT_NONE: return "Reserved"; case NVME_FEAT_ARBITRATION: return "Arbitration"; case NVME_FEAT_POWER_MGMT: return "Power Management"; case NVME_FEAT_LBA_RANGE: return "LBA Range Type"; @@ -5283,6 +5283,9 @@ void nvme_feature_show_fields(enum nvme_feat fid, unsigned int result, unsigned uint64_t ull; switch (fid) { + case NVME_FEAT_NONE: + printf("\tFeature Identifier Reserved\n"); + break; case NVME_FEAT_ARBITRATION: printf("\tHigh Priority Weight (HPW): %u\n", ((result & 0xff000000) >> 24) + 1); printf("\tMedium Priority Weight (MPW): %u\n", ((result & 0x00ff0000) >> 16) + 1); @@ -5401,10 +5404,11 @@ void nvme_feature_show_fields(enum nvme_feat fid, unsigned int result, unsigned case NVME_FEAT_HOST_BEHAVIOR: printf("\tHost Behavior Support: %s\n", (buf[0] & 0x1) ? "True" : "False"); break; - case NVME_FEAT_NONE: case NVME_FEAT_SANITIZE: + printf("\tNo-Deallocate Response Mode (NODRM) : %u\n", result & 0x1); + break; case NVME_FEAT_RRL: - printf("\t%s: to be implemented\n", nvme_feature_to_string(fid)); + printf("\tRead Recovery Level (RRL): %u\n", result & 0xf); break; } }