]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print: print new fields of nvm_id_ctrl
authorFrancis Pravin <francis.p@samsung.com>
Mon, 17 Feb 2025 09:10:40 +0000 (14:40 +0530)
committerDaniel Wagner <wagi@monom.org>
Mon, 17 Feb 2025 09:27:53 +0000 (10:27 +0100)
Print the new fields of I/O Command Set Specific Identify Controller
Data Structure based on NVM Command Set Specification 1.1.

Signed-off-by: Francis Pravin <francis.p@samsung.com>
nvme-print-json.c
nvme-print-stdout.c

index 4f342eb51861980d808e1ff2f3b410f26d86f6cf..4bd6a650d7ba4c505491e9ae96f3079e94253d20 100644 (file)
@@ -2971,6 +2971,8 @@ static void json_nvme_id_ns_descs(void *data, unsigned int nsid)
 static void json_nvme_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
 {
        struct json_object *r = json_create_object();
+       __u16 rsvd = (ctrl_nvm->aocs & 0xfffe) >> 1;
+       __u8 ralbas = ctrl_nvm->aocs & 0x1;
 
        obj_add_uint(r, "vsl", ctrl_nvm->vsl);
        obj_add_uint(r, "wzsl", ctrl_nvm->wzsl);
@@ -2978,15 +2980,17 @@ static void json_nvme_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
        obj_add_uint(r, "dmrl", ctrl_nvm->dmrl);
        obj_add_uint(r, "dmrsl", le32_to_cpu(ctrl_nvm->dmrsl));
        obj_add_uint64(r, "dmsl", le64_to_cpu(ctrl_nvm->dmsl));
+       obj_add_uint(r, "kpiocap", ctrl_nvm->kpiocap);
+       obj_add_uint(r, "wzdsl", ctrl_nvm->wzdsl);
        obj_add_uint(r, "aocs", le16_to_cpu(ctrl_nvm->aocs));
 
-       __u16 rsvd = (ctrl_nvm->aocs & 0xfffe) >> 1;
-       __u8 ralbas = ctrl_nvm->aocs & 0x1;
-
        if (rsvd)
                obj_add_uint(r, "[15:1]: Reserved", rsvd);
        obj_add_uint(r, "[0:0]: Reporting Allocated LBA Supported", ralbas);
 
+       obj_add_uint(r, "ver", le32_to_cpu(ctrl_nvm->ver));
+       obj_add_uint(r, "lbamqf", ctrl_nvm->lbamqf);
+
        json_print(r);
 }
 
index b3f95bafa5e1d09e2bbadb866021e84f16c84440..929984b2b266b48fdd02f74a6b9f7f2370a2e3b9 100644 (file)
@@ -3338,6 +3338,20 @@ static void stdout_id_ctrl(struct nvme_id_ctrl *ctrl,
        }
 }
 
+static void stdout_id_ctrl_nvm_kpiocap(__u8 kpiocap)
+{
+       __u8 rsvd2 = (kpiocap & 0xfc) >> 2;
+       __u8 kpiosc = (kpiocap & 0x2) >> 1;
+       __u8 kpios = kpiocap & 0x1;
+
+       if (rsvd2)
+               printf("  [7:2] : %#x\tReserved\n", rsvd2);
+       printf("  [1:1] : %#x\tKey Per I/O capability enabled and disabled %s in the"
+               "NVM subsystem\n", kpiosc, kpiosc ? "all namespaces" : "each namespace");
+       printf("  [0:0] : %#x\tKey Per I/O capability %sSupported\n", kpios,
+               kpios ? "" : "Not ");
+}
+
 static void stdout_id_ctrl_nvm_aocs(__u16 aocs)
 {
        __u16 rsvd = (aocs & 0xfffe) >> 1;
@@ -3384,6 +3398,10 @@ static void stdout_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
        printf("dmrl   : %u\n", ctrl_nvm->dmrl);
        printf("dmrsl  : %u\n", le32_to_cpu(ctrl_nvm->dmrsl));
        printf("dmsl   : %"PRIu64"\n", le64_to_cpu(ctrl_nvm->dmsl));
+       printf("kpiocap: %u\n", ctrl_nvm->kpiocap);
+       if (verbose)
+               stdout_id_ctrl_nvm_kpiocap(ctrl_nvm->kpiocap);
+       printf("wzdsl  : %u\n", ctrl_nvm->wzdsl);
        printf("aocs   : %u\n", le16_to_cpu(ctrl_nvm->aocs));
        if (verbose)
                stdout_id_ctrl_nvm_aocs(le16_to_cpu(ctrl_nvm->aocs));