aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_if.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_if.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_if.c')
-rw-r--r--net/bridge/br_if.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index b6a3872f5681..b7cdd2e98050 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -185,6 +185,12 @@ static struct net_device *new_bridge_dev(struct net *net, const char *name)
185 br = netdev_priv(dev); 185 br = netdev_priv(dev);
186 br->dev = dev; 186 br->dev = dev;
187 187
188 br->stats = alloc_percpu(struct br_cpu_netstats);
189 if (!br->stats) {
190 free_netdev(dev);
191 return NULL;
192 }
193
188 spin_lock_init(&br->lock); 194 spin_lock_init(&br->lock);
189 INIT_LIST_HEAD(&br->port_list); 195 INIT_LIST_HEAD(&br->port_list);
190 spin_lock_init(&br->hash_lock); 196 spin_lock_init(&br->hash_lock);