Skip to content

Commit

Permalink
nvme-print-stdout: print MAXWZD and NSZS bits of ONCS field
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
francispravin5 authored and igaw committed Dec 4, 2024
1 parent d025884 commit e3e056c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions nvme-print-stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,9 @@ static void stdout_id_ctrl_cqes(__u8 cqes)
static void stdout_id_ctrl_oncs(__le16 ctrl_oncs)
{
__u16 oncs = le16_to_cpu(ctrl_oncs);
__u16 rsvd = oncs >> 11;
__u16 rsvd13 = oncs >> 13;
bool nszs = !!(oncs & NVME_CTRL_ONCS_NAMESPACE_ZEROES);
bool maxwzd = !!(oncs & NVME_CTRL_ONCS_WRITE_ZEROES_DEALLOCATE);
bool afc = !!(oncs & NVME_CTRL_ONCS_ALL_FAST_COPY);
bool csa = !!(oncs & NVME_CTRL_ONCS_COPY_SINGLE_ATOMICITY);
bool copy = !!(oncs & NVME_CTRL_ONCS_COPY);
Expand All @@ -2191,8 +2193,12 @@ static void stdout_id_ctrl_oncs(__le16 ctrl_oncs)
bool wunc = !!(oncs & NVME_CTRL_ONCS_WRITE_UNCORRECTABLE);
bool cmp = !!(oncs & NVME_CTRL_ONCS_COMPARE);

if (rsvd)
printf(" [15:11] : %#x\tReserved\n", rsvd);
if (rsvd13)
printf(" [15:13] : %#x\tReserved\n", rsvd13);
printf(" [12:12] : %#x\tNamespace Zeroes %sSupported\n",
nszs, nszs ? "" : "Not ");
printf(" [11:11] : %#x\tMaximum Write Zeroes with Deallocate %sSupported\n",
maxwzd, maxwzd ? "" : "Not ");
printf(" [10:10] : %#x\tAll Fast Copy %sSupported\n",
afc, afc ? "" : "Not ");
printf(" [9:9] : %#x\tCopy Single Atomicity %sSupported\n",
Expand Down

0 comments on commit e3e056c

Please sign in to comment.