Skip to content

Commit e985b97

Browse files
ZakKemblekuba-moo
authored andcommitted
net: bcmgenet: count hw discarded packets in missed stat
Hardware discarded packets are now counted in their own missed stat instead of being lumped in with general errors. Signed-off-by: Zak Kemble <[email protected]> Tested-by: Florian Fainelli <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 59aa6e3 commit e985b97

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,7 +2297,7 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
22972297
DMA_P_INDEX_DISCARD_CNT_MASK;
22982298
if (discards > ring->old_discards) {
22992299
discards = discards - ring->old_discards;
2300-
BCMGENET_STATS64_ADD(stats, errors, discards);
2300+
BCMGENET_STATS64_ADD(stats, missed, discards);
23012301
ring->old_discards += discards;
23022302

23032303
/* Clear HW register when we reach 75% of maximum 0xFFFF */
@@ -3577,6 +3577,7 @@ static void bcmgenet_get_stats64(struct net_device *dev,
35773577
unsigned int start;
35783578
unsigned int q;
35793579
u64 multicast;
3580+
u64 rx_missed;
35803581

35813582
for (q = 0; q <= priv->hw_params->tx_queues; q++) {
35823583
tx_stats = &priv->tx_rings[q].stats64;
@@ -3602,6 +3603,7 @@ static void bcmgenet_get_stats64(struct net_device *dev,
36023603
rx_packets = u64_stats_read(&rx_stats->packets);
36033604
rx_errors = u64_stats_read(&rx_stats->errors);
36043605
rx_dropped = u64_stats_read(&rx_stats->dropped);
3606+
rx_missed = u64_stats_read(&rx_stats->missed);
36053607
rx_length_errors = u64_stats_read(&rx_stats->length_errors);
36063608
rx_over_errors = u64_stats_read(&rx_stats->over_errors);
36073609
rx_crc_errors = u64_stats_read(&rx_stats->crc_errors);
@@ -3617,7 +3619,7 @@ static void bcmgenet_get_stats64(struct net_device *dev,
36173619
stats->rx_packets += rx_packets;
36183620
stats->rx_errors += rx_errors;
36193621
stats->rx_dropped += rx_dropped;
3620-
stats->rx_missed_errors += rx_errors;
3622+
stats->rx_missed_errors += rx_missed;
36213623
stats->rx_length_errors += rx_length_errors;
36223624
stats->rx_over_errors += rx_over_errors;
36233625
stats->rx_crc_errors += rx_crc_errors;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ struct bcmgenet_rx_stats64 {
170170
u64_stats_t errors;
171171
u64_stats_t dropped;
172172
u64_stats_t multicast;
173+
u64_stats_t missed;
173174
u64_stats_t length_errors;
174175
u64_stats_t over_errors;
175176
u64_stats_t crc_errors;

0 commit comments

Comments
 (0)