diff options
author | Patrick McHardy <kaber@trash.net> | 2006-11-29 20:36:20 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:31:43 -0500 |
commit | 5e50da01d0ce7ef0ba3ed6cfabd62f327da0aca6 (patch) | |
tree | 6f2205ceae40a7fd5b498e94c60b65140740a027 /net/sched/sch_sfq.c | |
parent | 43effa1e57fc4635e0301b27d78f9d83afe78974 (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_sfq.c')
-rw-r--r-- | net/sched/sch_sfq.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index d0d6e595a78c..459cda258a5c 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -393,6 +393,7 @@ static int sfq_change(struct Qdisc *sch, struct rtattr *opt) | |||
393 | { | 393 | { |
394 | struct sfq_sched_data *q = qdisc_priv(sch); | 394 | struct sfq_sched_data *q = qdisc_priv(sch); |
395 | struct tc_sfq_qopt *ctl = RTA_DATA(opt); | 395 | struct tc_sfq_qopt *ctl = RTA_DATA(opt); |
396 | unsigned int qlen; | ||
396 | 397 | ||
397 | if (opt->rta_len < RTA_LENGTH(sizeof(*ctl))) | 398 | if (opt->rta_len < RTA_LENGTH(sizeof(*ctl))) |
398 | return -EINVAL; | 399 | return -EINVAL; |
@@ -403,8 +404,10 @@ static int sfq_change(struct Qdisc *sch, struct rtattr *opt) | |||
403 | if (ctl->limit) | 404 | if (ctl->limit) |
404 | q->limit = min_t(u32, ctl->limit, SFQ_DEPTH); | 405 | q->limit = min_t(u32, ctl->limit, SFQ_DEPTH); |
405 | 406 | ||
407 | qlen = sch->q.qlen; | ||
406 | while (sch->q.qlen >= q->limit-1) | 408 | while (sch->q.qlen >= q->limit-1) |
407 | sfq_drop(sch); | 409 | sfq_drop(sch); |
410 | qdisc_tree_decrease_qlen(sch, qlen - sch->q.qlen); | ||
408 | 411 | ||
409 | del_timer(&q->perturb_timer); | 412 | del_timer(&q->perturb_timer); |
410 | if (q->perturb_period) { | 413 | if (q->perturb_period) { |