Skip to content

Commit e3e056c

Browse files
francispravin5igaw
authored andcommitted
nvme-print-stdout: print MAXWZD and NSZS bits of ONCS field
Print the newly added MAXWZD and NSZS bits of ONCS field in Identify Controller Data Structure. TP4160 - WZSL Limit Modification Signed-off-by: Francis Pravin <[email protected]>
1 parent d025884 commit e3e056c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

nvme-print-stdout.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,9 @@ static void stdout_id_ctrl_cqes(__u8 cqes)
21782178
static void stdout_id_ctrl_oncs(__le16 ctrl_oncs)
21792179
{
21802180
__u16 oncs = le16_to_cpu(ctrl_oncs);
2181-
__u16 rsvd = oncs >> 11;
2181+
__u16 rsvd13 = oncs >> 13;
2182+
bool nszs = !!(oncs & NVME_CTRL_ONCS_NAMESPACE_ZEROES);
2183+
bool maxwzd = !!(oncs & NVME_CTRL_ONCS_WRITE_ZEROES_DEALLOCATE);
21822184
bool afc = !!(oncs & NVME_CTRL_ONCS_ALL_FAST_COPY);
21832185
bool csa = !!(oncs & NVME_CTRL_ONCS_COPY_SINGLE_ATOMICITY);
21842186
bool copy = !!(oncs & NVME_CTRL_ONCS_COPY);
@@ -2191,8 +2193,12 @@ static void stdout_id_ctrl_oncs(__le16 ctrl_oncs)
21912193
bool wunc = !!(oncs & NVME_CTRL_ONCS_WRITE_UNCORRECTABLE);
21922194
bool cmp = !!(oncs & NVME_CTRL_ONCS_COMPARE);
21932195

2194-
if (rsvd)
2195-
printf(" [15:11] : %#x\tReserved\n", rsvd);
2196+
if (rsvd13)
2197+
printf(" [15:13] : %#x\tReserved\n", rsvd13);
2198+
printf(" [12:12] : %#x\tNamespace Zeroes %sSupported\n",
2199+
nszs, nszs ? "" : "Not ");
2200+
printf(" [11:11] : %#x\tMaximum Write Zeroes with Deallocate %sSupported\n",
2201+
maxwzd, maxwzd ? "" : "Not ");
21962202
printf(" [10:10] : %#x\tAll Fast Copy %sSupported\n",
21972203
afc, afc ? "" : "Not ");
21982204
printf(" [9:9] : %#x\tCopy Single Atomicity %sSupported\n",

0 commit comments

Comments
 (0)