diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-06-23 16:00:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-23 16:00:48 -0400 |
commit | 406818ff347cbbdae2fb21fafd1939d00cf479c5 (patch) | |
tree | 02c6a4d90b4a810ed28a3e61e486cf00c9404bbd /net/bridge/br_private.h | |
parent | 16b8a4761cbe5082cd35641c066d7c4b6b83cdca (diff) |
bridge: 64bit rx/tx counters
Use u64_stats_sync infrastructure to provide 64bit rx/tx
counters even on 32bit hosts.
It is safe to use a single u64_stats_sync for rx and tx,
because BH is disabled on both, and we use per_cpu data.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_private.h')
-rw-r--r-- | net/bridge/br_private.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 07cf57b373fe..3f0678fd1fd0 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/netdevice.h> | 16 | #include <linux/netdevice.h> |
17 | #include <linux/if_bridge.h> | 17 | #include <linux/if_bridge.h> |
18 | #include <linux/netpoll.h> | 18 | #include <linux/netpoll.h> |
19 | #include <linux/u64_stats_sync.h> | ||
19 | #include <net/route.h> | 20 | #include <net/route.h> |
20 | 21 | ||
21 | #define BR_HASH_BITS 8 | 22 | #define BR_HASH_BITS 8 |
@@ -156,10 +157,11 @@ struct net_bridge_port | |||
156 | #define br_port_exists(dev) (dev->priv_flags & IFF_BRIDGE_PORT) | 157 | #define br_port_exists(dev) (dev->priv_flags & IFF_BRIDGE_PORT) |
157 | 158 | ||
158 | struct br_cpu_netstats { | 159 | struct br_cpu_netstats { |
159 | unsigned long rx_packets; | 160 | u64 rx_packets; |
160 | unsigned long rx_bytes; | 161 | u64 rx_bytes; |
161 | unsigned long tx_packets; | 162 | u64 tx_packets; |
162 | unsigned long tx_bytes; | 163 | u64 tx_bytes; |
164 | struct u64_stats_sync syncp; | ||
163 | }; | 165 | }; |
164 | 166 | ||
165 | struct net_bridge | 167 | struct net_bridge |