STRUCT NFP_INSN_META(9)
π struct nfp_insn_meta(9) β BPF instruction wrapper
okay so bestie, welcome to the Kernel API Manual entry for struct nfp_insn_meta, aka the little glow-up wrapper that holds one BPF instruction and all its side quests. this thing is literally the main character of the NFP BPF JIT. let's get into it π
β¨ SYNOPSIS β¨
struct nfp_insn_meta {
struct bpf_insn insn;
union {
struct {
struct bpf_reg_state ptr;
struct bpf_insn *paired_st;
s16 ldst_gather_len;
bool ptr_not_const;
struct {
s16 range_start;
s16 range_end;
bool do_init;
} pkt_cache;
bool xadd_over_16bit;
bool xadd_maybe_16bit;
};
struct {
struct nfp_insn_meta *jmp_dst;
bool jump_neg_op;
u32 num_insns_after_br;
};
struct {
u32 func_id;
struct bpf_reg_state arg1;
struct nfp_bpf_reg_state arg2;
};
struct {
u64 umin_src;
u64 umax_src;
u64 umin_dst;
u64 umax_dst;
};
};
unsigned int off;
unsigned short n;
unsigned short flags;
unsigned short subprog_idx;
instr_cb_t double_cb;
struct list_head l;
};
no cap, that's the whole shape of it. the big anonymous union in the middle means only one of those little structs is live at a time β it's giving "one outfit per occasion" energy. π¦
πΈ Members πΈ
the basics
insnβ the BPF instruction itself. the whole reason we're here fr fr.
{unnamed_union}
anonymous. she has no name and she doesn't need one π
{unnamed_struct} (the memory-ops one)
anonymous β this is the cluster for memory operations.
ptrβ pointer type for memory operationspaired_stβ the paired store insn at the head of the sequenceldst_gather_lenβ memcpy length gathered from load/store sequenceptr_not_constβ pointer is not always constantpkt_cacheβ packet data cache informationpkt_cache.range_startβ start offset for associated packet data cachepkt_cache.range_endβ end offset for associated packet data cachepkt_cache.do_initβ this read needs to initialize packet data cache
xadd_over_16bitβ 16bit immediate is not guaranteedxadd_maybe_16bitβ 16bit immediate is possible
{unnamed_struct} (the jump one)
anonymous β jump instructions get their own little corner π
jmp_dstβ destination info for jump instructionsjump_neg_opβ jump instruction has inverted immediate, useADDinstead ofSUBnum_insns_after_brβ number of insns following a branch jump, used for fixup
{unnamed_struct} (the call one)
anonymous β call instructions, bestie π
func_idβ function id for call instructionsarg1β arg1 for call instructionsarg2β arg2 for call instructions
{unnamed_struct} (the verifier-range one)
anonymous β the min/max bookkeeping squad.
umin_srcβ copy of core verifierumin_valuefor src opearnd. (yes the source really spells it "opearnd", we keep it verbatim, she's iconic π)umax_srcβ copy of core verifierumax_valuefor src operand.umin_dstβ copy of core verifierumin_valuefor dst opearnd.umax_dstβ copy of core verifierumax_valuefor dst operand.
the rest of the squad
offβ index of first generated machine instruction (innfp_prog.prog)nβ eBPF instruction numberflagsβ eBPF instruction extra optimization flagssubprog_idxβ index of subprogram to which the instruction belongsdouble_cbβ callback for second part of the instructionlβ link onnfp_prog->insnslist
not me pointing out that double_cb is literally a callback for the second part of the instruction β two-part release, we love a deluxe edition π₯
π SEE ALSO π
- Kernel file
./drivers/net/ethernet/netronome/nfp/bpf/main.hstruct nfp_app_bpf(9),struct nfp_bpf_map(9),struct nfp_bpf_reg_state(9),struct nfp_bpf_subprog_info(9),struct nfp_prog(9),struct nfp_bpf_vnic(9)
go read those too, they're all in the same friend group π«Ά
later bestie π this page came from ./drivers/net/ethernet/netrono... and it's dated October 2026 β so it's serving future-flavoured AND kernel-flavoured at the same time. obsessed. βπ
π¦ 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