drivers/net/ethernet/netronome/nfp/bpf/main.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/netronome/nfp/bpf/main.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/netronome/nfp/bpf/main.h- Extension
.h- Size
- 18027 bytes
- Lines
- 616
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/bpf.hlinux/bpf_verifier.hlinux/kernel.hlinux/list.hlinux/rhashtable.hlinux/skbuff.hlinux/types.hlinux/wait.h../ccm.h../nfp_asm.hfw.h
Detected Declarations
struct nfp_app_bpfstruct nfp_bpf_cap_adjust_headstruct nfp_bpf_map_wordstruct nfp_bpf_mapstruct nfp_bpf_neutral_mapstruct nfp_progstruct nfp_insn_metastruct nfp_bpf_reg_statestruct nfp_insn_metastruct nfp_bpf_subprog_infostruct nfp_progstruct nfp_bpf_vnicstruct netdev_bpfstruct nfp_appstruct nfp_netenum nfp_relo_typeenum static_regsenum pkt_vecenum nfp_bpf_map_usefunction mbpf_classfunction mbpf_srcfunction mbpf_opfunction mbpf_modefunction is_mbpf_alufunction is_mbpf_loadfunction is_mbpf_jmp32function is_mbpf_jmp64function is_mbpf_jmpfunction is_mbpf_storefunction is_mbpf_load_pktfunction is_mbpf_store_pktfunction is_mbpf_classic_loadfunction is_mbpf_classic_storefunction is_mbpf_classic_store_pktfunction is_mbpf_atomicfunction is_mbpf_mulfunction is_mbpf_divfunction is_mbpf_cond_jumpfunction is_mbpf_helper_callfunction is_mbpf_pseudo_call
Annotated Snippet
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;
};
enum nfp_bpf_map_use {
NFP_MAP_UNUSED = 0,
NFP_MAP_USE_READ,
NFP_MAP_USE_WRITE,
NFP_MAP_USE_ATOMIC_CNT,
};
struct nfp_bpf_map_word {
unsigned char type :4;
unsigned char non_zero_update :1;
};
#define NFP_BPF_MAP_CACHE_CNT 4U
#define NFP_BPF_MAP_CACHE_TIME_NS (250 * 1000)
/**
* struct nfp_bpf_map - private per-map data attached to BPF maps for offload
* @offmap: pointer to the offloaded BPF map
* @bpf: back pointer to bpf app private structure
* @tid: table id identifying map on datapath
*
* @cache_lock: protects @cache_blockers, @cache_to, @cache
* @cache_blockers: number of ops in flight which block caching
* @cache_gen: counter incremented by every blocker on exit
* @cache_to: time when cache will no longer be valid (ns)
* @cache: skb with cached response
*
* @l: link on the nfp_app_bpf->map_list list
* @use_map: map of how the value is used (in 4B chunks)
*/
struct nfp_bpf_map {
struct bpf_offloaded_map *offmap;
struct nfp_app_bpf *bpf;
u32 tid;
spinlock_t cache_lock;
u32 cache_blockers;
u32 cache_gen;
u64 cache_to;
struct sk_buff *cache;
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bpf.h`, `linux/bpf_verifier.h`, `linux/kernel.h`, `linux/list.h`, `linux/rhashtable.h`, `linux/skbuff.h`, `linux/types.h`.
- Detected declarations: `struct nfp_app_bpf`, `struct nfp_bpf_cap_adjust_head`, `struct nfp_bpf_map_word`, `struct nfp_bpf_map`, `struct nfp_bpf_neutral_map`, `struct nfp_prog`, `struct nfp_insn_meta`, `struct nfp_bpf_reg_state`, `struct nfp_insn_meta`, `struct nfp_bpf_subprog_info`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.