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_input.c | |
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_input.c')
-rw-r--r-- | net/bridge/br_input.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index f076c9d79d5e..5fc1c5b1c360 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c | |||
@@ -27,8 +27,10 @@ static int br_pass_frame_up(struct sk_buff *skb) | |||
27 | struct net_bridge *br = netdev_priv(brdev); | 27 | struct net_bridge *br = netdev_priv(brdev); |
28 | struct br_cpu_netstats *brstats = this_cpu_ptr(br->stats); | 28 | struct br_cpu_netstats *brstats = this_cpu_ptr(br->stats); |
29 | 29 | ||
30 | u64_stats_update_begin(&brstats->syncp); | ||
30 | brstats->rx_packets++; | 31 | brstats->rx_packets++; |
31 | brstats->rx_bytes += skb->len; | 32 | brstats->rx_bytes += skb->len; |
33 | u64_stats_update_end(&brstats->syncp); | ||
32 | 34 | ||
33 | indev = skb->dev; | 35 | indev = skb->dev; |
34 | skb->dev = brdev; | 36 | skb->dev = brdev; |