/linux-6.1.9/net/sched/ |
D | cls_bpf.c | 85 struct cls_bpf_prog *prog; in cls_bpf_classify() local 88 list_for_each_entry_rcu(prog, &head->plist, link) { in cls_bpf_classify() 91 qdisc_skb_cb(skb)->tc_classid = prog->res.classid; in cls_bpf_classify() 93 if (tc_skip_sw(prog->gen_flags)) { in cls_bpf_classify() 94 filter_res = prog->exts_integrated ? TC_ACT_UNSPEC : 0; in cls_bpf_classify() 99 filter_res = bpf_prog_run(prog->filter, skb); in cls_bpf_classify() 103 filter_res = bpf_prog_run(prog->filter, skb); in cls_bpf_classify() 108 if (prog->exts_integrated) { in cls_bpf_classify() 110 res->classid = TC_H_MAJ(prog->res.classid) | in cls_bpf_classify() 125 *res = prog->res; in cls_bpf_classify() [all …]
|
D | act_bpf.c | 38 struct tcf_bpf *prog = to_bpf(act); in tcf_bpf_act() local 42 tcf_lastuse_update(&prog->tcf_tm); in tcf_bpf_act() 43 bstats_update(this_cpu_ptr(prog->common.cpu_bstats), skb); in tcf_bpf_act() 45 filter = rcu_dereference(prog->filter); in tcf_bpf_act() 79 qstats_drop_inc(this_cpu_ptr(prog->common.cpu_qstats)); in tcf_bpf_act() 82 action = prog->tcf_action; in tcf_bpf_act() 92 static bool tcf_bpf_is_ebpf(const struct tcf_bpf *prog) in tcf_bpf_is_ebpf() argument 94 return !prog->bpf_ops; in tcf_bpf_is_ebpf() 97 static int tcf_bpf_dump_bpf_info(const struct tcf_bpf *prog, in tcf_bpf_dump_bpf_info() argument 102 if (nla_put_u16(skb, TCA_ACT_BPF_OPS_LEN, prog->bpf_num_ops)) in tcf_bpf_dump_bpf_info() [all …]
|
/linux-6.1.9/arch/x86/net/ |
D | bpf_jit_comp.c | 33 do { prog = emit_code(prog, bytes, len); } while (0) 259 u8 *prog = *pprog; in push_callee_regs() local 269 *pprog = prog; in push_callee_regs() 274 u8 *prog = *pprog; in pop_callee_regs() local 284 *pprog = prog; in pop_callee_regs() 295 u8 *prog = *pprog; in emit_prologue() local 301 memcpy(prog, x86_nops[5], X86_PATCH_SIZE); in emit_prologue() 302 prog += X86_PATCH_SIZE; in emit_prologue() 320 *pprog = prog; in emit_prologue() 325 u8 *prog = *pprog; in emit_patch() local [all …]
|
D | bpf_jit_comp32.c | 65 do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) 209 u8 *prog = *pprog; in emit_ia32_mov_i() local 230 *pprog = prog; in emit_ia32_mov_i() 237 u8 *prog = *pprog; in emit_ia32_mov_r() local 251 *pprog = prog; in emit_ia32_mov_r() 288 u8 *prog = *pprog; in emit_ia32_mul_r() local 314 *pprog = prog; in emit_ia32_mul_r() 321 u8 *prog = *pprog; in emit_ia32_to_le_r64() local 362 *pprog = prog; in emit_ia32_to_le_r64() 369 u8 *prog = *pprog; in emit_ia32_to_be_r64() local [all …]
|
/linux-6.1.9/drivers/clk/at91/ |
D | clk-programmable.c | 35 struct clk_programmable *prog = to_clk_programmable(hw); in clk_programmable_recalc_rate() local 36 const struct clk_programmable_layout *layout = prog->layout; in clk_programmable_recalc_rate() 40 regmap_read(prog->regmap, AT91_PMC_PCKR(prog->id), &pckr); in clk_programmable_recalc_rate() 53 struct clk_programmable *prog = to_clk_programmable(hw); in clk_programmable_determine_rate() local 54 const struct clk_programmable_layout *layout = prog->layout; in clk_programmable_determine_rate() 105 struct clk_programmable *prog = to_clk_programmable(hw); in clk_programmable_set_parent() local 106 const struct clk_programmable_layout *layout = prog->layout; in clk_programmable_set_parent() 113 if (prog->mux_table) in clk_programmable_set_parent() 114 pckr = clk_mux_index_to_val(prog->mux_table, 0, index); in clk_programmable_set_parent() 123 regmap_update_bits(prog->regmap, AT91_PMC_PCKR(prog->id), mask, pckr); in clk_programmable_set_parent() [all …]
|
/linux-6.1.9/arch/riscv/net/ |
D | bpf_jit_core.c | 18 const struct bpf_prog *prog = ctx->prog; in build_body() local 21 for (i = 0; i < prog->len; i++) { in build_body() 22 const struct bpf_insn *insn = &prog->insnsi[i]; in build_body() 42 struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) in bpf_int_jit_compile() argument 46 struct bpf_prog *tmp, *orig_prog = prog; in bpf_int_jit_compile() 51 if (!prog->jit_requested) in bpf_int_jit_compile() 54 tmp = bpf_jit_blind_constants(prog); in bpf_int_jit_compile() 57 if (tmp != prog) { in bpf_int_jit_compile() 59 prog = tmp; in bpf_int_jit_compile() 62 jit_data = prog->aux->jit_data; in bpf_int_jit_compile() [all …]
|
/linux-6.1.9/tools/testing/selftests/bpf/prog_tests/ |
D | tailcalls.c | 13 struct bpf_program *prog; in test_tailcall_1() local 28 prog = bpf_object__find_program_by_name(obj, "entry"); in test_tailcall_1() 29 if (CHECK_FAIL(!prog)) in test_tailcall_1() 32 main_fd = bpf_program__fd(prog); in test_tailcall_1() 47 prog = bpf_object__find_program_by_name(obj, prog_name); in test_tailcall_1() 48 if (CHECK_FAIL(!prog)) in test_tailcall_1() 51 prog_fd = bpf_program__fd(prog); in test_tailcall_1() 77 prog = bpf_object__find_program_by_name(obj, prog_name); in test_tailcall_1() 78 if (CHECK_FAIL(!prog)) in test_tailcall_1() 81 prog_fd = bpf_program__fd(prog); in test_tailcall_1() [all …]
|
D | trampoline_count.c | 15 struct bpf_program *prog; in load_prog() local 28 prog = bpf_object__find_program_by_name(obj, name); in load_prog() 29 if (!ASSERT_OK_PTR(prog, "obj_find_prog")) in load_prog() 32 return prog; in load_prog() 41 struct bpf_program *prog; in serial_test_trampoline_count() local 48 prog = load_prog(file, progs[i % ARRAY_SIZE(progs)], &inst[i]); in serial_test_trampoline_count() 49 if (!prog) in serial_test_trampoline_count() 52 link = bpf_program__attach(prog); in serial_test_trampoline_count() 60 prog = load_prog(file, "fmod_ret_test", &inst[i]); in serial_test_trampoline_count() 61 if (!prog) in serial_test_trampoline_count() [all …]
|
D | trace_ext.c | 24 struct bpf_program *prog; in test_trace_ext() local 42 prog = skel_pkt->progs.test_pkt_md_access; in test_trace_ext() 43 pkt_fd = bpf_program__fd(prog); in test_trace_ext() 51 prog = skel_ext->progs.test_pkt_md_access_new; in test_trace_ext() 52 bpf_program__set_attach_target(prog, pkt_fd, "test_pkt_md_access"); in test_trace_ext() 66 prog = skel_ext->progs.test_pkt_md_access_new; in test_trace_ext() 67 ext_fd = bpf_program__fd(prog); in test_trace_ext() 75 prog = skel_trace->progs.fentry; in test_trace_ext() 76 bpf_program__set_attach_target(prog, ext_fd, "test_pkt_md_access_new"); in test_trace_ext() 79 prog = skel_trace->progs.fexit; in test_trace_ext() [all …]
|
/linux-6.1.9/kernel/bpf/ |
D | syscall.c | 1922 static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog) in find_prog_type() argument 1933 if (!bpf_prog_is_dev_bound(prog->aux)) in find_prog_type() 1934 prog->aux->ops = ops; in find_prog_type() 1936 prog->aux->ops = &bpf_offload_prog_ops; in find_prog_type() 1937 prog->type = type; in find_prog_type() 1952 static void bpf_audit_prog(const struct bpf_prog *prog, unsigned int op) in bpf_audit_prog() argument 1967 prog->aux->id, bpf_audit_str[op]); in bpf_audit_prog() 1971 static int bpf_prog_alloc_id(struct bpf_prog *prog) in bpf_prog_alloc_id() argument 1977 id = idr_alloc_cyclic(&prog_idr, prog, 1, INT_MAX, GFP_ATOMIC); in bpf_prog_alloc_id() 1979 prog->aux->id = id; in bpf_prog_alloc_id() [all …]
|
D | dispatcher.c | 26 struct bpf_dispatcher *d, struct bpf_prog *prog) in bpf_dispatcher_find_prog() argument 31 if (prog == d->progs[i].prog) in bpf_dispatcher_find_prog() 44 struct bpf_prog *prog) in bpf_dispatcher_add_prog() argument 48 if (!prog) in bpf_dispatcher_add_prog() 51 entry = bpf_dispatcher_find_prog(d, prog); in bpf_dispatcher_add_prog() 61 bpf_prog_inc(prog); in bpf_dispatcher_add_prog() 62 entry->prog = prog; in bpf_dispatcher_add_prog() 69 struct bpf_prog *prog) in bpf_dispatcher_remove_prog() argument 73 if (!prog) in bpf_dispatcher_remove_prog() 76 entry = bpf_dispatcher_find_prog(d, prog); in bpf_dispatcher_remove_prog() [all …]
|
D | prog_iter.c | 16 struct bpf_prog *prog; in bpf_prog_seq_start() local 18 prog = bpf_prog_get_curr_or_next(&info->prog_id); in bpf_prog_seq_start() 19 if (!prog) in bpf_prog_seq_start() 24 return prog; in bpf_prog_seq_start() 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() local 52 ctx.prog = v; in DEFINE_BPF_ITER_FUNC() 54 prog = bpf_iter_get_info(&meta, in_stop); in DEFINE_BPF_ITER_FUNC() 55 if (prog) in DEFINE_BPF_ITER_FUNC() [all …]
|
D | bpf_lsm.c | 73 void bpf_lsm_find_cgroup_shim(const struct bpf_prog *prog, in BTF_SET_END() 78 if (btf_type_vlen(prog->aux->attach_func_proto) < 1 || in BTF_SET_END() 80 prog->aux->attach_btf_id)) { in BTF_SET_END() 86 args = btf_params(prog->aux->attach_func_proto); in BTF_SET_END() 99 const struct bpf_prog *prog) in bpf_lsm_verify_prog() argument 101 if (!prog->gpl_compatible) { in bpf_lsm_verify_prog() 107 if (!btf_id_set_contains(&bpf_lsm_hooks, prog->aux->attach_btf_id)) { in bpf_lsm_verify_prog() 109 prog->aux->attach_btf_id, prog->aux->attach_func_name); in bpf_lsm_verify_prog() 144 static bool bpf_ima_inode_hash_allowed(const struct bpf_prog *prog) in bpf_ima_inode_hash_allowed() argument 146 return bpf_lsm_is_sleepable_hook(prog->aux->attach_btf_id); in bpf_ima_inode_hash_allowed() [all …]
|
D | core.c | 109 fp->aux->prog = fp; in bpf_prog_alloc_no_stats() 126 struct bpf_prog *prog; in bpf_prog_alloc() local 129 prog = bpf_prog_alloc_no_stats(size, gfp_extra_flags); in bpf_prog_alloc() 130 if (!prog) in bpf_prog_alloc() 133 prog->stats = alloc_percpu_gfp(struct bpf_prog_stats, gfp_flags); in bpf_prog_alloc() 134 if (!prog->stats) { in bpf_prog_alloc() 135 free_percpu(prog->active); in bpf_prog_alloc() 136 kfree(prog->aux); in bpf_prog_alloc() 137 vfree(prog); in bpf_prog_alloc() 144 pstats = per_cpu_ptr(prog->stats, cpu); in bpf_prog_alloc() [all …]
|
D | offload.c | 80 int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr) in bpf_prog_offload_init() argument 97 offload->prog = prog; in bpf_prog_offload_init() 112 prog->aux->offload = offload; in bpf_prog_offload_init() 127 int bpf_prog_offload_verifier_prep(struct bpf_prog *prog) in bpf_prog_offload_verifier_prep() argument 133 offload = prog->aux->offload; in bpf_prog_offload_verifier_prep() 135 ret = offload->offdev->ops->prepare(prog); in bpf_prog_offload_verifier_prep() 150 offload = env->prog->aux->offload; in bpf_prog_offload_verify_insn() 165 offload = env->prog->aux->offload; in bpf_prog_offload_finalize() 186 offload = env->prog->aux->offload; in bpf_prog_offload_replace_insn() 203 offload = env->prog->aux->offload; in bpf_prog_offload_remove_insns() [all …]
|
D | trampoline.c | 108 bool bpf_prog_has_trampoline(const struct bpf_prog *prog) in bpf_prog_has_trampoline() argument 110 enum bpf_attach_type eatype = prog->expected_attach_type; in bpf_prog_has_trampoline() 111 enum bpf_prog_type ptype = prog->type; in bpf_prog_has_trampoline() 275 *ip_arg |= link->link.prog->call_get_func_ip; in bpf_trampoline_get_progs() 514 static enum bpf_tramp_prog_type bpf_attach_type_to_tramp(struct bpf_prog *prog) in bpf_attach_type_to_tramp() argument 516 switch (prog->expected_attach_type) { in bpf_attach_type_to_tramp() 524 if (!prog->aux->attach_func_proto->type) in bpf_attach_type_to_tramp() 543 kind = bpf_attach_type_to_tramp(link->link.prog); in __bpf_trampoline_link_prog() 557 tr->extension_prog = link->link.prog; in __bpf_trampoline_link_prog() 559 link->link.prog->bpf_func); in __bpf_trampoline_link_prog() [all …]
|
D | bpf_iter.c | 25 struct bpf_prog *prog; member 278 bpf_prog_put(iter_priv->prog); in iter_release() 334 struct bpf_prog *prog) in cache_btf_id() argument 336 tinfo->btf_id = prog->aux->attach_btf_id; in cache_btf_id() 339 bool bpf_iter_prog_supported(struct bpf_prog *prog) in bpf_iter_prog_supported() argument 341 const char *attach_fname = prog->aux->attach_func_name; in bpf_iter_prog_supported() 343 u32 prog_btf_id = prog->aux->attach_btf_id; in bpf_iter_prog_supported() 357 cache_btf_id(iter, prog); in bpf_iter_prog_supported() 365 prog->aux->ctx_arg_info_size = tinfo->reg_info->ctx_arg_info_size; in bpf_iter_prog_supported() 366 prog->aux->ctx_arg_info = tinfo->reg_info->ctx_arg_info; in bpf_iter_prog_supported() [all …]
|
/linux-6.1.9/drivers/net/hyperv/ |
D | netvsc_bpf.c | 31 struct bpf_prog *prog; in netvsc_run_xdp() local 38 prog = rcu_dereference(nvchan->bpf_prog); in netvsc_run_xdp() 40 if (!prog) in netvsc_run_xdp() 61 act = bpf_prog_run_xdp(prog, xdp); in netvsc_run_xdp() 73 if (!xdp_do_redirect(ndev, xdp, prog)) { in netvsc_run_xdp() 95 trace_xdp_exception(ndev, prog, act); in netvsc_run_xdp() 99 bpf_warn_invalid_xdp_action(ndev, prog, act); in netvsc_run_xdp() 124 int netvsc_xdp_set(struct net_device *dev, struct bpf_prog *prog, in netvsc_xdp_set() argument 133 if (!old_prog && !prog) in netvsc_xdp_set() 137 if (prog && buf_max > PAGE_SIZE) { in netvsc_xdp_set() [all …]
|
/linux-6.1.9/tools/lib/bpf/ |
D | libbpf.h | 248 bpf_object__next_program(const struct bpf_object *obj, struct bpf_program *prog); 256 bpf_object__prev_program(const struct bpf_object *obj, struct bpf_program *prog); 258 LIBBPF_API void bpf_program__set_ifindex(struct bpf_program *prog, 261 LIBBPF_API const char *bpf_program__name(const struct bpf_program *prog); 262 LIBBPF_API const char *bpf_program__section_name(const struct bpf_program *prog); 263 LIBBPF_API bool bpf_program__autoload(const struct bpf_program *prog); 264 LIBBPF_API int bpf_program__set_autoload(struct bpf_program *prog, bool autoload); 265 LIBBPF_API bool bpf_program__autoattach(const struct bpf_program *prog); 266 LIBBPF_API void bpf_program__set_autoattach(struct bpf_program *prog, bool autoattach); 290 LIBBPF_API const struct bpf_insn *bpf_program__insns(const struct bpf_program *prog); [all …]
|
D | libbpf.c | 72 static bool prog_is_subprog(const struct bpf_object *obj, const struct bpf_program *prog); 678 void bpf_program__unload(struct bpf_program *prog) in bpf_program__unload() argument 680 if (!prog) in bpf_program__unload() 683 zclose(prog->fd); in bpf_program__unload() 685 zfree(&prog->func_info); in bpf_program__unload() 686 zfree(&prog->line_info); in bpf_program__unload() 689 static void bpf_program__exit(struct bpf_program *prog) in bpf_program__exit() argument 691 if (!prog) in bpf_program__exit() 694 bpf_program__unload(prog); in bpf_program__exit() 695 zfree(&prog->name); in bpf_program__exit() [all …]
|
/linux-6.1.9/drivers/net/ethernet/microsoft/mana/ |
D | mana_bpf.c | 84 struct bpf_prog *prog; in mana_run_xdp() local 88 prog = rcu_dereference(rxq->bpf_prog); in mana_run_xdp() 90 if (!prog) in mana_run_xdp() 96 act = bpf_prog_run_xdp(prog, xdp); in mana_run_xdp() 107 rxq->xdp_rc = xdp_do_redirect(ndev, xdp, prog); in mana_run_xdp() 123 trace_xdp_exception(ndev, prog, act); in mana_run_xdp() 127 bpf_warn_invalid_xdp_action(ndev, prog, act); in mana_run_xdp() 155 void mana_chn_setxdp(struct mana_port_context *apc, struct bpf_prog *prog) in mana_chn_setxdp() argument 163 if (old_prog == prog) in mana_chn_setxdp() 166 if (prog) in mana_chn_setxdp() [all …]
|
/linux-6.1.9/drivers/net/netdevsim/ |
D | bpf.c | 31 struct bpf_prog *prog; member 68 state = env->prog->aux->offload->dev_priv; in nsim_bpf_verify_insn() 72 if (insn_idx == env->prog->len - 1) { in nsim_bpf_verify_insn() 89 return ns->xdp_hw.prog; in nsim_xdp_offload_active() 92 static void nsim_prog_set_loaded(struct bpf_prog *prog, bool loaded) in nsim_prog_set_loaded() argument 96 if (!prog || !prog->aux->offload) in nsim_prog_set_loaded() 99 state = prog->aux->offload->dev_priv; in nsim_prog_set_loaded() 104 nsim_bpf_offload(struct netdevsim *ns, struct bpf_prog *prog, bool oldprog) in nsim_bpf_offload() argument 111 ns->bpf_offloaded = prog; in nsim_bpf_offload() 112 ns->bpf_offloaded_id = prog ? prog->aux->id : 0; in nsim_bpf_offload() [all …]
|
/linux-6.1.9/scripts/ |
D | sphinx-pre-install | 93 foreach my $prog (sort keys %missing) { 94 my $is_optional = $missing{$prog}; 109 print "Warning: better to also install \"$prog\".\n"; 111 print "ERROR: please install \"$prog\", otherwise, build won't work.\n"; 114 if (defined($map{$prog})) { 115 $install .= " " . $map{$prog}; 117 $install .= " " . $prog; 159 my $prog = shift; 177 my $prog = shift; 180 return $prog if findprog($prog); [all …]
|
/linux-6.1.9/drivers/net/ethernet/netronome/nfp/bpf/ |
D | offload.c | 112 struct bpf_prog *prog) in nfp_map_ptrs_record() argument 116 mutex_lock(&prog->aux->used_maps_mutex); in nfp_map_ptrs_record() 120 for (i = 0; i < prog->aux->used_map_cnt; i++) in nfp_map_ptrs_record() 121 if (bpf_map_offload_neutral(prog->aux->used_maps[i])) in nfp_map_ptrs_record() 134 for (i = 0; i < prog->aux->used_map_cnt; i++) in nfp_map_ptrs_record() 135 if (bpf_map_offload_neutral(prog->aux->used_maps[i])) { in nfp_map_ptrs_record() 137 prog->aux->used_maps[i]); in nfp_map_ptrs_record() 146 mutex_unlock(&prog->aux->used_maps_mutex); in nfp_map_ptrs_record() 151 nfp_prog_prepare(struct nfp_prog *nfp_prog, const struct bpf_insn *prog, in nfp_prog_prepare() argument 162 meta->insn = prog[i]; in nfp_prog_prepare() [all …]
|
/linux-6.1.9/samples/bpf/ |
D | tracex5_user.c | 27 struct sock_fprog prog = { in install_accept_all_seccomp() local 31 if (prctl(PR_SET_SECCOMP, 2, &prog)) in install_accept_all_seccomp() 38 struct bpf_program *prog; in main() local 52 prog = bpf_object__find_program_by_name(obj, "bpf_prog1"); in main() 53 if (!prog) { in main() 64 link = bpf_program__attach(prog); in main() 77 bpf_object__for_each_program(prog, obj) { in main() 78 section = bpf_program__section_name(prog); in main() 83 fd = bpf_program__fd(prog); in main()
|