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>
This commit is contained in:

committed by
David S. Miller

parent
16b8a4761c
commit
406818ff34
@@ -16,6 +16,7 @@
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/if_bridge.h>
|
||||
#include <linux/netpoll.h>
|
||||
#include <linux/u64_stats_sync.h>
|
||||
#include <net/route.h>
|
||||
|
||||
#define BR_HASH_BITS 8
|
||||
@@ -156,10 +157,11 @@ struct net_bridge_port
|
||||
#define br_port_exists(dev) (dev->priv_flags & IFF_BRIDGE_PORT)
|
||||
|
||||
struct br_cpu_netstats {
|
||||
unsigned long rx_packets;
|
||||
unsigned long rx_bytes;
|
||||
unsigned long tx_packets;
|
||||
unsigned long tx_bytes;
|
||||
u64 rx_packets;
|
||||
u64 rx_bytes;
|
||||
u64 tx_packets;
|
||||
u64 tx_bytes;
|
||||
struct u64_stats_sync syncp;
|
||||
};
|
||||
|
||||
struct net_bridge
|
||||
|
Reference in New Issue
Block a user