Lines Matching refs:police

48 	struct tcf_police *police;  in tcf_police_init()  local
97 police = to_police(*a); in tcf_police_init()
113 err = gen_replace_estimator(&police->tcf_bstats, in tcf_police_init()
114 police->common.cpu_bstats, in tcf_police_init()
115 &police->tcf_rate_est, in tcf_police_init()
116 &police->tcf_lock, in tcf_police_init()
122 !gen_estimator_active(&police->tcf_rate_est))) { in tcf_police_init()
201 spin_lock_bh(&police->tcf_lock); in tcf_police_init()
202 spin_lock_bh(&police->tcfp_lock); in tcf_police_init()
203 police->tcfp_t_c = ktime_get_ns(); in tcf_police_init()
204 police->tcfp_toks = new->tcfp_burst; in tcf_police_init()
206 police->tcfp_ptoks = new->tcfp_mtu_ptoks; in tcf_police_init()
207 spin_unlock_bh(&police->tcfp_lock); in tcf_police_init()
209 new = rcu_replace_pointer(police->params, in tcf_police_init()
211 lockdep_is_held(&police->tcf_lock)); in tcf_police_init()
212 spin_unlock_bh(&police->tcf_lock); in tcf_police_init()
248 struct tcf_police *police = to_police(a); in tcf_police_act() local
253 tcf_lastuse_update(&police->tcf_tm); in tcf_police_act()
254 bstats_update(this_cpu_ptr(police->common.cpu_bstats), skb); in tcf_police_act()
256 ret = READ_ONCE(police->tcf_action); in tcf_police_act()
257 p = rcu_dereference_bh(police->params); in tcf_police_act()
262 if (!gen_estimator_read(&police->tcf_rate_est, &sample) || in tcf_police_act()
274 spin_lock_bh(&police->tcfp_lock); in tcf_police_act()
275 toks = min_t(s64, now - police->tcfp_t_c, p->tcfp_burst); in tcf_police_act()
277 ptoks = toks + police->tcfp_ptoks; in tcf_police_act()
284 toks += police->tcfp_toks; in tcf_police_act()
289 ppstoks = min_t(s64, now - police->tcfp_t_c, p->tcfp_pkt_burst); in tcf_police_act()
290 ppstoks += police->tcfp_pkttoks; in tcf_police_act()
296 police->tcfp_t_c = now; in tcf_police_act()
297 police->tcfp_toks = toks; in tcf_police_act()
298 police->tcfp_ptoks = ptoks; in tcf_police_act()
299 police->tcfp_pkttoks = ppstoks; in tcf_police_act()
300 spin_unlock_bh(&police->tcfp_lock); in tcf_police_act()
304 spin_unlock_bh(&police->tcfp_lock); in tcf_police_act()
308 qstats_overlimit_inc(this_cpu_ptr(police->common.cpu_qstats)); in tcf_police_act()
311 qstats_drop_inc(this_cpu_ptr(police->common.cpu_qstats)); in tcf_police_act()
318 struct tcf_police *police = to_police(a); in tcf_police_cleanup() local
321 p = rcu_dereference_protected(police->params, 1); in tcf_police_cleanup()
330 struct tcf_police *police = to_police(a); in tcf_police_stats_update() local
331 struct tcf_t *tm = &police->tcf_tm; in tcf_police_stats_update()
341 struct tcf_police *police = to_police(a); in tcf_police_dump() local
344 .index = police->tcf_index, in tcf_police_dump()
345 .refcnt = refcount_read(&police->tcf_refcnt) - ref, in tcf_police_dump()
346 .bindcnt = atomic_read(&police->tcf_bindcnt) - bind, in tcf_police_dump()
350 spin_lock_bh(&police->tcf_lock); in tcf_police_dump()
351 opt.action = police->tcf_action; in tcf_police_dump()
352 p = rcu_dereference_protected(police->params, in tcf_police_dump()
353 lockdep_is_held(&police->tcf_lock)); in tcf_police_dump()
358 if ((police->params->rate.rate_bytes_ps >= (1ULL << 32)) && in tcf_police_dump()
360 police->params->rate.rate_bytes_ps, in tcf_police_dump()
366 if ((police->params->peak.rate_bytes_ps >= (1ULL << 32)) && in tcf_police_dump()
368 police->params->peak.rate_bytes_ps, in tcf_police_dump()
374 police->params->ppsrate.rate_pkts_ps, in tcf_police_dump()
391 tcf_tm_dump(&t, &police->tcf_tm); in tcf_police_dump()
394 spin_unlock_bh(&police->tcf_lock); in tcf_police_dump()
399 spin_unlock_bh(&police->tcf_lock); in tcf_police_dump()
441 struct tcf_police *police = to_police(act); in tcf_police_offload_act_setup() local
445 p = rcu_dereference_protected(police->params, in tcf_police_offload_act_setup()
446 lockdep_is_held(&police->tcf_lock)); in tcf_police_offload_act_setup()
449 entry->police.burst = tcf_police_burst(act); in tcf_police_offload_act_setup()
450 entry->police.rate_bytes_ps = in tcf_police_offload_act_setup()
452 entry->police.peakrate_bytes_ps = tcf_police_peakrate_bytes_ps(act); in tcf_police_offload_act_setup()
453 entry->police.avrate = tcf_police_tcfp_ewma_rate(act); in tcf_police_offload_act_setup()
454 entry->police.overhead = tcf_police_rate_overhead(act); in tcf_police_offload_act_setup()
455 entry->police.burst_pkt = tcf_police_burst_pkt(act); in tcf_police_offload_act_setup()
456 entry->police.rate_pkt_ps = in tcf_police_offload_act_setup()
458 entry->police.mtu = tcf_police_tcfp_mtu(act); in tcf_police_offload_act_setup()
460 act_id = tcf_police_act_to_flow_act(police->tcf_action, in tcf_police_offload_act_setup()
461 &entry->police.exceed.extval, in tcf_police_offload_act_setup()
466 entry->police.exceed.act_id = act_id; in tcf_police_offload_act_setup()
469 &entry->police.notexceed.extval, in tcf_police_offload_act_setup()
474 entry->police.notexceed.act_id = act_id; in tcf_police_offload_act_setup()