]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/veth.c
Merge remote-tracking branch 'asoc/fix/rcar' into asoc-rcar
[karo-tx-linux.git] / drivers / net / veth.c
index c0e7c64765abd449070a7bce6826a994c674b8c7..b4a10bcb66a0f62be1606fa34629d120913fc74d 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/etherdevice.h>
 #include <linux/u64_stats_sync.h>
 
+#include <net/rtnetlink.h>
 #include <net/dst.h>
 #include <net/xfrm.h>
 #include <linux/veth.h>
@@ -155,10 +156,10 @@ static u64 veth_stats_one(struct pcpu_vstats *result, struct net_device *dev)
                unsigned int start;
 
                do {
-                       start = u64_stats_fetch_begin_bh(&stats->syncp);
+                       start = u64_stats_fetch_begin_irq(&stats->syncp);
                        packets = stats->packets;
                        bytes = stats->bytes;
-               } while (u64_stats_fetch_retry_bh(&stats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&stats->syncp, start));
                result->packets += packets;
                result->bytes += bytes;
        }
@@ -235,18 +236,9 @@ static int veth_change_mtu(struct net_device *dev, int new_mtu)
 
 static int veth_dev_init(struct net_device *dev)
 {
-       int i;
-
-       dev->vstats = alloc_percpu(struct pcpu_vstats);
+       dev->vstats = netdev_alloc_pcpu_stats(struct pcpu_vstats);
        if (!dev->vstats)
                return -ENOMEM;
-
-       for_each_possible_cpu(i) {
-               struct pcpu_vstats *veth_stats;
-               veth_stats = per_cpu_ptr(dev->vstats, i);
-               u64_stats_init(&veth_stats->syncp);
-       }
-
        return 0;
 }
 
@@ -336,10 +328,9 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 
                nla_peer = data[VETH_INFO_PEER];
                ifmp = nla_data(nla_peer);
-               err = nla_parse(peer_tb, IFLA_MAX,
-                               nla_data(nla_peer) + sizeof(struct ifinfomsg),
-                               nla_len(nla_peer) - sizeof(struct ifinfomsg),
-                               ifla_policy);
+               err = rtnl_nla_parse_ifla(peer_tb,
+                                         nla_data(nla_peer) + sizeof(struct ifinfomsg),
+                                         nla_len(nla_peer) - sizeof(struct ifinfomsg));
                if (err < 0)
                        return err;