aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/sit.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r--net/ipv6/sit.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index b4d74c86586c..1693c8d885f0 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1363,7 +1363,6 @@ static void ipip6_tunnel_setup(struct net_device *dev)
1363static int ipip6_tunnel_init(struct net_device *dev) 1363static int ipip6_tunnel_init(struct net_device *dev)
1364{ 1364{
1365 struct ip_tunnel *tunnel = netdev_priv(dev); 1365 struct ip_tunnel *tunnel = netdev_priv(dev);
1366 int i;
1367 1366
1368 tunnel->dev = dev; 1367 tunnel->dev = dev;
1369 tunnel->net = dev_net(dev); 1368 tunnel->net = dev_net(dev);
@@ -1372,16 +1371,10 @@ static int ipip6_tunnel_init(struct net_device *dev)
1372 memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); 1371 memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
1373 1372
1374 ipip6_tunnel_bind_dev(dev); 1373 ipip6_tunnel_bind_dev(dev);
1375 dev->tstats = alloc_percpu(struct pcpu_sw_netstats); 1374 dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
1376 if (!dev->tstats) 1375 if (!dev->tstats)
1377 return -ENOMEM; 1376 return -ENOMEM;
1378 1377
1379 for_each_possible_cpu(i) {
1380 struct pcpu_sw_netstats *ipip6_tunnel_stats;
1381 ipip6_tunnel_stats = per_cpu_ptr(dev->tstats, i);
1382 u64_stats_init(&ipip6_tunnel_stats->syncp);
1383 }
1384
1385 tunnel->dst_cache = alloc_percpu(struct ip_tunnel_dst); 1378 tunnel->dst_cache = alloc_percpu(struct ip_tunnel_dst);
1386 if (!tunnel->dst_cache) { 1379 if (!tunnel->dst_cache) {
1387 free_percpu(dev->tstats); 1380 free_percpu(dev->tstats);
@@ -1397,7 +1390,6 @@ static int __net_init ipip6_fb_tunnel_init(struct net_device *dev)
1397 struct iphdr *iph = &tunnel->parms.iph; 1390 struct iphdr *iph = &tunnel->parms.iph;
1398 struct net *net = dev_net(dev); 1391 struct net *net = dev_net(dev);
1399 struct sit_net *sitn = net_generic(net, sit_net_id); 1392 struct sit_net *sitn = net_generic(net, sit_net_id);
1400 int i;
1401 1393
1402 tunnel->dev = dev; 1394 tunnel->dev = dev;
1403 tunnel->net = dev_net(dev); 1395 tunnel->net = dev_net(dev);
@@ -1408,16 +1400,10 @@ static int __net_init ipip6_fb_tunnel_init(struct net_device *dev)
1408 iph->ihl = 5; 1400 iph->ihl = 5;
1409 iph->ttl = 64; 1401 iph->ttl = 64;
1410 1402
1411 dev->tstats = alloc_percpu(struct pcpu_sw_netstats); 1403 dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
1412 if (!dev->tstats) 1404 if (!dev->tstats)
1413 return -ENOMEM; 1405 return -ENOMEM;
1414 1406
1415 for_each_possible_cpu(i) {
1416 struct pcpu_sw_netstats *ipip6_fb_stats;
1417 ipip6_fb_stats = per_cpu_ptr(dev->tstats, i);
1418 u64_stats_init(&ipip6_fb_stats->syncp);
1419 }
1420
1421 tunnel->dst_cache = alloc_percpu(struct ip_tunnel_dst); 1407 tunnel->dst_cache = alloc_percpu(struct ip_tunnel_dst);
1422 if (!tunnel->dst_cache) { 1408 if (!tunnel->dst_cache) {
1423 free_percpu(dev->tstats); 1409 free_percpu(dev->tstats);