]> git.hungrycats.org Git - linux/commitdiff
[NET SCHED]: Adjust qlen when grafting in multiple qdiscs
authorPatrick McHardy <kaber@trash.net>
Tue, 18 Nov 2003 09:23:37 +0000 (01:23 -0800)
committerPatrick McHardy <kaber@coreworks.de>
Tue, 18 Nov 2003 09:23:37 +0000 (01:23 -0800)
net/sched/sch_cbq.c
net/sched/sch_dsmark.c
net/sched/sch_prio.c
net/sched/sch_tbf.c

index f7e5bef816dd0f5a82f7f20d6244e39230beec5b..d30c5f38ba97fa7a5c8e071022767de4c8b8863b 100644 (file)
@@ -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);
 
index ec9837bb9e5ddc3626349cd61bad9c9056b65c51..8db00228c0a42dbda910574148e59c2bd55ae216 100644 (file)
@@ -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;
 }
index c09a7f95050a89d7c7c428084280987d556898fc..7691f8ab78f2b62cb09cb02af82ea59fabcab09a 100644 (file)
@@ -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);
 
index c115df7521631d9ebd7d6800012974dad75cbc15..3fe6f4f37c7c3674b233fbf0aa371a83f3a8c7d8 100644 (file)
@@ -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;