Lines Matching refs:police

49 	struct tcf_police *police;  in tcf_police_init()  local
98 police = to_police(*a); in tcf_police_init()
114 err = gen_replace_estimator(&police->tcf_bstats, in tcf_police_init()
115 police->common.cpu_bstats, in tcf_police_init()
116 &police->tcf_rate_est, in tcf_police_init()
117 &police->tcf_lock, in tcf_police_init()
123 !gen_estimator_active(&police->tcf_rate_est))) { in tcf_police_init()
202 spin_lock_bh(&police->tcf_lock); in tcf_police_init()
203 spin_lock_bh(&police->tcfp_lock); in tcf_police_init()
204 police->tcfp_t_c = ktime_get_ns(); in tcf_police_init()
205 police->tcfp_toks = new->tcfp_burst; in tcf_police_init()
207 police->tcfp_ptoks = new->tcfp_mtu_ptoks; in tcf_police_init()
208 spin_unlock_bh(&police->tcfp_lock); in tcf_police_init()
210 new = rcu_replace_pointer(police->params, in tcf_police_init()
212 lockdep_is_held(&police->tcf_lock)); in tcf_police_init()
213 spin_unlock_bh(&police->tcf_lock); in tcf_police_init()
250 struct tcf_police *police = to_police(a); in tcf_police_act() local
255 tcf_lastuse_update(&police->tcf_tm); in tcf_police_act()
256 bstats_update(this_cpu_ptr(police->common.cpu_bstats), skb); in tcf_police_act()
258 ret = READ_ONCE(police->tcf_action); in tcf_police_act()
259 p = rcu_dereference_bh(police->params); in tcf_police_act()
264 if (!gen_estimator_read(&police->tcf_rate_est, &sample) || in tcf_police_act()
276 spin_lock_bh(&police->tcfp_lock); in tcf_police_act()
277 toks = min_t(s64, now - police->tcfp_t_c, p->tcfp_burst); in tcf_police_act()
279 ptoks = toks + police->tcfp_ptoks; in tcf_police_act()
286 toks += police->tcfp_toks; in tcf_police_act()
291 ppstoks = min_t(s64, now - police->tcfp_t_c, p->tcfp_pkt_burst); in tcf_police_act()
292 ppstoks += police->tcfp_pkttoks; in tcf_police_act()
298 police->tcfp_t_c = now; in tcf_police_act()
299 police->tcfp_toks = toks; in tcf_police_act()
300 police->tcfp_ptoks = ptoks; in tcf_police_act()
301 police->tcfp_pkttoks = ppstoks; in tcf_police_act()
302 spin_unlock_bh(&police->tcfp_lock); in tcf_police_act()
306 spin_unlock_bh(&police->tcfp_lock); in tcf_police_act()
310 qstats_overlimit_inc(this_cpu_ptr(police->common.cpu_qstats)); in tcf_police_act()
313 qstats_drop_inc(this_cpu_ptr(police->common.cpu_qstats)); in tcf_police_act()
320 struct tcf_police *police = to_police(a); in tcf_police_cleanup() local
323 p = rcu_dereference_protected(police->params, 1); in tcf_police_cleanup()
332 struct tcf_police *police = to_police(a); in tcf_police_stats_update() local
333 struct tcf_t *tm = &police->tcf_tm; in tcf_police_stats_update()
343 struct tcf_police *police = to_police(a); in tcf_police_dump() local
346 .index = police->tcf_index, in tcf_police_dump()
347 .refcnt = refcount_read(&police->tcf_refcnt) - ref, in tcf_police_dump()
348 .bindcnt = atomic_read(&police->tcf_bindcnt) - bind, in tcf_police_dump()
352 spin_lock_bh(&police->tcf_lock); in tcf_police_dump()
353 opt.action = police->tcf_action; in tcf_police_dump()
354 p = rcu_dereference_protected(police->params, in tcf_police_dump()
355 lockdep_is_held(&police->tcf_lock)); in tcf_police_dump()
360 if ((police->params->rate.rate_bytes_ps >= (1ULL << 32)) && in tcf_police_dump()
362 police->params->rate.rate_bytes_ps, in tcf_police_dump()
368 if ((police->params->peak.rate_bytes_ps >= (1ULL << 32)) && in tcf_police_dump()
370 police->params->peak.rate_bytes_ps, in tcf_police_dump()
376 police->params->ppsrate.rate_pkts_ps, in tcf_police_dump()
393 tcf_tm_dump(&t, &police->tcf_tm); in tcf_police_dump()
396 spin_unlock_bh(&police->tcf_lock); in tcf_police_dump()
401 spin_unlock_bh(&police->tcf_lock); in tcf_police_dump()
443 struct tcf_police *police = to_police(act); in tcf_police_offload_act_setup() local
447 p = rcu_dereference_protected(police->params, in tcf_police_offload_act_setup()
448 lockdep_is_held(&police->tcf_lock)); in tcf_police_offload_act_setup()
451 entry->police.burst = tcf_police_burst(act); in tcf_police_offload_act_setup()
452 entry->police.rate_bytes_ps = in tcf_police_offload_act_setup()
454 entry->police.peakrate_bytes_ps = tcf_police_peakrate_bytes_ps(act); in tcf_police_offload_act_setup()
455 entry->police.avrate = tcf_police_tcfp_ewma_rate(act); in tcf_police_offload_act_setup()
456 entry->police.overhead = tcf_police_rate_overhead(act); in tcf_police_offload_act_setup()
457 entry->police.burst_pkt = tcf_police_burst_pkt(act); in tcf_police_offload_act_setup()
458 entry->police.rate_pkt_ps = in tcf_police_offload_act_setup()
460 entry->police.mtu = tcf_police_tcfp_mtu(act); in tcf_police_offload_act_setup()
462 act_id = tcf_police_act_to_flow_act(police->tcf_action, in tcf_police_offload_act_setup()
463 &entry->police.exceed.extval, in tcf_police_offload_act_setup()
468 entry->police.exceed.act_id = act_id; in tcf_police_offload_act_setup()
471 &entry->police.notexceed.extval, in tcf_police_offload_act_setup()
476 entry->police.notexceed.act_id = act_id; in tcf_police_offload_act_setup()