]> git.hungrycats.org Git - linux/commitdiff
[PKT_SCHED]: CBQ: Use generic rate estimator
authorThomas Graf <tgraf@suug.ch>
Thu, 21 Oct 2004 15:27:25 +0000 (08:27 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Thu, 21 Oct 2004 15:27:25 +0000 (08:27 -0700)
Makes CBQ use the generic rate estimator.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_cbq.c

index 44926bc62ce52c98ae347337fd9660f20e7cc262..74ca4ee720e4c22570d403540e399e7764186921 100644 (file)
@@ -1759,7 +1759,7 @@ static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl)
        qdisc_destroy(cl->q);
        qdisc_put_rtab(cl->R_tab);
 #ifdef CONFIG_NET_ESTIMATOR
-       qdisc_kill_estimator(&cl->stats);
+       gen_kill_estimator(&cl->bstats, &cl->rate_est);
 #endif
        if (cl != &q->link)
                kfree(cl);
@@ -1905,11 +1905,9 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
                sch_tree_unlock(sch);
 
 #ifdef CONFIG_NET_ESTIMATOR
-               if (tca[TCA_RATE-1]) {
-                       qdisc_kill_estimator(&cl->stats);
-                       qdisc_new_estimator(&cl->stats, cl->stats_lock,
-                                           tca[TCA_RATE-1]);
-               }
+               if (tca[TCA_RATE-1])
+                       gen_replace_estimator(&cl->bstats, &cl->rate_est,
+                               cl->stats_lock, tca[TCA_RATE-1]);
 #endif
                return 0;
        }
@@ -1999,8 +1997,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
 
 #ifdef CONFIG_NET_ESTIMATOR
        if (tca[TCA_RATE-1])
-               qdisc_new_estimator(&cl->stats, cl->stats_lock,
-                                   tca[TCA_RATE-1]);
+               gen_new_estimator(&cl->bstats, &cl->rate_est,
+                       cl->stats_lock, tca[TCA_RATE-1]);
 #endif
 
        *arg = (unsigned long)cl;