]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print-stdout: print MAXWZD and NSZS bits of ONCS field
authorFrancis Pravin <francis.p@samsung.com>
Wed, 4 Dec 2024 12:10:59 +0000 (17:40 +0530)
committerDaniel Wagner <wagi@monom.org>
Wed, 4 Dec 2024 14:02:36 +0000 (15:02 +0100)
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 <francis.p@samsung.com>
nvme-print-stdout.c

index 7e16760966cb093eb1a0c55f492bf93992d503d6..5312a794c6a421365aaa23678f1f9330b924ca92 100644 (file)
@@ -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);
@@ -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",