Skip to content

Commit a19d215

Browse files
Jarek Poplawskidavem330
authored andcommitted
pkt_sched: Fix qstats.qlen updating in dump_stats
Some classful qdiscs miss qstats.qlen updating with q.qlen of their child qdiscs in dump_stats methods. Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0522fea commit a19d215

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

net/sched/sch_drr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ static int drr_dump_class_stats(struct Qdisc *sch, unsigned long arg,
274274
struct tc_drr_stats xstats;
275275

276276
memset(&xstats, 0, sizeof(xstats));
277-
if (cl->qdisc->q.qlen)
277+
if (cl->qdisc->q.qlen) {
278278
xstats.deficit = cl->deficit;
279+
cl->qdisc->qstats.qlen = cl->qdisc->q.qlen;
280+
}
279281

280282
if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
281283
gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||

net/sched/sch_mq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ static int mq_dump_class_stats(struct Qdisc *sch, unsigned long cl,
193193
struct netdev_queue *dev_queue = mq_queue_get(sch, cl);
194194

195195
sch = dev_queue->qdisc_sleeping;
196+
sch->qstats.qlen = sch->q.qlen;
196197
if (gnet_stats_copy_basic(d, &sch->bstats) < 0 ||
197198
gnet_stats_copy_queue(d, &sch->qstats) < 0)
198199
return -1;

net/sched/sch_multiq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ static int multiq_dump_class_stats(struct Qdisc *sch, unsigned long cl,
359359
struct Qdisc *cl_q;
360360

361361
cl_q = q->queues[cl - 1];
362+
cl_q->qstats.qlen = cl_q->q.qlen;
362363
if (gnet_stats_copy_basic(d, &cl_q->bstats) < 0 ||
363364
gnet_stats_copy_queue(d, &cl_q->qstats) < 0)
364365
return -1;

net/sched/sch_prio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ static int prio_dump_class_stats(struct Qdisc *sch, unsigned long cl,
322322
struct Qdisc *cl_q;
323323

324324
cl_q = q->queues[cl - 1];
325+
cl_q->qstats.qlen = cl_q->q.qlen;
325326
if (gnet_stats_copy_basic(d, &cl_q->bstats) < 0 ||
326327
gnet_stats_copy_queue(d, &cl_q->qstats) < 0)
327328
return -1;

0 commit comments

Comments
 (0)