Home
last modified time | relevance | path

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

1234567891011

/linux/include/linux/
H A Dbpf.h39 struct bpf_prog;
135 void (*map_poke_run)(struct bpf_map *map, u32 key, struct bpf_prog *old,
136 struct bpf_prog *new);
965 bool (*allowed)(const struct bpf_prog *prog);
1093 int (*test_run)(struct bpf_prog *prog, const union bpf_attr *kattr,
1102 const struct bpf_prog *prog);
1108 const struct bpf_prog *prog,
1111 const struct bpf_prog *prog);
1112 int (*gen_epilogue)(struct bpf_insn *insn, const struct bpf_prog *prog,
1119 struct bpf_prog *pro
1775 struct bpf_prog { global() struct
1793 typebpf_prog global() argument
1801 statsbpf_prog global() argument
1805 auxbpf_prog global() argument
1827 __anone9e50916130abpf_prog global() argument
[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()
/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()
81 BTF_ID_LIST_SINGLE(btf_bpf_prog_id, struct, bpf_prog)
H A Dcore.c100 struct bpf_prog *bpf_prog_alloc_no_stats(unsigned int size, gfp_t gfp_extra_flags) in bpf_prog_alloc_no_stats()
104 struct bpf_prog *fp; in bpf_prog_alloc_no_stats()
150 struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags) in bpf_prog_alloc()
153 struct bpf_prog *prog; in bpf_prog_alloc()
178 int bpf_prog_alloc_jited_linfo(struct bpf_prog *prog) in bpf_prog_alloc_jited_linfo()
192 void bpf_prog_jit_attempt_done(struct bpf_prog *prog) in bpf_prog_jit_attempt_done()
228 void bpf_prog_fill_jited_linfo(struct bpf_prog *prog, in bpf_prog_fill_jited_linfo()
257 struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size, in bpf_prog_realloc()
261 struct bpf_prog *fp; in bpf_prog_realloc()
287 void __bpf_prog_free(struct bpf_prog *fp) in __bpf_prog_free()
[all …]
H A Dcgroup.c68 const struct bpf_prog *prog; in bpf_prog_run_array_cg()
98 const struct bpf_prog *shim_prog; in __cgroup_bpf_run_lsm_sock()
107 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_sock()
120 const struct bpf_prog *shim_prog; in __cgroup_bpf_run_lsm_socket()
129 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_socket()
142 const struct bpf_prog *shim_prog; in __cgroup_bpf_run_lsm_current()
147 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_current()
238 struct bpf_prog *prog, in bpf_cgroup_storages_alloc()
372 static struct bpf_prog *prog_list_prog(struct bpf_prog_list *pl) in prog_list_prog()
623 struct bpf_prog *prog, in find_attach_entry()
[all …]
H A Dtrampoline.c137 bool bpf_prog_has_trampoline(const struct bpf_prog *prog) in bpf_prog_has_trampoline()
725 static enum bpf_tramp_prog_type bpf_attach_type_to_tramp(struct bpf_prog *prog) in bpf_attach_type_to_tramp()
749 static int bpf_freplace_check_tgt_prog(struct bpf_prog *tgt_prog) in bpf_freplace_check_tgt_prog()
769 struct bpf_prog *tgt_prog) in __bpf_trampoline_link_prog()
843 struct bpf_prog *tgt_prog) in bpf_trampoline_link_prog()
855 struct bpf_prog *tgt_prog) in __bpf_trampoline_unlink_prog()
886 struct bpf_prog *tgt_prog) in bpf_trampoline_unlink_prog()
923 static struct bpf_shim_tramp_link *cgroup_shim_alloc(const struct bpf_prog *prog, in cgroup_shim_alloc()
929 struct bpf_prog *p; in cgroup_shim_alloc()
967 struct bpf_prog *p = link->link.prog; in cgroup_shim_find()
[all …]
H A Doffload.c99 static void __bpf_prog_offload_destroy(struct bpf_prog *prog) in __bpf_prog_offload_destroy()
179 static int __bpf_prog_dev_bound_init(struct bpf_prog *prog, struct net_device *netdev) in __bpf_prog_dev_bound_init()
219 int bpf_prog_dev_bound_init(struct bpf_prog *prog, union bpf_attr *attr) in bpf_prog_dev_bound_init()
261 int bpf_prog_dev_bound_inherit(struct bpf_prog *new_prog, struct bpf_prog *old_prog) in bpf_prog_dev_bound_inherit()
287 int bpf_prog_offload_verifier_prep(struct bpf_prog *prog) in bpf_prog_offload_verifier_prep()
372 void bpf_prog_dev_bound_destroy(struct bpf_prog *prog) in bpf_prog_dev_bound_destroy()
393 static int bpf_prog_offload_translate(struct bpf_prog *prog) in bpf_prog_offload_translate()
414 int bpf_prog_offload_compile(struct bpf_prog *prog) in bpf_prog_offload_compile()
422 struct bpf_prog *prog;
453 struct bpf_prog *prog) in bpf_prog_offload_info_fill()
[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()
H A Ddevmap.c62 struct bpf_prog *xdp_prog;
70 struct bpf_prog *xdp_prog;
121 valsize != offsetofend(struct bpf_devmap_val, bpf_prog.fd)) || in dev_map_alloc_check()
336 static int dev_map_bpf_prog_run(struct bpf_prog *xdp_prog, in dev_map_bpf_prog_run()
464 struct net_device *dev_rx, struct bpf_prog *xdp_prog) in bq_enqueue()
496 struct bpf_prog *xdp_prog) in __xdp_enqueue()
701 const struct bpf_prog *xdp_prog) in dev_map_generic_redirect()
724 const struct bpf_prog *xdp_prog) in dev_map_redirect_clone()
743 const struct bpf_prog *xdp_prog, in dev_map_redirect_multi()
888 struct bpf_prog *prog = NULL; in __dev_map_alloc_node()
[all …]
/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.h163 int tcx_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog);
164 int tcx_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
165 int tcx_prog_detach(const union bpf_attr *attr, struct bpf_prog *prog);
179 struct bpf_prog *prog) in tcx_prog_attach()
185 struct bpf_prog *prog) in tcx_link_attach()
191 struct bpf_prog *prog) in tcx_prog_detach()
/linux/tools/testing/selftests/bpf/prog_tests/
H A Dxdp_cpumap_attach.c46 val.bpf_prog.fd = prog_fd; in test_xdp_with_cpumap_helpers()
52 ASSERT_EQ(info.id, val.bpf_prog.id, "Match program id to cpumap entry prog_id"); in test_xdp_with_cpumap_helpers()
80 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_prog); in test_xdp_with_cpumap_helpers()
88 val.bpf_prog.fd = bad_fd; in test_xdp_with_cpumap_helpers()
104 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_cm_frags); in test_xdp_with_cpumap_frags_helpers()
135 val.bpf_prog.fd = frags_prog_fd; in test_xdp_with_cpumap_frags_helpers()
141 ASSERT_EQ(info.id, val.bpf_prog.id,
149 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_cm); in test_xdp_cpumap_attach()
H A Dxdp_devmap_attach.c51 val.bpf_prog.fd = dm_fd; in test_xdp_with_devmap_helpers()
57 ASSERT_EQ(info.id, val.bpf_prog.id, "Match program id to devmap entry prog_id"); in test_xdp_with_devmap_helpers()
81 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_prog); in test_xdp_with_devmap_helpers()
90 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_dm_frags); in test_xdp_with_devmap_helpers()
155 val.bpf_prog.fd = dm_fd_frags; in test_xdp_with_devmap_helpers_veth()
161 ASSERT_EQ(info.id, val.bpf_prog.id, in test_xdp_with_devmap_helpers_veth()
169 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_dm); in test_xdp_with_devmap_helpers_veth()
218 val.bpf_prog.fd = dm_fd; in test_xdp_with_devmap_helpers_veth()
224 ASSERT_EQ(info.id, val.bpf_prog.id, "Match program id to devmap entry prog_id"); in test_xdp_with_devmap_helpers_veth()
H A Dcgroup_storage.c54 skel->links.bpf_prog = in test_cgroup_storage()
55 bpf_program__attach_cgroup(skel->progs.bpf_prog, cgroup_fd); in test_cgroup_storage()
56 if (!ASSERT_OK_PTR(skel->links.bpf_prog, "attach program")) in test_cgroup_storage()
/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/tools/testing/selftests/net/
H A Dpsock_lib.h61 struct sock_fprog bpf_prog; in pair_udp_setfilter() local
63 bpf_prog.filter = bpf_filter; in pair_udp_setfilter()
64 bpf_prog.len = ARRAY_SIZE(bpf_filter); in pair_udp_setfilter()
66 if (setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, &bpf_prog, in pair_udp_setfilter()
67 sizeof(bpf_prog))) { in pair_udp_setfilter()
/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()
293 const struct bpf_prog *prog, in nf_is_valid_access()
324 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/arch/um/drivers/
H A Dvector_user.c862 struct sock_fprog *bpf_prog; in uml_vector_default_bpf() local
864 bpf_prog = uml_kmalloc(sizeof(struct sock_fprog), UM_GFP_KERNEL); in uml_vector_default_bpf()
865 if (bpf_prog) { in uml_vector_default_bpf()
866 bpf_prog->len = DEFAULT_BPF_LEN; in uml_vector_default_bpf()
867 bpf_prog->filter = NULL; in uml_vector_default_bpf()
874 bpf_prog->filter = bpf; in uml_vector_default_bpf()
888 kfree(bpf_prog); in uml_vector_default_bpf()
889 bpf_prog = NULL; in uml_vector_default_bpf()
891 return bpf_prog; in uml_vector_default_bpf()
899 struct sock_fprog *bpf_prog; in uml_vector_user_bpf() local
[all …]
/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/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/arch/x86/net/
H A Dbpf_jit_comp.c726 static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog, in emit_bpf_tail_call_indirect() argument
778 if (bpf_prog->aux->exception_boundary) { in emit_bpf_tail_call_indirect()
783 if (bpf_arena_get_kern_vm_start(bpf_prog->aux->arena)) in emit_bpf_tail_call_indirect()
799 offsetof(struct bpf_prog, bpf_func)); in emit_bpf_tail_call_indirect()
814 static void emit_bpf_tail_call_direct(struct bpf_prog *bpf_prog, in emit_bpf_tail_call_direct() argument
845 if (bpf_prog->aux->exception_boundary) { in emit_bpf_tail_call_direct()
850 if (bpf_arena_get_kern_vm_start(bpf_prog->aux->arena)) in emit_bpf_tail_call_direct()
871 static void bpf_tail_call_direct_fixup(struct bpf_prog *prog) in bpf_tail_call_direct_fixup()
875 struct bpf_prog *target; in bpf_tail_call_direct_fixup()
1611 struct bpf_prog *bpf_prog) in emit_spectre_bhb_barrier() argument
[all …]
/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()
/linux/samples/bpf/
H A Dxdp_sample.bpf.c97 const struct bpf_prog *xdp, const void *tgt, int err, in BPF_PROG()
105 const struct bpf_prog *xdp, const void *tgt, int err, in BPF_PROG()
113 const struct bpf_prog *xdp, const void *tgt, int err, in BPF_PROG()
121 const struct bpf_prog *xdp, const void *tgt, int err, in BPF_PROG()
182 const struct bpf_prog *xdp, u32 act) in BPF_PROG()
/linux/arch/riscv/net/
H A Dbpf_jit_core.c21 const struct bpf_prog *prog = ctx->prog; in build_body()
44 struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) in bpf_int_jit_compile()
48 struct bpf_prog *tmp, *orig_prog = prog; in bpf_int_jit_compile()
247 void bpf_jit_free(struct bpf_prog *prog) in bpf_jit_free()

1234567891011