STRUCT NFP_APP_BPF(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct nfp_app_bpf β€” the bpf app priv structure, bestie

okay so real talk: this page lives in the Kernel API Manual (section 9, kernel internals, iykyk), and it's all about struct nfp_app_bpf β€” literally the bpf app priv structure. that's the whole NAME. short, sweet, iconic. ✨


🌸 SYNOPSIS 🌸

bestie. look at her. she's gorgeous. copy this exactly, no cap:

struct nfp_app_bpf {
    struct nfp_app *app;
    struct nfp_ccm ccm;
    struct bpf_offload_dev *bpf_dev;
    unsigned int cmsg_key_sz;
    unsigned int cmsg_val_sz;
    unsigned int cmsg_cache_cnt;
    struct list_head map_list;
    unsigned int maps_in_use;
    unsigned int map_elems_in_use;
    struct rhashtable maps_neutral;
    u32 abi_version;
    struct nfp_bpf_cap_adjust_head {
      u32 flags;
      int off_min;
      int off_max;
      int guaranteed_sub;
      int guaranteed_add;
    } adjust_head;
    struct {
      u32 types;
      u32 max_maps;
      u32 max_elems;
      u32 max_key_sz;
      u32 max_val_sz;
      u32 max_elem_sz;
    } maps;
    struct {
      u32 map_lookup;
      u32 map_update;
      u32 map_delete;
      u32 perf_event_output;
    } helpers;
    bool pseudo_random;
    bool queue_select;
    bool adjust_tail;
    bool cmsg_multi_ent;
 };

she ate. periodt. 🫢


✨ Members ✨

the app-side girlies

  • app β€” backpointer to the app. she knows where she came from πŸ’–
  • ccm β€” common control message handler data
  • bpf_dev β€” the BPF offload device handle
  • cmsg_key_sz β€” size of key in cmsg element array
  • cmsg_val_sz β€” size of value in cmsg element array
  • cmsg_cache_cnt β€” number of entries to read for caching. she's counting, lowkey πŸ“–

the map accounting section (very responsible, we love her)

  • map_list β€” list of offloaded maps
  • maps_in_use β€” number of currently offloaded maps
  • map_elems_in_use β€” number of elements allocated to offloaded maps
  • maps_neutral β€” hash table of offload-neutral maps (on pointer)

versioning & vibes

  • abi_version β€” global BPF ABI version

adjust_head β€” the adjust head capability 🌈

  • adjust_head.flags β€” extra flags for adjust head
  • adjust_head.off_min β€” minimal packet offset within buffer required
  • adjust_head.off_max β€” maximum packet offset within buffer required
  • adjust_head.guaranteed_sub β€” negative adjustment guaranteed possible
  • adjust_head.guaranteed_add β€” positive adjustment guaranteed possible

maps β€” the map capability block πŸ‘‘

  • maps.types β€” supported map types
  • maps.max_maps β€” max number of maps supported
  • maps.max_elems β€” max number of entries in each map
  • maps.max_key_sz β€” max size of map key
  • maps.max_val_sz β€” max size of map value
  • maps.max_elem_sz β€” max size of map entry (key + value)

helpers β€” helper addressess for various calls 🧚

ngl, the original spells it "addressess" and we're keeping it, it's canon now πŸ’€
  • helpers.map_lookup β€” map lookup helper address
  • helpers.map_update β€” map update helper address
  • helpers.map_delete β€” map delete helper address
  • helpers.perf_event_output β€” output perf event to a ring buffer

the bool girlies πŸ¦‹

  • pseudo_random β€” FW initialized the pseudo-random machinery (CSRs)
  • queue_select β€” BPF can set the RX queue ID in packet vector
  • adjust_tail β€” BPF can simply trunc packet size for adjust tail
  • cmsg_multi_ent β€” FW can pack multiple map entries in a single cmsg

the way this struct has range. main character energy fr fr. πŸŽ€


πŸ’œ SEE ALSO πŸ’œ

go read these next, bestie, they're all family:

  • Kernel file ./drivers/net/ethernet/netronome/nfp/bpf/main.h
  • struct nfp_bpf_map(9)
  • struct nfp_bpf_reg_state(9)
  • struct nfp_insn_meta(9)
  • struct nfp_bpf_subprog_info(9)
  • struct nfp_prog(9)
  • struct nfp_bpf_vnic(9)

okay and that's the whole page!! πŸ“ this one came from ./drivers/net/ethernet/netrono... and it's dated October 2026, so yeah, timestamped and everything πŸ’… go off, kernel docs. mwah. πŸ˜­πŸ’–

πŸ“¦ where this page comes from