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.h | |
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.h')
-rw-r--r-- | drivers/net/gianfar.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index 68984eb88ae0..54de4135e932 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h | |||
@@ -907,12 +907,21 @@ enum { | |||
907 | MQ_MG_MODE | 907 | MQ_MG_MODE |
908 | }; | 908 | }; |
909 | 909 | ||
910 | /* | ||
911 | * Per TX queue stats | ||
912 | */ | ||
913 | struct tx_q_stats { | ||
914 | unsigned long tx_packets; | ||
915 | unsigned long tx_bytes; | ||
916 | }; | ||
917 | |||
910 | /** | 918 | /** |
911 | * struct gfar_priv_tx_q - per tx queue structure | 919 | * struct gfar_priv_tx_q - per tx queue structure |
912 | * @txlock: per queue tx spin lock | 920 | * @txlock: per queue tx spin lock |
913 | * @tx_skbuff:skb pointers | 921 | * @tx_skbuff:skb pointers |
914 | * @skb_curtx: to be used skb pointer | 922 | * @skb_curtx: to be used skb pointer |
915 | * @skb_dirtytx:the last used skb pointer | 923 | * @skb_dirtytx:the last used skb pointer |
924 | * @stats: bytes/packets stats | ||
916 | * @qindex: index of this queue | 925 | * @qindex: index of this queue |
917 | * @dev: back pointer to the dev structure | 926 | * @dev: back pointer to the dev structure |
918 | * @grp: back pointer to the group to which this queue belongs | 927 | * @grp: back pointer to the group to which this queue belongs |
@@ -934,6 +943,7 @@ struct gfar_priv_tx_q { | |||
934 | struct txbd8 *tx_bd_base; | 943 | struct txbd8 *tx_bd_base; |
935 | struct txbd8 *cur_tx; | 944 | struct txbd8 *cur_tx; |
936 | struct txbd8 *dirty_tx; | 945 | struct txbd8 *dirty_tx; |
946 | struct tx_q_stats stats; | ||
937 | struct net_device *dev; | 947 | struct net_device *dev; |
938 | struct gfar_priv_grp *grp; | 948 | struct gfar_priv_grp *grp; |
939 | u16 skb_curtx; | 949 | u16 skb_curtx; |