aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_device.c
diff options
context:
space:
mode:
authorLi RongQing <roy.qing.li@gmail.com>2014-01-04 00:57:59 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-04 20:10:24 -0500
commit8f84985fec10de64a6b4cdfea45f2b0ab8f07c78 (patch)
tree03d58e9d72384e8066a6232c793b3ee4242668f6 /net/bridge/br_device.c
parent653864d9dd6ae26d884abfd53420e61e7383b1da (diff)
net: unify the pcpu_tstats and br_cpu_netstats as one
They are same, so unify them as one, pcpu_sw_netstats. Define pcpu_sw_netstat in netdevice.h, remove pcpu_tstats from if_tunnel and remove br_cpu_netstats from br_private.h Cc: Cong Wang <xiyou.wangcong@gmail.com> Cc: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Li RongQing <roy.qing.li@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_device.c')
-rw-r--r--net/bridge/br_device.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index f00cfd2a0143..e4401a531afb 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -32,7 +32,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
32 const unsigned char *dest = skb->data; 32 const unsigned char *dest = skb->data;
33 struct net_bridge_fdb_entry *dst; 33 struct net_bridge_fdb_entry *dst;
34 struct net_bridge_mdb_entry *mdst; 34 struct net_bridge_mdb_entry *mdst;
35 struct br_cpu_netstats *brstats = this_cpu_ptr(br->stats); 35 struct pcpu_sw_netstats *brstats = this_cpu_ptr(br->stats);
36 u16 vid = 0; 36 u16 vid = 0;
37 37
38 rcu_read_lock(); 38 rcu_read_lock();
@@ -90,12 +90,12 @@ static int br_dev_init(struct net_device *dev)
90 struct net_bridge *br = netdev_priv(dev); 90 struct net_bridge *br = netdev_priv(dev);
91 int i; 91 int i;
92 92
93 br->stats = alloc_percpu(struct br_cpu_netstats); 93 br->stats = alloc_percpu(struct pcpu_sw_netstats);
94 if (!br->stats) 94 if (!br->stats)
95 return -ENOMEM; 95 return -ENOMEM;
96 96
97 for_each_possible_cpu(i) { 97 for_each_possible_cpu(i) {
98 struct br_cpu_netstats *br_dev_stats; 98 struct pcpu_sw_netstats *br_dev_stats;
99 br_dev_stats = per_cpu_ptr(br->stats, i); 99 br_dev_stats = per_cpu_ptr(br->stats, i);
100 u64_stats_init(&br_dev_stats->syncp); 100 u64_stats_init(&br_dev_stats->syncp);
101 } 101 }
@@ -135,12 +135,12 @@ static struct rtnl_link_stats64 *br_get_stats64(struct net_device *dev,
135 struct rtnl_link_stats64 *stats) 135 struct rtnl_link_stats64 *stats)
136{ 136{
137 struct net_bridge *br = netdev_priv(dev); 137 struct net_bridge *br = netdev_priv(dev);
138 struct br_cpu_netstats tmp, sum = { 0 }; 138 struct pcpu_sw_netstats tmp, sum = { 0 };
139 unsigned int cpu; 139 unsigned int cpu;
140 140
141 for_each_possible_cpu(cpu) { 141 for_each_possible_cpu(cpu) {
142 unsigned int start; 142 unsigned int start;
143 const struct br_cpu_netstats *bstats 143 const struct pcpu_sw_netstats *bstats
144 = per_cpu_ptr(br->stats, cpu); 144 = per_cpu_ptr(br->stats, cpu);
145 do { 145 do {
146 start = u64_stats_fetch_begin_bh(&bstats->syncp); 146 start = u64_stats_fetch_begin_bh(&bstats->syncp);