aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_main.c64
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c8
-rw-r--r--drivers/net/loopback.c4
-rw-r--r--drivers/net/macvlan.c6
-rw-r--r--drivers/net/sfc/efx.c3
-rw-r--r--drivers/net/sfc/ethtool.c3
6 files changed, 44 insertions, 44 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a95a41b74b4e..9bb9bfa225b6 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3804,51 +3804,49 @@ static int bond_close(struct net_device *bond_dev)
3804 return 0; 3804 return 0;
3805} 3805}
3806 3806
3807static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev) 3807static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
3808 struct rtnl_link_stats64 *stats)
3808{ 3809{
3809 struct bonding *bond = netdev_priv(bond_dev); 3810 struct bonding *bond = netdev_priv(bond_dev);
3810 struct rtnl_link_stats64 *stats = &bond_dev->stats64; 3811 struct rtnl_link_stats64 temp;
3811 struct rtnl_link_stats64 local_stats;
3812 struct slave *slave; 3812 struct slave *slave;
3813 int i; 3813 int i;
3814 3814
3815 memset(&local_stats, 0, sizeof(local_stats)); 3815 memset(stats, 0, sizeof(*stats));
3816 3816
3817 read_lock_bh(&bond->lock); 3817 read_lock_bh(&bond->lock);
3818 3818
3819 bond_for_each_slave(bond, slave, i) { 3819 bond_for_each_slave(bond, slave, i) {
3820 const struct rtnl_link_stats64 *sstats = 3820 const struct rtnl_link_stats64 *sstats =
3821 dev_get_stats(slave->dev); 3821 dev_get_stats(slave->dev, &temp);
3822 3822
3823 local_stats.rx_packets += sstats->rx_packets; 3823 stats->rx_packets += sstats->rx_packets;
3824 local_stats.rx_bytes += sstats->rx_bytes; 3824 stats->rx_bytes += sstats->rx_bytes;
3825 local_stats.rx_errors += sstats->rx_errors; 3825 stats->rx_errors += sstats->rx_errors;
3826 local_stats.rx_dropped += sstats->rx_dropped; 3826 stats->rx_dropped += sstats->rx_dropped;
3827 3827
3828 local_stats.tx_packets += sstats->tx_packets; 3828 stats->tx_packets += sstats->tx_packets;
3829 local_stats.tx_bytes += sstats->tx_bytes; 3829 stats->tx_bytes += sstats->tx_bytes;
3830 local_stats.tx_errors += sstats->tx_errors; 3830 stats->tx_errors += sstats->tx_errors;
3831 local_stats.tx_dropped += sstats->tx_dropped; 3831 stats->tx_dropped += sstats->tx_dropped;
3832 3832
3833 local_stats.multicast += sstats->multicast; 3833 stats->multicast += sstats->multicast;
3834 local_stats.collisions += sstats->collisions; 3834 stats->collisions += sstats->collisions;
3835 3835
3836 local_stats.rx_length_errors += sstats->rx_length_errors; 3836 stats->rx_length_errors += sstats->rx_length_errors;
3837 local_stats.rx_over_errors += sstats->rx_over_errors; 3837 stats->rx_over_errors += sstats->rx_over_errors;
3838 local_stats.rx_crc_errors += sstats->rx_crc_errors; 3838 stats->rx_crc_errors += sstats->rx_crc_errors;
3839 local_stats.rx_frame_errors += sstats->rx_frame_errors; 3839 stats->rx_frame_errors += sstats->rx_frame_errors;
3840 local_stats.rx_fifo_errors += sstats->rx_fifo_errors; 3840 stats->rx_fifo_errors += sstats->rx_fifo_errors;
3841 local_stats.rx_missed_errors += sstats->rx_missed_errors; 3841 stats->rx_missed_errors += sstats->rx_missed_errors;
3842 3842
3843 local_stats.tx_aborted_errors += sstats->tx_aborted_errors; 3843 stats->tx_aborted_errors += sstats->tx_aborted_errors;
3844 local_stats.tx_carrier_errors += sstats->tx_carrier_errors; 3844 stats->tx_carrier_errors += sstats->tx_carrier_errors;
3845 local_stats.tx_fifo_errors += sstats->tx_fifo_errors; 3845 stats->tx_fifo_errors += sstats->tx_fifo_errors;
3846 local_stats.tx_heartbeat_errors += sstats->tx_heartbeat_errors; 3846 stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors;
3847 local_stats.tx_window_errors += sstats->tx_window_errors; 3847 stats->tx_window_errors += sstats->tx_window_errors;
3848 } 3848 }
3849 3849
3850 memcpy(stats, &local_stats, sizeof(struct net_device_stats));
3851
3852 read_unlock_bh(&bond->lock); 3850 read_unlock_bh(&bond->lock);
3853 3851
3854 return stats; 3852 return stats;
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index b35ef36741ef..da54b38bb480 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -55,7 +55,7 @@ struct ixgbe_stats {
55 offsetof(struct ixgbe_adapter, m) 55 offsetof(struct ixgbe_adapter, m)
56#define IXGBE_NETDEV_STAT(m) NETDEV_STATS, \ 56#define IXGBE_NETDEV_STAT(m) NETDEV_STATS, \
57 sizeof(((struct net_device *)0)->m), \ 57 sizeof(((struct net_device *)0)->m), \
58 offsetof(struct net_device, m) 58 offsetof(struct net_device, m) - offsetof(struct net_device, stats)
59 59
60static struct ixgbe_stats ixgbe_gstrings_stats[] = { 60static struct ixgbe_stats ixgbe_gstrings_stats[] = {
61 {"rx_packets", IXGBE_NETDEV_STAT(stats.rx_packets)}, 61 {"rx_packets", IXGBE_NETDEV_STAT(stats.rx_packets)},
@@ -998,16 +998,18 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
998 struct ixgbe_adapter *adapter = netdev_priv(netdev); 998 struct ixgbe_adapter *adapter = netdev_priv(netdev);
999 u64 *queue_stat; 999 u64 *queue_stat;
1000 int stat_count = sizeof(struct ixgbe_queue_stats) / sizeof(u64); 1000 int stat_count = sizeof(struct ixgbe_queue_stats) / sizeof(u64);
1001 struct rtnl_link_stats64 temp;
1002 const struct rtnl_link_stats64 *net_stats;
1001 int j, k; 1003 int j, k;
1002 int i; 1004 int i;
1003 char *p = NULL; 1005 char *p = NULL;
1004 1006
1005 ixgbe_update_stats(adapter); 1007 ixgbe_update_stats(adapter);
1006 dev_get_stats(netdev); 1008 net_stats = dev_get_stats(netdev, &temp);
1007 for (i = 0; i < IXGBE_GLOBAL_STATS_LEN; i++) { 1009 for (i = 0; i < IXGBE_GLOBAL_STATS_LEN; i++) {
1008 switch (ixgbe_gstrings_stats[i].type) { 1010 switch (ixgbe_gstrings_stats[i].type) {
1009 case NETDEV_STATS: 1011 case NETDEV_STATS:
1010 p = (char *) netdev + 1012 p = (char *) net_stats +
1011 ixgbe_gstrings_stats[i].stat_offset; 1013 ixgbe_gstrings_stats[i].stat_offset;
1012 break; 1014 break;
1013 case IXGBE_STATS: 1015 case IXGBE_STATS:
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 4dd0510d7a99..9a0996795321 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -98,10 +98,10 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,
98 return NETDEV_TX_OK; 98 return NETDEV_TX_OK;
99} 99}
100 100
101static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev) 101static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev,
102 struct rtnl_link_stats64 *stats)
102{ 103{
103 const struct pcpu_lstats __percpu *pcpu_lstats; 104 const struct pcpu_lstats __percpu *pcpu_lstats;
104 struct rtnl_link_stats64 *stats = &dev->stats64;
105 u64 bytes = 0; 105 u64 bytes = 0;
106 u64 packets = 0; 106 u64 packets = 0;
107 u64 drops = 0; 107 u64 drops = 0;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index e6d626e78515..6112f1498940 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -431,12 +431,12 @@ static void macvlan_uninit(struct net_device *dev)
431 free_percpu(vlan->rx_stats); 431 free_percpu(vlan->rx_stats);
432} 432}
433 433
434static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev) 434static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev,
435 struct rtnl_link_stats64 *stats)
435{ 436{
436 struct rtnl_link_stats64 *stats = &dev->stats64;
437 struct macvlan_dev *vlan = netdev_priv(dev); 437 struct macvlan_dev *vlan = netdev_priv(dev);
438 438
439 dev_txq_stats_fold(dev, &dev->stats); 439 dev_txq_stats_fold(dev, (struct net_device_stats *)stats);
440 440
441 if (vlan->rx_stats) { 441 if (vlan->rx_stats) {
442 struct macvlan_rx_stats *p, accum = {0}; 442 struct macvlan_rx_stats *p, accum = {0};
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 35b3f2922e5c..ba674c5ca29e 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1533,11 +1533,10 @@ static int efx_net_stop(struct net_device *net_dev)
1533} 1533}
1534 1534
1535/* Context: process, dev_base_lock or RTNL held, non-blocking. */ 1535/* Context: process, dev_base_lock or RTNL held, non-blocking. */
1536static struct rtnl_link_stats64 *efx_net_stats(struct net_device *net_dev) 1536static struct rtnl_link_stats64 *efx_net_stats(struct net_device *net_dev, struct rtnl_link_stats64 *stats)
1537{ 1537{
1538 struct efx_nic *efx = netdev_priv(net_dev); 1538 struct efx_nic *efx = netdev_priv(net_dev);
1539 struct efx_mac_stats *mac_stats = &efx->mac_stats; 1539 struct efx_mac_stats *mac_stats = &efx->mac_stats;
1540 struct rtnl_link_stats64 *stats = &net_dev->stats64;
1541 1540
1542 spin_lock_bh(&efx->stats_lock); 1541 spin_lock_bh(&efx->stats_lock);
1543 efx->type->update_stats(efx); 1542 efx->type->update_stats(efx);
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index 3b8b0a062749..fd19d6ab97a2 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -469,12 +469,13 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
469 struct efx_mac_stats *mac_stats = &efx->mac_stats; 469 struct efx_mac_stats *mac_stats = &efx->mac_stats;
470 struct efx_ethtool_stat *stat; 470 struct efx_ethtool_stat *stat;
471 struct efx_channel *channel; 471 struct efx_channel *channel;
472 struct rtnl_link_stats64 temp;
472 int i; 473 int i;
473 474
474 EFX_BUG_ON_PARANOID(stats->n_stats != EFX_ETHTOOL_NUM_STATS); 475 EFX_BUG_ON_PARANOID(stats->n_stats != EFX_ETHTOOL_NUM_STATS);
475 476
476 /* Update MAC and NIC statistics */ 477 /* Update MAC and NIC statistics */
477 dev_get_stats(net_dev); 478 dev_get_stats(net_dev, &temp);
478 479
479 /* Fill detailed statistics buffer */ 480 /* Fill detailed statistics buffer */
480 for (i = 0; i < EFX_ETHTOOL_NUM_STATS; i++) { 481 for (i = 0; i < EFX_ETHTOOL_NUM_STATS; i++) {