diff options
author | Paolo Abeni <pabeni@redhat.com> | 2019-03-28 16:53:12 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-01 23:50:13 +0200 |
commit | 5dd431b6b92c0db324d134d2a4006dd4f87f2261 (patch) | |
tree | 43b3a8686bdd4aa52060e7518954de6fef1bc10e /net/sched/sch_mq.c | |
parent | net/sched: fix ->get helper of the matchall cls (diff) | |
download | linux-5dd431b6b92c0db324d134d2a4006dd4f87f2261.tar.xz linux-5dd431b6b92c0db324d134d2a4006dd4f87f2261.zip |
net: sched: introduce and use qstats read helpers
Classful qdiscs can't access directly the child qdiscs backlog
length: if such qdisc is NOLOCK, per CPU values should be
accounted instead.
Most qdiscs no not respect the above. As a result, qstats fetching
for most classful qdisc is currently incorrect: if the child qdisc is
NOLOCK, it always reports 0 len backlog.
This change introduces a pair of helpers to safely fetch
both backlog and qlen and use them in stats class dumping
functions, fixing the above issue and cleaning a bit the code.
DRR needs also to access the child qdisc queue length, so it
needs custom handling.
Fixes: c5ad119fb6c0 ("net: sched: pfifo_fast use skb_array")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_mq.c')
-rw-r--r-- | net/sched/sch_mq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c index 203659bc3906..3a3312467692 100644 --- a/net/sched/sch_mq.c +++ b/net/sched/sch_mq.c @@ -249,7 +249,7 @@ static int mq_dump_class_stats(struct Qdisc *sch, unsigned long cl, sch = dev_queue->qdisc_sleeping; if (gnet_stats_copy_basic(&sch->running, d, NULL, &sch->bstats) < 0 || - gnet_stats_copy_queue(d, NULL, &sch->qstats, sch->q.qlen) < 0) + qdisc_qstats_copy(d, sch) < 0) return -1; return 0; } |