Skip to content

Commit

Permalink
net/sched: Change behavior of mq select_queue()
Browse files Browse the repository at this point in the history
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 <jesus.sanchez-palencia@intel.com>
Tested-by: Henrik Austad <henrik@austad.us>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Jesus Sanchez-Palencia authored and Jeff Kirsher committed Oct 27, 2017
1 parent 26aa045 commit ce8a75f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions net/sched/sch_mq.c
Original file line number Diff line number Diff line change
@@ -130,15 +130,7 @@ static struct netdev_queue *mq_queue_get(struct Qdisc *sch, unsigned long cl)
static struct netdev_queue *mq_select_queue(struct Qdisc *sch,
struct tcmsg *tcm)
{
unsigned int ntx = TC_H_MIN(tcm->tcm_parent);
struct netdev_queue *dev_queue = mq_queue_get(sch, ntx);

if (!dev_queue) {
struct net_device *dev = qdisc_dev(sch);

return netdev_get_tx_queue(dev, 0);
}
return dev_queue;
return mq_queue_get(sch, TC_H_MIN(tcm->tcm_parent));
}

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

0 comments on commit ce8a75f

Please sign in to comment.