]> Pileus Git - ~andy/linux/blobdiff - net/ipv6/ip6_gre.c
net: Explicitly initialize u64_stats_sync structures for lockdep
[~andy/linux] / net / ipv6 / ip6_gre.c
index 7bb5446b9d73c16a7f4096f2705ce60f997c7c2a..8acb28621f9cfd57071eeff1a39acd0de1ff6c02 100644 (file)
@@ -976,6 +976,7 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)
                if (t->parms.o_flags&GRE_SEQ)
                        addend += 4;
        }
+       t->hlen = addend;
 
        if (p->flags & IP6_TNL_F_CAP_XMIT) {
                int strict = (ipv6_addr_type(&p->raddr) &
@@ -1002,8 +1003,6 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)
                }
                ip6_rt_put(rt);
        }
-
-       t->hlen = addend;
 }
 
 static int ip6gre_tnl_change(struct ip6_tnl *t,
@@ -1173,9 +1172,8 @@ done:
 
 static int ip6gre_tunnel_change_mtu(struct net_device *dev, int new_mtu)
 {
-       struct ip6_tnl *tunnel = netdev_priv(dev);
        if (new_mtu < 68 ||
-           new_mtu > 0xFFF8 - dev->hard_header_len - tunnel->hlen)
+           new_mtu > 0xFFF8 - dev->hard_header_len)
                return -EINVAL;
        dev->mtu = new_mtu;
        return 0;
@@ -1254,6 +1252,7 @@ static void ip6gre_tunnel_setup(struct net_device *dev)
 static int ip6gre_tunnel_init(struct net_device *dev)
 {
        struct ip6_tnl *tunnel;
+       int i;
 
        tunnel = netdev_priv(dev);
 
@@ -1271,6 +1270,13 @@ static int ip6gre_tunnel_init(struct net_device *dev)
        if (!dev->tstats)
                return -ENOMEM;
 
+       for_each_possible_cpu(i) {
+               struct pcpu_tstats *ip6gre_tunnel_stats;
+               ip6gre_tunnel_stats = per_cpu_ptr(dev->tstats, i);
+               u64_stats_init(&ip6gre_tunnel_stats->syncp);
+       }
+
+
        return 0;
 }
 
@@ -1451,6 +1457,7 @@ static void ip6gre_netlink_parms(struct nlattr *data[],
 static int ip6gre_tap_init(struct net_device *dev)
 {
        struct ip6_tnl *tunnel;
+       int i;
 
        tunnel = netdev_priv(dev);
 
@@ -1464,6 +1471,12 @@ static int ip6gre_tap_init(struct net_device *dev)
        if (!dev->tstats)
                return -ENOMEM;
 
+       for_each_possible_cpu(i) {
+               struct pcpu_tstats *ip6gre_tap_stats;
+               ip6gre_tap_stats = per_cpu_ptr(dev->tstats, i);
+               u64_stats_init(&ip6gre_tap_stats->syncp);
+       }
+
        return 0;
 }