Home
last modified time | relevance | path

Searched refs:prog (Results 1 – 25 of 378) sorted by relevance

12345678910>>...16

/Linux-v5.15/net/sched/
Dcls_bpf.c85 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()
106 if (prog->exts_integrated) { in cls_bpf_classify()
108 res->classid = TC_H_MAJ(prog->res.classid) | in cls_bpf_classify()
123 *res = prog->res; in cls_bpf_classify()
[all …]
Dact_bpf.c39 struct tcf_bpf *prog = to_bpf(act); in tcf_bpf_act() local
43 tcf_lastuse_update(&prog->tcf_tm); in tcf_bpf_act()
44 bstats_cpu_update(this_cpu_ptr(prog->common.cpu_bstats), skb); in tcf_bpf_act()
46 filter = rcu_dereference(prog->filter); in tcf_bpf_act()
78 qstats_drop_inc(this_cpu_ptr(prog->common.cpu_qstats)); in tcf_bpf_act()
81 action = prog->tcf_action; in tcf_bpf_act()
91 static bool tcf_bpf_is_ebpf(const struct tcf_bpf *prog) in tcf_bpf_is_ebpf() argument
93 return !prog->bpf_ops; in tcf_bpf_is_ebpf()
96 static int tcf_bpf_dump_bpf_info(const struct tcf_bpf *prog, in tcf_bpf_dump_bpf_info() argument
101 if (nla_put_u16(skb, TCA_ACT_BPF_OPS_LEN, prog->bpf_num_ops)) in tcf_bpf_dump_bpf_info()
[all …]
/Linux-v5.15/arch/riscv/net/
Dbpf_jit_core.c18 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
45 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-v5.15/arch/x86/net/
Dbpf_jit_comp.c34 do { prog = emit_code(prog, bytes, len); } while (0)
241 u8 *prog = *pprog; in push_callee_regs() local
251 *pprog = prog; in push_callee_regs()
256 u8 *prog = *pprog; in pop_callee_regs() local
266 *pprog = prog; in pop_callee_regs()
277 u8 *prog = *pprog; in emit_prologue() local
282 memcpy(prog, x86_nops[5], X86_PATCH_SIZE); in emit_prologue()
283 prog += X86_PATCH_SIZE; in emit_prologue()
297 *pprog = prog; in emit_prologue()
302 u8 *prog = *pprog; in emit_patch() local
[all …]
Dbpf_jit_comp32.c64 do { prog = emit_code(prog, bytes, len); cnt += len; } while (0)
208 u8 *prog = *pprog; in emit_ia32_mov_i() local
229 *pprog = prog; in emit_ia32_mov_i()
236 u8 *prog = *pprog; in emit_ia32_mov_r() local
250 *pprog = prog; in emit_ia32_mov_r()
287 u8 *prog = *pprog; in emit_ia32_mul_r() local
313 *pprog = prog; in emit_ia32_mul_r()
320 u8 *prog = *pprog; in emit_ia32_to_le_r64() local
361 *pprog = prog; in emit_ia32_to_le_r64()
368 u8 *prog = *pprog; in emit_ia32_to_be_r64() local
[all …]
/Linux-v5.15/drivers/clk/at91/
Dclk-programmable.c34 struct clk_programmable *prog = to_clk_programmable(hw); in clk_programmable_recalc_rate() local
35 const struct clk_programmable_layout *layout = prog->layout; in clk_programmable_recalc_rate()
39 regmap_read(prog->regmap, AT91_PMC_PCKR(prog->id), &pckr); in clk_programmable_recalc_rate()
52 struct clk_programmable *prog = to_clk_programmable(hw); in clk_programmable_determine_rate() local
53 const struct clk_programmable_layout *layout = prog->layout; in clk_programmable_determine_rate()
104 struct clk_programmable *prog = to_clk_programmable(hw); in clk_programmable_set_parent() local
105 const struct clk_programmable_layout *layout = prog->layout; in clk_programmable_set_parent()
112 if (prog->mux_table) in clk_programmable_set_parent()
113 pckr = clk_mux_index_to_val(prog->mux_table, 0, index); in clk_programmable_set_parent()
122 regmap_update_bits(prog->regmap, AT91_PMC_PCKR(prog->id), mask, pckr); in clk_programmable_set_parent()
[all …]
/Linux-v5.15/tools/lib/bpf/
Dlibbpf.h177 LIBBPF_API void *bpf_object__priv(const struct bpf_object *prog);
189 LIBBPF_API struct bpf_program *bpf_program__next(struct bpf_program *prog,
197 LIBBPF_API struct bpf_program *bpf_program__prev(struct bpf_program *prog,
202 LIBBPF_API int bpf_program__set_priv(struct bpf_program *prog, void *priv,
205 LIBBPF_API void *bpf_program__priv(const struct bpf_program *prog);
206 LIBBPF_API void bpf_program__set_ifindex(struct bpf_program *prog,
209 LIBBPF_API const char *bpf_program__name(const struct bpf_program *prog);
210 LIBBPF_API const char *bpf_program__section_name(const struct bpf_program *prog);
212 const char *bpf_program__title(const struct bpf_program *prog, bool needs_copy);
213 LIBBPF_API bool bpf_program__autoload(const struct bpf_program *prog);
[all …]
Dlibbpf.c73 static bool prog_is_subprog(const struct bpf_object *obj, const struct bpf_program *prog);
222 struct bpf_program *prog);
530 void bpf_program__unload(struct bpf_program *prog) in bpf_program__unload() argument
534 if (!prog) in bpf_program__unload()
541 if (prog->instances.nr > 0) { in bpf_program__unload()
542 for (i = 0; i < prog->instances.nr; i++) in bpf_program__unload()
543 zclose(prog->instances.fds[i]); in bpf_program__unload()
544 } else if (prog->instances.nr != -1) { in bpf_program__unload()
546 prog->instances.nr); in bpf_program__unload()
549 prog->instances.nr = -1; in bpf_program__unload()
[all …]
/Linux-v5.15/kernel/bpf/
Dsyscall.c1642 static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog) in find_prog_type() argument
1653 if (!bpf_prog_is_dev_bound(prog->aux)) in find_prog_type()
1654 prog->aux->ops = ops; in find_prog_type()
1656 prog->aux->ops = &bpf_offload_prog_ops; in find_prog_type()
1657 prog->type = type; in find_prog_type()
1672 static void bpf_audit_prog(const struct bpf_prog *prog, unsigned int op) in bpf_audit_prog() argument
1687 prog->aux->id, bpf_audit_str[op]); in bpf_audit_prog()
1691 static int bpf_prog_alloc_id(struct bpf_prog *prog) in bpf_prog_alloc_id() argument
1697 id = idr_alloc_cyclic(&prog_idr, prog, 1, INT_MAX, GFP_ATOMIC); in bpf_prog_alloc_id()
1699 prog->aux->id = id; in bpf_prog_alloc_id()
[all …]
Ddispatcher.c25 struct bpf_dispatcher *d, struct bpf_prog *prog) in bpf_dispatcher_find_prog() argument
30 if (prog == d->progs[i].prog) in bpf_dispatcher_find_prog()
43 struct bpf_prog *prog) in bpf_dispatcher_add_prog() argument
47 if (!prog) in bpf_dispatcher_add_prog()
50 entry = bpf_dispatcher_find_prog(d, prog); in bpf_dispatcher_add_prog()
60 bpf_prog_inc(prog); in bpf_dispatcher_add_prog()
61 entry->prog = prog; in bpf_dispatcher_add_prog()
68 struct bpf_prog *prog) in bpf_dispatcher_remove_prog() argument
72 if (!prog) in bpf_dispatcher_remove_prog()
75 entry = bpf_dispatcher_find_prog(d, prog); in bpf_dispatcher_remove_prog()
[all …]
Dcore.c105 fp->aux->prog = fp; in bpf_prog_alloc_no_stats()
118 struct bpf_prog *prog; in bpf_prog_alloc() local
121 prog = bpf_prog_alloc_no_stats(size, gfp_extra_flags); in bpf_prog_alloc()
122 if (!prog) in bpf_prog_alloc()
125 prog->stats = alloc_percpu_gfp(struct bpf_prog_stats, gfp_flags); in bpf_prog_alloc()
126 if (!prog->stats) { in bpf_prog_alloc()
127 free_percpu(prog->active); in bpf_prog_alloc()
128 kfree(prog->aux); in bpf_prog_alloc()
129 vfree(prog); in bpf_prog_alloc()
136 pstats = per_cpu_ptr(prog->stats, cpu); in bpf_prog_alloc()
[all …]
Dprog_iter.c16 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 …]
Doffload.c80 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 …]
Dtrampoline.c193 *ip_arg |= aux->prog->call_get_func_ip; in bpf_trampoline_get_progs()
194 *progs++ = aux->prog; in bpf_trampoline_get_progs()
391 static enum bpf_tramp_prog_type bpf_attach_type_to_tramp(struct bpf_prog *prog) in bpf_attach_type_to_tramp() argument
393 switch (prog->expected_attach_type) { in bpf_attach_type_to_tramp()
401 if (!prog->aux->attach_func_proto->type) in bpf_attach_type_to_tramp()
413 int bpf_trampoline_link_prog(struct bpf_prog *prog, struct bpf_trampoline *tr) in bpf_trampoline_link_prog() argument
419 kind = bpf_attach_type_to_tramp(prog); in bpf_trampoline_link_prog()
435 tr->extension_prog = prog; in bpf_trampoline_link_prog()
437 prog->bpf_func); in bpf_trampoline_link_prog()
444 if (!hlist_unhashed(&prog->aux->tramp_hlist)) { in bpf_trampoline_link_prog()
[all …]
Dbpf_iter.c24 struct bpf_prog *prog; member
268 bpf_prog_put(iter_priv->prog); in iter_release()
324 struct bpf_prog *prog) in cache_btf_id() argument
326 tinfo->btf_id = prog->aux->attach_btf_id; in cache_btf_id()
329 bool bpf_iter_prog_supported(struct bpf_prog *prog) in bpf_iter_prog_supported() argument
331 const char *attach_fname = prog->aux->attach_func_name; in bpf_iter_prog_supported()
332 u32 prog_btf_id = prog->aux->attach_btf_id; in bpf_iter_prog_supported()
348 cache_btf_id(tinfo, prog); in bpf_iter_prog_supported()
356 prog->aux->ctx_arg_info_size = tinfo->reg_info->ctx_arg_info_size; in bpf_iter_prog_supported()
357 prog->aux->ctx_arg_info = tinfo->reg_info->ctx_arg_info; in bpf_iter_prog_supported()
[all …]
/Linux-v5.15/drivers/net/hyperv/
Dnetvsc_bpf.c29 struct bpf_prog *prog; in netvsc_run_xdp() local
35 prog = rcu_dereference(nvchan->bpf_prog); in netvsc_run_xdp()
37 if (!prog) in netvsc_run_xdp()
58 act = bpf_prog_run_xdp(prog, xdp); in netvsc_run_xdp()
67 trace_xdp_exception(ndev, prog, act); in netvsc_run_xdp()
96 int netvsc_xdp_set(struct net_device *dev, struct bpf_prog *prog, in netvsc_xdp_set() argument
105 if (!old_prog && !prog) in netvsc_xdp_set()
109 if (prog && buf_max > PAGE_SIZE) { in netvsc_xdp_set()
117 if (prog && (dev->features & NETIF_F_LRO)) { in netvsc_xdp_set()
124 if (prog) in netvsc_xdp_set()
[all …]
/Linux-v5.15/tools/testing/selftests/bpf/prog_tests/
Dtailcalls.c13 struct bpf_program *prog; in test_tailcall_1() local
24 prog = bpf_object__find_program_by_title(obj, "classifier"); in test_tailcall_1()
25 if (CHECK_FAIL(!prog)) in test_tailcall_1()
28 main_fd = bpf_program__fd(prog); in test_tailcall_1()
43 prog = bpf_object__find_program_by_title(obj, prog_name); in test_tailcall_1()
44 if (CHECK_FAIL(!prog)) in test_tailcall_1()
47 prog_fd = bpf_program__fd(prog); in test_tailcall_1()
75 prog = bpf_object__find_program_by_title(obj, prog_name); in test_tailcall_1()
76 if (CHECK_FAIL(!prog)) in test_tailcall_1()
79 prog_fd = bpf_program__fd(prog); in test_tailcall_1()
[all …]
Dtrace_ext.c24 struct bpf_program *prog; in test_trace_ext() local
38 prog = skel_pkt->progs.test_pkt_md_access; in test_trace_ext()
39 pkt_fd = bpf_program__fd(prog); in test_trace_ext()
47 prog = skel_ext->progs.test_pkt_md_access_new; in test_trace_ext()
48 bpf_program__set_attach_target(prog, pkt_fd, "test_pkt_md_access"); in test_trace_ext()
62 prog = skel_ext->progs.test_pkt_md_access_new; in test_trace_ext()
63 ext_fd = bpf_program__fd(prog); in test_trace_ext()
71 prog = skel_trace->progs.fentry; in test_trace_ext()
72 bpf_program__set_attach_target(prog, ext_fd, "test_pkt_md_access_new"); in test_trace_ext()
75 prog = skel_trace->progs.fexit; in test_trace_ext()
[all …]
/Linux-v5.15/drivers/net/netdevsim/
Dbpf.c31 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-v5.15/scripts/
Dsphinx-pre-install91 foreach my $prog (sort keys %missing) {
92 my $is_optional = $missing{$prog};
106 print "Warning: better to also install \"$prog\".\n";
108 print "ERROR: please install \"$prog\", otherwise, build won't work.\n";
110 if (defined($map{$prog})) {
111 $install .= " " . $map{$prog};
113 $install .= " " . $prog;
155 my $prog = shift;
173 my $prog = shift;
176 return $prog if findprog($prog);
[all …]
/Linux-v5.15/drivers/net/ethernet/netronome/nfp/bpf/
Doffload.c112 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-v5.15/include/linux/
Dbpf.h391 bool (*allowed)(const struct bpf_prog *prog);
485 int (*test_run)(struct bpf_prog *prog, const union bpf_attr *kattr,
493 const struct bpf_prog *prog);
499 const struct bpf_prog *prog,
502 const struct bpf_prog *prog);
508 struct bpf_prog *prog, u32 *target_size);
527 int (*prepare)(struct bpf_prog *prog);
528 int (*translate)(struct bpf_prog *prog);
529 void (*destroy)(struct bpf_prog *prog);
533 struct bpf_prog *prog; member
[all …]
/Linux-v5.15/samples/bpf/
Dtracex5_user.c27 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()
/Linux-v5.15/net/core/
Dsock_reuseport.c101 RCU_INIT_POINTER(reuse->prog, NULL); in __reuseport_alloc()
192 more_reuse->prog = reuse->prog; in reuseport_grow()
222 sk_reuseport_prog_free(rcu_dereference_protected(reuse->prog, 1)); in reuseport_free_rcu()
381 struct bpf_prog *prog; in reuseport_stop_listen_sock() local
387 prog = rcu_dereference_protected(reuse->prog, in reuseport_stop_listen_sock()
391 (prog && prog->expected_attach_type == BPF_SK_REUSEPORT_SELECT_OR_MIGRATE)) { in reuseport_stop_listen_sock()
413 struct bpf_prog *prog, struct sk_buff *skb, in run_bpf_filter() argument
431 index = bpf_prog_run_save_cb(prog, skb); in run_bpf_filter()
475 struct bpf_prog *prog; in reuseport_select_sock() local
486 prog = rcu_dereference(reuse->prog); in reuseport_select_sock()
[all …]
/Linux-v5.15/drivers/media/rc/
Dbpf-lirc.c83 lirc_mode2_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in lirc_mode2_func_proto() argument
123 const struct bpf_prog *prog, in lirc_mode2_is_valid_access() argument
137 static int lirc_bpf_attach(struct rc_dev *rcdev, struct bpf_prog *prog) in lirc_bpf_attach() argument
163 ret = bpf_prog_array_copy(old_array, NULL, prog, 0, &new_array); in lirc_bpf_attach()
175 static int lirc_bpf_detach(struct rc_dev *rcdev, struct bpf_prog *prog) in lirc_bpf_detach() argument
196 ret = bpf_prog_array_copy(old_array, prog, NULL, 0, &new_array); in lirc_bpf_detach()
207 bpf_prog_put(prog); in lirc_bpf_detach()
238 for (item = array->items; item->prog; item++) in lirc_bpf_free()
239 bpf_prog_put(item->prog); in lirc_bpf_free()
244 int lirc_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog) in lirc_prog_attach() argument
[all …]

12345678910>>...16