Lines Matching refs:prog

39 	struct tcf_bpf *prog = act->priv;  in tcf_bpf()  local
47 tcf_lastuse_update(&prog->tcf_tm); in tcf_bpf()
48 bstats_cpu_update(this_cpu_ptr(prog->common.cpu_bstats), skb); in tcf_bpf()
51 filter = rcu_dereference(prog->filter); in tcf_bpf()
80 qstats_drop_inc(this_cpu_ptr(prog->common.cpu_qstats)); in tcf_bpf()
83 action = prog->tcf_action; in tcf_bpf()
93 static bool tcf_bpf_is_ebpf(const struct tcf_bpf *prog) in tcf_bpf_is_ebpf() argument
95 return !prog->bpf_ops; in tcf_bpf_is_ebpf()
98 static int tcf_bpf_dump_bpf_info(const struct tcf_bpf *prog, in tcf_bpf_dump_bpf_info() argument
103 if (nla_put_u16(skb, TCA_ACT_BPF_OPS_LEN, prog->bpf_num_ops)) in tcf_bpf_dump_bpf_info()
106 nla = nla_reserve(skb, TCA_ACT_BPF_OPS, prog->bpf_num_ops * in tcf_bpf_dump_bpf_info()
111 memcpy(nla_data(nla), prog->bpf_ops, nla_len(nla)); in tcf_bpf_dump_bpf_info()
116 static int tcf_bpf_dump_ebpf_info(const struct tcf_bpf *prog, in tcf_bpf_dump_ebpf_info() argument
119 if (nla_put_u32(skb, TCA_ACT_BPF_FD, prog->bpf_fd)) in tcf_bpf_dump_ebpf_info()
122 if (prog->bpf_name && in tcf_bpf_dump_ebpf_info()
123 nla_put_string(skb, TCA_ACT_BPF_NAME, prog->bpf_name)) in tcf_bpf_dump_ebpf_info()
133 struct tcf_bpf *prog = act->priv; in tcf_bpf_dump() local
135 .index = prog->tcf_index, in tcf_bpf_dump()
136 .refcnt = prog->tcf_refcnt - ref, in tcf_bpf_dump()
137 .bindcnt = prog->tcf_bindcnt - bind, in tcf_bpf_dump()
138 .action = prog->tcf_action, in tcf_bpf_dump()
146 if (tcf_bpf_is_ebpf(prog)) in tcf_bpf_dump()
147 ret = tcf_bpf_dump_ebpf_info(prog, skb); in tcf_bpf_dump()
149 ret = tcf_bpf_dump_bpf_info(prog, skb); in tcf_bpf_dump()
153 tm.install = jiffies_to_clock_t(jiffies - prog->tcf_tm.install); in tcf_bpf_dump()
154 tm.lastuse = jiffies_to_clock_t(jiffies - prog->tcf_tm.lastuse); in tcf_bpf_dump()
155 tm.expires = jiffies_to_clock_t(prog->tcf_tm.expires); in tcf_bpf_dump()
261 static void tcf_bpf_prog_fill_cfg(const struct tcf_bpf *prog, in tcf_bpf_prog_fill_cfg() argument
264 cfg->is_ebpf = tcf_bpf_is_ebpf(prog); in tcf_bpf_prog_fill_cfg()
268 cfg->filter = rcu_dereference_protected(prog->filter, 1); in tcf_bpf_prog_fill_cfg()
270 cfg->bpf_ops = prog->bpf_ops; in tcf_bpf_prog_fill_cfg()
271 cfg->bpf_name = prog->bpf_name; in tcf_bpf_prog_fill_cfg()
281 struct tcf_bpf *prog; in tcf_bpf_init() local
299 sizeof(*prog), bind, true); in tcf_bpf_init()
329 prog = to_bpf(act); in tcf_bpf_init()
333 tcf_bpf_prog_fill_cfg(prog, &old); in tcf_bpf_init()
335 prog->bpf_ops = cfg.bpf_ops; in tcf_bpf_init()
336 prog->bpf_name = cfg.bpf_name; in tcf_bpf_init()
339 prog->bpf_num_ops = cfg.bpf_num_ops; in tcf_bpf_init()
341 prog->bpf_fd = cfg.bpf_fd; in tcf_bpf_init()
343 prog->tcf_action = parm->action; in tcf_bpf_init()
344 rcu_assign_pointer(prog->filter, cfg.filter); in tcf_bpf_init()