Skip to content

Commit 48ff213

Browse files
francispravin5igaw
authored andcommitted
nvme-print: print new fields of Asynchronous Event Configuration
Print the newly added fields of Asynchronous Event Configuration feature (FID - 0Bh) NVM Express Base Specification 2.1. Signed-off-by: Francis Pravin <[email protected]>
1 parent 6bb7b12 commit 48ff213

File tree

2 files changed

+58
-26
lines changed

2 files changed

+58
-26
lines changed

nvme-print-json.c

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3353,24 +3353,36 @@ static void json_feature_show_fields_write_atomic(struct json_object *r, unsigne
33533353

33543354
static void json_feature_show_fields_async_event(struct json_object *r, unsigned int result)
33553355
{
3356-
obj_add_str(r, "Discovery Log Page Change Notices", (result & 0x80000000) >> 31 ?
3357-
"Send async event" : "Do not send async event");
3358-
obj_add_str(r, "Endurance Group Event Aggregate Log Change Notices", (result & 0x4000) >> 14 ?
3359-
"Send async event" : "Do not send async event");
3360-
obj_add_str(r, "LBA Status Information Notices", (result & 0x2000) >> 13 ?
3361-
"Send async event" : "Do not send async event");
3356+
const char *async = "Send async event";
3357+
const char *no_async = "Do not send async event";
3358+
3359+
obj_add_str(r, "Discovery Log Page Change Notices", NVME_FEAT_AE_DLPCN(result) ?
3360+
async : no_async);
3361+
obj_add_str(r, "Host Discovery Log Page Change Notification", NVME_FEAT_AE_HDLPCN(result) ?
3362+
async : no_async);
3363+
obj_add_str(r, "AVE Discovery Log Page Change Notification", NVME_FEAT_AE_ADLPCN(result) ?
3364+
async : no_async);
3365+
obj_add_str(r, "Pull Model DDC Request Log Page Change Notification",
3366+
NVME_FEAT_AE_PMDRLPCN(result) ? async : no_async);
3367+
obj_add_str(r, "Zone Descriptor Changed Notices", NVME_FEAT_AE_ZDCN(result) ?
3368+
async : no_async);
3369+
obj_add_str(r, "Reachability Group", NVME_FEAT_AE_RGRP0(result) ? async : no_async);
3370+
obj_add_str(r, "Reachability Association", NVME_FEAT_AE_RASSN(result) ? async : no_async);
3371+
obj_add_str(r, "Normal NVM Subsystem Shutdown", NVME_FEAT_AE_NNSSHDN(result) ?
3372+
async : no_async);
3373+
obj_add_str(r, "Endurance Group Event Aggregate Log Change Notices",
3374+
NVME_FEAT_AE_EGA(result) ? async : no_async);
3375+
obj_add_str(r, "LBA Status Information Notices", NVME_FEAT_AE_LBAS(result) ?
3376+
async : no_async);
33623377
obj_add_str(r, "Predictable Latency Event Aggregate Log Change Notices",
3363-
(result & 0x1000) >> 12 ? "Send async event" : "Do not send async event");
3364-
obj_add_str(r, "Asymmetric Namespace Access Change Notices", (result & 0x800) >> 11 ?
3365-
"Send async event" : "Do not send async event");
3366-
obj_add_str(r, "Telemetry Log Notices", (result & 0x400) >> 10 ? "Send async event" :
3367-
"Do not send async event");
3368-
obj_add_str(r, "Firmware Activation Notices", (result & 0x200) >> 9 ? "Send async event" :
3369-
"Do not send async event");
3370-
obj_add_str(r, "Namespace Attribute Notices", (result & 0x100) >> 8 ? "Send async event" :
3371-
"Do not send async event");
3372-
obj_add_str(r, "SMART / Health Critical Warnings", result & 0xff ? "Send async event" :
3373-
"Do not send async event");
3378+
NVME_FEAT_AE_PLA(result) ? async : no_async);
3379+
obj_add_str(r, "Asymmetric Namespace Access Change Notices", NVME_FEAT_AE_ANA(result) ?
3380+
async : no_async);
3381+
obj_add_str(r, "Telemetry Log Notices", NVME_FEAT_AE_TELEM(result) ? async : no_async);
3382+
obj_add_str(r, "Firmware Activation Notices", NVME_FEAT_AE_FW(result) ? async : no_async);
3383+
obj_add_str(r, "Namespace Attribute Notices", NVME_FEAT_AE_NAN(result) ? async : no_async);
3384+
obj_add_str(r, "SMART / Health Critical Warnings", NVME_FEAT_AE_SMART(result) ?
3385+
async : no_async);
33743386
}
33753387

33763388
static void json_auto_pst(struct nvme_feat_auto_pst *apst, struct json_object *r)

nvme-print-stdout.c

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4898,6 +4898,8 @@ static void stdout_feature_show_fields(enum nvme_features_id fid,
48984898
unsigned int result,
48994899
unsigned char *buf)
49004900
{
4901+
const char *async = "Send async event";
4902+
const char *no_async = "Do not send async event";
49014903
__u8 field;
49024904
uint64_t ull;
49034905

@@ -4968,23 +4970,41 @@ static void stdout_feature_show_fields(enum nvme_features_id fid,
49684970
break;
49694971
case NVME_FEAT_FID_ASYNC_EVENT:
49704972
printf("\tDiscovery Log Page Change Notices : %s\n",
4971-
((result & 0x80000000) >> 31) ? "Send async event" : "Do not send async event");
4973+
NVME_FEAT_AE_DLPCN(result) ? async : no_async);
4974+
printf("\tHost Discovery Log Page Change Notification : %s\n",
4975+
NVME_FEAT_AE_HDLPCN(result) ? async : no_async);
4976+
printf("\tAVE Discovery Log Page Change Notification : %s\n",
4977+
NVME_FEAT_AE_ADLPCN(result) ? async : no_async);
4978+
printf("\tPull Model DDC Request Log Page Change Notification : %s\n",
4979+
NVME_FEAT_AE_PMDRLPCN(result) ? async : no_async);
4980+
printf("\tZone Descriptor Changed Notices : %s\n",
4981+
NVME_FEAT_AE_ZDCN(result) ? async : no_async);
4982+
printf("\tAllocated Namespace Attribute Notices : %s\n",
4983+
NVME_FEAT_AE_ANSAN(result) ? async : no_async);
4984+
printf("\tReachability Group : %s\n",
4985+
NVME_FEAT_AE_RGRP0(result) ? async : no_async);
4986+
printf("\tReachability Association : %s\n",
4987+
NVME_FEAT_AE_RASSN(result) ? async : no_async);
4988+
printf("\tTemperature Threshold Hysteresis Recovery : %s\n",
4989+
NVME_FEAT_AE_TTHRY(result) ? async : no_async);
4990+
printf("\tNormal NVM Subsystem Shutdown : %s\n",
4991+
NVME_FEAT_AE_NNSSHDN(result) ? async : no_async);
49724992
printf("\tEndurance Group Event Aggregate Log Change Notices : %s\n",
4973-
NVME_FEAT_AE_EGA(result) ? "Send async event" : "Do not send async event");
4993+
NVME_FEAT_AE_EGA(result) ? async : no_async);
49744994
printf("\tLBA Status Information Notices : %s\n",
4975-
NVME_FEAT_AE_LBAS(result) ? "Send async event" : "Do not send async event");
4995+
NVME_FEAT_AE_LBAS(result) ? async : no_async);
49764996
printf("\tPredictable Latency Event Aggregate Log Change Notices : %s\n",
4977-
NVME_FEAT_AE_PLA(result) ? "Send async event" : "Do not send async event");
4997+
NVME_FEAT_AE_PLA(result) ? async : no_async);
49784998
printf("\tAsymmetric Namespace Access Change Notices : %s\n",
4979-
NVME_FEAT_AE_ANA(result) ? "Send async event" : "Do not send async event");
4999+
NVME_FEAT_AE_ANA(result) ? async : no_async);
49805000
printf("\tTelemetry Log Notices : %s\n",
4981-
NVME_FEAT_AE_TELEM(result) ? "Send async event" : "Do not send async event");
5001+
NVME_FEAT_AE_TELEM(result) ? async : no_async);
49825002
printf("\tFirmware Activation Notices : %s\n",
4983-
NVME_FEAT_AE_FW(result) ? "Send async event" : "Do not send async event");
5003+
NVME_FEAT_AE_FW(result) ? async : no_async);
49845004
printf("\tNamespace Attribute Notices : %s\n",
4985-
NVME_FEAT_AE_NAN(result) ? "Send async event" : "Do not send async event");
5005+
NVME_FEAT_AE_NAN(result) ? async : no_async);
49865006
printf("\tSMART / Health Critical Warnings : %s\n",
4987-
NVME_FEAT_AE_SMART(result) ? "Send async event" : "Do not send async event");
5007+
NVME_FEAT_AE_SMART(result) ? async : no_async);
49885008
break;
49895009
case NVME_FEAT_FID_AUTO_PST:
49905010
printf("\tAutonomous Power State Transition Enable (APSTE): %s\n",

0 commit comments

Comments
 (0)