@@ -51,12 +51,12 @@ NStats = namedtuple("NStats", "rx_ok, rx_err, rx_drop, rx_ovr, tx_ok,\
51
51
rx_uca, rx_mca, rx_bca, rx_all,\
52
52
tx_64, tx_65_127, tx_128_255, tx_256_511, tx_512_1023, tx_1024_1518, tx_1519_2047, tx_2048_4095, tx_4096_9216, tx_9217_16383,\
53
53
tx_uca, tx_mca, tx_bca, tx_all,\
54
- rx_jbr, rx_frag, rx_usize, rx_ovrrun" )
54
+ rx_jbr, rx_frag, rx_usize, rx_ovrrun, fec_corr, fec_uncorr " )
55
55
header_all = ['IFACE' , 'STATE' , 'RX_OK' , 'RX_BPS' , 'RX_PPS' , 'RX_UTIL' , 'RX_ERR' , 'RX_DRP' , 'RX_OVR' ,
56
- 'TX_OK' , 'TX_BPS' , 'TX_PPS' , 'TX_UTIL' , 'TX_ERR' , 'TX_DRP' , 'TX_OVR' ]
56
+ 'TX_OK' , 'TX_BPS' , 'TX_PPS' , 'TX_UTIL' , 'TX_ERR' , 'TX_DRP' , 'TX_OVR' , 'FEC_CORR' , 'FEC_UNCORR' ]
57
57
header_std = ['IFACE' , 'STATE' , 'RX_OK' , 'RX_BPS' , 'RX_UTIL' , 'RX_ERR' , 'RX_DRP' , 'RX_OVR' ,
58
58
'TX_OK' , 'TX_BPS' , 'TX_UTIL' , 'TX_ERR' , 'TX_DRP' , 'TX_OVR' ]
59
- header_errors_only = ['IFACE' , 'STATE' , 'RX_ERR' , 'RX_DRP' , 'RX_OVR' , 'TX_ERR' , 'TX_DRP' , 'TX_OVR' ]
59
+ header_errors_only = ['IFACE' , 'STATE' , 'RX_ERR' , 'RX_DRP' , 'RX_OVR' , 'TX_ERR' , 'TX_DRP' , 'TX_OVR' , 'FEC_CORR' , 'FEC_UNCORR' ]
60
60
header_rates_only = ['IFACE' , 'STATE' , 'RX_OK' , 'RX_BPS' , 'RX_PPS' , 'RX_UTIL' , 'TX_OK' , 'TX_BPS' , 'TX_PPS' , 'TX_UTIL' ]
61
61
62
62
rates_key_list = [ 'RX_BPS' , 'RX_PPS' , 'RX_UTIL' , 'TX_BPS' , 'TX_PPS' , 'TX_UTIL' ]
@@ -67,7 +67,7 @@ RateStats = namedtuple("RateStats", ratestat_fields)
67
67
The order and count of statistics mentioned below needs to be in sync with the values in portstat script
68
68
So, any fields added/deleted in here should be reflected in portstat script also
69
69
"""
70
- BUCKET_NUM = 42
70
+ BUCKET_NUM = 44
71
71
counter_bucket_dict = {
72
72
0 :['SAI_PORT_STAT_IF_IN_UCAST_PKTS' , 'SAI_PORT_STAT_IF_IN_NON_UCAST_PKTS' ],
73
73
1 :['SAI_PORT_STAT_IF_IN_ERRORS' ],
@@ -110,7 +110,9 @@ counter_bucket_dict = {
110
110
38 :['SAI_PORT_STAT_ETHER_STATS_JABBERS' ],
111
111
39 :['SAI_PORT_STAT_ETHER_STATS_FRAGMENTS' ],
112
112
40 :['SAI_PORT_STAT_ETHER_STATS_UNDERSIZE_PKTS' ],
113
- 41 :['SAI_PORT_STAT_IP_IN_RECEIVES' ]
113
+ 41 :['SAI_PORT_STAT_IP_IN_RECEIVES' ],
114
+ 42 :['SAI_PORT_STAT_IF_IN_FEC_CORRECTABLE_FRAMES' ],
115
+ 43 :['SAI_PORT_STAT_IF_IN_FEC_NOT_CORRECTABLE_FRAMES' ]
114
116
}
115
117
116
118
STATUS_NA = 'N/A'
@@ -285,7 +287,9 @@ class Portstat(object):
285
287
format_util (rates .tx_bps , port_speed ),
286
288
format_number_with_comma (data .tx_err ),
287
289
format_number_with_comma (data .tx_drop ),
288
- format_number_with_comma (data .tx_ovr )))
290
+ format_number_with_comma (data .tx_ovr ),
291
+ format_number_with_comma (data .fec_corr ),
292
+ format_number_with_comma (data .fec_uncorr )))
289
293
elif errors_only :
290
294
header = header_errors_only
291
295
table .append ((key , self .get_port_state (key ),
@@ -294,7 +298,9 @@ class Portstat(object):
294
298
format_number_with_comma (data .rx_ovr ),
295
299
format_number_with_comma (data .tx_err ),
296
300
format_number_with_comma (data .tx_drop ),
297
- format_number_with_comma (data .tx_ovr )))
301
+ format_number_with_comma (data .tx_ovr ),
302
+ format_number_with_comma (data .fec_corr ),
303
+ format_number_with_comma (data .fec_uncorr )))
298
304
elif rates_only :
299
305
header = header_rates_only
300
306
table .append ((key , self .get_port_state (key ),
@@ -430,7 +436,9 @@ class Portstat(object):
430
436
format_util (rates .tx_bps , port_speed ),
431
437
ns_diff (cntr .tx_err , old_cntr .tx_err ),
432
438
ns_diff (cntr .tx_drop , old_cntr .tx_drop ),
433
- ns_diff (cntr .tx_ovr , old_cntr .tx_ovr )))
439
+ ns_diff (cntr .tx_ovr , old_cntr .tx_ovr ),
440
+ ns_diff (cntr .fec_corr , old_cntr .fec_corr ),
441
+ ns_diff (cntr .fec_uncorr , old_cntr .fec_uncorr )))
434
442
else :
435
443
table .append ((key , self .get_port_state (key ),
436
444
format_number_with_comma (cntr .rx_ok ),
@@ -446,7 +454,9 @@ class Portstat(object):
446
454
format_util (rates .tx_bps , port_speed ),
447
455
format_number_with_comma (cntr .tx_err ),
448
456
format_number_with_comma (cntr .tx_drop ),
449
- format_number_with_comma (cntr .tx_ovr )))
457
+ format_number_with_comma (cntr .tx_ovr ),
458
+ format_number_with_comma (cntr .fec_corr ),
459
+ format_number_with_comma (cntr .fec_uncorr )))
450
460
elif errors_only :
451
461
header = header_errors_only
452
462
if old_cntr is not None :
@@ -456,15 +466,19 @@ class Portstat(object):
456
466
ns_diff (cntr .rx_ovr , old_cntr .rx_ovr ),
457
467
ns_diff (cntr .tx_err , old_cntr .tx_err ),
458
468
ns_diff (cntr .tx_drop , old_cntr .tx_drop ),
459
- ns_diff (cntr .tx_ovr , old_cntr .tx_ovr )))
469
+ ns_diff (cntr .tx_ovr , old_cntr .tx_ovr ),
470
+ ns_diff (cntr .fec_corr , old_cntr .fec_corr ),
471
+ ns_diff (cntr .fec_uncorr , old_cntr .fec_uncorr )))
460
472
else :
461
473
table .append ((key , self .get_port_state (key ),
462
474
format_number_with_comma (cntr .rx_err ),
463
475
format_number_with_comma (cntr .rx_drop ),
464
476
format_number_with_comma (cntr .rx_ovr ),
465
477
format_number_with_comma (cntr .tx_err ),
466
478
format_number_with_comma (cntr .tx_drop ),
467
- format_number_with_comma (cntr .tx_ovr )))
479
+ format_number_with_comma (cntr .tx_ovr ),
480
+ format_number_with_comma (cntr .fec_corr ),
481
+ format_number_with_comma (cntr .fec_uncorr )))
468
482
elif rates_only :
469
483
header = header_rates_only
470
484
if old_cntr is not None :
@@ -639,4 +653,4 @@ Examples:
639
653
portstat .cnstat_diff_print (cnstat_new_dict , cnstat_dict , ratestat_new_dict , intf_list , use_json , print_all , errors_only , rates_only , detail )
640
654
641
655
if __name__ == "__main__" :
642
- main ()
656
+ main ()
0 commit comments