diff options
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) | |||
1550 | rcu_read_unlock(); | 1550 | rcu_read_unlock(); |
1551 | } | 1551 | } |
1552 | 1552 | ||
1553 | /* | ||
1554 | * Routine to help set real_num_tx_queues. To avoid skbs mapped to queues | ||
1555 | * greater then real_num_tx_queues stale skbs on the qdisc must be flushed. | ||
1556 | */ | ||
1557 | void netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) | ||
1558 | { | ||
1559 | unsigned int real_num = dev->real_num_tx_queues; | ||
1560 | |||
1561 | if (unlikely(txq > dev->num_tx_queues)) | ||
1562 | ; | ||
1563 | else if (txq > real_num) | ||
1564 | dev->real_num_tx_queues = txq; | ||
1565 | else if (txq < real_num) { | ||
1566 | dev->real_num_tx_queues = txq; | ||
1567 | qdisc_reset_all_tx_gt(dev, txq); | ||
1568 | } | ||
1569 | } | ||
1570 | EXPORT_SYMBOL(netif_set_real_num_tx_queues); | ||
1553 | 1571 | ||
1554 | static inline void __netif_reschedule(struct Qdisc *q) | 1572 | static inline void __netif_reschedule(struct Qdisc *q) |
1555 | { | 1573 | { |