Skip to content

Commit 103a273

Browse files
francispravin5igaw
authored andcommitted
nvme-print: print the new fields added in TP4165
Print the new fields added in TP4165. Signed-off-by: Francis Pravin <francis.p@samsung.com> Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
1 parent 2634b41 commit 103a273

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

nvme-print-json.c

+2
Original file line numberDiff line numberDiff line change
@@ -3033,6 +3033,7 @@ static void json_nvme_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
30333033
obj_add_uint(r, "dmrl", ctrl_nvm->dmrl);
30343034
obj_add_uint(r, "dmrsl", le32_to_cpu(ctrl_nvm->dmrsl));
30353035
obj_add_uint64(r, "dmsl", le64_to_cpu(ctrl_nvm->dmsl));
3036+
obj_add_uint(r, "aocs", le16_to_cpu(ctrl_nvm->aocs));
30363037

30373038
json_print(r);
30383039
}
@@ -3066,6 +3067,7 @@ static void json_nvme_nvm_id_ns(struct nvme_nvm_id_ns *nvm_ns,
30663067
}
30673068
if (ns->nsfeat & 0x20)
30683069
obj_add_int(r, "npdgl", le32_to_cpu(nvm_ns->npdgl));
3070+
obj_add_uint(r, "tlbaag", le32_to_cpu(nvm_ns->tlbaag));
30693071

30703072
json_print(r);
30713073
}

nvme-print-stdout.c

+18
Original file line numberDiff line numberDiff line change
@@ -3053,15 +3053,32 @@ static void stdout_id_ctrl(struct nvme_id_ctrl *ctrl,
30533053
}
30543054
}
30553055

3056+
static void stdout_id_ctrl_nvm_aocs(__u16 aocs)
3057+
{
3058+
__u16 rsvd = (aocs & 0xfffe) >> 1;
3059+
__u8 ralbas = aocs & 0x1;
3060+
3061+
if (rsvd)
3062+
printf(" [15:1] : %#x\tReserved\n", rsvd);
3063+
printf(" [0:0] : %#x\tReporting Allocated LBA %sSupported\n", ralbas,
3064+
ralbas ? "" : "Not ");
3065+
printf("\n");
3066+
}
3067+
30563068
static void stdout_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
30573069
{
3070+
int verbose = stdout_print_ops.flags & VERBOSE;
3071+
30583072
printf("NVMe Identify Controller NVM:\n");
30593073
printf("vsl : %u\n", ctrl_nvm->vsl);
30603074
printf("wzsl : %u\n", ctrl_nvm->wzsl);
30613075
printf("wusl : %u\n", ctrl_nvm->wusl);
30623076
printf("dmrl : %u\n", ctrl_nvm->dmrl);
30633077
printf("dmrsl : %u\n", le32_to_cpu(ctrl_nvm->dmrsl));
30643078
printf("dmsl : %"PRIu64"\n", le64_to_cpu(ctrl_nvm->dmsl));
3079+
printf("aocs : %u\n", le16_to_cpu(ctrl_nvm->aocs));
3080+
if (verbose)
3081+
stdout_id_ctrl_nvm_aocs(le16_to_cpu(ctrl_nvm->aocs));
30653082
}
30663083

30673084
static void stdout_nvm_id_ns_pic(__u8 pic)
@@ -3159,6 +3176,7 @@ static void stdout_nvm_id_ns(struct nvme_nvm_id_ns *nvm_ns, unsigned int nsid,
31593176
}
31603177
if (ns->nsfeat & 0x20)
31613178
printf("npdgl : %#x\n", le32_to_cpu(nvm_ns->npdgl));
3179+
printf("tlbaag: %#x\n", le32_to_cpu(nvm_ns->tlbaag));
31623180
}
31633181

31643182
static void stdout_zns_id_ctrl(struct nvme_zns_id_ctrl *ctrl)

nvme.c

+3
Original file line numberDiff line numberDiff line change
@@ -3467,6 +3467,9 @@ static int nvm_id_ctrl(int argc, char **argv, struct command *cmd,
34673467
return err;
34683468
}
34693469

3470+
if (argconfig_parse_seen(opts, "verbose"))
3471+
flags |= VERBOSE;
3472+
34703473
ctrl_nvm = nvme_alloc(sizeof(*ctrl_nvm));
34713474
if (!ctrl_nvm)
34723475
return -ENOMEM;

0 commit comments

Comments
 (0)