Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41950
b: refs/heads/master
c: 5e50da0
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Dec 3, 2006
1 parent 692c9a0 commit 67d038a
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 43effa1e57fc4635e0301b27d78f9d83afe78974
refs/heads/master: 5e50da01d0ce7ef0ba3ed6cfabd62f327da0aca6
2 changes: 1 addition & 1 deletion trunk/net/sched/sch_cbq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ static int cbq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
sch_tree_lock(sch);
*old = cl->q;
cl->q = new;
sch->q.qlen -= (*old)->q.qlen;
qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
qdisc_reset(*old);
sch_tree_unlock(sch);

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/sched/sch_dsmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ static int dsmark_graft(struct Qdisc *sch, unsigned long arg,

sch_tree_lock(sch);
*old = xchg(&p->q, new);
qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
qdisc_reset(*old);
sch->q.qlen = 0;
sch_tree_unlock(sch);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,8 @@ static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,

sch_tree_lock(sch);
*old = xchg(&q->qdisc, new);
qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
qdisc_reset(*old);
sch->q.qlen = 0;
sch_tree_unlock(sch);

return 0;
Expand Down
11 changes: 8 additions & 3 deletions trunk/net/sched/sch_prio.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ static int prio_tune(struct Qdisc *sch, struct rtattr *opt)

for (i=q->bands; i<TCQ_PRIO_BANDS; i++) {
struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc);
if (child != &noop_qdisc)
if (child != &noop_qdisc) {
qdisc_tree_decrease_qlen(child, child->q.qlen);
qdisc_destroy(child);
}
}
sch_tree_unlock(sch);

Expand All @@ -236,8 +238,11 @@ static int prio_tune(struct Qdisc *sch, struct rtattr *opt)
sch_tree_lock(sch);
child = xchg(&q->queues[i], child);

if (child != &noop_qdisc)
if (child != &noop_qdisc) {
qdisc_tree_decrease_qlen(child,
child->q.qlen);
qdisc_destroy(child);
}
sch_tree_unlock(sch);
}
}
Expand Down Expand Up @@ -295,7 +300,7 @@ static int prio_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
sch_tree_lock(sch);
*old = q->queues[band];
q->queues[band] = new;
sch->q.qlen -= (*old)->q.qlen;
qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
qdisc_reset(*old);
sch_tree_unlock(sch);

Expand Down
6 changes: 4 additions & 2 deletions trunk/net/sched/sch_red.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@ static int red_change(struct Qdisc *sch, struct rtattr *opt)
sch_tree_lock(sch);
q->flags = ctl->flags;
q->limit = ctl->limit;
if (child)
if (child) {
qdisc_tree_decrease_qlen(q->qdisc, q->qdisc->q.qlen);
qdisc_destroy(xchg(&q->qdisc, child));
}

red_set_parms(&q->parms, ctl->qth_min, ctl->qth_max, ctl->Wlog,
ctl->Plog, ctl->Scell_log,
Expand Down Expand Up @@ -308,8 +310,8 @@ static int red_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,

sch_tree_lock(sch);
*old = xchg(&q->qdisc, new);
qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
qdisc_reset(*old);
sch->q.qlen = 0;
sch_tree_unlock(sch);
return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/sched/sch_sfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ static int sfq_change(struct Qdisc *sch, struct rtattr *opt)
{
struct sfq_sched_data *q = qdisc_priv(sch);
struct tc_sfq_qopt *ctl = RTA_DATA(opt);
unsigned int qlen;

if (opt->rta_len < RTA_LENGTH(sizeof(*ctl)))
return -EINVAL;
Expand All @@ -403,8 +404,10 @@ static int sfq_change(struct Qdisc *sch, struct rtattr *opt)
if (ctl->limit)
q->limit = min_t(u32, ctl->limit, SFQ_DEPTH);

qlen = sch->q.qlen;
while (sch->q.qlen >= q->limit-1)
sfq_drop(sch);
qdisc_tree_decrease_qlen(sch, qlen - sch->q.qlen);

del_timer(&q->perturb_timer);
if (q->perturb_period) {
Expand Down
6 changes: 4 additions & 2 deletions trunk/net/sched/sch_tbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,10 @@ static int tbf_change(struct Qdisc* sch, struct rtattr *opt)
}

sch_tree_lock(sch);
if (child)
if (child) {
qdisc_tree_decrease_qlen(q->qdisc, q->qdisc->q.qlen);
qdisc_destroy(xchg(&q->qdisc, child));
}
q->limit = qopt->limit;
q->mtu = qopt->mtu;
q->max_size = max_size;
Expand Down Expand Up @@ -451,8 +453,8 @@ static int tbf_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,

sch_tree_lock(sch);
*old = xchg(&q->qdisc, new);
qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
qdisc_reset(*old);
sch->q.qlen = 0;
sch_tree_unlock(sch);

return 0;
Expand Down

0 comments on commit 67d038a

Please sign in to comment.