Lines Matching refs:police

59 	struct tcf_police *police;  in tcf_police_init()  local
108 police = to_police(*a); in tcf_police_init()
124 err = gen_replace_estimator(&police->tcf_bstats, in tcf_police_init()
125 police->common.cpu_bstats, in tcf_police_init()
126 &police->tcf_rate_est, in tcf_police_init()
127 &police->tcf_lock, in tcf_police_init()
133 !gen_estimator_active(&police->tcf_rate_est))) { in tcf_police_init()
212 spin_lock_bh(&police->tcf_lock); in tcf_police_init()
213 spin_lock_bh(&police->tcfp_lock); in tcf_police_init()
214 police->tcfp_t_c = ktime_get_ns(); in tcf_police_init()
215 police->tcfp_toks = new->tcfp_burst; in tcf_police_init()
217 police->tcfp_ptoks = new->tcfp_mtu_ptoks; in tcf_police_init()
218 spin_unlock_bh(&police->tcfp_lock); in tcf_police_init()
220 new = rcu_replace_pointer(police->params, in tcf_police_init()
222 lockdep_is_held(&police->tcf_lock)); in tcf_police_init()
223 spin_unlock_bh(&police->tcf_lock); in tcf_police_init()
245 struct tcf_police *police = to_police(a); in tcf_police_act() local
250 tcf_lastuse_update(&police->tcf_tm); in tcf_police_act()
251 bstats_update(this_cpu_ptr(police->common.cpu_bstats), skb); in tcf_police_act()
253 ret = READ_ONCE(police->tcf_action); in tcf_police_act()
254 p = rcu_dereference_bh(police->params); in tcf_police_act()
259 if (!gen_estimator_read(&police->tcf_rate_est, &sample) || in tcf_police_act()
271 spin_lock_bh(&police->tcfp_lock); in tcf_police_act()
272 toks = min_t(s64, now - police->tcfp_t_c, p->tcfp_burst); in tcf_police_act()
274 ptoks = toks + police->tcfp_ptoks; in tcf_police_act()
281 toks += police->tcfp_toks; in tcf_police_act()
286 ppstoks = min_t(s64, now - police->tcfp_t_c, p->tcfp_pkt_burst); in tcf_police_act()
287 ppstoks += police->tcfp_pkttoks; in tcf_police_act()
293 police->tcfp_t_c = now; in tcf_police_act()
294 police->tcfp_toks = toks; in tcf_police_act()
295 police->tcfp_ptoks = ptoks; in tcf_police_act()
296 police->tcfp_pkttoks = ppstoks; in tcf_police_act()
297 spin_unlock_bh(&police->tcfp_lock); in tcf_police_act()
301 spin_unlock_bh(&police->tcfp_lock); in tcf_police_act()
305 qstats_overlimit_inc(this_cpu_ptr(police->common.cpu_qstats)); in tcf_police_act()
308 qstats_drop_inc(this_cpu_ptr(police->common.cpu_qstats)); in tcf_police_act()
315 struct tcf_police *police = to_police(a); in tcf_police_cleanup() local
318 p = rcu_dereference_protected(police->params, 1); in tcf_police_cleanup()
327 struct tcf_police *police = to_police(a); in tcf_police_stats_update() local
328 struct tcf_t *tm = &police->tcf_tm; in tcf_police_stats_update()
338 struct tcf_police *police = to_police(a); in tcf_police_dump() local
341 .index = police->tcf_index, in tcf_police_dump()
342 .refcnt = refcount_read(&police->tcf_refcnt) - ref, in tcf_police_dump()
343 .bindcnt = atomic_read(&police->tcf_bindcnt) - bind, in tcf_police_dump()
347 spin_lock_bh(&police->tcf_lock); in tcf_police_dump()
348 opt.action = police->tcf_action; in tcf_police_dump()
349 p = rcu_dereference_protected(police->params, in tcf_police_dump()
350 lockdep_is_held(&police->tcf_lock)); in tcf_police_dump()
355 if ((police->params->rate.rate_bytes_ps >= (1ULL << 32)) && in tcf_police_dump()
357 police->params->rate.rate_bytes_ps, in tcf_police_dump()
363 if ((police->params->peak.rate_bytes_ps >= (1ULL << 32)) && in tcf_police_dump()
365 police->params->peak.rate_bytes_ps, in tcf_police_dump()
371 police->params->ppsrate.rate_pkts_ps, in tcf_police_dump()
388 tcf_tm_dump(&t, &police->tcf_tm); in tcf_police_dump()
391 spin_unlock_bh(&police->tcf_lock); in tcf_police_dump()
396 spin_unlock_bh(&police->tcf_lock); in tcf_police_dump()