From: Jarek Poplawski Date: Thu, 17 Sep 2009 17:26:07 +0000 (-0700) Subject: pkt_sched: Fix qstats.qlen updating in dump_stats X-Git-Tag: firefly_0821_release~11864^2~329 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a19d2158439d6fba8160d7d2446f233f525f09e7;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index 12b2fb04b29b..5a888af7e5da 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c @@ -274,8 +274,10 @@ static int drr_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct tc_drr_stats xstats; memset(&xstats, 0, sizeof(xstats)); - if (cl->qdisc->q.qlen) + if (cl->qdisc->q.qlen) { xstats.deficit = cl->deficit; + cl->qdisc->qstats.qlen = cl->qdisc->q.qlen; + } if (gnet_stats_copy_basic(d, &cl->bstats) < 0 || gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 || diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c index 600c50143cc7..d1dea3d5dc92 100644 --- a/net/sched/sch_mq.c +++ b/net/sched/sch_mq.c @@ -193,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; diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c index 069f81c97277..7db2c88ce585 100644 --- a/net/sched/sch_multiq.c +++ b/net/sched/sch_multiq.c @@ -359,6 +359,7 @@ static int multiq_dump_class_stats(struct Qdisc *sch, unsigned long cl, struct Qdisc *cl_q; cl_q = q->queues[cl - 1]; + cl_q->qstats.qlen = cl_q->q.qlen; if (gnet_stats_copy_basic(d, &cl_q->bstats) < 0 || gnet_stats_copy_queue(d, &cl_q->qstats) < 0) return -1; diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 0f73c412d04b..93285cecb246 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c @@ -322,6 +322,7 @@ static int prio_dump_class_stats(struct Qdisc *sch, unsigned long cl, struct Qdisc *cl_q; cl_q = q->queues[cl - 1]; + cl_q->qstats.qlen = cl_q->q.qlen; if (gnet_stats_copy_basic(d, &cl_q->bstats) < 0 || gnet_stats_copy_queue(d, &cl_q->qstats) < 0) return -1;