X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=net%2Fsched%2Fsch_mq.c;h=d1dea3d5dc929f1dc2051b2ed42f65168c88aa09;hb=991d79b0d1255f89267a350b0048eca59f100cbb;hp=dd5ee022f1f7c1d76b28b4fd76028880db6ecaa5;hpb=0cb583fd2862f19ea88b02eb307d11c09e51e2f8;p=mv-sheeva.git diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c index dd5ee022f1f..d1dea3d5dc9 100644 --- a/net/sched/sch_mq.c +++ b/net/sched/sch_mq.c @@ -125,13 +125,18 @@ static struct netdev_queue *mq_queue_get(struct Qdisc *sch, unsigned long cl) return netdev_get_tx_queue(dev, ntx); } -static unsigned int mq_select_queue(struct Qdisc *sch, struct tcmsg *tcm) +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 (!mq_queue_get(sch, ntx)) - return 0; - return ntx - 1; + if (!dev_queue) { + struct net_device *dev = qdisc_dev(sch); + + return netdev_get_tx_queue(dev, 0); + } + return dev_queue; } static int mq_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new, @@ -188,6 +193,7 @@ static int mq_dump_class_stats(struct Qdisc *sch, unsigned long cl, struct netdev_queue *dev_queue = mq_queue_get(sch, cl); sch = dev_queue->qdisc_sleeping; + sch->qstats.qlen = sch->q.qlen; if (gnet_stats_copy_basic(d, &sch->bstats) < 0 || gnet_stats_copy_queue(d, &sch->qstats) < 0) return -1;