Lines Matching refs:s
48 struct tcf_sample *s; in tcf_sample_init() local
107 s = to_sample(*a); in tcf_sample_init()
109 spin_lock_bh(&s->tcf_lock); in tcf_sample_init()
111 s->rate = rate; in tcf_sample_init()
112 s->psample_group_num = psample_group_num; in tcf_sample_init()
113 psample_group = rcu_replace_pointer(s->psample_group, psample_group, in tcf_sample_init()
114 lockdep_is_held(&s->tcf_lock)); in tcf_sample_init()
117 s->truncate = true; in tcf_sample_init()
118 s->trunc_size = nla_get_u32(tb[TCA_SAMPLE_TRUNC_SIZE]); in tcf_sample_init()
120 spin_unlock_bh(&s->tcf_lock); in tcf_sample_init()
138 struct tcf_sample *s = to_sample(a); in tcf_sample_cleanup() local
142 psample_group = rcu_dereference_protected(s->psample_group, 1); in tcf_sample_cleanup()
143 RCU_INIT_POINTER(s->psample_group, NULL); in tcf_sample_cleanup()
167 struct tcf_sample *s = to_sample(a); in tcf_sample_act() local
172 tcf_lastuse_update(&s->tcf_tm); in tcf_sample_act()
173 bstats_cpu_update(this_cpu_ptr(s->common.cpu_bstats), skb); in tcf_sample_act()
174 retval = READ_ONCE(s->tcf_action); in tcf_sample_act()
176 psample_group = rcu_dereference_bh(s->psample_group); in tcf_sample_act()
179 if (psample_group && (prandom_u32() % s->rate == 0)) { in tcf_sample_act()
191 md.trunc_size = s->truncate ? s->trunc_size : skb->len; in tcf_sample_act()
192 psample_sample_packet(psample_group, skb, s->rate, &md); in tcf_sample_act()
204 struct tcf_sample *s = to_sample(a); in tcf_sample_stats_update() local
205 struct tcf_t *tm = &s->tcf_tm; in tcf_sample_stats_update()
215 struct tcf_sample *s = to_sample(a); in tcf_sample_dump() local
217 .index = s->tcf_index, in tcf_sample_dump()
218 .refcnt = refcount_read(&s->tcf_refcnt) - ref, in tcf_sample_dump()
219 .bindcnt = atomic_read(&s->tcf_bindcnt) - bind, in tcf_sample_dump()
223 spin_lock_bh(&s->tcf_lock); in tcf_sample_dump()
224 opt.action = s->tcf_action; in tcf_sample_dump()
228 tcf_tm_dump(&t, &s->tcf_tm); in tcf_sample_dump()
232 if (nla_put_u32(skb, TCA_SAMPLE_RATE, s->rate)) in tcf_sample_dump()
235 if (s->truncate) in tcf_sample_dump()
236 if (nla_put_u32(skb, TCA_SAMPLE_TRUNC_SIZE, s->trunc_size)) in tcf_sample_dump()
239 if (nla_put_u32(skb, TCA_SAMPLE_PSAMPLE_GROUP, s->psample_group_num)) in tcf_sample_dump()
241 spin_unlock_bh(&s->tcf_lock); in tcf_sample_dump()
246 spin_unlock_bh(&s->tcf_lock); in tcf_sample_dump()
279 struct tcf_sample *s = to_sample(a); in tcf_sample_get_group() local
282 group = rcu_dereference_protected(s->psample_group, in tcf_sample_get_group()
283 lockdep_is_held(&s->tcf_lock)); in tcf_sample_get_group()