Skip to content

Commit 314a9cb

Browse files
hkallweitdavem330
authored andcommitted
r8169: simplify getting stats by using netdev_stats_to_stats64
Let netdev_stats_to_stats64() do the copy work for us. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 047521d commit 314a9cb

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4827,6 +4827,8 @@ rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
48274827

48284828
pm_runtime_get_noresume(&pdev->dev);
48294829

4830+
netdev_stats_to_stats64(stats, &dev->stats);
4831+
48304832
do {
48314833
start = u64_stats_fetch_begin_irq(&tp->rx_stats.syncp);
48324834
stats->rx_packets = tp->rx_stats.packets;
@@ -4839,14 +4841,6 @@ rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
48394841
stats->tx_bytes = tp->tx_stats.bytes;
48404842
} while (u64_stats_fetch_retry_irq(&tp->tx_stats.syncp, start));
48414843

4842-
stats->rx_dropped = dev->stats.rx_dropped;
4843-
stats->tx_dropped = dev->stats.tx_dropped;
4844-
stats->rx_length_errors = dev->stats.rx_length_errors;
4845-
stats->rx_errors = dev->stats.rx_errors;
4846-
stats->rx_crc_errors = dev->stats.rx_crc_errors;
4847-
stats->rx_fifo_errors = dev->stats.rx_fifo_errors;
4848-
stats->multicast = dev->stats.multicast;
4849-
48504844
/*
48514845
* Fetch additional counter values missing in stats collected by driver
48524846
* from tally counters.

0 commit comments

Comments
 (0)