diff options
author | David S. Miller <davem@davemloft.net> | 2010-07-08 02:59:38 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-08 02:59:38 +0400 |
commit | 597e608a8492d662736c9bc6aa507dbf1cadc17d (patch) | |
tree | 6c330cdd0a4809f67dd191b37e34f5b4318cef78 /net/core/dev.c | |
parent | acbc0f039ff4b93da737c91937b7c70018ded39f (diff) | |
parent | 33b665eeeb85956ccbdf31c4c31a4e2a31133c44 (diff) | |
download | linux-597e608a8492d662736c9bc6aa507dbf1cadc17d.tar.xz |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 92482d7a87a9..eb4201cf9c8c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1550,6 +1550,24 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) rcu_read_unlock(); } +/* + * Routine to help set real_num_tx_queues. To avoid skbs mapped to queues + * greater then real_num_tx_queues stale skbs on the qdisc must be flushed. + */ +void netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) +{ + unsigned int real_num = dev->real_num_tx_queues; + + if (unlikely(txq > dev->num_tx_queues)) + ; + else if (txq > real_num) + dev->real_num_tx_queues = txq; + else if (txq < real_num) { + dev->real_num_tx_queues = txq; + qdisc_reset_all_tx_gt(dev, txq); + } +} +EXPORT_SYMBOL(netif_set_real_num_tx_queues); static inline void __netif_reschedule(struct Qdisc *q) { |