Home
last modified time | relevance | path

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

12345678910>>...15

/kernel/linux/linux-5.10/net/sched/
Dcls_bpf.c85 struct cls_bpf_prog *prog; in cls_bpf_classify() local
90 list_for_each_entry_rcu(prog, &head->plist, link) { in cls_bpf_classify()
93 qdisc_skb_cb(skb)->tc_classid = prog->res.classid; in cls_bpf_classify()
95 if (tc_skip_sw(prog->gen_flags)) { in cls_bpf_classify()
96 filter_res = prog->exts_integrated ? TC_ACT_UNSPEC : 0; in cls_bpf_classify()
101 filter_res = BPF_PROG_RUN(prog->filter, skb); in cls_bpf_classify()
105 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 …]
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()
47 filter = rcu_dereference(prog->filter); in tcf_bpf_act()
80 qstats_drop_inc(this_cpu_ptr(prog->common.cpu_qstats)); in tcf_bpf_act()
83 action = prog->tcf_action; in tcf_bpf_act()
93 static bool tcf_bpf_is_ebpf(const struct tcf_bpf *prog) in tcf_bpf_is_ebpf() argument
95 return !prog->bpf_ops; in tcf_bpf_is_ebpf()
98 static int tcf_bpf_dump_bpf_info(const struct tcf_bpf *prog, in tcf_bpf_dump_bpf_info() argument
103 if (nla_put_u16(skb, TCA_ACT_BPF_OPS_LEN, prog->bpf_num_ops)) in tcf_bpf_dump_bpf_info()
[all …]
/kernel/linux/linux-5.10/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 …]
/kernel/linux/linux-5.10/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 …]
/kernel/linux/linux-5.10/arch/x86/net/
Dbpf_jit_comp.c33 do { prog = emit_code(prog, bytes, len); cnt += len; } while (0)
236 u8 *prog = *pprog; in push_callee_regs() local
247 *pprog = prog; in push_callee_regs()
252 u8 *prog = *pprog; in pop_callee_regs() local
263 *pprog = prog; in pop_callee_regs()
274 u8 *prog = *pprog; in emit_prologue() local
280 memcpy(prog, ideal_nops[NOP_ATOMIC5], cnt); in emit_prologue()
281 prog += cnt; in emit_prologue()
295 *pprog = prog; in emit_prologue()
300 u8 *prog = *pprog; in emit_patch() local
[all …]
Dbpf_jit_comp32.c65 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 …]
/kernel/linux/linux-5.10/tools/lib/bpf/
Dlibbpf.h168 LIBBPF_API void *bpf_object__priv(const struct bpf_object *prog);
180 LIBBPF_API struct bpf_program *bpf_program__next(struct bpf_program *prog,
188 LIBBPF_API struct bpf_program *bpf_program__prev(struct bpf_program *prog,
193 LIBBPF_API int bpf_program__set_priv(struct bpf_program *prog, void *priv,
196 LIBBPF_API void *bpf_program__priv(const struct bpf_program *prog);
197 LIBBPF_API void bpf_program__set_ifindex(struct bpf_program *prog,
200 LIBBPF_API const char *bpf_program__name(const struct bpf_program *prog);
201 LIBBPF_API const char *bpf_program__section_name(const struct bpf_program *prog);
203 const char *bpf_program__title(const struct bpf_program *prog, bool needs_copy);
204 LIBBPF_API bool bpf_program__autoload(const struct bpf_program *prog);
[all …]
Dlibbpf.c202 struct bpf_program *prog);
488 void bpf_program__unload(struct bpf_program *prog) in bpf_program__unload() argument
492 if (!prog) in bpf_program__unload()
499 if (prog->instances.nr > 0) { in bpf_program__unload()
500 for (i = 0; i < prog->instances.nr; i++) in bpf_program__unload()
501 zclose(prog->instances.fds[i]); in bpf_program__unload()
502 } else if (prog->instances.nr != -1) { in bpf_program__unload()
504 prog->instances.nr); in bpf_program__unload()
507 prog->instances.nr = -1; in bpf_program__unload()
508 zfree(&prog->instances.fds); in bpf_program__unload()
[all …]
/kernel/linux/linux-5.10/kernel/bpf/
Dsyscall.c1603 static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog) in find_prog_type() argument
1614 if (!bpf_prog_is_dev_bound(prog->aux)) in find_prog_type()
1615 prog->aux->ops = ops; in find_prog_type()
1617 prog->aux->ops = &bpf_offload_prog_ops; in find_prog_type()
1618 prog->type = type; in find_prog_type()
1633 static void bpf_audit_prog(const struct bpf_prog *prog, unsigned int op) in bpf_audit_prog() argument
1648 prog->aux->id, bpf_audit_str[op]); in bpf_audit_prog()
1674 static int bpf_prog_charge_memlock(struct bpf_prog *prog) in bpf_prog_charge_memlock() argument
1679 ret = __bpf_prog_charge(user, prog->pages); in bpf_prog_charge_memlock()
1685 prog->aux->user = user; in bpf_prog_charge_memlock()
[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.c102 fp->aux->prog = fp; in bpf_prog_alloc_no_stats()
115 struct bpf_prog *prog; in bpf_prog_alloc() local
118 prog = bpf_prog_alloc_no_stats(size, gfp_extra_flags); in bpf_prog_alloc()
119 if (!prog) in bpf_prog_alloc()
122 prog->aux->stats = alloc_percpu_gfp(struct bpf_prog_stats, gfp_flags); in bpf_prog_alloc()
123 if (!prog->aux->stats) { in bpf_prog_alloc()
124 kfree(prog->aux); in bpf_prog_alloc()
125 vfree(prog); in bpf_prog_alloc()
132 pstats = per_cpu_ptr(prog->aux->stats, cpu); in bpf_prog_alloc()
135 return prog; 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 …]
Dbpf_iter.c24 struct bpf_prog *prog; member
254 bpf_prog_put(iter_priv->prog); in iter_release()
310 struct bpf_prog *prog) in cache_btf_id() argument
312 tinfo->btf_id = prog->aux->attach_btf_id; in cache_btf_id()
315 bool bpf_iter_prog_supported(struct bpf_prog *prog) in bpf_iter_prog_supported() argument
317 const char *attach_fname = prog->aux->attach_func_name; in bpf_iter_prog_supported()
318 u32 prog_btf_id = prog->aux->attach_btf_id; in bpf_iter_prog_supported()
334 cache_btf_id(tinfo, prog); in bpf_iter_prog_supported()
342 prog->aux->ctx_arg_info_size = tinfo->reg_info->ctx_arg_info_size; in bpf_iter_prog_supported()
343 prog->aux->ctx_arg_info = tinfo->reg_info->ctx_arg_info; in bpf_iter_prog_supported()
[all …]
Dbpf_lsm.c37 const struct bpf_prog *prog) in BTF_SET_END()
39 if (!prog->gpl_compatible) { in BTF_SET_END()
45 if (!btf_id_set_contains(&bpf_lsm_hooks, prog->aux->attach_btf_id)) { in BTF_SET_END()
47 prog->aux->attach_btf_id, prog->aux->attach_func_name); in BTF_SET_END()
55 bpf_lsm_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in bpf_lsm_func_proto() argument
67 return tracing_prog_func_proto(func_id, prog); in bpf_lsm_func_proto()
/kernel/linux/linux-5.10/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()
56 act = bpf_prog_run_xdp(prog, xdp); in netvsc_run_xdp()
65 trace_xdp_exception(ndev, prog, act); in netvsc_run_xdp()
94 int netvsc_xdp_set(struct net_device *dev, struct bpf_prog *prog, in netvsc_xdp_set() argument
103 if (!old_prog && !prog) in netvsc_xdp_set()
107 if (prog && buf_max > PAGE_SIZE) { in netvsc_xdp_set()
115 if (prog && (dev->features & NETIF_F_LRO)) { in netvsc_xdp_set()
122 if (prog) in netvsc_xdp_set()
[all …]
/kernel/linux/linux-5.10/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 …]
Dsignal_pending.c12 struct bpf_insn prog[4096]; in test_signal_pending_by_type() local
21 for (i = 0; i < ARRAY_SIZE(prog); i++) in test_signal_pending_by_type()
22 prog[i] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, 0); in test_signal_pending_by_type()
23 prog[ARRAY_SIZE(prog) - 1] = BPF_EXIT_INSN(); in test_signal_pending_by_type()
25 prog_fd = bpf_load_program(prog_type, prog, ARRAY_SIZE(prog), in test_signal_pending_by_type()
/kernel/linux/linux-5.10/scripts/
Dsphinx-pre-install90 foreach my $prog (sort keys %missing) {
91 my $is_optional = $missing{$prog};
105 print "Warning: better to also install \"$prog\".\n";
107 print "ERROR: please install \"$prog\", otherwise, build won't work.\n";
109 if (defined($map{$prog})) {
110 $install .= " " . $map{$prog};
112 $install .= " " . $prog;
154 my $prog = shift;
172 my $prog = shift;
175 return $prog if findprog($prog);
[all …]
/kernel/linux/linux-5.10/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 …]
/kernel/linux/linux-5.10/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 …]
/kernel/linux/linux-5.10/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()
39 struct bpf_program *prog; in main() local
55 prog = bpf_object__find_program_by_name(obj, "bpf_prog1"); in main()
56 if (!prog) { in main()
67 link = bpf_program__attach(prog); in main()
80 bpf_object__for_each_program(prog, obj) { in main()
81 section = bpf_program__section_name(prog); in main()
86 fd = bpf_program__fd(prog); in main()
/kernel/linux/linux-5.10/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, &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, &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 …]
/kernel/linux/linux-5.10/net/core/
Dsock_reuseport.c48 RCU_INIT_POINTER(reuse->prog, NULL); in __reuseport_alloc()
117 more_reuse->prog = reuse->prog; in reuseport_grow()
143 sk_reuseport_prog_free(rcu_dereference_protected(reuse->prog, 1)); in reuseport_free_rcu()
234 struct bpf_prog *prog, struct sk_buff *skb, in run_bpf_filter() argument
252 index = bpf_prog_run_save_cb(prog, skb); in run_bpf_filter()
279 struct bpf_prog *prog; in reuseport_select_sock() local
290 prog = rcu_dereference(reuse->prog); in reuseport_select_sock()
296 if (!prog || !skb) in reuseport_select_sock()
299 if (prog->type == BPF_PROG_TYPE_SK_REUSEPORT) in reuseport_select_sock()
300 sk2 = bpf_run_sk_reuseport(reuse, sk, prog, skb, hash); in reuseport_select_sock()
[all …]

12345678910>>...15