aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_vti.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-01-06 17:37:45 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-06 17:37:45 -0500
commit56a4342dfe3145cd66f766adccb28fd9b571606d (patch)
treed1593764488ff8cbb0b83cb9ae35fd968bf81760 /net/ipv6/ip6_vti.c
parent805c1f4aedaba1bc8d839e7c27b128083dd5c2f0 (diff)
parentfe0d692bbc645786bce1a98439e548ae619269f5 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c net/ipv6/ip6_tunnel.c net/ipv6/ip6_vti.c ipv6 tunnel statistic bug fixes conflicting with consolidation into generic sw per-cpu net stats. qlogic conflict between queue counting bug fix and the addition of multiple MAC address support. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_vti.c')
-rw-r--r--net/ipv6/ip6_vti.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index da1d9e4d62ca..b50acd5e75d2 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -74,27 +74,6 @@ struct vti6_net {
74 struct ip6_tnl __rcu **tnls[2]; 74 struct ip6_tnl __rcu **tnls[2];
75}; 75};
76 76
77static struct net_device_stats *vti6_get_stats(struct net_device *dev)
78{
79 struct pcpu_sw_netstats sum = { 0 };
80 int i;
81
82 for_each_possible_cpu(i) {
83 const struct pcpu_sw_netstats *tstats =
84 per_cpu_ptr(dev->tstats, i);
85
86 sum.rx_packets += tstats->rx_packets;
87 sum.rx_bytes += tstats->rx_bytes;
88 sum.tx_packets += tstats->tx_packets;
89 sum.tx_bytes += tstats->tx_bytes;
90 }
91 dev->stats.rx_packets = sum.rx_packets;
92 dev->stats.rx_bytes = sum.rx_bytes;
93 dev->stats.tx_packets = sum.tx_packets;
94 dev->stats.tx_bytes = sum.tx_bytes;
95 return &dev->stats;
96}
97
98#define for_each_vti6_tunnel_rcu(start) \ 77#define for_each_vti6_tunnel_rcu(start) \
99 for (t = rcu_dereference(start); t; t = rcu_dereference(t->next)) 78 for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
100 79
@@ -331,8 +310,10 @@ static int vti6_rcv(struct sk_buff *skb)
331 } 310 }
332 311
333 tstats = this_cpu_ptr(t->dev->tstats); 312 tstats = this_cpu_ptr(t->dev->tstats);
313 u64_stats_update_begin(&tstats->syncp);
334 tstats->rx_packets++; 314 tstats->rx_packets++;
335 tstats->rx_bytes += skb->len; 315 tstats->rx_bytes += skb->len;
316 u64_stats_update_end(&tstats->syncp);
336 317
337 skb->mark = 0; 318 skb->mark = 0;
338 secpath_reset(skb); 319 secpath_reset(skb);
@@ -716,7 +697,7 @@ static const struct net_device_ops vti6_netdev_ops = {
716 .ndo_start_xmit = vti6_tnl_xmit, 697 .ndo_start_xmit = vti6_tnl_xmit,
717 .ndo_do_ioctl = vti6_ioctl, 698 .ndo_do_ioctl = vti6_ioctl,
718 .ndo_change_mtu = vti6_change_mtu, 699 .ndo_change_mtu = vti6_change_mtu,
719 .ndo_get_stats = vti6_get_stats, 700 .ndo_get_stats64 = ip_tunnel_get_stats64,
720}; 701};
721 702
722/** 703/**