aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/netdevice.h3
-rw-r--r--net/core/dev.c9
2 files changed, 9 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index fdac1159253e..9464e6452967 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -724,6 +724,9 @@ struct net_device
724 void (*poll_controller)(struct net_device *dev); 724 void (*poll_controller)(struct net_device *dev);
725#endif 725#endif
726 726
727 u16 (*select_queue)(struct net_device *dev,
728 struct sk_buff *skb);
729
727#ifdef CONFIG_NET_NS 730#ifdef CONFIG_NET_NS
728 /* Network namespace this network device is inside */ 731 /* Network namespace this network device is inside */
729 struct net *nd_net; 732 struct net *nd_net;
diff --git a/net/core/dev.c b/net/core/dev.c
index f027a1ac4fbb..7ca9564d2f44 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1670,6 +1670,9 @@ static struct netdev_queue *dev_pick_tx(struct net_device *dev,
1670{ 1670{
1671 u16 queue_index = 0; 1671 u16 queue_index = 0;
1672 1672
1673 if (dev->select_queue)
1674 queue_index = dev->select_queue(dev, skb);
1675
1673 skb_set_queue_mapping(skb, queue_index); 1676 skb_set_queue_mapping(skb, queue_index);
1674 return netdev_get_tx_queue(dev, queue_index); 1677 return netdev_get_tx_queue(dev, queue_index);
1675} 1678}
@@ -1710,14 +1713,14 @@ int dev_queue_xmit(struct sk_buff *skb)
1710 } 1713 }
1711 1714
1712gso: 1715gso:
1713 txq = dev_pick_tx(dev, skb);
1714 spin_lock_prefetch(&txq->lock);
1715
1716 /* Disable soft irqs for various locks below. Also 1716 /* Disable soft irqs for various locks below. Also
1717 * stops preemption for RCU. 1717 * stops preemption for RCU.
1718 */ 1718 */
1719 rcu_read_lock_bh(); 1719 rcu_read_lock_bh();
1720 1720
1721 txq = dev_pick_tx(dev, skb);
1722 spin_lock_prefetch(&txq->lock);
1723
1721 /* Updates of qdisc are serialized by queue->lock. 1724 /* Updates of qdisc are serialized by queue->lock.
1722 * The struct Qdisc which is pointed to by qdisc is now a 1725 * The struct Qdisc which is pointed to by qdisc is now a
1723 * rcu structure - it may be accessed without acquiring 1726 * rcu structure - it may be accessed without acquiring