Lines Matching defs:gact

26 static int gact_net_rand(struct tcf_gact *gact)
29 if (get_random_u32_below(gact->tcfg_pval))
30 return gact->tcf_action;
31 return gact->tcfg_paction;
34 static int gact_determ(struct tcf_gact *gact)
36 u32 pack = atomic_inc_return(&gact->packets);
39 if (pack % gact->tcfg_pval)
40 return gact->tcf_action;
41 return gact->tcfg_paction;
44 typedef int (*g_rand)(struct tcf_gact *gact);
63 struct tcf_gact *gact;
123 gact = to_gact(*a);
125 spin_lock_bh(&gact->tcf_lock);
129 gact->tcfg_paction = p_parm->paction;
130 gact->tcfg_pval = max_t(u16, 1, p_parm->pval);
135 gact->tcfg_ptype = p_parm->ptype;
138 spin_unlock_bh(&gact->tcf_lock);
153 struct tcf_gact *gact = to_gact(a);
154 int action = READ_ONCE(gact->tcf_action);
158 u32 ptype = READ_ONCE(gact->tcfg_ptype);
161 action = gact_rand[ptype](gact);
164 tcf_action_update_bstats(&gact->common, skb);
166 tcf_action_inc_drop_qstats(&gact->common);
168 tcf_lastuse_update(&gact->tcf_tm);
176 struct tcf_gact *gact = to_gact(a);
177 int action = READ_ONCE(gact->tcf_action);
178 struct tcf_t *tm = &gact->tcf_tm;
189 struct tcf_gact *gact = to_gact(a);
191 .index = gact->tcf_index,
192 .refcnt = refcount_read(&gact->tcf_refcnt) - ref,
193 .bindcnt = atomic_read(&gact->tcf_bindcnt) - bind,
197 spin_lock_bh(&gact->tcf_lock);
198 opt.action = gact->tcf_action;
202 if (gact->tcfg_ptype) {
204 .paction = gact->tcfg_paction,
205 .pval = gact->tcfg_pval,
206 .ptype = gact->tcfg_ptype,
213 tcf_tm_dump(&t, &gact->tcf_tm);
216 spin_unlock_bh(&gact->tcf_lock);
221 spin_unlock_bh(&gact->tcf_lock);
288 .kind = "gact",