@@ -162,8 +162,7 @@ static void nvme_resources_free(struct nvme_resources *res)
162162 htable_subsys_clear (& res -> ht_s );
163163}
164164
165- static void stdout_feature_show_fields (enum nvme_features_id fid ,
166- unsigned int result ,
165+ static void stdout_feature_show_fields (enum nvme_features_id fid , __u32 cdw11 , unsigned int result ,
167166 unsigned char * buf );
168167static void stdout_smart_log (struct nvme_smart_log * smart , unsigned int nsid , const char * devname );
169168
@@ -463,7 +462,7 @@ static void pel_set_feature_event(void *pevent_log_info, __u32 offset)
463462 cdw12 = le32_to_cpu (set_feat_event -> cdw_mem [2 ]);
464463 stdout_persistent_event_log_fdp_events (cdw11 , cdw12 , mem_buf );
465464 } else {
466- stdout_feature_show_fields (fid , cdw11 , mem_buf );
465+ stdout_feature_show_fields (fid , cdw11 , cdw11 , mem_buf );
467466 }
468467}
469468
@@ -4864,6 +4863,64 @@ static void stdout_plm_config(struct nvme_plm_config *plmcfg)
48644863 printf ("\tDTWIN Time Threshold :%" PRIu64 "\n" , le64_to_cpu (plmcfg -> dtwintt ));
48654864}
48664865
4866+ static void stdout_perfc_std_attr (struct nvme_std_perf_attr * std_perf )
4867+ {
4868+ printf ("\tRandom 4 KiB average read latency (R4KARL): %s\n" ,
4869+ nvme_perf_lat_to_string (std_perf -> r4karl ));
4870+ }
4871+
4872+ static void stdout_perfc_attr_id_list (struct nvme_perf_attr_id_list * id_list )
4873+ {
4874+ int i ;
4875+
4876+ printf ("\tAttribute Type (ATTRTYP): %s\n" ,
4877+ nvme_perf_attr_type_to_string (NVME_GET (id_list -> attrtyp , FEAT_PERFC_ATTRTYP )));
4878+ printf ("\tMaximum Saveable Vendor Specific Performance Attributes (MSVSPA): %u\n" ,
4879+ id_list -> msvspa );
4880+ printf ("\tUnused Saveable Vendor Specific Performance Attributes (USVSPA): %u\n" ,
4881+ id_list -> usvspa );
4882+ for (i = 0 ; i < ARRAY_SIZE (id_list -> id_list ); i ++ )
4883+ printf ("\tPerformance Attribute %Xh Identifier (PA%XHI): %s\n" , i , i ,
4884+ util_uuid_to_string (id_list -> id_list [i ].id ));
4885+ }
4886+
4887+ static void stdout_perfc_vs_attr (struct nvme_vs_perf_attr * vs_perf )
4888+ {
4889+ printf ("\tPerformance Attribute Identifier (PAID): %s\n" ,
4890+ memcmp (vs_perf -> paid .id , zero_uuid , sizeof (zero_uuid )) ?
4891+ util_uuid_to_string (vs_perf -> paid .id ) : "Unused" );
4892+ printf ("\tAttribute Length (ATTRL): %u\n" , le16_to_cpu (vs_perf -> attrl ));
4893+ printf ("\tVendor Specific (VS)\n" );
4894+ d ((unsigned char * )vs_perf -> vs , le16_to_cpu (vs_perf -> attrl ), 16 , 1 );
4895+ }
4896+
4897+ static void stdout_perf_characteristics (__u32 cdw11 , unsigned char * buf )
4898+ {
4899+ struct nvme_perf_characteristics * attr = (struct nvme_perf_characteristics * )buf ;
4900+ __u8 attri ;
4901+ bool rvspa ;
4902+
4903+ nvme_feature_decode_perf_characteristics (cdw11 , & attri , & rvspa );
4904+
4905+ printf ("\tAttribute Index (ATTRI): %s\n" , nvme_attr_index_to_string (attri ));
4906+ printf ("\tRevert Vendor Specific Performance Attribute (RVSPA): %s\n" ,
4907+ rvspa ? "Deleted" : "Not deleted" );
4908+
4909+ switch (attri ) {
4910+ case 0 :
4911+ stdout_perfc_std_attr (attr -> std_perf );
4912+ break ;
4913+ case 0xc0 :
4914+ stdout_perfc_attr_id_list (attr -> id_list );
4915+ break ;
4916+ case 0xc1 ... 0xff :
4917+ stdout_perfc_vs_attr (attr -> vs_perf );
4918+ break ;
4919+ default :
4920+ break ;
4921+ }
4922+ }
4923+
48674924static void stdout_host_metadata (enum nvme_features_id fid ,
48684925 struct nvme_host_metadata * data )
48694926{
@@ -4894,8 +4951,7 @@ static void stdout_feature_show(enum nvme_features_id fid, int sel, unsigned int
48944951 nvme_feature_to_string (fid ), nvme_select_to_string (sel ), result ? 10 : 8 , result );
48954952}
48964953
4897- static void stdout_feature_show_fields (enum nvme_features_id fid ,
4898- unsigned int result ,
4954+ static void stdout_feature_show_fields (enum nvme_features_id fid , __u32 cdw11 , unsigned int result ,
48994955 unsigned char * buf )
49004956{
49014957 const char * async = "Send async event" ;
@@ -5093,6 +5149,9 @@ static void stdout_feature_show_fields(enum nvme_features_id fid,
50935149 printf ("\tPower Loss Signaling Mode (PLSM): %s\n" ,
50945150 nvme_pls_mode_to_string (NVME_GET (result , FEAT_PLS_MODE )));
50955151 break ;
5152+ case NVME_FEAT_FID_PERF_CHARACTERISTICS :
5153+ if (buf )
5154+ stdout_perf_characteristics (cdw11 , buf );
50965155 case NVME_FEAT_FID_ENH_CTRL_METADATA :
50975156 case NVME_FEAT_FID_CTRL_METADATA :
50985157 case NVME_FEAT_FID_NS_METADATA :
0 commit comments