]> git.itanic.dy.fi Git - linux-stable/commit
net: sched: introduce and use qstats read helpers
authorPaolo Abeni <pabeni@redhat.com>
Thu, 28 Mar 2019 15:53:12 +0000 (16:53 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Apr 2019 21:50:13 +0000 (14:50 -0700)
commit5dd431b6b92c0db324d134d2a4006dd4f87f2261
tree43b3a8686bdd4aa52060e7518954de6fef1bc10e
parent0db6f8befc32c68bb13d7ffbb2e563c79e913e13
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>
include/net/sch_generic.h
net/sched/sch_cbq.c
net/sched/sch_drr.c
net/sched/sch_hfsc.c
net/sched/sch_htb.c
net/sched/sch_mq.c
net/sched/sch_mqprio.c
net/sched/sch_multiq.c
net/sched/sch_prio.c
net/sched/sch_qfq.c
net/sched/sch_taprio.c