aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_tunnel.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-06 19:16:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-06 19:16:28 -0500
commita707271a8180eb60edc3bd9dc3cb425c7547fd76 (patch)
tree89e99bfe15f6fa5379555c2c57f38ea9502a2d90 /net/ipv6/ip6_tunnel.c
parentf0a679afefc0b6288310f88606b4bb1f243f1aa9 (diff)
parentfe0d692bbc645786bce1a98439e548ae619269f5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "I'm hoping this is the very last batch of networking fixes for 3.13, here goes nothing: 1) Fix crashes in VLAN's header_ops passthru. 2) Bridge multicast code needs to use BH spinlocks to prevent deadlocks with timers. From Curt Brune. 3) ipv6 tunnels lack proper synchornization when updating percpu statistics. From Li RongQing. 4) Fixes to bnx2x driver from Yaniv Rosner, Dmitry Kravkov and Michal Kalderon. 5) Avoid undefined operator evaluation order in llc code, from Daniel Borkmann. 6) Error paths in various GSO offload paths do not unwind properly, in particular they must undo any modifications they have made to the SKB. From Wei-Chun Chao. 7) Fix RX refill races during restore in virtio-net, from Jason Wang. 8) Fix SKB use after free in LLC code, from Daniel Borkmann. 9) Missing unlock and OOPS in netpoll code when VLAN tag handling fails. 10) Fix vxlan device attachment wrt ipv6, from Fan Du. 11) Don't allow creating infiniband links to non-infiniband devices, from Hangbin Liu. 12) Revert FEC phy reset active low change, it breaks things. From Fabio Estevam. 13) Fix header pointer handling in 6lowpan header building code, from Daniel Borkmann. 14) Fix RSS handling in be2net driver, from Vasundhara Volam. 15) Fix modem port indexing in HSO driver, from Dan Williams" * http://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (38 commits) bridge: use spin_lock_bh() in br_multicast_set_hash_max ipv6: don't install anycast address for /128 addresses on routers hso: fix handling of modem port SERIAL_STATE notifications isdn: Drop big endian cpp checks from telespci and hfc_pci drivers be2net: fix max_evt_qs calculation for BE3 in SR-IOV config be2net: increase the timeout value for loopback-test FW cmd be2net: disable RSS when number of RXQs is reduced to 1 via set-channels xen-netback: Include header for vmalloc net: 6lowpan: fix lowpan_header_create non-compression memcpy call fec: Revert "fec: Do not assume that PHY reset is active low" bnx2x: fix VLAN configuration for VFs. bnx2x: fix AFEX memory overflow bnx2x: Clean before update RSS arrives bnx2x: Correct number of MSI-X vectors for VFs bnx2x: limit number of interrupt vectors for 57711 qlcnic: Fix bug in Tx completion path infiniband: make sure the src net is infiniband when create new link {vxlan, inet6} Mark vxlan_dev flags with VXLAN_F_IPV6 properly cxgb4: allow large buffer size to have page size netpoll: Fix missing TXQ unlock and and OOPS. ...
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
-rw-r--r--net/ipv6/ip6_tunnel.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index d6062325db08..7881965a8248 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -103,16 +103,25 @@ struct ip6_tnl_net {
103 103
104static struct net_device_stats *ip6_get_stats(struct net_device *dev) 104static struct net_device_stats *ip6_get_stats(struct net_device *dev)
105{ 105{
106 struct pcpu_tstats sum = { 0 }; 106 struct pcpu_tstats tmp, sum = { 0 };
107 int i; 107 int i;
108 108
109 for_each_possible_cpu(i) { 109 for_each_possible_cpu(i) {
110 unsigned int start;
110 const struct pcpu_tstats *tstats = per_cpu_ptr(dev->tstats, i); 111 const struct pcpu_tstats *tstats = per_cpu_ptr(dev->tstats, i);
111 112
112 sum.rx_packets += tstats->rx_packets; 113 do {
113 sum.rx_bytes += tstats->rx_bytes; 114 start = u64_stats_fetch_begin_bh(&tstats->syncp);
114 sum.tx_packets += tstats->tx_packets; 115 tmp.rx_packets = tstats->rx_packets;
115 sum.tx_bytes += tstats->tx_bytes; 116 tmp.rx_bytes = tstats->rx_bytes;
117 tmp.tx_packets = tstats->tx_packets;
118 tmp.tx_bytes = tstats->tx_bytes;
119 } while (u64_stats_fetch_retry_bh(&tstats->syncp, start));
120
121 sum.rx_packets += tmp.rx_packets;
122 sum.rx_bytes += tmp.rx_bytes;
123 sum.tx_packets += tmp.tx_packets;
124 sum.tx_bytes += tmp.tx_bytes;
116 } 125 }
117 dev->stats.rx_packets = sum.rx_packets; 126 dev->stats.rx_packets = sum.rx_packets;
118 dev->stats.rx_bytes = sum.rx_bytes; 127 dev->stats.rx_bytes = sum.rx_bytes;
@@ -824,8 +833,10 @@ static int ip6_tnl_rcv(struct sk_buff *skb, __u16 protocol,
824 } 833 }
825 834
826 tstats = this_cpu_ptr(t->dev->tstats); 835 tstats = this_cpu_ptr(t->dev->tstats);
836 u64_stats_update_begin(&tstats->syncp);
827 tstats->rx_packets++; 837 tstats->rx_packets++;
828 tstats->rx_bytes += skb->len; 838 tstats->rx_bytes += skb->len;
839 u64_stats_update_end(&tstats->syncp);
829 840
830 netif_rx(skb); 841 netif_rx(skb);
831 842