Skip to content

Commit 1a3de10

Browse files
francispravin5igaw
authored andcommitted
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 <[email protected]>
1 parent 7f04d34 commit 1a3de10

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

nvme-print-json.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,22 +2971,26 @@ static void json_nvme_id_ns_descs(void *data, unsigned int nsid)
29712971
static void json_nvme_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
29722972
{
29732973
struct json_object *r = json_create_object();
2974+
__u16 rsvd = (ctrl_nvm->aocs & 0xfffe) >> 1;
2975+
__u8 ralbas = ctrl_nvm->aocs & 0x1;
29742976

29752977
obj_add_uint(r, "vsl", ctrl_nvm->vsl);
29762978
obj_add_uint(r, "wzsl", ctrl_nvm->wzsl);
29772979
obj_add_uint(r, "wusl", ctrl_nvm->wusl);
29782980
obj_add_uint(r, "dmrl", ctrl_nvm->dmrl);
29792981
obj_add_uint(r, "dmrsl", le32_to_cpu(ctrl_nvm->dmrsl));
29802982
obj_add_uint64(r, "dmsl", le64_to_cpu(ctrl_nvm->dmsl));
2983+
obj_add_uint(r, "kpiocap", ctrl_nvm->kpiocap);
2984+
obj_add_uint(r, "wzdsl", ctrl_nvm->wzdsl);
29812985
obj_add_uint(r, "aocs", le16_to_cpu(ctrl_nvm->aocs));
29822986

2983-
__u16 rsvd = (ctrl_nvm->aocs & 0xfffe) >> 1;
2984-
__u8 ralbas = ctrl_nvm->aocs & 0x1;
2985-
29862987
if (rsvd)
29872988
obj_add_uint(r, "[15:1]: Reserved", rsvd);
29882989
obj_add_uint(r, "[0:0]: Reporting Allocated LBA Supported", ralbas);
29892990

2991+
obj_add_uint(r, "ver", le32_to_cpu(ctrl_nvm->ver));
2992+
obj_add_uint(r, "lbamqf", ctrl_nvm->lbamqf);
2993+
29902994
json_print(r);
29912995
}
29922996

nvme-print-stdout.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3338,6 +3338,20 @@ static void stdout_id_ctrl(struct nvme_id_ctrl *ctrl,
33383338
}
33393339
}
33403340

3341+
static void stdout_id_ctrl_nvm_kpiocap(__u8 kpiocap)
3342+
{
3343+
__u8 rsvd2 = (kpiocap & 0xfc) >> 2;
3344+
__u8 kpiosc = (kpiocap & 0x2) >> 1;
3345+
__u8 kpios = kpiocap & 0x1;
3346+
3347+
if (rsvd2)
3348+
printf(" [7:2] : %#x\tReserved\n", rsvd2);
3349+
printf(" [1:1] : %#x\tKey Per I/O capability enabled and disabled %s in the"
3350+
"NVM subsystem\n", kpiosc, kpiosc ? "all namespaces" : "each namespace");
3351+
printf(" [0:0] : %#x\tKey Per I/O capability %sSupported\n", kpios,
3352+
kpios ? "" : "Not ");
3353+
}
3354+
33413355
static void stdout_id_ctrl_nvm_aocs(__u16 aocs)
33423356
{
33433357
__u16 rsvd = (aocs & 0xfffe) >> 1;
@@ -3384,6 +3398,10 @@ static void stdout_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
33843398
printf("dmrl : %u\n", ctrl_nvm->dmrl);
33853399
printf("dmrsl : %u\n", le32_to_cpu(ctrl_nvm->dmrsl));
33863400
printf("dmsl : %"PRIu64"\n", le64_to_cpu(ctrl_nvm->dmsl));
3401+
printf("kpiocap: %u\n", ctrl_nvm->kpiocap);
3402+
if (verbose)
3403+
stdout_id_ctrl_nvm_kpiocap(ctrl_nvm->kpiocap);
3404+
printf("wzdsl : %u\n", ctrl_nvm->wzdsl);
33873405
printf("aocs : %u\n", le16_to_cpu(ctrl_nvm->aocs));
33883406
if (verbose)
33893407
stdout_id_ctrl_nvm_aocs(le16_to_cpu(ctrl_nvm->aocs));

0 commit comments

Comments
 (0)