___bpf_prog_run(9)
π
___bpf_prog_run(9) β from the Kernel API Manual, bestie π«Ά
okay so picture this: you've got an eBPF program just vibing there, fully loaded, ready to go, and somebody has to actually run it on a context. that someone is this function. she's the main character of the eBPF interpreter, no cap π
β¨ NAME β¨
___bpf_prog_run β run an eBPF program on a given context. that's it. that's the whole gig π
πΈ SYNOPSIS πΈ
u64 ___bpf_prog_run (u64 *regs , const struct bpf_insn *insn );
look at her. three underscores in front because she's that girl. returns a u64, takes two pointers, zero notes π
π ARGUMENTS π
regsβ the array ofMAX_BPF_EXT_REGeBPF pseudo-registers. yes,MAX_BPF_EXT_REGof them, exactly that many, don't @ me. this is the register file, the whole cast of characters π§insnβ the array of eBPF instructions. this is the script, the choreography, the thing that's about to get decoded and executed fr fr π¦
π« DESCRIPTION π«
Decode and execute eBPF instructions.
like. that's literally it. you hand her the registers, you hand her the instruction array, and she goes through them β decoding, executing, doing the absolute most β until the program is done. the way she just reads bytecode and runs it? iconic. lowkey the whole kernel depends on her π
β RETURN β
whatever value is in BPF_R0 at program exit. not a metaphor, not a vibe, literally whatever ended up sitting in BPF_R0 when the program wrapped up. she doesn't editorialize, she just returns it π
π₯ SEE ALSO π₯
- Kernel file
./kernel/bpf/core.c bpf_prog_select_runtime(9)bpf_prog_array_delete_safe_at(9)bpf_prog_array_update_at(9)
go read those too, i'm begging you, they're all in the same friend group π
ngl the synopsis line has some spicy spacing β u64 *regs , const struct bpf_insn *insn β that space before the comma is canon, do not come for her π
okay that's the page!! source lives in ./kernel/bpf, version/date stamp is October 2026, and the manual is the Kernel API Manual β mwah, hope this helped, go run some eBPF bestie πππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms