diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-04-22 10:56:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-22 15:39:05 -0400 |
commit | 26349c71b4323e62f8de0fe45f2f06c4df535b9b (patch) | |
tree | e11984283a1cae8ae93e612f974cec9dd6bc8508 /net/ipv6 | |
parent | 0e2d686530d5e6c3c50c2c4f9ef8d6428252c35c (diff) |
ip6_gre: use netdev_alloc_pcpu_stats()
The code there just open-codes the same, so use the provided macro instead.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ip6_gre.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index b5e6cc1d4a73..a38d3ac0f18f 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
@@ -1246,7 +1246,6 @@ static void ip6gre_tunnel_setup(struct net_device *dev) | |||
1246 | static int ip6gre_tunnel_init(struct net_device *dev) | 1246 | static int ip6gre_tunnel_init(struct net_device *dev) |
1247 | { | 1247 | { |
1248 | struct ip6_tnl *tunnel; | 1248 | struct ip6_tnl *tunnel; |
1249 | int i; | ||
1250 | 1249 | ||
1251 | tunnel = netdev_priv(dev); | 1250 | tunnel = netdev_priv(dev); |
1252 | 1251 | ||
@@ -1260,16 +1259,10 @@ static int ip6gre_tunnel_init(struct net_device *dev) | |||
1260 | if (ipv6_addr_any(&tunnel->parms.raddr)) | 1259 | if (ipv6_addr_any(&tunnel->parms.raddr)) |
1261 | dev->header_ops = &ip6gre_header_ops; | 1260 | dev->header_ops = &ip6gre_header_ops; |
1262 | 1261 | ||
1263 | dev->tstats = alloc_percpu(struct pcpu_sw_netstats); | 1262 | dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); |
1264 | if (!dev->tstats) | 1263 | if (!dev->tstats) |
1265 | return -ENOMEM; | 1264 | return -ENOMEM; |
1266 | 1265 | ||
1267 | for_each_possible_cpu(i) { | ||
1268 | struct pcpu_sw_netstats *ip6gre_tunnel_stats; | ||
1269 | ip6gre_tunnel_stats = per_cpu_ptr(dev->tstats, i); | ||
1270 | u64_stats_init(&ip6gre_tunnel_stats->syncp); | ||
1271 | } | ||
1272 | |||
1273 | return 0; | 1266 | return 0; |
1274 | } | 1267 | } |
1275 | 1268 | ||