Home
last modified time | relevance | path

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

12345678910>>...20

/linux/net/sched/
H A Dcls_bpf.c87 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()
100 filter_res = bpf_prog_run_data_pointers(prog->filter, skb); in cls_bpf_classify()
103 filter_res = bpf_prog_run_data_pointers(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 …]
H A Dact_bpf.c40 struct tcf_bpf *prog = to_bpf(act); in tcf_bpf_act() local
44 tcf_lastuse_update(&prog->tcf_tm); in tcf_bpf_act()
45 bstats_update(this_cpu_ptr(prog->common.cpu_bstats), skb); in tcf_bpf_act()
47 filter = rcu_dereference_bh(prog->filter); in tcf_bpf_act()
79 qstats_cpu_drop_inc(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/tools/testing/selftests/bpf/prog_tests/
H A Dexceptions.c44 ASSERT_OK(ret, #_prog " prog run ret"); \ in test_exceptions_success()
45 ASSERT_EQ(ropts.retval, return_val, #_prog " prog run retval"); \ in test_exceptions_success()
102 struct bpf_program *prog = NULL; \ in test_exceptions_success()
107 ASSERT_OK_PTR(bpf_program__name(prog), bpf_program__name(prog)); \ in test_exceptions_success()
120 if (!ASSERT_ERR_PTR(link = bpf_program__attach(prog), "attach err")) \ in test_exceptions_success()
123 if (!ASSERT_OK_PTR(link = bpf_program__attach(prog), "attach ok")) \ in test_exceptions_success()
132 prog = eskel->progs.pfentry; in test_exceptions_success()
133 bpf_program__set_autoload(prog, true); in test_exceptions_success()
134 if (!ASSERT_OK(bpf_program__set_attach_target(prog, in test_exceptions_success()
[all...]
H A Dtailcalls.c27 struct bpf_program *prog; in test_tailcall_1() local
42 prog = bpf_object__find_program_by_name(obj, "entry"); in test_tailcall_1()
43 if (CHECK_FAIL(!prog)) in test_tailcall_1()
46 main_fd = bpf_program__fd(prog); in test_tailcall_1()
61 prog = bpf_object__find_program_by_name(obj, prog_name); in test_tailcall_1()
62 if (CHECK_FAIL(!prog)) in test_tailcall_1()
65 prog_fd = bpf_program__fd(prog); in test_tailcall_1()
91 prog = bpf_object__find_program_by_name(obj, prog_name); in test_tailcall_1()
92 if (CHECK_FAIL(!prog)) in test_tailcall_1()
95 prog_fd = bpf_program__fd(prog); in test_tailcall_1()
[all …]
H A Dtrampoline_count.c13 struct bpf_program *prog; in load_prog() local
26 prog = bpf_object__find_program_by_name(obj, name); in load_prog()
27 if (!ASSERT_OK_PTR(prog, "obj_find_prog")) in load_prog()
30 return prog; in load_prog()
38 struct bpf_program *prog; in serial_test_trampoline_count()
51 prog = load_prog(file, progs[i % ARRAY_SIZE(progs)], &inst[i]); in serial_test_trampoline_count()
52 if (!prog) in serial_test_trampoline_count()
55 link = bpf_program__attach(prog); in serial_test_trampoline_count()
63 prog = load_prog(file, "fmod_ret_test", &inst[i]); in serial_test_trampoline_count()
64 if (!prog) in serial_test_trampoline_count()
39 struct bpf_program *prog; serial_test_trampoline_count() local
[all...]
H A Dtrace_ext.c24 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 …]
H A Dlibarena.c13 static void run_libarena_test(struct libarena *skel, struct bpf_program *prog, in run_libarena_test() argument
29 ret = libarena_run_prog(bpf_program__fd(prog)); in run_libarena_test()
36 struct bpf_program *prog = arg; in run_libarena_parallel_prog() local
38 return (void *)(long)libarena_run_prog(bpf_program__fd(prog)); in run_libarena_parallel_prog()
149 struct bpf_program *prog; in libarena_parallel_test_enabled() local
158 prog = bpf_object__find_program_by_name(skel->obj, progname); in libarena_parallel_test_enabled()
159 if (!prog) in libarena_parallel_test_enabled()
162 ret = libarena_run_prog(bpf_program__fd(prog)); in libarena_parallel_test_enabled()
170 static void run_libarena_parallel_test(struct libarena *skel, struct bpf_program *prog, in run_libarena_parallel_test() argument
210 ret = libarena_run_prog(bpf_program__fd(prog)); in run_libarena_parallel_test()
[all …]
/linux/arch/riscv/net/
H A Dbpf_jit_core.c21 const struct bpf_prog *prog = ctx->prog; in build_body() local
24 for (i = 0; i < prog->len; i++) { in build_body()
25 const struct bpf_insn *insn = &prog->insnsi[i]; in build_body()
44 struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog) in bpf_int_jit_compile() argument
52 if (!prog->jit_requested) in bpf_int_jit_compile()
53 return prog; in bpf_int_jit_compile()
55 jit_data = prog->aux->jit_data; in bpf_int_jit_compile()
59 return prog; in bpf_int_jit_compile()
61 prog->aux->jit_data = jit_data; in bpf_int_jit_compile()
72 ctx->arena_vm_start = bpf_arena_get_kern_vm_start(prog->aux->arena); in bpf_int_jit_compile()
[all …]
/linux/drivers/clk/at91/
H A Dclk-programmable.c35 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/arch/x86/net/
H A Dbpf_jit_comp.c41 do { prog = emit_code(prog, bytes, len); } while (0)
335 u8 *prog = *pprog; in push_r9() local
338 *pprog = prog; in push_r9()
343 u8 *prog = *pprog; in pop_r9() local
346 *pprog = prog; in pop_r9()
351 u8 *prog = *pprog; in push_r12() local
354 *pprog = prog; in push_r12()
359 u8 *prog = *pprog; in push_callee_regs() local
369 *pprog = prog; in push_callee_regs()
374 u8 *prog = *pprog; in pop_r12() local
[all …]
/linux/tools/workqueue/
H A Dwq_dump.py101 worker_pool_idr = prog['worker_pool_idr']
102 workqueues = prog['workqueues']
103 wq_unbound_cpumask = prog['wq_unbound_cpumask']
104 wq_pod_types = prog['wq_pod_types']
105 wq_affn_dfl = prog['wq_affn_dfl']
106 wq_affn_names = prog['wq_affn_names']
108 WQ_BH = prog['WQ_BH']
109 WQ_UNBOUND = prog['WQ_UNBOUND']
110 WQ_ORDERED = prog['__WQ_ORDERED']
111 WQ_MEM_RECLAIM = prog['WQ_MEM_RECLAIM']
[all …]
/linux/kernel/bpf/
H A Dmprog.c20 if (type && link->prog->type != type) { in bpf_mprog_link()
26 tuple->prog = link->prog; in bpf_mprog_link()
34 struct bpf_prog *prog = ERR_PTR(-EINVAL); in bpf_mprog_prog() local
38 prog = bpf_prog_by_id(id_or_fd); in bpf_mprog_prog()
40 prog = bpf_prog_get(id_or_fd); in bpf_mprog_prog()
41 if (IS_ERR(prog)) in bpf_mprog_prog()
42 return PTR_ERR(prog); in bpf_mprog_prog()
43 if (type && prog->type != type) { in bpf_mprog_prog()
44 bpf_prog_put(prog); in bpf_mprog_prog()
49 tuple->prog = prog; in bpf_mprog_prog()
[all …]
H A Dfixups.c29 static bool is_addr_space_cast32(struct bpf_prog *prog, const struct bpf_insn *insn) in is_addr_space_cast32() argument
31 struct bpf_map *arena = (struct bpf_map *)prog->aux->arena; in is_addr_space_cast32()
68 static bool bpf_is_reg64(struct bpf_prog *prog, struct bpf_insn *insn) in bpf_is_reg64() argument
85 if (is_addr_space_cast32(prog, insn)) in bpf_is_reg64()
109 int bpf_insn_def32(struct bpf_prog *prog, struct bpf_insn *insn) in bpf_insn_def32() argument
113 if (dst_reg < 0 || bpf_is_reg64(prog, insn)) in bpf_insn_def32()
132 bpf_jit_find_kfunc_model(const struct bpf_prog *prog, in bpf_jit_find_kfunc_model() argument
142 tab = prog->aux->kfunc_tab; in bpf_jit_find_kfunc_model()
173 tab = env->prog->aux->kfunc_tab; in sort_kfunc_descs_by_imm_off()
295 static void adjust_poke_descs(struct bpf_prog *prog, u32 off, u32 len) in adjust_poke_descs() argument
[all …]
H A Dsyscall.c2354 static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog) in find_prog_type() argument
2365 if (!bpf_prog_is_offloaded(prog->aux)) in find_prog_type()
2366 prog->aux->ops = ops; in find_prog_type()
2368 prog->aux->ops = &bpf_offload_prog_ops; in find_prog_type()
2369 prog->type = type; in find_prog_type()
2384 static void bpf_audit_prog(const struct bpf_prog *prog, unsigned int op) in bpf_audit_prog() argument
2399 prog->aux->id, bpf_audit_str[op]); in bpf_audit_prog()
2403 static int bpf_prog_alloc_id(struct bpf_prog *prog) in bpf_prog_alloc_id() argument
2409 id = idr_alloc_cyclic(&prog_idr, prog, 1, INT_MAX, GFP_ATOMIC); in bpf_prog_alloc_id()
2411 prog->aux->id = id; in bpf_prog_alloc_id()
[all …]
H A Dcore.c127 fp->aux->prog = fp; in bpf_prog_alloc_no_stats()
154 struct bpf_prog *prog; in bpf_prog_alloc() local
157 prog = bpf_prog_alloc_no_stats(size, gfp_extra_flags); in bpf_prog_alloc()
158 if (!prog) in bpf_prog_alloc()
161 prog->stats = alloc_percpu_gfp(struct bpf_prog_stats, gfp_flags); in bpf_prog_alloc()
162 if (!prog->stats) { in bpf_prog_alloc()
163 free_percpu(prog->active); in bpf_prog_alloc()
164 kfree(prog->aux); in bpf_prog_alloc()
165 vfree(prog); in bpf_prog_alloc()
172 pstats = per_cpu_ptr(prog->stats, cpu); in bpf_prog_alloc()
[all …]
H A Ddispatcher.c26 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 …]
H A 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 …]
H A Dcheck_btf.c39 struct bpf_prog *prog; in prepare_btf_func() local
60 prog = env->prog; in prepare_btf_func()
61 btf = prog->aux->btf; in prepare_btf_func()
124 prog->aux->func_info = krecord; in prepare_btf_func()
125 prog->aux->func_info_cnt = nfuncs; in prepare_btf_func()
141 struct bpf_prog *prog; in check_btf_func() local
160 prog = env->prog; in check_btf_func()
161 btf = prog->aux->btf; in check_btf_func()
165 krecord = prog->aux->func_info; in check_btf_func()
202 prog->aux->func_info_aux = info_aux; in check_btf_func()
[all …]
H A Dbpf_lsm.c94 void bpf_lsm_find_cgroup_shim(const struct bpf_prog *prog, in BTF_SET_END()
99 if (btf_type_vlen(prog->aux->attach_func_proto) < 1 || in BTF_SET_END()
101 prog->aux->attach_btf_id)) { in BTF_SET_END()
107 args = btf_params(prog->aux->attach_func_proto); in BTF_SET_END()
120 const struct bpf_prog *prog) in bpf_lsm_verify_prog() argument
122 u32 btf_id = prog->aux->attach_btf_id; in bpf_lsm_verify_prog()
123 const char *func_name = prog->aux->attach_func_name; in bpf_lsm_verify_prog()
125 if (!prog->gpl_compatible) { in bpf_lsm_verify_prog()
174 static bool bpf_ima_inode_hash_allowed(const struct bpf_prog *prog) in bpf_ima_inode_hash_allowed() argument
176 return bpf_lsm_is_sleepable_hook(prog->aux->attach_btf_id); in bpf_ima_inode_hash_allowed()
[all …]
/linux/drivers/net/hyperv/
H A Dnetvsc_bpf.c31 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/tools/lib/bpf/
H A Dlibbpf.c76 static bool prog_is_subprog(const struct bpf_object *obj, const struct bpf_program *prog);
775 struct bpf_program *prog; member
798 void bpf_program__unload(struct bpf_program *prog) in bpf_program__unload() argument
800 if (!prog) in bpf_program__unload()
803 zclose(prog->fd); in bpf_program__unload()
805 zfree(&prog->func_info); in bpf_program__unload()
806 zfree(&prog->line_info); in bpf_program__unload()
807 zfree(&prog->subprogs); in bpf_program__unload()
810 static void bpf_program__exit(struct bpf_program *prog) in bpf_program__exit() argument
812 if (!prog) in bpf_program__exit()
[all …]
/linux/drivers/net/ethernet/microsoft/mana/
H A Dmana_bpf.c84 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()
149 void mana_chn_setxdp(struct mana_port_context *apc, struct bpf_prog *prog) in mana_chn_setxdp() argument
157 if (old_prog == prog) in mana_chn_setxdp()
160 if (prog) in mana_chn_setxdp()
[all …]
/linux/drivers/net/ethernet/netronome/nfp/bpf/
H A 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()
132 for (i = 0; i < prog->aux->used_map_cnt; i++) in nfp_map_ptrs_record()
133 if (bpf_map_offload_neutral(prog->aux->used_maps[i])) { in nfp_map_ptrs_record()
135 prog->aux->used_maps[i]); in nfp_map_ptrs_record()
144 mutex_unlock(&prog->aux->used_maps_mutex); in nfp_map_ptrs_record()
149 nfp_prog_prepare(struct nfp_prog *nfp_prog, const struct bpf_insn *prog, in nfp_prog_prepare() argument
160 meta->insn = prog[i]; in nfp_prog_prepare()
[all …]
/linux/include/linux/
H A Dbpf.h655 struct bpf_map *bpf_prog_arena(struct bpf_prog *prog);
1025 bool (*allowed)(const struct bpf_prog *prog);
1138 int (*test_run)(struct bpf_prog *prog, const union bpf_attr *kattr,
1147 const struct bpf_prog *prog);
1153 const struct bpf_prog *prog,
1156 const struct bpf_prog *prog);
1157 int (*gen_epilogue)(struct bpf_insn *insn, const struct bpf_prog *prog,
1164 struct bpf_prog *prog, u32 *target_size);
1180 int (*prepare)(struct bpf_prog *prog);
1181 int (*translate)(struct bpf_prog *prog);
[all …]
H A Dbpf_lsm.h31 const struct bpf_prog *prog);
34 bool bpf_lsm_is_trusted(const struct bpf_prog *prog);
49 void bpf_lsm_find_cgroup_shim(const struct bpf_prog *prog, bpf_func_t *bpf_func);
51 int bpf_lsm_get_retval_range(const struct bpf_prog *prog,
56 bool bpf_lsm_has_d_inode_locked(const struct bpf_prog *prog);
68 static inline bool bpf_lsm_is_trusted(const struct bpf_prog *prog) in bpf_lsm_is_trusted() argument
74 const struct bpf_prog *prog) in bpf_lsm_verify_prog() argument
89 static inline void bpf_lsm_find_cgroup_shim(const struct bpf_prog *prog, in bpf_lsm_find_cgroup_shim() argument
94 static inline int bpf_lsm_get_retval_range(const struct bpf_prog *prog, in bpf_lsm_get_retval_range() argument
108 static inline bool bpf_lsm_has_d_inode_locked(const struct bpf_prog *prog) in bpf_lsm_has_d_inode_locked() argument

12345678910>>...20