Commit d92f37d6 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[PKT_SCHED]: Use generic rate estimator

Adapts qdiscs to use generic estimator.
Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ccafbfbd
......@@ -461,8 +461,8 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
#ifdef CONFIG_NET_ESTIMATOR
if (tca[TCA_RATE-1])
qdisc_new_estimator(&sch->stats, sch->stats_lock,
tca[TCA_RATE-1]);
gen_new_estimator(&sch->bstats, &sch->rate_est,
sch->stats_lock, tca[TCA_RATE-1]);
#endif
return sch;
}
......@@ -489,11 +489,9 @@ static int qdisc_change(struct Qdisc *sch, struct rtattr **tca)
return err;
}
#ifdef CONFIG_NET_ESTIMATOR
if (tca[TCA_RATE-1]) {
qdisc_kill_estimator(&sch->stats);
qdisc_new_estimator(&sch->stats, sch->stats_lock,
tca[TCA_RATE-1]);
}
if (tca[TCA_RATE-1])
gen_replace_estimator(&sch->bstats, &sch->rate_est,
sch->stats_lock, tca[TCA_RATE-1]);
#endif
return 0;
}
......
......@@ -465,7 +465,7 @@ static void __qdisc_destroy(struct rcu_head *head)
struct Qdisc_ops *ops = qdisc->ops;
#ifdef CONFIG_NET_ESTIMATOR
qdisc_kill_estimator(&qdisc->stats);
gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est);
#endif
write_lock(&qdisc_tree_lock);
if (ops->reset)
......
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