@@ -1029,14 +1029,34 @@ struct bcmgenet_stats {
1029
1029
tx_rings[num].stats64, packets), \
1030
1030
STAT_GENET_SOFT_MIB64("txq" __stringify(num) "_bytes", \
1031
1031
tx_rings[num].stats64, bytes), \
1032
+ STAT_GENET_SOFT_MIB64("txq" __stringify(num) "_errors", \
1033
+ tx_rings[num].stats64, errors), \
1034
+ STAT_GENET_SOFT_MIB64("txq" __stringify(num) "_dropped", \
1035
+ tx_rings[num].stats64, dropped), \
1032
1036
STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_bytes", \
1033
1037
rx_rings[num].stats64, bytes), \
1034
1038
STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_packets", \
1035
1039
rx_rings[num].stats64, packets), \
1036
1040
STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_errors", \
1037
1041
rx_rings[num].stats64, errors), \
1038
1042
STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_dropped", \
1039
- rx_rings[num].stats64, dropped)
1043
+ rx_rings[num].stats64, dropped), \
1044
+ STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_multicast", \
1045
+ rx_rings[num].stats64, multicast), \
1046
+ STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_missed", \
1047
+ rx_rings[num].stats64, missed), \
1048
+ STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_length_errors", \
1049
+ rx_rings[num].stats64, length_errors), \
1050
+ STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_over_errors", \
1051
+ rx_rings[num].stats64, over_errors), \
1052
+ STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_crc_errors", \
1053
+ rx_rings[num].stats64, crc_errors), \
1054
+ STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_frame_errors", \
1055
+ rx_rings[num].stats64, frame_errors), \
1056
+ STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_fragmented_errors", \
1057
+ rx_rings[num].stats64, fragmented_errors), \
1058
+ STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_broadcast", \
1059
+ rx_rings[num].stats64, broadcast)
1040
1060
1041
1061
/* There is a 0xC gap between the end of RX and beginning of TX stats and then
1042
1062
* between the end of TX stats and the beginning of the RX RUNT
@@ -1057,6 +1077,11 @@ static const struct bcmgenet_stats bcmgenet_gstrings_stats[] = {
1057
1077
STAT_RTNL (rx_dropped ),
1058
1078
STAT_RTNL (tx_dropped ),
1059
1079
STAT_RTNL (multicast ),
1080
+ STAT_RTNL (rx_missed_errors ),
1081
+ STAT_RTNL (rx_length_errors ),
1082
+ STAT_RTNL (rx_over_errors ),
1083
+ STAT_RTNL (rx_crc_errors ),
1084
+ STAT_RTNL (rx_frame_errors ),
1060
1085
/* UniMAC RSV counters */
1061
1086
STAT_GENET_MIB_RX ("rx_64_octets" , mib .rx .pkt_cnt .cnt_64 ),
1062
1087
STAT_GENET_MIB_RX ("rx_65_127_oct" , mib .rx .pkt_cnt .cnt_127 ),
@@ -2358,7 +2383,7 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
2358
2383
if (unlikely (!(dma_flag & DMA_EOP ) || !(dma_flag & DMA_SOP ))) {
2359
2384
netif_err (priv , rx_status , dev ,
2360
2385
"dropping fragmented packet!\n" );
2361
- BCMGENET_STATS64_INC (stats , errors );
2386
+ BCMGENET_STATS64_INC (stats , fragmented_errors );
2362
2387
dev_kfree_skb_any (skb );
2363
2388
goto next ;
2364
2389
}
@@ -2412,6 +2437,8 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
2412
2437
u64_stats_add (& stats -> bytes , len );
2413
2438
if (dma_flag & DMA_RX_MULT )
2414
2439
u64_stats_inc (& stats -> multicast );
2440
+ else if (dma_flag & DMA_RX_BRDCAST )
2441
+ u64_stats_inc (& stats -> broadcast );
2415
2442
u64_stats_update_end (& stats -> syncp );
2416
2443
2417
2444
/* Notify kernel */
@@ -3569,6 +3596,7 @@ static void bcmgenet_get_stats64(struct net_device *dev,
3569
3596
struct bcmgenet_tx_stats64 * tx_stats ;
3570
3597
struct bcmgenet_rx_stats64 * rx_stats ;
3571
3598
u64 rx_length_errors , rx_over_errors ;
3599
+ u64 rx_missed , rx_fragmented_errors ;
3572
3600
u64 rx_crc_errors , rx_frame_errors ;
3573
3601
u64 tx_errors , tx_dropped ;
3574
3602
u64 rx_errors , rx_dropped ;
@@ -3577,7 +3605,6 @@ static void bcmgenet_get_stats64(struct net_device *dev,
3577
3605
unsigned int start ;
3578
3606
unsigned int q ;
3579
3607
u64 multicast ;
3580
- u64 rx_missed ;
3581
3608
3582
3609
for (q = 0 ; q <= priv -> hw_params -> tx_queues ; q ++ ) {
3583
3610
tx_stats = & priv -> tx_rings [q ].stats64 ;
@@ -3608,12 +3635,14 @@ static void bcmgenet_get_stats64(struct net_device *dev,
3608
3635
rx_over_errors = u64_stats_read (& rx_stats -> over_errors );
3609
3636
rx_crc_errors = u64_stats_read (& rx_stats -> crc_errors );
3610
3637
rx_frame_errors = u64_stats_read (& rx_stats -> frame_errors );
3638
+ rx_fragmented_errors = u64_stats_read (& rx_stats -> fragmented_errors );
3611
3639
multicast = u64_stats_read (& rx_stats -> multicast );
3612
3640
} while (u64_stats_fetch_retry (& rx_stats -> syncp , start ));
3613
3641
3614
3642
rx_errors += rx_length_errors ;
3615
3643
rx_errors += rx_crc_errors ;
3616
3644
rx_errors += rx_frame_errors ;
3645
+ rx_errors += rx_fragmented_errors ;
3617
3646
3618
3647
stats -> rx_bytes += rx_bytes ;
3619
3648
stats -> rx_packets += rx_packets ;
0 commit comments