/linux/net/sched/ |
A D | cls_bpf.c | 151 skip_sw = prog && tc_skip_sw(prog->gen_flags); in cls_bpf_offload_cmd() 157 cls_bpf.prog = prog ? prog->filter : NULL; in cls_bpf_offload_cmd() 166 &prog->gen_flags, &prog->in_hw_count, in cls_bpf_offload_cmd() 202 if (prog && tc_skip_hw(prog->gen_flags)) in cls_bpf_offload() 203 prog = NULL; in cls_bpf_offload() 232 cls_bpf.prog = prog->filter; in cls_bpf_offload_update_stats() 271 kfree(prog); in __cls_bpf_delete_prog() 475 prog = kzalloc(sizeof(*prog), GFP_KERNEL); in cls_bpf_change() 476 if (!prog) in cls_bpf_change() 636 if (prog && prog->res.classid == classid) { in cls_bpf_bind_class() [all …]
|
A D | act_bpf.c | 81 action = prog->tcf_action; in tcf_bpf_act() 93 return !prog->bpf_ops; in tcf_bpf_is_ebpf() 119 if (prog->bpf_name && in tcf_bpf_dump_ebpf_info() 141 .index = prog->tcf_index, in tcf_bpf_dump() 148 spin_lock_bh(&prog->tcf_lock); in tcf_bpf_dump() 149 opt.action = prog->tcf_action; in tcf_bpf_dump() 153 if (tcf_bpf_is_ebpf(prog)) in tcf_bpf_dump() 272 cfg->bpf_ops = prog->bpf_ops; in tcf_bpf_prog_fill_cfg() 287 struct tcf_bpf *prog; in tcf_bpf_init() local 347 prog = to_bpf(*act); in tcf_bpf_init() [all …]
|
/linux/arch/x86/net/ |
A D | bpf_jit_comp.c | 33 do { prog = emit_code(prog, bytes, len); } while (0) 339 u8 *prog; in __bpf_arch_text_poke() local 901 prog = temp; in do_jit() 1787 if (emit_call(&prog, p->bpf_func, prog)) in invoke_bpf_prog() 1824 emit_nops(&prog, target - prog); in emit_align() 1984 u8 *prog; in arch_prepare_bpf_trampoline() local 2036 if (emit_call(&prog, __bpf_tramp_enter, prog)) { in arch_prepare_bpf_trampoline() 2064 if (emit_call(&prog, orig_call, prog)) { in arch_prepare_bpf_trampoline() 2107 if (emit_call(&prog, __bpf_tramp_exit, prog)) { in arch_prepare_bpf_trampoline() 2155 emit_indirect_jump(&prog, 2 /* rdx */, prog); in emit_bpf_dispatcher() [all …]
|
A D | bpf_jit_comp32.c | 65 do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) 230 *pprog = prog; in emit_ia32_mov_i() 251 *pprog = prog; in emit_ia32_mov_r() 314 *pprog = prog; in emit_ia32_mul_r() 362 *pprog = prog; in emit_ia32_to_le_r64() 428 *pprog = prog; in emit_ia32_to_be_r64() 475 *pprog = prog; in emit_ia32_div_mod_r() 587 &prog); in emit_ia32_alu_r64() 2545 prog = tmp; in bpf_int_jit_compile() 2616 bpf_jit_prog_release_other(prog, prog == orig_prog ? in bpf_int_jit_compile() [all …]
|
/linux/drivers/clk/at91/ |
A D | clk-programmable.c | 40 regmap_read(prog->regmap, AT91_PMC_PCKR(prog->id), &pckr); in clk_programmable_recalc_rate() 113 if (prog->mux_table) in clk_programmable_set_parent() 123 regmap_update_bits(prog->regmap, AT91_PMC_PCKR(prog->id), mask, pckr); in clk_programmable_set_parent() 135 regmap_read(prog->regmap, AT91_PMC_PCKR(prog->id), &pckr); in clk_programmable_get_parent() 143 ret = clk_mux_val_to_index(&prog->hw, prog->mux_table, 0, ret); in clk_programmable_get_parent() 174 regmap_update_bits(prog->regmap, AT91_PMC_PCKR(prog->id), in clk_programmable_set_rate() 230 prog = kzalloc(sizeof(*prog), GFP_KERNEL); in at91_clk_register_programmable() 231 if (!prog) in at91_clk_register_programmable() 240 prog->id = id; in at91_clk_register_programmable() 246 hw = &prog->hw; in at91_clk_register_programmable() [all …]
|
/linux/arch/riscv/net/ |
A D | bpf_jit_core.c | 18 const struct bpf_prog *prog = ctx->prog; in build_body() local 57 if (tmp != prog) { in bpf_int_jit_compile() 59 prog = tmp; in bpf_int_jit_compile() 66 prog = orig_prog; in bpf_int_jit_compile() 80 ctx->prog = prog; in bpf_int_jit_compile() 83 prog = orig_prog; in bpf_int_jit_compile() 133 prog = orig_prog; in bpf_int_jit_compile() 148 prog = orig_prog; in bpf_int_jit_compile() 157 prog->jited = 1; in bpf_int_jit_compile() 172 bpf_jit_prog_release_other(prog, prog == orig_prog ? in bpf_int_jit_compile() [all …]
|
/linux/tools/lib/bpf/ |
A D | libbpf.h | 195 struct bpf_program *bpf_program__next(struct bpf_program *prog, 206 struct bpf_program *bpf_program__prev(struct bpf_program *prog, 278 LIBBPF_API void bpf_program__unload(struct bpf_program *prog); 288 struct bpf_program *prog); 294 bpf_program__attach(const struct bpf_program *prog); 365 bpf_program__attach_tracepoint(const struct bpf_program *prog, 378 bpf_program__attach_trace(const struct bpf_program *prog); 380 bpf_program__attach_lsm(const struct bpf_program *prog); 388 bpf_program__attach_freplace(const struct bpf_program *prog, 403 bpf_program__attach_iter(const struct bpf_program *prog, [all …]
|
A D | libbpf.c | 601 prog->clear_priv(prog, prog->priv); in bpf_program__exit() 669 memset(prog, 0, sizeof(*prog)); in bpf_object__init_prog() 676 prog->insns_cnt = prog->sec_insn_cnt; in bpf_object__init_prog() 6431 prog->name, prog->sec_name); in load_program() 6626 err = load_program(prog, prog->insns, prog->insns_cnt, in bpf_program__load() 6717 prog->name, prog->sec_name); in bpf_object_init_progs() 6735 err = prog->sec_def->init_fn(prog, prog->sec_def->cookie); in bpf_object_init_progs() 8100 prog->clear_priv(prog, prog->priv); in bpf_program__set_priv() 8611 map->name, prog->name, prog->sec_name, prog->type, in bpf_object__collect_st_ops_relos() 10150 prog->name, prog->sec_name); in attach_raw_tp() [all …]
|
/linux/kernel/bpf/ |
A D | syscall.c | 1804 prog = aux->prog; in bpf_prog_put_deferred() 1882 bin2hex(prog_tag, prog->tag, sizeof(prog->tag)); in bpf_prog_show_fdinfo() 2347 prog = bpf_prog_select_runtime(prog, &err); in bpf_prog_load() 2383 __bpf_prog_put_noref(prog, prog->aux->func_cnt); in bpf_prog_load() 2422 link->prog = prog; in bpf_link_init() 2514 const struct bpf_prog *prog = link->prog; in bpf_link_show_fdinfo() local 2517 bin2hex(prog_tag, prog->tag, sizeof(prog->tag)); in bpf_link_show_fdinfo() 3410 prog = bpf_prog_inc_not_zero(prog); in bpf_prog_get_curr_or_next() 3432 if (prog) in bpf_prog_by_id() 3433 prog = bpf_prog_inc_not_zero(prog); in bpf_prog_by_id() [all …]
|
A D | core.c | 123 if (!prog) in bpf_prog_alloc() 146 if (!prog->aux->nr_linfo || !prog->jit_requested) in bpf_prog_alloc_jited_linfo() 161 (!prog->jited || !prog->aux->jited_linfo[0])) { in bpf_prog_jit_attempt_done() 2007 if (item->prog != &dummy_bpf_prog.prog) in bpf_prog_array_length() 2017 if (item->prog != &dummy_bpf_prog.prog) in bpf_prog_array_is_empty() 2030 if (item->prog == &dummy_bpf_prog.prog) in bpf_prog_array_copy_core() 2124 if (item->prog == &dummy_bpf_prog.prog) in bpf_prog_array_update_at() 2127 WRITE_ONCE(item->prog, prog); in bpf_prog_array_update_at() 2156 if (existing->prog != &dummy_bpf_prog.prog) in bpf_prog_array_copy() 2188 existing->prog == &dummy_bpf_prog.prog) in bpf_prog_array_copy() [all …]
|
A D | dispatcher.c | 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() 80 entry->prog = NULL; in bpf_dispatcher_remove_prog() 81 bpf_prog_put(prog); in bpf_dispatcher_remove_prog() [all …]
|
A D | offload.c | 97 offload->prog = prog; in bpf_prog_offload_init() 112 prog->aux->offload = offload; in bpf_prog_offload_init() 133 offload = prog->aux->offload; in bpf_prog_offload_verifier_prep() 220 bpf_prog_free_id(prog, true); in __bpf_prog_offload_destroy() 224 prog->aux->offload = NULL; in __bpf_prog_offload_destroy() 230 if (prog->aux->offload) in bpf_prog_offload_destroy() 241 offload = prog->aux->offload; in bpf_prog_offload_translate() 264 struct bpf_prog *prog; member 295 struct bpf_prog *prog) in bpf_prog_offload_info_fill() argument 298 .prog = prog, in bpf_prog_offload_info_fill() [all …]
|
A 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); 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() 56 ret = bpf_iter_run_prog(prog, &ctx); in DEFINE_BPF_ITER_FUNC() [all …]
|
A D | bpf_iter.c | 24 struct bpf_prog *prog; member 324 struct bpf_prog *prog) in cache_btf_id() argument 348 cache_btf_id(tinfo, prog); in bpf_iter_prog_supported() 499 struct bpf_prog *prog) in bpf_iter_link_attach() argument 569 struct bpf_prog *prog) in init_seq_meta() argument 573 priv_data->prog = prog; in init_seq_meta() 584 struct bpf_prog *prog; in prepare_seq_file() local 590 prog = link->link.prog; in prepare_seq_file() 591 bpf_prog_inc(prog); in prepare_seq_file() 620 bpf_prog_put(prog); in prepare_seq_file() [all …]
|
A D | trampoline.c | 195 *progs++ = aux->prog; in bpf_trampoline_get_progs() 436 tr->extension_prog = prog; in bpf_trampoline_link_prog() 438 prog->bpf_func); in bpf_trampoline_link_prog() 546 stats = this_cpu_ptr(prog->stats); in inc_misses_counter() 571 inc_misses_counter(prog); in __bpf_prog_enter() 591 stats = this_cpu_ptr(prog->stats); in update_prog_stats() 602 update_prog_stats(prog, start); in __bpf_prog_exit() 603 __this_cpu_dec(*(prog->active)); in __bpf_prog_exit() 614 inc_misses_counter(prog); in __bpf_prog_enter_sleepable() 622 update_prog_stats(prog, start); in __bpf_prog_exit_sleepable() [all …]
|
A D | cgroup.c | 126 if (pl->prog) in cgroup_bpf_release() 171 if (pl->prog) in prog_list_prog() 172 return pl->prog; in prog_list_prog() 398 if (prog && pl->prog == prog && prog != replace_prog) in find_attach_entry() 483 prog ? : link->link.prog, cgrp)) in __cgroup_bpf_attach() 497 pl->prog = prog; in __cgroup_bpf_attach() 581 WRITE_ONCE(item->prog, link->link.prog); in replace_effective_prog() 678 if (pl->prog == prog && pl->link == link) in find_detach_entry() 869 prog = NULL; in cgroup_bpf_prog_detach() 872 if (prog) in cgroup_bpf_prog_detach() [all …]
|
/linux/tools/testing/selftests/bpf/prog_tests/ |
A D | tailcalls.c | 13 struct bpf_program *prog; in test_tailcall_1() local 25 if (CHECK_FAIL(!prog)) in test_tailcall_1() 44 if (CHECK_FAIL(!prog)) in test_tailcall_1() 76 if (CHECK_FAIL(!prog)) in test_tailcall_1() 98 if (CHECK_FAIL(!prog)) in test_tailcall_1() 163 if (CHECK_FAIL(!prog)) in test_tailcall_2() 182 if (CHECK_FAIL(!prog)) in test_tailcall_2() 237 if (CHECK_FAIL(!prog)) in test_tailcall_count() 253 if (CHECK_FAIL(!prog)) in test_tailcall_count() 333 if (CHECK_FAIL(!prog)) in test_tailcall_4() [all …]
|
A D | fexit_bpf2bpf.c | 63 struct bpf_program **prog = NULL, *p; in test_fexit_bpf2bpf_common() local 86 if (!ASSERT_OK_PTR(prog, "prog_ptr")) in test_fexit_bpf2bpf_common() 113 if (!ASSERT_OK_PTR(prog[i], prog_name[i])) in test_fexit_bpf2bpf_common() 116 link[i] = bpf_program__attach_trace(prog[i]); in test_fexit_bpf2bpf_common() 155 free(prog); in test_fexit_bpf2bpf_common() 217 struct bpf_program *prog = NULL; in test_second_attach() local 273 struct bpf_program *prog; in test_fmod_ret_freplace() local 296 freplace_link = bpf_program__attach_trace(prog); in test_fmod_ret_freplace() 304 attach_prog_fd = bpf_program__fd(prog); in test_fmod_ret_freplace() 340 struct bpf_program *prog; in test_obj_load_failure_common() local [all …]
|
A D | trace_ext.c | 24 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/drivers/net/hyperv/ |
A D | netvsc_bpf.c | 29 struct bpf_prog *prog; in netvsc_run_xdp() local 37 if (!prog) in netvsc_run_xdp() 58 act = bpf_prog_run_xdp(prog, xdp); in netvsc_run_xdp() 105 if (!old_prog && !prog) in netvsc_xdp_set() 109 if (prog && buf_max > PAGE_SIZE) { in netvsc_xdp_set() 124 if (prog) in netvsc_xdp_set() 154 if (prog) in netvsc_vf_setxdp() 155 bpf_prog_inc(prog); in netvsc_vf_setxdp() 158 xdp.prog = prog; in netvsc_vf_setxdp() 162 if (ret && prog) in netvsc_vf_setxdp() [all …]
|
/linux/drivers/net/netdevsim/ |
A D | bpf.c | 31 struct bpf_prog *prog; member 89 return ns->xdp_hw.prog; in nsim_xdp_offload_active() 96 if (!prog || !prog->aux->offload) in nsim_prog_set_loaded() 111 ns->bpf_offloaded = prog; in nsim_bpf_offload() 112 ns->bpf_offloaded_id = prog ? prog->aux->id : 0; in nsim_bpf_offload() 122 struct bpf_prog *prog = cls_bpf->prog; in nsim_bpf_setup_tc_block_cb() local 147 if (prog && !prog->aux->offload && !ns->bpf_tc_non_bound_accept) { in nsim_bpf_setup_tc_block_cb() 161 if (!cls_bpf->prog) in nsim_bpf_setup_tc_block_cb() 230 state->prog = prog; in nsim_bpf_create_prog() 295 if (bpf->prog && bpf->prog->aux->offload) { in nsim_setup_prog_checks() [all …]
|
/linux/scripts/ |
A D | sphinx-pre-install | 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); 183 my $prog = shift; 194 my $prog = shift; 210 foreach my $prog(@pkgs) { 221 foreach my $prog(@pkgs) { [all …]
|
/linux/drivers/net/ethernet/netronome/nfp/bpf/ |
A D | offload.c | 112 struct bpf_prog *prog) in nfp_map_ptrs_record() argument 137 prog->aux->used_maps[i]); in nfp_map_ptrs_record() 162 meta->insn = prog[i]; in nfp_prog_prepare() 202 nfp_prog->type = prog->type; in nfp_bpf_verifier_prep() 205 ret = nfp_prog_prepare(nfp_prog, prog->insnsi, prog->len); in nfp_bpf_verifier_prep() 234 if (!nfp_prog->prog) in nfp_bpf_translate() 242 prog->aux->offload->jited_image = nfp_prog->prog; in nfp_bpf_translate() 251 kvfree(nfp_prog->prog); in nfp_bpf_destroy() 580 if (prog && !bpf_offload_dev_match(prog, nn->dp.netdev)) in nfp_net_bpf_offload() 583 if (prog && old_prog) { in nfp_net_bpf_offload() [all …]
|
/linux/include/linux/ |
A D | bpf.h | 542 struct bpf_prog *prog; member 646 bool prog; member 706 struct bpf_prog *prog; member 895 struct bpf_prog *prog; member 961 struct bpf_prog *prog; member 1134 struct bpf_prog *prog, 1153 struct bpf_prog *prog; member 1241 while ((prog = READ_ONCE(item->prog))) { in BPF_PROG_RUN_ARRAY_CG_FLAGS() 1270 while ((prog = READ_ONCE(item->prog))) { in BPF_PROG_RUN_ARRAY_CG() 1299 while ((prog = READ_ONCE(item->prog))) { in BPF_PROG_RUN_ARRAY() [all …]
|
/linux/net/core/ |
A D | sock_reuseport.c | 192 more_reuse->prog = reuse->prog; in reuseport_grow() 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() 475 struct bpf_prog *prog; in reuseport_select_sock() local 486 prog = rcu_dereference(reuse->prog); in reuseport_select_sock() 492 if (!prog || !skb) in reuseport_select_sock() 528 struct bpf_prog *prog; in reuseport_migrate_sock() local 546 prog = rcu_dereference(reuse->prog); in reuseport_migrate_sock() 547 if (!prog || prog->expected_attach_type != BPF_SK_REUSEPORT_SELECT_OR_MIGRATE) { in reuseport_migrate_sock() [all …]
|