netdev: Add netdev->select_queue() method.

Devices or device layers can set this to control the queue selection
performed by dev_pick_tx().

This function runs under RCU protection, which allows overriding
functions to have some way of synchronizing with things like dynamic
->real_num_tx_queues adjustments.

This makes the spinlock prefetch in dev_queue_xmit() a little bit
less effective, but that's the price right now for correctness.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2008-07-15 03:03:33 -07:00
parent e3c50d5d25
commit eae792b722
2 changed files with 9 additions and 3 deletions

View File

@@ -724,6 +724,9 @@ struct net_device
void (*poll_controller)(struct net_device *dev);
#endif
u16 (*select_queue)(struct net_device *dev,
struct sk_buff *skb);
#ifdef CONFIG_NET_NS
/* Network namespace this network device is inside */
struct net *nd_net;