aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_input.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-03-02 08:32:09 -0500
committerDavid S. Miller <davem@davemloft.net>2010-03-17 00:23:19 -0400
commit14bb4789833a2e2610f30e2d3e1451701ac96ec1 (patch)
tree992a40f1c885d22f6bce27d270e5839b1d8d121b /net/bridge/br_input.c
parent0a9627f2649a02bea165cfd529d7bcb625c2fcad (diff)
bridge: per-cpu packet statistics (v3)
The shared packet statistics are a potential source of slow down on bridged traffic. Convert to per-cpu array, but only keep those statistics which change per-packet. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> 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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index d74d570fc848..333dfb7c5886 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -23,9 +23,11 @@ const u8 br_group_address[ETH_ALEN] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
23static int br_pass_frame_up(struct sk_buff *skb) 23static int br_pass_frame_up(struct sk_buff *skb)
24{ 24{
25 struct net_device *indev, *brdev = BR_INPUT_SKB_CB(skb)->brdev; 25 struct net_device *indev, *brdev = BR_INPUT_SKB_CB(skb)->brdev;
26 struct net_bridge *br = netdev_priv(brdev);
27 struct br_cpu_netstats *brstats = this_cpu_ptr(br->stats);
26 28
27 brdev->stats.rx_packets++; 29 brstats->rx_packets++;
28 brdev->stats.rx_bytes += skb->len; 30 brstats->rx_bytes += skb->len;
29 31
30 indev = skb->dev; 32 indev = skb->dev;
31 skb->dev = brdev; 33 skb->dev = brdev;