diff options
author | Paolo Abeni <pabeni@redhat.com> | 2019-03-28 16:53:13 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-01 14:50:13 -0700 |
commit | e5f0e8f8e456589d56e4955154ed5d468cd6d286 (patch) | |
tree | 394e064316a0965588c3784a36a24fca3a7b352d /net/sched/sch_multiq.c | |
parent | 5dd431b6b92c0db324d134d2a4006dd4f87f2261 (diff) | |
download | linux-e5f0e8f8e456589d56e4955154ed5d468cd6d286.tar.gz linux-e5f0e8f8e456589d56e4955154ed5d468cd6d286.tar.bz2 linux-e5f0e8f8e456589d56e4955154ed5d468cd6d286.zip |
net: sched: introduce and use qdisc tree flush/purge helpers
The same code to flush qdisc tree and purge the qdisc queue
is duplicated in many places and in most cases it does not
respect NOLOCK qdisc: the global backlog len is used and the
per CPU values are ignored.
This change addresses the above, factoring-out the relevant
code and using the helpers introduced by the previous patch
to fetch the correct backlog len.
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_multiq.c')
-rw-r--r-- | net/sched/sch_multiq.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c index 53c918a11378..35b03ae08e0f 100644 --- a/net/sched/sch_multiq.c +++ b/net/sched/sch_multiq.c @@ -201,9 +201,9 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt, for (i = q->bands; i < q->max_bands; i++) { if (q->queues[i] != &noop_qdisc) { struct Qdisc *child = q->queues[i]; + q->queues[i] = &noop_qdisc; - qdisc_tree_reduce_backlog(child, child->q.qlen, - child->qstats.backlog); + qdisc_tree_flush_backlog(child); qdisc_put(child); } } @@ -225,9 +225,7 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt, qdisc_hash_add(child, true); if (old != &noop_qdisc) { - qdisc_tree_reduce_backlog(old, - old->q.qlen, - old->qstats.backlog); + qdisc_tree_flush_backlog(old); qdisc_put(old); } sch_tree_unlock(sch); |