STRUCT NFP_PROG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 the prog array. like, how many of them are actually real, bestie
  • __prog_alloc_len β€” alloc size of the prog array. the mall budget vs. the actual spend, iykyk
  • stack_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 here
  • type β€” BPF program type. the genre of this program, if u will
  • last_bpf_off β€” address of the last instruction translated from BPF. the lil landmark for where the translating got to
  • tgt_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 behaviour
  • tgt_call_pop_regs β€” jump target for subroutine used for restoring R6~R9. bringing them back, no cap
  • n_translated β€” number of successfully translated instructions (for errors). the success counter, and yes it's also the error-reporting girlie
  • error β€” 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 tbh
  • adjust_head_location β€” if program has single adjust head call β€” the insn no. one single call, one lil number, periodt
  • map_records_cnt β€” the number of map pointers recorded for this prog
  • subprog_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 from bpf->maps_neutral. neutral map records, very chill of them
  • subprog β€” pointer to an array of objects holding info about sub-programs. a whole lil array of sub-program lore
  • n_insns β€” number of instructions on insns list
  • insns β€” list of BPF instruction wrappers (struct nfp_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