mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-18 03:06:43 +00:00
net/sched: taprio: don't access q->qdiscs[] in unoffloaded mode during attach()
This is a simple code transformation with no intended behavior change, just to make it absolutely clear that q->qdiscs[] is only attached to the child taprio classes in full offload mode. Right now we use the q->qdiscs[] variable in taprio_attach() for software mode too, but that is quite confusing and avoidable. We use it only to reach the netdev TX queue, but we could as well just use netdev_get_tx_queue() for that. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://lore.kernel.org/r/20230807193324.4128292-2-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
e972a54706
commit
09e0c3bbde
@ -2145,14 +2145,20 @@ static void taprio_attach(struct Qdisc *sch)
|
||||
|
||||
/* Attach underlying qdisc */
|
||||
for (ntx = 0; ntx < dev->num_tx_queues; ntx++) {
|
||||
struct Qdisc *qdisc = q->qdiscs[ntx];
|
||||
struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, ntx);
|
||||
struct Qdisc *old;
|
||||
|
||||
if (FULL_OFFLOAD_IS_ENABLED(q->flags)) {
|
||||
struct Qdisc *qdisc = q->qdiscs[ntx];
|
||||
|
||||
qdisc->flags |= TCQ_F_ONETXQUEUE | TCQ_F_NOPARENT;
|
||||
old = dev_graft_qdisc(qdisc->dev_queue, qdisc);
|
||||
old = dev_graft_qdisc(dev_queue, qdisc);
|
||||
} else {
|
||||
old = dev_graft_qdisc(qdisc->dev_queue, sch);
|
||||
/* In software mode, attach the root taprio qdisc
|
||||
* to all netdev TX queues, so that dev_qdisc_enqueue()
|
||||
* goes through taprio_enqueue().
|
||||
*/
|
||||
old = dev_graft_qdisc(dev_queue, sch);
|
||||
qdisc_refcount_inc(sch);
|
||||
}
|
||||
if (old)
|
||||
|
Loading…
x
Reference in New Issue
Block a user