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

committed by
David S. Miller

parent
0a9627f264
commit
14bb478983
@@ -185,6 +185,12 @@ static struct net_device *new_bridge_dev(struct net *net, const char *name)
|
||||
br = netdev_priv(dev);
|
||||
br->dev = dev;
|
||||
|
||||
br->stats = alloc_percpu(struct br_cpu_netstats);
|
||||
if (!br->stats) {
|
||||
free_netdev(dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
spin_lock_init(&br->lock);
|
||||
INIT_LIST_HEAD(&br->port_list);
|
||||
spin_lock_init(&br->hash_lock);
|
||||
|
Reference in New Issue
Block a user