STRUCT NFP_PROG(9)
β¨ struct nfp_prog(9) β¨
okay so this is the Kernel API Manual page for struct nfp_prog, which is, like, the nfp BPF program struct π
bestie, this is the whole vibe of a translated BPF program living its best life inside the nfp driver. grab a lil snack, we're going member by member π
πΈ SYNOPSIS πΈ
struct nfp_prog {
struct nfp_app_bpf *bpf;
u64 *prog;
unsigned int prog_len;
unsigned int __prog_alloc_len;
unsigned int stack_size;
struct nfp_insn_meta *verifier_meta;
enum bpf_prog_type type;
unsigned int last_bpf_off;
unsigned int tgt_out;
unsigned int tgt_abort;
unsigned int tgt_call_push_regs;
unsigned int tgt_call_pop_regs;
unsigned int n_translated;
int error;
unsigned int stack_frame_depth;
unsigned int adjust_head_location;
unsigned int map_records_cnt;
unsigned int subprog_cnt;
struct nfp_bpf_neutral_map **map_records;
struct nfp_bpf_subprog_info *subprog;
unsigned int n_insns;
struct list_head insns;
};
no cap, that's the whole struct, every single field, we do not skip π«Ά
π Members π
okay this is the part where we meet the cast, main character energy only:
bpfβ backpointer to the bpf app priv structure. it's giving "knows where it came from" πprogβ the machine code itself. the actual beef π₯prog_lenβ number of valid instructions in theprogarray. like, how many of them are actually real, bestie__prog_alloc_lenβ alloc size of theprogarray. the mall budget vs. the actual spend, iykykstack_sizeβ total amount of stack used. the full stack situation πΈverifier_metaβ temporary storage for the verifier's insn meta. it's just visiting, it doesn't live heretypeβ BPF program type. the genre of this program, if u willlast_bpf_offβ address of the last instruction translated from BPF. the lil landmark for where the translating got totgt_outβ jump target for normal exit. the happy path π¦tgt_abortβ jump target for abort (e.g. access outside of packet buffer). the "something went wrong" exit, dramatic but necessary πtgt_call_push_regsβ jump target for subroutine for saving R6~R9 to stack. saving the registers, iconic behaviourtgt_call_pop_regsβ jump target for subroutine used for restoring R6~R9. bringing them back, no capn_translatedβ number of successfully translated instructions (for errors). the success counter, and yes it's also the error-reporting girlieerrorβ error code if something went wrong. if this is set, we're not slaying, we're coping πstack_frame_depthβ max stack depth for current frame. deep like my feelings about Unix tbhadjust_head_locationβ if program has single adjust head call β the insn no. one single call, one lil number, periodtmap_records_cntβ the number of map pointers recorded for this progsubprog_cntβ number of sub-programs, including main function. yes, the main function counts, it's still a member of the family πmap_recordsβ the map record pointers frombpf->maps_neutral. neutral map records, very chill of themsubprogβ pointer to an array of objects holding info about sub-programs. a whole lil array of sub-program loren_insnsβ number of instructions oninsnslistinsnsβ list of BPF instruction wrappers (structnfp_insn_meta)
π SEE ALSO π
go read these next, bestie, they're all in the kernel file ./drivers/net/ethernet/netronome/nfp/bpf/main.h:
- struct
nfp_app_bpf(9) - struct
nfp_bpf_map(9) - struct
nfp_bpf_reg_state(9) - struct
nfp_insn_meta(9) - struct
nfp_bpf_subprog_info(9) - struct
nfp_bpf_vnic(9)
β¨ friendly reminder: this page is straight outta ./drivers/net/ethernet/netrono... (yes the header truncates it, that's just how it is) and it's dated October 2026 πΈ
okay that's the whole page, you ate that, go forth and translate some BPF, mwah πππ«Ά
π¦ 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