Commit 2e60391e authored by Patrick McHardy's avatar Patrick McHardy Committed by Patrick McHardy

[NET SCHED]: Adjust qlen when grafting in multiple qdiscs

parent 0ccb30c0
......@@ -1670,6 +1670,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_reset(*old);
sch_tree_unlock(sch);
......
......@@ -77,6 +77,7 @@ static int dsmark_graft(struct Qdisc *sch,unsigned long arg,
*old = xchg(&p->q,new);
if (*old)
qdisc_reset(*old);
sch->q.qlen = 0;
sch_tree_unlock(sch); /* @@@ move up ? */
return 0;
}
......
......@@ -266,6 +266,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_reset(*old);
sch_tree_unlock(sch);
......
......@@ -455,6 +455,8 @@ static int tbf_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
sch_tree_lock(sch);
*old = xchg(&q->qdisc, new);
qdisc_reset(*old);
sch->q.qlen = 0;
sch->stats.backlog = 0;
sch_tree_unlock(sch);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment