Skip to content

Commit ce8a75f

Browse files
Jesus Sanchez-PalenciaJeff Kirsher
authored andcommitted
net/sched: Change behavior of mq select_queue()
Currently, the class_ops select_queue() implementation on sch_mq returns a pointer to netdev_queue #0 when it receives and invalid qdisc id. That can be misleading since all of mq's inner qdiscs are attached to a valid netdev_queue. Here we fix that by returning NULL when a qdisc id is invalid. This is aligned with how select_queue() is implemented for sch_mqprio in the next patch on this series, keeping a consistent behavior between these two qdiscs. Signed-off-by: Jesus Sanchez-Palencia <[email protected]> Tested-by: Henrik Austad <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 26aa045 commit ce8a75f

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

net/sched/sch_mq.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,7 @@ static struct netdev_queue *mq_queue_get(struct Qdisc *sch, unsigned long cl)
130130
static struct netdev_queue *mq_select_queue(struct Qdisc *sch,
131131
struct tcmsg *tcm)
132132
{
133-
unsigned int ntx = TC_H_MIN(tcm->tcm_parent);
134-
struct netdev_queue *dev_queue = mq_queue_get(sch, ntx);
135-
136-
if (!dev_queue) {
137-
struct net_device *dev = qdisc_dev(sch);
138-
139-
return netdev_get_tx_queue(dev, 0);
140-
}
141-
return dev_queue;
133+
return mq_queue_get(sch, TC_H_MIN(tcm->tcm_parent));
142134
}
143135

144136
static int mq_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new,

0 commit comments

Comments
 (0)