diff options
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 7c6a46f80372..8e726cb47ed7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -749,7 +749,8 @@ EXPORT_SYMBOL(dev_get_by_index); | |||
749 | * @ha: hardware address | 749 | * @ha: hardware address |
750 | * | 750 | * |
751 | * Search for an interface by MAC address. Returns NULL if the device | 751 | * Search for an interface by MAC address. Returns NULL if the device |
752 | * is not found or a pointer to the device. The caller must hold RCU | 752 | * is not found or a pointer to the device. |
753 | * The caller must hold RCU or RTNL. | ||
753 | * The returned device has not had its ref count increased | 754 | * The returned device has not had its ref count increased |
754 | * and the caller must therefore be careful about locking | 755 | * and the caller must therefore be careful about locking |
755 | * | 756 | * |
@@ -2562,7 +2563,8 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, | |||
2562 | 2563 | ||
2563 | map = rcu_dereference(rxqueue->rps_map); | 2564 | map = rcu_dereference(rxqueue->rps_map); |
2564 | if (map) { | 2565 | if (map) { |
2565 | if (map->len == 1) { | 2566 | if (map->len == 1 && |
2567 | !rcu_dereference_raw(rxqueue->rps_flow_table)) { | ||
2566 | tcpu = map->cpus[0]; | 2568 | tcpu = map->cpus[0]; |
2567 | if (cpu_online(tcpu)) | 2569 | if (cpu_online(tcpu)) |
2568 | cpu = tcpu; | 2570 | cpu = tcpu; |
@@ -3423,6 +3425,8 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) | |||
3423 | __skb_pull(skb, skb_headlen(skb)); | 3425 | __skb_pull(skb, skb_headlen(skb)); |
3424 | skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb)); | 3426 | skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb)); |
3425 | skb->vlan_tci = 0; | 3427 | skb->vlan_tci = 0; |
3428 | skb->dev = napi->dev; | ||
3429 | skb->skb_iif = 0; | ||
3426 | 3430 | ||
3427 | napi->skb = skb; | 3431 | napi->skb = skb; |
3428 | } | 3432 | } |
@@ -5656,30 +5660,35 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, | |||
5656 | 5660 | ||
5657 | dev_net_set(dev, &init_net); | 5661 | dev_net_set(dev, &init_net); |
5658 | 5662 | ||
5663 | dev->gso_max_size = GSO_MAX_SIZE; | ||
5664 | |||
5665 | INIT_LIST_HEAD(&dev->ethtool_ntuple_list.list); | ||
5666 | dev->ethtool_ntuple_list.count = 0; | ||
5667 | INIT_LIST_HEAD(&dev->napi_list); | ||
5668 | INIT_LIST_HEAD(&dev->unreg_list); | ||
5669 | INIT_LIST_HEAD(&dev->link_watch_list); | ||
5670 | dev->priv_flags = IFF_XMIT_DST_RELEASE; | ||
5671 | setup(dev); | ||
5672 | |||
5659 | dev->num_tx_queues = txqs; | 5673 | dev->num_tx_queues = txqs; |
5660 | dev->real_num_tx_queues = txqs; | 5674 | dev->real_num_tx_queues = txqs; |
5661 | if (netif_alloc_netdev_queues(dev)) | 5675 | if (netif_alloc_netdev_queues(dev)) |
5662 | goto free_pcpu; | 5676 | goto free_all; |
5663 | 5677 | ||
5664 | #ifdef CONFIG_RPS | 5678 | #ifdef CONFIG_RPS |
5665 | dev->num_rx_queues = rxqs; | 5679 | dev->num_rx_queues = rxqs; |
5666 | dev->real_num_rx_queues = rxqs; | 5680 | dev->real_num_rx_queues = rxqs; |
5667 | if (netif_alloc_rx_queues(dev)) | 5681 | if (netif_alloc_rx_queues(dev)) |
5668 | goto free_pcpu; | 5682 | goto free_all; |
5669 | #endif | 5683 | #endif |
5670 | 5684 | ||
5671 | dev->gso_max_size = GSO_MAX_SIZE; | ||
5672 | |||
5673 | INIT_LIST_HEAD(&dev->ethtool_ntuple_list.list); | ||
5674 | dev->ethtool_ntuple_list.count = 0; | ||
5675 | INIT_LIST_HEAD(&dev->napi_list); | ||
5676 | INIT_LIST_HEAD(&dev->unreg_list); | ||
5677 | INIT_LIST_HEAD(&dev->link_watch_list); | ||
5678 | dev->priv_flags = IFF_XMIT_DST_RELEASE; | ||
5679 | setup(dev); | ||
5680 | strcpy(dev->name, name); | 5685 | strcpy(dev->name, name); |
5681 | return dev; | 5686 | return dev; |
5682 | 5687 | ||
5688 | free_all: | ||
5689 | free_netdev(dev); | ||
5690 | return NULL; | ||
5691 | |||
5683 | free_pcpu: | 5692 | free_pcpu: |
5684 | free_percpu(dev->pcpu_refcnt); | 5693 | free_percpu(dev->pcpu_refcnt); |
5685 | kfree(dev->_tx); | 5694 | kfree(dev->_tx); |