diff options
Diffstat (limited to 'net')
| -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 2b3bf53bc687..723a34710ad4 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -1553,6 +1553,24 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) | |||
| 1553 | rcu_read_unlock(); | 1553 | rcu_read_unlock(); |
| 1554 | } | 1554 | } |
| 1555 | 1555 | ||
| 1556 | /* | ||
| 1557 | * Routine to help set real_num_tx_queues. To avoid skbs mapped to queues | ||
| 1558 | * greater then real_num_tx_queues stale skbs on the qdisc must be flushed. | ||
| 1559 | */ | ||
| 1560 | void netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) | ||
| 1561 | { | ||
| 1562 | unsigned int real_num = dev->real_num_tx_queues; | ||
| 1563 | |||
| 1564 | if (unlikely(txq > dev->num_tx_queues)) | ||
| 1565 | ; | ||
| 1566 | else if (txq > real_num) | ||
| 1567 | dev->real_num_tx_queues = txq; | ||
| 1568 | else if (txq < real_num) { | ||
| 1569 | dev->real_num_tx_queues = txq; | ||
| 1570 | qdisc_reset_all_tx_gt(dev, txq); | ||
| 1571 | } | ||
| 1572 | } | ||
| 1573 | EXPORT_SYMBOL(netif_set_real_num_tx_queues); | ||
| 1556 | 1574 | ||
| 1557 | static inline void __netif_reschedule(struct Qdisc *q) | 1575 | static inline void __netif_reschedule(struct Qdisc *q) |
| 1558 | { | 1576 | { |
