]> Pileus Git - ~andy/linux/blobdiff - net/core/dev.c
xfrm: allow to avoid copying DSCP during encapsulation
[~andy/linux] / net / core / dev.c
index 18d8b5acc3435f0a81dd0513fae7f1d829e71db8..96103894ad69dd86e93265305701a25e14867194 100644 (file)
@@ -658,11 +658,10 @@ __setup("netdev=", netdev_boot_setup);
 
 struct net_device *__dev_get_by_name(struct net *net, const char *name)
 {
-       struct hlist_node *p;
        struct net_device *dev;
        struct hlist_head *head = dev_name_hash(net, name);
 
-       hlist_for_each_entry(dev, p, head, name_hlist)
+       hlist_for_each_entry(dev, head, name_hlist)
                if (!strncmp(dev->name, name, IFNAMSIZ))
                        return dev;
 
@@ -684,11 +683,10 @@ EXPORT_SYMBOL(__dev_get_by_name);
 
 struct net_device *dev_get_by_name_rcu(struct net *net, const char *name)
 {
-       struct hlist_node *p;
        struct net_device *dev;
        struct hlist_head *head = dev_name_hash(net, name);
 
-       hlist_for_each_entry_rcu(dev, p, head, name_hlist)
+       hlist_for_each_entry_rcu(dev, head, name_hlist)
                if (!strncmp(dev->name, name, IFNAMSIZ))
                        return dev;
 
@@ -735,11 +733,10 @@ EXPORT_SYMBOL(dev_get_by_name);
 
 struct net_device *__dev_get_by_index(struct net *net, int ifindex)
 {
-       struct hlist_node *p;
        struct net_device *dev;
        struct hlist_head *head = dev_index_hash(net, ifindex);
 
-       hlist_for_each_entry(dev, p, head, index_hlist)
+       hlist_for_each_entry(dev, head, index_hlist)
                if (dev->ifindex == ifindex)
                        return dev;
 
@@ -760,11 +757,10 @@ EXPORT_SYMBOL(__dev_get_by_index);
 
 struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex)
 {
-       struct hlist_node *p;
        struct net_device *dev;
        struct hlist_head *head = dev_index_hash(net, ifindex);
 
-       hlist_for_each_entry_rcu(dev, p, head, index_hlist)
+       hlist_for_each_entry_rcu(dev, head, index_hlist)
                if (dev->ifindex == ifindex)
                        return dev;
 
@@ -4061,6 +4057,9 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
        napi->gro_list = NULL;
        napi->skb = NULL;
        napi->poll = poll;
+       if (weight > NAPI_POLL_WEIGHT)
+               pr_err_once("netif_napi_add() called with weight %d on device %s\n",
+                           weight, dev->name);
        napi->weight = weight;
        list_add(&napi->dev_list, &dev->napi_list);
        napi->dev = dev;