diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 1 | ||||
-rw-r--r-- | net/sched/sch_generic.c | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 25dab1598803..ccc03abeee52 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2875,6 +2875,7 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) netif_setup_tc(dev, txq); dev->real_num_tx_queues = txq; + dev_qdisc_set_real_num_tx_queues(dev); if (disabling) { synchronize_net(); diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 6c9595f1048a..36a40ebcf0ee 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -1268,6 +1268,27 @@ int dev_qdisc_change_tx_queue_len(struct net_device *dev) return ret; } +void dev_qdisc_set_real_num_tx_queues(struct net_device *dev) +{ +#ifdef CONFIG_NET_SCHED + struct Qdisc *sch = dev->qdisc; + unsigned int ntx; + + if (!sch) + return; + + ASSERT_RTNL(); + + for (ntx = 0; ntx < dev->real_num_tx_queues; ntx++) { + struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, ntx); + struct Qdisc *qdisc = dev_queue->qdisc; + + if (qdisc && !qdisc_hashed(qdisc)) + qdisc_hash_add(qdisc, false); + } +#endif +} + static void dev_init_scheduler_queue(struct net_device *dev, struct netdev_queue *dev_queue, void *_qdisc) |