aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-11-26 18:24:32 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-26 18:24:32 -0500
commit244e6c2d0724bc4908a1995804704bdee3b31528 (patch)
treee208a765607733401302bf8582b37d1adab63c08 /net/sched
parent3d4cd60ed0533d3b33832e298530c7b021da982b (diff)
pkt_sched: gen_estimator: Optimize gen_estimator_active()
Since all other gen_estimator functions use bstats and rate_est params together, and searching for them is optimized now, let's use this also in gen_estimator_active(). The return type of gen_estimator_active() is changed to bool, and gen_find_node() parameters to const, btw. In tcf_act_police_locate() a check for ACT_P_CREATED is added before calling gen_estimator_active(). Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_police.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index c39f60cea6ee..5c72a116b1a4 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -183,7 +183,9 @@ override:
183 if (R_tab == NULL) 183 if (R_tab == NULL)
184 goto failure; 184 goto failure;
185 185
186 if (!est && !gen_estimator_active(&police->tcf_rate_est)) { 186 if (!est && (ret == ACT_P_CREATED ||
187 !gen_estimator_active(&police->tcf_bstats,
188 &police->tcf_rate_est))) {
187 err = -EINVAL; 189 err = -EINVAL;
188 goto failure; 190 goto failure;
189 } 191 }