diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-01-12 07:13:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-14 00:44:34 -0500 |
commit | 1ac9ad1394fa542ac7ae0dc943ee3cda678799fa (patch) | |
tree | d846be421ed68f4fc612ae7c061783dab73d5fa2 /drivers/net/gianfar.c | |
parent | 1949e084bfd143c76e22c0b37f370d6e7bf4bfdd (diff) |
net: remove dev_txq_stats_fold()
After recent changes, (percpu stats on vlan/tunnels...), we dont need
anymore per struct netdev_queue tx_bytes/tx_packets/tx_dropped counters.
Only remaining users are ixgbe, sch_teql, gianfar & macvlan :
1) ixgbe can be converted to use existing tx_ring counters.
2) macvlan incremented txq->tx_dropped, it can use the
dev->stats.tx_dropped counter.
3) sch_teql : almost revert ab35cd4b8f42 (Use net_device internal stats)
Now we have ndo_get_stats64(), use it, even for "unsigned long"
fields (No need to bring back a struct net_device_stats)
4) gianfar adds a stats structure per tx queue to hold
tx_bytes/tx_packets
This removes a lockdep warning (and possible lockup) in rndis gadget,
calling dev_get_stats() from hard IRQ context.
Ref: http://www.spinics.net/lists/netdev/msg149202.html
Reported-by: Neil Jones <neiljay@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jarek Poplawski <jarkao2@gmail.com>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: Sandeep Gopalpet <sandeep.kumar@freescale.com>
CC: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r-- | drivers/net/gianfar.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 45c4b7bfcf39..f1d4b450e797 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -433,7 +433,6 @@ static void gfar_init_mac(struct net_device *ndev) | |||
433 | static struct net_device_stats *gfar_get_stats(struct net_device *dev) | 433 | static struct net_device_stats *gfar_get_stats(struct net_device *dev) |
434 | { | 434 | { |
435 | struct gfar_private *priv = netdev_priv(dev); | 435 | struct gfar_private *priv = netdev_priv(dev); |
436 | struct netdev_queue *txq; | ||
437 | unsigned long rx_packets = 0, rx_bytes = 0, rx_dropped = 0; | 436 | unsigned long rx_packets = 0, rx_bytes = 0, rx_dropped = 0; |
438 | unsigned long tx_packets = 0, tx_bytes = 0; | 437 | unsigned long tx_packets = 0, tx_bytes = 0; |
439 | int i = 0; | 438 | int i = 0; |
@@ -449,9 +448,8 @@ static struct net_device_stats *gfar_get_stats(struct net_device *dev) | |||
449 | dev->stats.rx_dropped = rx_dropped; | 448 | dev->stats.rx_dropped = rx_dropped; |
450 | 449 | ||
451 | for (i = 0; i < priv->num_tx_queues; i++) { | 450 | for (i = 0; i < priv->num_tx_queues; i++) { |
452 | txq = netdev_get_tx_queue(dev, i); | 451 | tx_bytes += priv->tx_queue[i]->stats.tx_bytes; |
453 | tx_bytes += txq->tx_bytes; | 452 | tx_packets += priv->tx_queue[i]->stats.tx_packets; |
454 | tx_packets += txq->tx_packets; | ||
455 | } | 453 | } |
456 | 454 | ||
457 | dev->stats.tx_bytes = tx_bytes; | 455 | dev->stats.tx_bytes = tx_bytes; |
@@ -2108,8 +2106,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2108 | } | 2106 | } |
2109 | 2107 | ||
2110 | /* Update transmit stats */ | 2108 | /* Update transmit stats */ |
2111 | txq->tx_bytes += skb->len; | 2109 | tx_queue->stats.tx_bytes += skb->len; |
2112 | txq->tx_packets ++; | 2110 | tx_queue->stats.tx_packets++; |
2113 | 2111 | ||
2114 | txbdp = txbdp_start = tx_queue->cur_tx; | 2112 | txbdp = txbdp_start = tx_queue->cur_tx; |
2115 | lstatus = txbdp->lstatus; | 2113 | lstatus = txbdp->lstatus; |