@@ -1452,6 +1452,19 @@ void json_nvme_id_uuid_list(struct nvme_id_uuid_list *uuid_list)
14521452 json_free_object (root );
14531453}
14541454
1455+ static const char * nvme_trtype_to_string (__u8 trtype )
1456+ {
1457+ switch (trtype ) {
1458+ case 0 : return "The transport type is not indicated or the error " \
1459+ "is not transport related." ;
1460+ case 1 : return "RDMA Transport error." ;
1461+ case 2 : return "Fibre Channel Transport error." ;
1462+ case 3 : return "TCP Transport error." ;
1463+ case 254 : return "Intra-host Transport error." ;
1464+ default : return "Reserved" ;
1465+ };
1466+ }
1467+
14551468void show_error_log (struct nvme_error_log_page * err_log , int entries , const char * devname )
14561469{
14571470 int i ;
@@ -1462,17 +1475,19 @@ void show_error_log(struct nvme_error_log_page *err_log, int entries, const char
14621475 for (i = 0 ; i < entries ; i ++ ) {
14631476 printf (" Entry[%2d] \n" , i );
14641477 printf (".................\n" );
1465- printf ("error_count : %" PRIu64 "\n" , le64_to_cpu (err_log [i ].error_count ));
1466- printf ("sqid : %d\n" , err_log [i ].sqid );
1467- printf ("cmdid : %#x\n" , err_log [i ].cmdid );
1468- printf ("status_field : %#x(%s)\n" , err_log [i ].status_field ,
1478+ printf ("error_count : %" PRIu64 "\n" , le64_to_cpu (err_log [i ].error_count ));
1479+ printf ("sqid : %d\n" , err_log [i ].sqid );
1480+ printf ("cmdid : %#x\n" , err_log [i ].cmdid );
1481+ printf ("status_field : %#x(%s)\n" , err_log [i ].status_field ,
14691482 nvme_status_to_string (le16_to_cpu (err_log [i ].status_field ) >> 1 ));
1470- printf ("parm_err_loc : %#x\n" , err_log [i ].parm_error_location );
1471- printf ("lba : %#" PRIx64 "\n" ,le64_to_cpu (err_log [i ].lba ));
1472- printf ("nsid : %#x\n" , err_log [i ].nsid );
1473- printf ("vs : %d\n" , err_log [i ].vs );
1474- printf ("cs : %#" PRIx64 "\n" ,
1483+ printf ("parm_err_loc : %#x\n" , err_log [i ].parm_error_location );
1484+ printf ("lba : %#" PRIx64 "\n" ,le64_to_cpu (err_log [i ].lba ));
1485+ printf ("nsid : %#x\n" , err_log [i ].nsid );
1486+ printf ("vs : %d\n" , err_log [i ].vs );
1487+ printf ("trtype : %s\n" , nvme_trtype_to_string (err_log [i ].trtype ));
1488+ printf ("cs : %#" PRIx64 "\n" ,
14751489 le64_to_cpu (err_log [i ].cs ));
1490+ printf ("trtype_spec_info: %#x\n" , err_log [i ].trtype_spec_info );
14761491 printf (".................\n" );
14771492 }
14781493}
@@ -3021,8 +3036,11 @@ void json_error_log(struct nvme_error_log_page *err_log, int entries, const char
30213036 json_object_add_value_uint (error , "nsid" ,
30223037 le32_to_cpu (err_log [i ].nsid ));
30233038 json_object_add_value_int (error , "vs" , err_log [i ].vs );
3039+ json_object_add_value_int (error , "trtype" , err_log [i ].trtype );
30243040 json_object_add_value_uint (error , "cs" ,
30253041 le64_to_cpu (err_log [i ].cs ));
3042+ json_object_add_value_int (error , "trtype_spec_info" ,
3043+ le16_to_cpu (err_log [i ].trtype_spec_info ));
30263044
30273045 json_array_add_value_object (errors , error );
30283046 }
0 commit comments