Skip to content

Commit b17b2d9

Browse files
nitin-saoigaw
authored andcommitted
nvme-print: Added print for two new fields for HMB feature
As per TP4104, added print for two new fields for HMB feature HMNARE (Host Memory Non-operational Access Restriction Enable) and HMNAR (Host Memory Non-operational Access Restricted) with 1 bit each. Bit 1 is not used for Get Feature command and will be 0. And added print for HMBR field in stdout_id_ctrl_ctratt. Signed-off-by: Nitin Sao <nitin.sao@samsung.com> Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com> Reviewed-by: Mohit Kapoor <mohit.kap@samsung.com>
1 parent c01c44b commit b17b2d9

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

nvme-print-json.c

+4
Original file line numberDiff line numberDiff line change
@@ -3425,6 +3425,10 @@ static void json_feature_show_fields_host_mem_buf(struct json_object *r, unsigne
34253425
unsigned char *buf)
34263426
{
34273427
obj_add_str(r, "Enable Host Memory (EHM)", result & 1 ? "Enabled" : "Disabled");
3428+
obj_add_str(r, "Host Memory Non-operational Access Restriction Enable (HMNARE)",
3429+
(result & 0x00000004) ? "True" : "False");
3430+
obj_add_str(r, "Host Memory Non-operational Access Restricted (HMNAR)",
3431+
(result & 0x00000008) ? "True" : "False");
34283432

34293433
if (buf)
34303434
json_host_mem_buffer((struct nvme_host_mem_buf_attrs *)buf, r);

nvme-print-stdout.c

+10-3
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,8 @@ static void stdout_id_ctrl_ctratt(__le32 ctrl_ctratt)
17141714
__u32 ctratt = le32_to_cpu(ctrl_ctratt);
17151715
__u32 rsvd20 = (ctratt >> 20);
17161716
__u32 fdps = (ctratt >> 19) & 0x1;
1717-
__u32 rsvd17 = (ctratt >> 17) & 0x3;
1717+
__u32 rsvd18 = (ctratt >> 18) & 0x1;
1718+
__u32 hmbr = (ctratt >> 17) & 0x1;
17181719
__u32 mem = (ctratt >> 16) & 0x1;
17191720
__u32 elbas = (ctratt >> 15) & 0x1;
17201721
__u32 delnvmset = (ctratt >> 14) & 0x1;
@@ -1737,8 +1738,10 @@ static void stdout_id_ctrl_ctratt(__le32 ctrl_ctratt)
17371738
printf(" [31:20] : %#x\tReserved\n", rsvd20);
17381739
printf(" [19:19] : %#x\tFlexible Data Placement %sSupported\n",
17391740
fdps, fdps ? "" : "Not ");
1740-
if (rsvd17)
1741-
printf(" [18:17] : %#x\tReserved\n", rsvd17);
1741+
if (rsvd18)
1742+
printf(" [18:18] : %#x\tReserved\n", rsvd18);
1743+
printf(" [17:17] : %#x\tHMB Restrict Non-Operational Power State Access %sSupported\n",
1744+
hmbr, hmbr ? "" : "Not ");
17421745
printf(" [16:16] : %#x\tMDTS and Size Limits Exclude Metadata %sSupported\n",
17431746
mem, mem ? "" : "Not ");
17441747
printf(" [15:15] : %#x\tExtended LBA Formats %sSupported\n",
@@ -4511,6 +4514,10 @@ static void stdout_feature_show_fields(enum nvme_features_id fid,
45114514
break;
45124515
case NVME_FEAT_FID_HOST_MEM_BUF:
45134516
printf("\tEnable Host Memory (EHM): %s\n", (result & 0x00000001) ? "Enabled" : "Disabled");
4517+
printf("\tHost Memory Non-operational Access Restriction Enable (HMNARE): %s\n",
4518+
(result & 0x00000004) ? "True" : "False");
4519+
printf("\tHost Memory Non-operational Access Restricted (HMNAR): %s\n",
4520+
(result & 0x00000008) ? "True" : "False");
45144521
if (buf)
45154522
stdout_host_mem_buffer((struct nvme_host_mem_buf_attrs *)buf);
45164523
break;

0 commit comments

Comments
 (0)