summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorJulian Wiedmann <jwi@linux.ibm.com>2020-03-10 17:53:35 +0100
committerDavid S. Miller <davem@davemloft.net>2020-03-11 23:17:28 -0700
commit4cda75275f9f89f9485b0ca4d6950c95258a9bce (patch)
tree2c8a0b60de98ed17368e8daa55dae141569c2bbb /net/sched
parentdacf470b26418e91bef195342b25a234c94052e3 (diff)
downloadlinux-4cda75275f9f89f9485b0ca4d6950c95258a9bce.tar.gz
linux-4cda75275f9f89f9485b0ca4d6950c95258a9bce.tar.bz2
linux-4cda75275f9f89f9485b0ca4d6950c95258a9bce.zip
net: sched: make newly activated qdiscs visible
In their .attach callback, mq[prio] only add the qdiscs of the currently active TX queues to the device's qdisc hash list. If a user later increases the number of active TX queues, their qdiscs are not visible via eg. 'tc qdisc show'. Add a hook to netif_set_real_num_tx_queues() that walks all active TX queues and adds those which are missing to the hash list. CC: Eric Dumazet <edumazet@google.com> CC: Jamal Hadi Salim <jhs@mojatatu.com> CC: Cong Wang <xiyou.wangcong@gmail.com> CC: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_generic.c21
1 files changed, 21 insertions, 0 deletions
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)