Merge tag 'kconfig-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-2.6-microblaze.git] / net / bridge / br_device.c
index 9a2fb4a..6f742fe 100644 (file)
@@ -206,27 +206,8 @@ static void br_get_stats64(struct net_device *dev,
                           struct rtnl_link_stats64 *stats)
 {
        struct net_bridge *br = netdev_priv(dev);
-       struct pcpu_sw_netstats tmp, sum = { 0 };
-       unsigned int cpu;
-
-       for_each_possible_cpu(cpu) {
-               unsigned int start;
-               const struct pcpu_sw_netstats *bstats
-                       = per_cpu_ptr(br->stats, cpu);
-               do {
-                       start = u64_stats_fetch_begin_irq(&bstats->syncp);
-                       memcpy(&tmp, bstats, sizeof(tmp));
-               } while (u64_stats_fetch_retry_irq(&bstats->syncp, start));
-               sum.tx_bytes   += tmp.tx_bytes;
-               sum.tx_packets += tmp.tx_packets;
-               sum.rx_bytes   += tmp.rx_bytes;
-               sum.rx_packets += tmp.rx_packets;
-       }
 
-       stats->tx_bytes   = sum.tx_bytes;
-       stats->tx_packets = sum.tx_packets;
-       stats->rx_bytes   = sum.rx_bytes;
-       stats->rx_packets = sum.rx_packets;
+       dev_fetch_sw_netstats(stats, br->stats);
 }
 
 static int br_change_mtu(struct net_device *dev, int new_mtu)