Lines Matching refs:police
57 struct tcf_police *police; in tcf_police_init() local
105 police = to_police(*a); in tcf_police_init()
121 err = gen_replace_estimator(&police->tcf_bstats, in tcf_police_init()
122 police->common.cpu_bstats, in tcf_police_init()
123 &police->tcf_rate_est, in tcf_police_init()
124 &police->tcf_lock, in tcf_police_init()
130 !gen_estimator_active(&police->tcf_rate_est))) { in tcf_police_init()
186 spin_lock_bh(&police->tcf_lock); in tcf_police_init()
187 spin_lock_bh(&police->tcfp_lock); in tcf_police_init()
188 police->tcfp_t_c = ktime_get_ns(); in tcf_police_init()
189 police->tcfp_toks = new->tcfp_burst; in tcf_police_init()
191 police->tcfp_ptoks = new->tcfp_mtu_ptoks; in tcf_police_init()
192 spin_unlock_bh(&police->tcfp_lock); in tcf_police_init()
194 new = rcu_replace_pointer(police->params, in tcf_police_init()
196 lockdep_is_held(&police->tcf_lock)); in tcf_police_init()
197 spin_unlock_bh(&police->tcf_lock); in tcf_police_init()
233 struct tcf_police *police = to_police(a); in tcf_police_act() local
238 tcf_lastuse_update(&police->tcf_tm); in tcf_police_act()
239 bstats_cpu_update(this_cpu_ptr(police->common.cpu_bstats), skb); in tcf_police_act()
241 ret = READ_ONCE(police->tcf_action); in tcf_police_act()
242 p = rcu_dereference_bh(police->params); in tcf_police_act()
247 if (!gen_estimator_read(&police->tcf_rate_est, &sample) || in tcf_police_act()
259 spin_lock_bh(&police->tcfp_lock); in tcf_police_act()
260 toks = min_t(s64, now - police->tcfp_t_c, p->tcfp_burst); in tcf_police_act()
262 ptoks = toks + police->tcfp_ptoks; in tcf_police_act()
268 toks += police->tcfp_toks; in tcf_police_act()
273 police->tcfp_t_c = now; in tcf_police_act()
274 police->tcfp_toks = toks; in tcf_police_act()
275 police->tcfp_ptoks = ptoks; in tcf_police_act()
276 spin_unlock_bh(&police->tcfp_lock); in tcf_police_act()
280 spin_unlock_bh(&police->tcfp_lock); in tcf_police_act()
284 qstats_overlimit_inc(this_cpu_ptr(police->common.cpu_qstats)); in tcf_police_act()
287 qstats_drop_inc(this_cpu_ptr(police->common.cpu_qstats)); in tcf_police_act()
294 struct tcf_police *police = to_police(a); in tcf_police_cleanup() local
297 p = rcu_dereference_protected(police->params, 1); in tcf_police_cleanup()
306 struct tcf_police *police = to_police(a); in tcf_police_stats_update() local
307 struct tcf_t *tm = &police->tcf_tm; in tcf_police_stats_update()
317 struct tcf_police *police = to_police(a); in tcf_police_dump() local
320 .index = police->tcf_index, in tcf_police_dump()
321 .refcnt = refcount_read(&police->tcf_refcnt) - ref, in tcf_police_dump()
322 .bindcnt = atomic_read(&police->tcf_bindcnt) - bind, in tcf_police_dump()
326 spin_lock_bh(&police->tcf_lock); in tcf_police_dump()
327 opt.action = police->tcf_action; in tcf_police_dump()
328 p = rcu_dereference_protected(police->params, in tcf_police_dump()
329 lockdep_is_held(&police->tcf_lock)); in tcf_police_dump()
334 if ((police->params->rate.rate_bytes_ps >= (1ULL << 32)) && in tcf_police_dump()
336 police->params->rate.rate_bytes_ps, in tcf_police_dump()
342 if ((police->params->peak.rate_bytes_ps >= (1ULL << 32)) && in tcf_police_dump()
344 police->params->peak.rate_bytes_ps, in tcf_police_dump()
357 tcf_tm_dump(&t, &police->tcf_tm); in tcf_police_dump()
360 spin_unlock_bh(&police->tcf_lock); in tcf_police_dump()
365 spin_unlock_bh(&police->tcf_lock); in tcf_police_dump()