]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print: fix HMB get feature response in human readable format
authorGollu Appalanaidu <anaidu.gollu@samsung.com>
Mon, 1 Mar 2021 18:37:07 +0000 (00:07 +0530)
committerKeith Busch <kbusch@kernel.org>
Tue, 2 Mar 2021 19:40:37 +0000 (12:40 -0700)
For Host Memory Buffer(HMB) fearure as part of get feature Memory
Return(MR) bit is not part of the CQE CDW0 and add endianess conversion
for the get feature HMB attribute data structure.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
nvme-print.c

index 2c8803aeaef6c482ee6766a96fda5ff70d1c48be..6c09b257dcfe3ba92780812ae2a4f34affe53931 100755 (executable)
@@ -5350,13 +5350,13 @@ static void nvme_show_timestamp(struct nvme_timestamp *ts)
 static void nvme_show_host_mem_buffer(struct nvme_host_mem_buffer *hmb)
 {
        printf("\tHost Memory Descriptor List Entry Count (HMDLEC): %u\n",
-               hmb->hmdlec);
+               le32_to_cpu(hmb->hmdlec));
        printf("\tHost Memory Descriptor List Address     (HMDLAU): 0x%x\n",
-               hmb->hmdlau);
+               le32_to_cpu(hmb->hmdlau));
        printf("\tHost Memory Descriptor List Address     (HMDLAL): 0x%x\n",
-               hmb->hmdlal);
+               le32_to_cpu(hmb->hmdlal));
        printf("\tHost Memory Buffer Size                  (HSIZE): %u\n",
-               hmb->hsize);
+               le32_to_cpu(hmb->hsize));
 }
 
 static void nvme_directive_show_fields(__u8 dtype, __u8 doper,
@@ -5539,7 +5539,6 @@ void nvme_feature_show_fields(enum nvme_feat fid, unsigned int result, unsigned
                nvme_show_auto_pst((struct nvme_auto_pst *)buf);
                break;
        case NVME_FEAT_HOST_MEM_BUF:
-               printf("\tMemory Return       (MR): %s\n", ((result & 0x00000002) >> 1) ? "True":"False");
                printf("\tEnable Host Memory (EHM): %s\n", (result & 0x00000001) ? "Enabled":"Disabled");
                nvme_show_host_mem_buffer((struct nvme_host_mem_buffer *)buf);
                break;