From 1a3de10728411644ad89b65f3c3aa82251f9e410 Mon Sep 17 00:00:00 2001 From: Francis Pravin Date: Mon, 17 Feb 2025 14:40:40 +0530 Subject: [PATCH] nvme-print: print new fields of nvm_id_ctrl 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 --- nvme-print-json.c | 10 +++++++--- nvme-print-stdout.c | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/nvme-print-json.c b/nvme-print-json.c index 4f342eb5..4bd6a650 100644 --- a/nvme-print-json.c +++ b/nvme-print-json.c @@ -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); } diff --git a/nvme-print-stdout.c b/nvme-print-stdout.c index b3f95baf..929984b2 100644 --- a/nvme-print-stdout.c +++ b/nvme-print-stdout.c @@ -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)); -- 2.50.1