aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_tunnel.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/ipv4/ip_tunnel.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/ipv4/ip_tunnel.c')
-rw-r--r--net/ipv4/ip_tunnel.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index e2c9cff26eb5..07a5ed374262 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -132,7 +132,8 @@ struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
132 int i; 132 int i;
133 133
134 for_each_possible_cpu(i) { 134 for_each_possible_cpu(i) {
135 const struct pcpu_tstats *tstats = per_cpu_ptr(dev->tstats, i); 135 const struct pcpu_sw_netstats *tstats =
136 per_cpu_ptr(dev->tstats, i);
136 u64 rx_packets, rx_bytes, tx_packets, tx_bytes; 137 u64 rx_packets, rx_bytes, tx_packets, tx_bytes;
137 unsigned int start; 138 unsigned int start;
138 139
@@ -460,7 +461,7 @@ static struct ip_tunnel *ip_tunnel_create(struct net *net,
460int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, 461int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
461 const struct tnl_ptk_info *tpi, bool log_ecn_error) 462 const struct tnl_ptk_info *tpi, bool log_ecn_error)
462{ 463{
463 struct pcpu_tstats *tstats; 464 struct pcpu_sw_netstats *tstats;
464 const struct iphdr *iph = ip_hdr(skb); 465 const struct iphdr *iph = ip_hdr(skb);
465 int err; 466 int err;
466 467
@@ -1049,12 +1050,12 @@ int ip_tunnel_init(struct net_device *dev)
1049 int i, err; 1050 int i, err;
1050 1051
1051 dev->destructor = ip_tunnel_dev_free; 1052 dev->destructor = ip_tunnel_dev_free;
1052 dev->tstats = alloc_percpu(struct pcpu_tstats); 1053 dev->tstats = alloc_percpu(struct pcpu_sw_netstats);
1053 if (!dev->tstats) 1054 if (!dev->tstats)
1054 return -ENOMEM; 1055 return -ENOMEM;
1055 1056
1056 for_each_possible_cpu(i) { 1057 for_each_possible_cpu(i) {
1057 struct pcpu_tstats *ipt_stats; 1058 struct pcpu_sw_netstats *ipt_stats;
1058 ipt_stats = per_cpu_ptr(dev->tstats, i); 1059 ipt_stats = per_cpu_ptr(dev->tstats, i);
1059 u64_stats_init(&ipt_stats->syncp); 1060 u64_stats_init(&ipt_stats->syncp);
1060 } 1061 }