/linux/include/linux/ |
H A D | bpf.h | 38 struct bpf_prog; 133 void (*map_poke_run)(struct bpf_map *map, u32 key, struct bpf_prog *old, 134 struct bpf_prog *new); 917 bool (*allowed)(const struct bpf_prog *prog); 1044 int (*test_run)(struct bpf_prog *prog, const union bpf_attr *kattr, 1053 const struct bpf_prog *prog); 1059 const struct bpf_prog *prog, 1062 const struct bpf_prog *prog); 1063 int (*gen_epilogue)(struct bpf_insn *insn, const struct bpf_prog *prog, 1070 struct bpf_prog *prog, u32 *target_size); [all …]
|
H A D | filter.h | 682 struct bpf_prog *prog; 697 static __always_inline u32 __bpf_prog_run(const struct bpf_prog *prog, in __bpf_prog_run() 723 static __always_inline u32 bpf_prog_run(const struct bpf_prog *prog, const void *ctx) in bpf_prog_run() 736 static inline u32 bpf_prog_run_pin_on_cpu(const struct bpf_prog *prog, in bpf_prog_run_pin_on_cpu() 942 static inline u32 __bpf_prog_run_save_cb(const struct bpf_prog *prog, in __bpf_prog_run_save_cb() 963 static inline u32 bpf_prog_run_save_cb(const struct bpf_prog *prog, in bpf_prog_run_save_cb() 974 static inline u32 bpf_prog_run_clear_cb(const struct bpf_prog *prog, in bpf_prog_run_clear_cb() 993 void bpf_prog_change_xdp(struct bpf_prog *prev_prog, struct bpf_prog *prog); 995 static inline u32 bpf_prog_insn_size(const struct bpf_prog *prog) in bpf_prog_insn_size() 1000 static inline u32 bpf_prog_tag_scratch_size(const struct bpf_prog *prog) in bpf_prog_tag_scratch_size() [all …]
|
H A D | bpf-netns.h | 26 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 D | bpf_mprog.h | 132 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 D | bpf-cgroup.h | 19 struct bpf_prog; 107 struct bpf_prog *prog; 166 struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(struct bpf_prog *prog, 416 enum bpf_prog_type ptype, struct bpf_prog *prog); 419 int cgroup_bpf_link_attach(const union bpf_attr *attr, struct bpf_prog *prog); 424 cgroup_common_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog); 434 struct bpf_prog *prog) in cgroup_bpf_prog_attach() 446 struct bpf_prog *prog) in cgroup_bpf_link_attach() 458 cgroup_common_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in cgroup_common_func_proto() 466 struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return NULL; } in bpf_cgroup_storage_alloc()
|
/linux/drivers/net/ethernet/microsoft/mana/ |
H A D | mana_bpf.c | 84 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 D | prog_iter.c | 16 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 D | trampoline.c | 107 bool bpf_prog_has_trampoline(const struct bpf_prog *prog) in bpf_prog_has_trampoline() 509 static enum bpf_tramp_prog_type bpf_attach_type_to_tramp(struct bpf_prog *prog) in bpf_attach_type_to_tramp() 531 static int bpf_freplace_check_tgt_prog(struct bpf_prog *tgt_prog) in bpf_freplace_check_tgt_prog() 551 struct bpf_prog *tgt_prog) in __bpf_trampoline_link_prog() 603 struct bpf_prog *tgt_prog) in bpf_trampoline_link_prog() 615 struct bpf_prog *tgt_prog) in __bpf_trampoline_unlink_prog() 638 struct bpf_prog *tgt_prog) in bpf_trampoline_unlink_prog() 675 static struct bpf_shim_tramp_link *cgroup_shim_alloc(const struct bpf_prog *prog, in cgroup_shim_alloc() 681 struct bpf_prog *p; in cgroup_shim_alloc() 719 struct bpf_prog *p = link->link.prog; in cgroup_shim_find() [all …]
|
H A D | core.c | 97 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() 144 struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags) in bpf_prog_alloc() 147 struct bpf_prog *prog; in bpf_prog_alloc() 172 int bpf_prog_alloc_jited_linfo(struct bpf_prog *prog) in bpf_prog_alloc_jited_linfo() 186 void bpf_prog_jit_attempt_done(struct bpf_prog *prog) in bpf_prog_jit_attempt_done() 222 void bpf_prog_fill_jited_linfo(struct bpf_prog *prog, in bpf_prog_fill_jited_linfo() 251 struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size, in bpf_prog_realloc() 255 struct bpf_prog *fp; in bpf_prog_realloc() 281 void __bpf_prog_free(struct bpf_prog *fp) in __bpf_prog_free() [all …]
|
H A D | cgroup.c | 67 const struct bpf_prog *prog; in bpf_prog_run_array_cg() 99 const struct bpf_prog *shim_prog; in __cgroup_bpf_run_lsm_sock() 108 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_sock() 121 const struct bpf_prog *shim_prog; in __cgroup_bpf_run_lsm_socket() 130 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_socket() 143 const struct bpf_prog *shim_prog; in __cgroup_bpf_run_lsm_current() 148 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_current() 239 struct bpf_prog *prog, in bpf_cgroup_storages_alloc() 373 static struct bpf_prog *prog_list_prog(struct bpf_prog_list *pl) in prog_list_prog() 624 struct bpf_prog *prog, in find_attach_entry() [all …]
|
H A D | offload.c | 109 static void __bpf_prog_offload_destroy(struct bpf_prog *prog) in __bpf_prog_offload_destroy() 189 static int __bpf_prog_dev_bound_init(struct bpf_prog *prog, struct net_device *netdev) in __bpf_prog_dev_bound_init() 229 int bpf_prog_dev_bound_init(struct bpf_prog *prog, union bpf_attr *attr) in bpf_prog_dev_bound_init() 271 int bpf_prog_dev_bound_inherit(struct bpf_prog *new_prog, struct bpf_prog *old_prog) in bpf_prog_dev_bound_inherit() 297 int bpf_prog_offload_verifier_prep(struct bpf_prog *prog) in bpf_prog_offload_verifier_prep() 382 void bpf_prog_dev_bound_destroy(struct bpf_prog *prog) in bpf_prog_dev_bound_destroy() 403 static int bpf_prog_offload_translate(struct bpf_prog *prog) in bpf_prog_offload_translate() 424 int bpf_prog_offload_compile(struct bpf_prog *prog) in bpf_prog_offload_compile() 432 struct bpf_prog *prog; 463 struct bpf_prog *prog) in bpf_prog_offload_info_fill() [all …]
|
H A D | tcx.c | 10 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 D | netkit.h | 9 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 D | tcx.h | 163 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 D | xdp_cpumap_attach.c | 46 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() 89 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_cm_frags); in test_xdp_with_cpumap_helpers() 120 val.bpf_prog.fd = frags_prog_fd; in test_xdp_with_cpumap_frags_helpers() 126 ASSERT_EQ(info.id, val.bpf_prog.id, in test_xdp_with_cpumap_frags_helpers() 134 val.bpf_prog.fd = bpf_program__fd(skel->progs.xdp_dummy_cm); in test_xdp_with_cpumap_frags_helpers()
|
H A D | xdp_devmap_attach.c | 50 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 D | psock_lib.h | 65 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 D | netvsc_bpf.c | 31 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/net/netfilter/ |
H A D | nf_bpf_link.c | 11 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 D | xt_bpf.c | 25 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 D | vector_user.c | 862 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 D | xt_bpf.h | 12 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 D | iterators.bpf.c | 44 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 D | bpf_jit_comp.c | 718 static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog, in emit_bpf_tail_call_indirect() argument 770 if (bpf_prog->aux->exception_boundary) { in emit_bpf_tail_call_indirect() 775 if (bpf_arena_get_kern_vm_start(bpf_prog->aux->arena)) in emit_bpf_tail_call_indirect() 791 offsetof(struct bpf_prog, bpf_func)); in emit_bpf_tail_call_indirect() 806 static void emit_bpf_tail_call_direct(struct bpf_prog *bpf_prog, in emit_bpf_tail_call_direct() argument 837 if (bpf_prog->aux->exception_boundary) { in emit_bpf_tail_call_direct() 842 if (bpf_arena_get_kern_vm_start(bpf_prog->aux->arena)) in emit_bpf_tail_call_direct() 863 static void bpf_tail_call_direct_fixup(struct bpf_prog *prog) in bpf_tail_call_direct_fixup() 867 struct bpf_prog *target; in bpf_tail_call_direct_fixup() 1511 struct bpf_prog *bpf_prog) in emit_spectre_bhb_barrier() argument [all …]
|
/linux/drivers/media/rc/ |
H A D | bpf-lirc.c | 83 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()
|