Skip to contentSkip to conversation

net: bridge: add missing counters to ndo_get_stats64 callback

PATCH Applied Heiner Kallweit 2 participants 2 messages Nov 13, 2020 – Nov 16, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: bridge: add missing counters to ndo_get_stats64 callback

In br_forward.c and br_input.c fields dev->stats.tx_dropped and dev->stats.multicast are populated, but they are ignored in ndo_get_stats64.

Fixes 28172739f0a2 ("net: fix 64 bit counters on 32 bit arches")

---
Patch will not apply cleanly on kernel versions that don't have dev_fetch_sw_netstats() yet.

---
 net/bridge/br_device.c | 1 +
 1 file changed, 1 insertion(+)
net/bridge/br_device.c +1 -0
index 387403931..77bcc8487 100644
@@ -207,6 +207,7 @@ static void br_get_stats64(struct net_device *dev,
 {
 	struct net_bridge *br = netdev_priv(dev);
 
+	netdev_stats_to_stats64(stats, &dev->stats);
 	dev_fetch_sw_netstats(stats, br->stats);
 }
 
Signature · 1 line
2.29.2
maintainer Applied
#1 lore raw
Quoted 9 lines · On Fri, 13 Nov 2020 10:27:27 +0100 Heiner Kallweit wrote:

In br_forward.c and br_input.c fields dev->stats.tx_dropped and dev->stats.multicast are populated, but they are ignored in ndo_get_stats64.

Fixes 28172739f0a2 ("net: fix 64 bit counters on 32 bit arches")

---
Patch will not apply cleanly on kernel versions that don't have dev_fetch_sw_netstats() yet.

Looks straightforward enough, I'll backport manually.

Applied, thanks!