Home
last modified time | relevance | path

Searched refs:bpf_prog (Results 1 – 25 of 261) sorted by relevance

1234567891011

/linux/include/linux/
H A Dbpf.h37 struct bpf_prog;
132 void (*map_poke_run)(struct bpf_map *map, u32 key, struct bpf_prog *old,
133 struct bpf_prog *new);
858 bool (*allowed)(const struct bpf_prog *prog);
969 int (*test_run)(struct bpf_prog *prog, const union bpf_attr *kattr,
978 const struct bpf_prog *prog);
984 const struct bpf_prog *prog,
987 const struct bpf_prog *prog);
988 int (*gen_epilogue)(struct bpf_insn *insn, const struct bpf_prog *prog,
995 struct bpf_prog *prog, u32 *target_size);
[all …]
H A Dbpf_lsm.h29 const struct bpf_prog *prog);
32 bool bpf_lsm_is_trusted(const struct bpf_prog *prog);
47 void bpf_lsm_find_cgroup_shim(const struct bpf_prog *prog, bpf_func_t *bpf_func);
49 int bpf_lsm_get_retval_range(const struct bpf_prog *prog,
58 static inline bool bpf_lsm_is_trusted(const struct bpf_prog *prog) in bpf_lsm_is_trusted()
64 const struct bpf_prog *prog) in bpf_lsm_verify_prog()
79 static inline void bpf_lsm_find_cgroup_shim(const struct bpf_prog *prog, in bpf_lsm_find_cgroup_shim()
84 static inline int bpf_lsm_get_retval_range(const struct bpf_prog *prog, in bpf_lsm_get_retval_range()
H A Dfilter.h665 struct bpf_prog *prog;
680 static __always_inline u32 __bpf_prog_run(const struct bpf_prog *prog, in __bpf_prog_run()
706 static __always_inline u32 bpf_prog_run(const struct bpf_prog *prog, const void *ctx) in bpf_prog_run()
719 static inline u32 bpf_prog_run_pin_on_cpu(const struct bpf_prog *prog, in bpf_prog_run_pin_on_cpu()
925 static inline u32 __bpf_prog_run_save_cb(const struct bpf_prog *prog, in __bpf_prog_run_save_cb()
946 static inline u32 bpf_prog_run_save_cb(const struct bpf_prog *prog, in bpf_prog_run_save_cb()
957 static inline u32 bpf_prog_run_clear_cb(const struct bpf_prog *prog, in bpf_prog_run_clear_cb()
976 void bpf_prog_change_xdp(struct bpf_prog *prev_prog, struct bpf_prog *prog);
978 static inline u32 bpf_prog_insn_size(const struct bpf_prog *prog) in bpf_prog_insn_size()
983 static inline u32 bpf_prog_tag_scratch_size(const struct bpf_prog *prog) in bpf_prog_tag_scratch_size()
[all …]
H A Dbpf-netns.h26 struct bpf_prog;
32 struct bpf_prog *prog);
35 struct bpf_prog *prog);
44 struct bpf_prog *prog) in netns_bpf_prog_attach()
56 struct bpf_prog *prog) in netns_bpf_link_create()
H A Dbpf_mprog.h132 struct bpf_prog *prog;
148 struct bpf_prog *ref;
154 struct bpf_prog *prog;
203 struct bpf_prog *prog) in bpf_mprog_exists()
206 const struct bpf_prog *tmp; in bpf_mprog_exists()
322 struct bpf_prog *prog_new, struct bpf_link *link,
323 struct bpf_prog *prog_old,
328 struct bpf_prog *prog, struct bpf_link *link,
H A Dbpf-cgroup.h19 struct bpf_prog;
111 struct bpf_prog *prog;
170 struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(struct bpf_prog *prog,
420 enum bpf_prog_type ptype, struct bpf_prog *prog);
423 int cgroup_bpf_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
428 cgroup_common_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog);
430 cgroup_current_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog);
438 struct bpf_prog *prog) in cgroup_bpf_prog_attach()
450 struct bpf_prog *prog) in cgroup_bpf_link_attach()
462 cgroup_common_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in cgroup_common_func_proto()
[all …]
/linux/drivers/net/ethernet/microsoft/mana/
H A Dmana_bpf.c84 struct bpf_prog *prog; in mana_run_xdp()
88 prog = rcu_dereference(rxq->bpf_prog); in mana_run_xdp()
136 struct bpf_prog *mana_xdp_get(struct mana_port_context *apc) in mana_xdp_get()
140 return apc->bpf_prog; in mana_xdp_get()
143 static struct bpf_prog *mana_chn_xdp_get(struct mana_port_context *apc) in mana_chn_xdp_get()
145 return rtnl_dereference(apc->rxqs[0]->bpf_prog); in mana_chn_xdp_get()
149 void mana_chn_setxdp(struct mana_port_context *apc, struct bpf_prog *prog) in mana_chn_setxdp()
151 struct bpf_prog *old_prog = mana_chn_xdp_get(apc); in mana_chn_setxdp()
164 rcu_assign_pointer(apc->rxqs[i]->bpf_prog, prog); in mana_chn_setxdp()
171 static int mana_xdp_set(struct net_device *ndev, struct bpf_prog *prog, in mana_xdp_set()
[all …]
/linux/kernel/bpf/
H A Dprog_iter.c16 struct bpf_prog *prog; in bpf_prog_seq_start()
33 bpf_prog_put((struct bpf_prog *)v); in bpf_prog_seq_next()
39 __bpf_md_ptr(struct bpf_prog *, prog);
42 DEFINE_BPF_ITER_FUNC(bpf_prog, struct bpf_iter_meta *meta, struct bpf_prog *prog) in DEFINE_BPF_ITER_FUNC() argument
48 struct bpf_prog *prog; in DEFINE_BPF_ITER_FUNC()
71 bpf_prog_put((struct bpf_prog *)v); in bpf_prog_seq_stop()
82 BTF_ID(struct, bpf_prog)
H A Dtrampoline.c107 bool bpf_prog_has_trampoline(const struct bpf_prog *prog) in bpf_prog_has_trampoline()
504 static enum bpf_tramp_prog_type bpf_attach_type_to_tramp(struct bpf_prog *prog) in bpf_attach_type_to_tramp()
639 static struct bpf_shim_tramp_link *cgroup_shim_alloc(const struct bpf_prog *prog, in cgroup_shim_alloc()
644 struct bpf_prog *p; in cgroup_shim_alloc()
682 struct bpf_prog *p = link->link.prog; in cgroup_shim_find()
692 int bpf_trampoline_link_cgroup_shim(struct bpf_prog *prog, in bpf_trampoline_link_cgroup_shim()
758 void bpf_trampoline_unlink_cgroup_shim(struct bpf_prog *prog) in bpf_trampoline_unlink_cgroup_shim()
861 static u64 notrace __bpf_prog_enter_recur(struct bpf_prog *prog, struct bpf_tramp_run_ctx *run_ctx) in __bpf_prog_enter_recur()
876 static void notrace update_prog_stats(struct bpf_prog *prog, in update_prog_stats()
899 static void notrace __bpf_prog_exit_recur(struct bpf_prog *prog, u64 start, in __bpf_prog_exit_recur()
[all …]
H A Ddispatcher.c26 struct bpf_dispatcher *d, struct bpf_prog *prog) in bpf_dispatcher_find_prog()
44 struct bpf_prog *prog) in bpf_dispatcher_add_prog()
69 struct bpf_prog *prog) in bpf_dispatcher_remove_prog()
137 void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from, in bpf_dispatcher_change_prog()
138 struct bpf_prog *to) in bpf_dispatcher_change_prog()
H A Doffload.c108 static void __bpf_prog_offload_destroy(struct bpf_prog *prog) in __bpf_prog_offload_destroy()
188 static int __bpf_prog_dev_bound_init(struct bpf_prog *prog, struct net_device *netdev) in __bpf_prog_dev_bound_init()
228 int bpf_prog_dev_bound_init(struct bpf_prog *prog, union bpf_attr *attr) in bpf_prog_dev_bound_init()
270 int bpf_prog_dev_bound_inherit(struct bpf_prog *new_prog, struct bpf_prog *old_prog) in bpf_prog_dev_bound_inherit()
296 int bpf_prog_offload_verifier_prep(struct bpf_prog *prog) in bpf_prog_offload_verifier_prep()
381 void bpf_prog_dev_bound_destroy(struct bpf_prog *prog) in bpf_prog_dev_bound_destroy()
402 static int bpf_prog_offload_translate(struct bpf_prog *prog) in bpf_prog_offload_translate()
423 int bpf_prog_offload_compile(struct bpf_prog *prog) in bpf_prog_offload_compile()
431 struct bpf_prog *prog;
462 struct bpf_prog *prog) in bpf_prog_offload_info_fill()
[all …]
H A Dcgroup.c54 const struct bpf_prog *prog; in bpf_prog_run_array_cg()
86 const struct bpf_prog *shim_prog; in __cgroup_bpf_run_lsm_sock()
95 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_sock()
108 const struct bpf_prog *shim_prog; in __cgroup_bpf_run_lsm_socket()
117 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_socket()
130 const struct bpf_prog *shim_prog; in __cgroup_bpf_run_lsm_current()
135 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_current()
226 struct bpf_prog *prog, in bpf_cgroup_storages_alloc()
360 static struct bpf_prog *prog_list_prog(struct bpf_prog_list *pl) in prog_list_prog()
574 struct bpf_prog *prog, in find_attach_entry()
[all …]
H A Dcore.c97 struct bpf_prog *bpf_prog_alloc_no_stats(unsigned int size, gfp_t gfp_extra_flags) in bpf_prog_alloc_no_stats()
101 struct bpf_prog *fp; in bpf_prog_alloc_no_stats()
139 struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags) in bpf_prog_alloc()
142 struct bpf_prog *prog; in bpf_prog_alloc()
167 int bpf_prog_alloc_jited_linfo(struct bpf_prog *prog) in bpf_prog_alloc_jited_linfo()
181 void bpf_prog_jit_attempt_done(struct bpf_prog *prog) in bpf_prog_jit_attempt_done()
217 void bpf_prog_fill_jited_linfo(struct bpf_prog *prog, in bpf_prog_fill_jited_linfo()
246 struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size, in bpf_prog_realloc()
250 struct bpf_prog *fp; in bpf_prog_realloc()
276 void __bpf_prog_free(struct bpf_prog *fp) in __bpf_prog_free()
[all …]
H A Dtcx.c10 int tcx_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog) in tcx_prog_attach()
15 struct bpf_prog *replace_prog = NULL; in tcx_prog_attach()
59 int tcx_prog_detach(const union bpf_attr *attr, struct bpf_prog *prog) in tcx_prog_detach()
203 static int tcx_link_update(struct bpf_link *link, struct bpf_prog *nprog, in tcx_link_update()
204 struct bpf_prog *oprog) in tcx_link_update()
302 struct bpf_prog *prog) in tcx_link_init()
310 int tcx_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) in tcx_link_attach()
/linux/include/net/
H A Dnetkit.h9 int netkit_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog);
10 int netkit_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
11 int netkit_prog_detach(const union bpf_attr *attr, struct bpf_prog *prog);
16 struct bpf_prog *prog) in netkit_prog_attach()
22 struct bpf_prog *prog) in netkit_link_attach()
28 struct bpf_prog *prog) in netkit_prog_detach()
H A Dtcx.h164 int tcx_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog);
165 int tcx_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
166 int tcx_prog_detach(const union bpf_attr *attr, struct bpf_prog *prog);
180 struct bpf_prog *prog) in tcx_prog_attach()
186 struct bpf_prog *prog) in tcx_link_attach()
192 struct bpf_prog *prog) in tcx_prog_detach()
/linux/tools/testing/selftests/bpf/prog_tests/
H A Dxdp_cpumap_attach.c40 val.bpf_prog.fd = prog_fd; in test_xdp_with_cpumap_helpers()
46 ASSERT_EQ(info.id, val.bpf_prog.id, "Match program id to cpumap entry prog_id"); in test_xdp_with_cpumap_helpers()
54 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_prog); in test_xdp_with_cpumap_helpers()
63 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_cm_frags); in test_xdp_with_cpumap_helpers()
92 val.bpf_prog.fd = frags_prog_fd; in test_xdp_with_cpumap_frags_helpers()
98 ASSERT_EQ(info.id, val.bpf_prog.id, in test_xdp_with_cpumap_frags_helpers()
106 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_cm); in test_xdp_with_cpumap_frags_helpers()
H A Dxdp_devmap_attach.c50 val.bpf_prog.fd = dm_fd; in test_xdp_with_devmap_helpers()
56 ASSERT_EQ(info.id, val.bpf_prog.id, "Match program id to devmap entry prog_id"); in test_xdp_with_devmap_helpers()
80 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_prog); in test_xdp_with_devmap_helpers()
89 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_dm_frags); in test_xdp_with_devmap_helpers()
131 val.bpf_prog.fd = dm_fd_frags; in test_xdp_with_devmap_frags_helpers()
137 ASSERT_EQ(info.id, val.bpf_prog.id, in test_xdp_with_devmap_frags_helpers()
145 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_dm); in test_xdp_with_devmap_frags_helpers()
194 val.bpf_prog.fd = dm_fd; in test_xdp_with_devmap_helpers_veth()
200 ASSERT_EQ(info.id, val.bpf_prog.id, "Match program id to devmap entry prog_id"); in test_xdp_with_devmap_helpers_veth()
/linux/tools/testing/selftests/net/
H A Dpsock_lib.h65 struct sock_fprog bpf_prog; in pair_udp_setfilter() local
67 bpf_prog.filter = bpf_filter; in pair_udp_setfilter()
68 bpf_prog.len = ARRAY_SIZE(bpf_filter); in pair_udp_setfilter()
70 if (setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, &bpf_prog, in pair_udp_setfilter()
71 sizeof(bpf_prog))) { in pair_udp_setfilter()
/linux/drivers/net/hyperv/
H A Dnetvsc_bpf.c31 struct bpf_prog *prog; in netvsc_run_xdp()
38 prog = rcu_dereference(nvchan->bpf_prog); in netvsc_run_xdp()
119 struct bpf_prog *netvsc_xdp_get(struct netvsc_device *nvdev) in netvsc_xdp_get()
121 return rtnl_dereference(nvdev->chan_table[0].bpf_prog); in netvsc_xdp_get()
124 int netvsc_xdp_set(struct net_device *dev, struct bpf_prog *prog, in netvsc_xdp_set()
128 struct bpf_prog *old_prog; in netvsc_xdp_set()
156 rcu_assign_pointer(nvdev->chan_table[i].bpf_prog, prog); in netvsc_xdp_set()
165 int netvsc_vf_setxdp(struct net_device *vf_netdev, struct bpf_prog *prog) in netvsc_vf_setxdp()
/linux/include/uapi/linux/netfilter/
H A Dxt_bpf.h12 struct bpf_prog;
19 struct bpf_prog *filter __attribute__((aligned(8)));
39 struct bpf_prog *filter __attribute__((aligned(8)));
/linux/net/netfilter/
H A Dnf_bpf_link.c11 static unsigned int nf_hook_run_bpf(void *bpf_prog, struct sk_buff *skb, in nf_hook_run_bpf() argument
14 const struct bpf_prog *prog = bpf_prog; in nf_hook_run_bpf()
165 static int bpf_nf_link_update(struct bpf_link *link, struct bpf_prog *new_prog, in bpf_nf_link_update()
166 struct bpf_prog *old_prog) in bpf_nf_link_update()
210 int bpf_nf_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) in bpf_nf_link_attach()
292 const struct bpf_prog *prog, in nf_is_valid_access()
320 bpf_nf_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in bpf_nf_func_proto()
H A Dxt_bpf.c25 struct bpf_prog **ret) in __bpf_mt_check_bytecode()
43 static int __bpf_mt_check_fd(int fd, struct bpf_prog **ret) in __bpf_mt_check_fd()
45 struct bpf_prog *prog; in __bpf_mt_check_fd()
55 static int __bpf_mt_check_path(const char *path, struct bpf_prog **ret) in __bpf_mt_check_path()
/linux/kernel/bpf/preload/iterators/
H A Diterators.bpf.c44 struct bpf_prog *dst_prog;
49 struct bpf_prog { struct
55 struct bpf_prog *prog;
103 struct bpf_prog *prog = ctx->prog; in dump_bpf_prog()
/linux/drivers/media/rc/
H A Dbpf-lirc.c83 lirc_mode2_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in lirc_mode2_func_proto()
123 const struct bpf_prog *prog, in lirc_mode2_is_valid_access()
137 static int lirc_bpf_attach(struct rc_dev *rcdev, struct bpf_prog *prog) in lirc_bpf_attach()
175 static int lirc_bpf_detach(struct rc_dev *rcdev, struct bpf_prog *prog) in lirc_bpf_detach()
248 int lirc_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog) in lirc_prog_attach()
269 struct bpf_prog *prog; in lirc_prog_detach()

1234567891011