diff options
author | Li RongQing <roy.qing.li@gmail.com> | 2014-01-04 00:57:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-04 20:10:24 -0500 |
commit | 8f84985fec10de64a6b4cdfea45f2b0ab8f07c78 (patch) | |
tree | 03d58e9d72384e8066a6232c793b3ee4242668f6 /net/ipv6/sit.c | |
parent | 653864d9dd6ae26d884abfd53420e61e7383b1da (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/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 366fbba3359a..9937b2616713 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -671,7 +671,7 @@ static int ipip6_rcv(struct sk_buff *skb) | |||
671 | tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev, | 671 | tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev, |
672 | iph->saddr, iph->daddr); | 672 | iph->saddr, iph->daddr); |
673 | if (tunnel != NULL) { | 673 | if (tunnel != NULL) { |
674 | struct pcpu_tstats *tstats; | 674 | struct pcpu_sw_netstats *tstats; |
675 | 675 | ||
676 | if (tunnel->parms.iph.protocol != IPPROTO_IPV6 && | 676 | if (tunnel->parms.iph.protocol != IPPROTO_IPV6 && |
677 | tunnel->parms.iph.protocol != 0) | 677 | tunnel->parms.iph.protocol != 0) |
@@ -1361,12 +1361,12 @@ static int ipip6_tunnel_init(struct net_device *dev) | |||
1361 | memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); | 1361 | memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); |
1362 | 1362 | ||
1363 | ipip6_tunnel_bind_dev(dev); | 1363 | ipip6_tunnel_bind_dev(dev); |
1364 | dev->tstats = alloc_percpu(struct pcpu_tstats); | 1364 | dev->tstats = alloc_percpu(struct pcpu_sw_netstats); |
1365 | if (!dev->tstats) | 1365 | if (!dev->tstats) |
1366 | return -ENOMEM; | 1366 | return -ENOMEM; |
1367 | 1367 | ||
1368 | for_each_possible_cpu(i) { | 1368 | for_each_possible_cpu(i) { |
1369 | struct pcpu_tstats *ipip6_tunnel_stats; | 1369 | struct pcpu_sw_netstats *ipip6_tunnel_stats; |
1370 | ipip6_tunnel_stats = per_cpu_ptr(dev->tstats, i); | 1370 | ipip6_tunnel_stats = per_cpu_ptr(dev->tstats, i); |
1371 | u64_stats_init(&ipip6_tunnel_stats->syncp); | 1371 | u64_stats_init(&ipip6_tunnel_stats->syncp); |
1372 | } | 1372 | } |
@@ -1391,12 +1391,12 @@ static int __net_init ipip6_fb_tunnel_init(struct net_device *dev) | |||
1391 | iph->ihl = 5; | 1391 | iph->ihl = 5; |
1392 | iph->ttl = 64; | 1392 | iph->ttl = 64; |
1393 | 1393 | ||
1394 | dev->tstats = alloc_percpu(struct pcpu_tstats); | 1394 | dev->tstats = alloc_percpu(struct pcpu_sw_netstats); |
1395 | if (!dev->tstats) | 1395 | if (!dev->tstats) |
1396 | return -ENOMEM; | 1396 | return -ENOMEM; |
1397 | 1397 | ||
1398 | for_each_possible_cpu(i) { | 1398 | for_each_possible_cpu(i) { |
1399 | struct pcpu_tstats *ipip6_fb_stats; | 1399 | struct pcpu_sw_netstats *ipip6_fb_stats; |
1400 | ipip6_fb_stats = per_cpu_ptr(dev->tstats, i); | 1400 | ipip6_fb_stats = per_cpu_ptr(dev->tstats, i); |
1401 | u64_stats_init(&ipip6_fb_stats->syncp); | 1401 | u64_stats_init(&ipip6_fb_stats->syncp); |
1402 | } | 1402 | } |