Skip to content

Commit 0f7787b

Browse files
Jesus Sanchez-PalenciaJeff Kirsher
authored andcommitted
net/sched: Add select_queue() class_ops for mqprio
When replacing a child qdisc from mqprio, tc_modify_qdisc() must fetch the netdev_queue pointer that the current child qdisc is associated with before creating the new qdisc. Currently, when using mqprio as root qdisc, the kernel will end up getting the queue #0 pointer from the mqprio (root qdisc), which leaves any new child qdisc with a possibly wrong netdev_queue pointer. Implementing the Qdisc_class_ops select_queue() on mqprio fixes this issue and avoid an inconsistent state when child qdiscs are replaced. Signed-off-by: Jesus Sanchez-Palencia <[email protected]> Tested-by: Henrik Austad <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent ce8a75f commit 0f7787b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

net/sched/sch_mqprio.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,13 +575,20 @@ static void mqprio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
575575
}
576576
}
577577

578+
static struct netdev_queue *mqprio_select_queue(struct Qdisc *sch,
579+
struct tcmsg *tcm)
580+
{
581+
return mqprio_queue_get(sch, TC_H_MIN(tcm->tcm_parent));
582+
}
583+
578584
static const struct Qdisc_class_ops mqprio_class_ops = {
579585
.graft = mqprio_graft,
580586
.leaf = mqprio_leaf,
581587
.find = mqprio_find,
582588
.walk = mqprio_walk,
583589
.dump = mqprio_dump_class,
584590
.dump_stats = mqprio_dump_class_stats,
591+
.select_queue = mqprio_select_queue,
585592
};
586593

587594
static struct Qdisc_ops mqprio_qdisc_ops __read_mostly = {

0 commit comments

Comments
 (0)