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) ...@@ -461,8 +461,8 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
#ifdef CONFIG_NET_ESTIMATOR #ifdef CONFIG_NET_ESTIMATOR
if (tca[TCA_RATE-1]) if (tca[TCA_RATE-1])
qdisc_new_estimator(&sch->stats, sch->stats_lock, gen_new_estimator(&sch->bstats, &sch->rate_est,
tca[TCA_RATE-1]); sch->stats_lock, tca[TCA_RATE-1]);
#endif #endif
return sch; return sch;
} }
...@@ -489,11 +489,9 @@ static int qdisc_change(struct Qdisc *sch, struct rtattr **tca) ...@@ -489,11 +489,9 @@ static int qdisc_change(struct Qdisc *sch, struct rtattr **tca)
return err; return err;
} }
#ifdef CONFIG_NET_ESTIMATOR #ifdef CONFIG_NET_ESTIMATOR
if (tca[TCA_RATE-1]) { if (tca[TCA_RATE-1])
qdisc_kill_estimator(&sch->stats); gen_replace_estimator(&sch->bstats, &sch->rate_est,
qdisc_new_estimator(&sch->stats, sch->stats_lock, sch->stats_lock, tca[TCA_RATE-1]);
tca[TCA_RATE-1]);
}
#endif #endif
return 0; return 0;
} }
......
...@@ -465,7 +465,7 @@ static void __qdisc_destroy(struct rcu_head *head) ...@@ -465,7 +465,7 @@ static void __qdisc_destroy(struct rcu_head *head)
struct Qdisc_ops *ops = qdisc->ops; struct Qdisc_ops *ops = qdisc->ops;
#ifdef CONFIG_NET_ESTIMATOR #ifdef CONFIG_NET_ESTIMATOR
qdisc_kill_estimator(&qdisc->stats); gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est);
#endif #endif
write_lock(&qdisc_tree_lock); write_lock(&qdisc_tree_lock);
if (ops->reset) 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