[NET_SCHED]: Fix endless loops caused by inaccurate qlen counters
authorPatrick McHardy <kaber@trash.net>
Wed, 28 Mar 2007 19:31:36 +0000 (21:31 +0200)
committerAdrian Bunk <bunk@stusta.de>
Wed, 28 Mar 2007 19:31:36 +0000 (21:31 +0200)
commit39740872332b2dd28b479d9d8333c42c32465953
tree9cd54571212e6cffc911f9e8724d27c141e036cf
parent921e8ebfc8b0e41dc724ea52f4b95b7c44f6e880
[NET_SCHED]: Fix endless loops caused by inaccurate qlen counters

There are multiple problems related to qlen adjustment that can lead
to an upper qdisc getting out of sync with the real number of packets
queued, leading to endless dequeueing attempts by the upper layer code.

All qdiscs must maintain an accurate q.qlen counter. There are basically
two groups of operations affecting the qlen: operations that propagate
down the tree (enqueue, dequeue, requeue, drop, reset) beginning at the
root qdisc and operations only affecting a subtree or single qdisc
(change, graft, delete class). Since qlen changes during operations from
the second group don't propagate to ancestor qdiscs, their qlen values
become desynchronized.

This patch adds a function to propagate qlen changes up the qdisc tree,
optionally calling a callback function to perform qdisc-internal
maintenance when the child qdisc is deactivated, and converts all
qdiscs to use this where necessary.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
12 files changed:
include/net/sch_generic.h
net/sched/sch_api.c
net/sched/sch_atm.c
net/sched/sch_cbq.c
net/sched/sch_dsmark.c
net/sched/sch_generic.c
net/sched/sch_hfsc.c
net/sched/sch_htb.c
net/sched/sch_netem.c
net/sched/sch_prio.c
net/sched/sch_sfq.c
net/sched/sch_tbf.c