aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_prio.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-11-29 20:36:20 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:31:43 -0500
commit5e50da01d0ce7ef0ba3ed6cfabd62f327da0aca6 (patch)
tree6f2205ceae40a7fd5b498e94c60b65140740a027 /net/sched/sch_prio.c
parent43effa1e57fc4635e0301b27d78f9d83afe78974 (diff)
[NET_SCHED]: Fix endless loops (part 2): "simple" qdiscs
Convert the "simple" qdiscs to use qdisc_tree_decrease_qlen() where necessary: - all graft operations - destruction of old child qdiscs in prio, red and tbf change operation - purging of queue in sfq change operation Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_prio.c')
-rw-r--r--net/sched/sch_prio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 3fc0c0fa5bcc..2567b4c96c1e 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -222,8 +222,10 @@ static int prio_tune(struct Qdisc *sch, struct rtattr *opt)
222 222
223 for (i=q->bands; i<TCQ_PRIO_BANDS; i++) { 223 for (i=q->bands; i<TCQ_PRIO_BANDS; i++) {
224 struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc); 224 struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc);
225 if (child != &noop_qdisc) 225 if (child != &noop_qdisc) {
226 qdisc_tree_decrease_qlen(child, child->q.qlen);
226 qdisc_destroy(child); 227 qdisc_destroy(child);
228 }
227 } 229 }
228 sch_tree_unlock(sch); 230 sch_tree_unlock(sch);
229 231
@@ -236,8 +238,11 @@ static int prio_tune(struct Qdisc *sch, struct rtattr *opt)
236 sch_tree_lock(sch); 238 sch_tree_lock(sch);
237 child = xchg(&q->queues[i], child); 239 child = xchg(&q->queues[i], child);
238 240
239 if (child != &noop_qdisc) 241 if (child != &noop_qdisc) {
242 qdisc_tree_decrease_qlen(child,
243 child->q.qlen);
240 qdisc_destroy(child); 244 qdisc_destroy(child);
245 }
241 sch_tree_unlock(sch); 246 sch_tree_unlock(sch);
242 } 247 }
243 } 248 }
@@ -295,7 +300,7 @@ static int prio_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
295 sch_tree_lock(sch); 300 sch_tree_lock(sch);
296 *old = q->queues[band]; 301 *old = q->queues[band];
297 q->queues[band] = new; 302 q->queues[band] = new;
298 sch->q.qlen -= (*old)->q.qlen; 303 qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
299 qdisc_reset(*old); 304 qdisc_reset(*old);
300 sch_tree_unlock(sch); 305 sch_tree_unlock(sch);
301 306