aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_mq.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_mq.c')
-rw-r--r--net/sched/sch_mq.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c
index dd5ee022f1f7..d1dea3d5dc92 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)
125 return netdev_get_tx_queue(dev, ntx); 125 return netdev_get_tx_queue(dev, ntx);
126} 126}
127 127
128static unsigned int mq_select_queue(struct Qdisc *sch, struct tcmsg *tcm) 128static struct netdev_queue *mq_select_queue(struct Qdisc *sch,
129 struct tcmsg *tcm)
129{ 130{
130 unsigned int ntx = TC_H_MIN(tcm->tcm_parent); 131 unsigned int ntx = TC_H_MIN(tcm->tcm_parent);
132 struct netdev_queue *dev_queue = mq_queue_get(sch, ntx);
131 133
132 if (!mq_queue_get(sch, ntx)) 134 if (!dev_queue) {
133 return 0; 135 struct net_device *dev = qdisc_dev(sch);
134 return ntx - 1; 136
137 return netdev_get_tx_queue(dev, 0);
138 }
139 return dev_queue;
135} 140}
136 141
137static int mq_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new, 142static 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,
188 struct netdev_queue *dev_queue = mq_queue_get(sch, cl); 193 struct netdev_queue *dev_queue = mq_queue_get(sch, cl);
189 194
190 sch = dev_queue->qdisc_sleeping; 195 sch = dev_queue->qdisc_sleeping;
196 sch->qstats.qlen = sch->q.qlen;
191 if (gnet_stats_copy_basic(d, &sch->bstats) < 0 || 197 if (gnet_stats_copy_basic(d, &sch->bstats) < 0 ||
192 gnet_stats_copy_queue(d, &sch->qstats) < 0) 198 gnet_stats_copy_queue(d, &sch->qstats) < 0)
193 return -1; 199 return -1;