Skip to contentSkip to conversation

net: bcmgenet: correct per TX/RX ring statistics

PATCH In review Doug Berger 3 participants 3 messages Apr 23, 2020

Subsystems (3)
lore
Share & tools
lore

Doug Berger

author maintainer
#0 lore raw

PATCH 1/1 net: bcmgenet: correct per TX/RX ring statistics

The change to track net_device_stats per ring to better support SMP missed updating the rx_dropped member.

The ndo_get_stats method is also needed to combine the results for ethtool statistics (-S) before filling in the ethtool structure.

Fixes 37a30b435b92 ("net: bcmgenet: Track per TX/RX rings statistics")
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +3 -0
index d975338bf78d..c4765bbe527b 100644
@@ -934,6 +934,8 @@ static void bcmgenet_get_ethtool_stats(struct net_device *dev,
 	if (netif_running(dev))
 		bcmgenet_update_mib_counters(priv);
 
+	dev->netdev_ops->ndo_get_stats(dev);
+
 	for (i = 0; i < BCMGENET_STATS_LEN; i++) {
 		const struct bcmgenet_stats *s;
 		char *p;
@@ -3156,6 +3158,7 @@ static struct net_device_stats *bcmgenet_get_stats(struct net_device *dev)
 	dev->stats.rx_packets = rx_packets;
 	dev->stats.rx_errors = rx_errors;
 	dev->stats.rx_missed_errors = rx_errors;
+	dev->stats.rx_dropped = rx_dropped;
 	return &dev->stats;
 }
 
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Doug Berger

The change to track net_device_stats per ring to better support SMP missed updating the rx_dropped member.

The ndo_get_stats method is also needed to combine the results for ethtool statistics (-S) before filling in the ethtool structure.

Fixes 37a30b435b92 ("net: bcmgenet: Track per TX/RX rings statistics")

Thanks for catching that!

Signature · 1 line
Florian
maintainer
#2 lore raw
In reply to Doug Berger

From: Doug Berger <[email protected]>
Date: Thu, 23 Apr 2020 15:44:17 -0700

Quoted 8 lines

The change to track net_device_stats per ring to better support SMP missed updating the rx_dropped member.

The ndo_get_stats method is also needed to combine the results for ethtool statistics (-S) before filling in the ethtool structure.

Fixes 37a30b435b92 ("net: bcmgenet: Track per TX/RX rings statistics")

Applied and queued up for -stable, thanks.