summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_input.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-03-02 13:32:09 +0000
committerDavid S. Miller <davem@davemloft.net>2010-03-16 21:23:19 -0700
commit14bb4789833a2e2610f30e2d3e1451701ac96ec1 (patch)
tree992a40f1c885d22f6bce27d270e5839b1d8d121b /net/bridge/br_input.c
parent0a9627f2649a02bea165cfd529d7bcb625c2fcad (diff)
downloadblackbird-op-linux-14bb4789833a2e2610f30e2d3e1451701ac96ec1.tar.gz
blackbird-op-linux-14bb4789833a2e2610f30e2d3e1451701ac96ec1.zip
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 };
static int br_pass_frame_up(struct sk_buff *skb)
{
struct net_device *indev, *brdev = BR_INPUT_SKB_CB(skb)->brdev;
+ struct net_bridge *br = netdev_priv(brdev);
+ struct br_cpu_netstats *brstats = this_cpu_ptr(br->stats);
- brdev->stats.rx_packets++;
- brdev->stats.rx_bytes += skb->len;
+ brstats->rx_packets++;
+ brstats->rx_bytes += skb->len;
indev = skb->dev;
skb->dev = brdev;
OpenPOWER on IntegriCloud