Skip to content

Commit 31da39b

Browse files
ZakKembleNipaLocal
authored and
NipaLocal
committed
net: bcmgenet: expose more stats in ethtool
Expose more per-queue and overall stats in ethtool Signed-off-by: Zak Kemble <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent e4d0bb2 commit 31da39b

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,14 +1029,34 @@ struct bcmgenet_stats {
10291029
tx_rings[num].stats64, packets), \
10301030
STAT_GENET_SOFT_MIB64("txq" __stringify(num) "_bytes", \
10311031
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), \
10321036
STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_bytes", \
10331037
rx_rings[num].stats64, bytes), \
10341038
STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_packets", \
10351039
rx_rings[num].stats64, packets), \
10361040
STAT_GENET_SOFT_MIB64("rxq" __stringify(num) "_errors", \
10371041
rx_rings[num].stats64, errors), \
10381042
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)
10401060

10411061
/* There is a 0xC gap between the end of RX and beginning of TX stats and then
10421062
* 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[] = {
10571077
STAT_RTNL(rx_dropped),
10581078
STAT_RTNL(tx_dropped),
10591079
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),
10601085
/* UniMAC RSV counters */
10611086
STAT_GENET_MIB_RX("rx_64_octets", mib.rx.pkt_cnt.cnt_64),
10621087
STAT_GENET_MIB_RX("rx_65_127_oct", mib.rx.pkt_cnt.cnt_127),
@@ -2412,6 +2437,8 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
24122437
u64_stats_add(&stats->bytes, len);
24132438
if (dma_flag & DMA_RX_MULT)
24142439
u64_stats_inc(&stats->multicast);
2440+
else if (dma_flag & DMA_RX_BRDCAST)
2441+
u64_stats_inc(&stats->broadcast);
24152442
u64_stats_update_end(&stats->syncp);
24162443

24172444
/* Notify kernel */

0 commit comments

Comments
 (0)