kernel/bpf/offload.c
Source file repositories/reference/linux-study-clean/kernel/bpf/offload.c
File Facts
- System
- Linux kernel
- Corpus path
kernel/bpf/offload.c- Extension
.c- Size
- 20279 bytes
- Lines
- 867
- Domain
- Core OS
- Bucket
- Scheduler, Processes, Timers, Sync, And Syscalls
- Inferred role
- Core OS: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bpf.hlinux/bpf_verifier.hlinux/bug.hlinux/kdev_t.hlinux/list.hlinux/lockdep.hlinux/netdevice.hlinux/printk.hlinux/proc_ns.hlinux/rhashtable.hlinux/rtnetlink.hlinux/rwsem.hnet/netdev_lock.hnet/xdp.h
Detected Declarations
struct bpf_offload_devstruct bpf_offload_netdevstruct ns_get_path_bpf_prog_argsstruct ns_get_path_bpf_map_argsfunction bpf_dev_offload_checkfunction bpf_offload_find_netdevfunction __bpf_offload_dev_netdev_registerfunction __bpf_prog_offload_destroyfunction bpf_map_offload_ndofunction __bpf_map_offload_destroyfunction __bpf_offload_dev_netdev_unregisterfunction __bpf_prog_dev_bound_initfunction bpf_prog_dev_bound_initfunction bpf_prog_dev_bound_inheritfunction bpf_prog_offload_verifier_prepfunction bpf_prog_offload_verify_insnfunction bpf_prog_offload_finalizefunction bpf_prog_offload_replace_insnfunction bpf_prog_offload_remove_insnsfunction bpf_prog_dev_bound_destroyfunction bpf_prog_offload_translatefunction bpf_prog_warn_on_execfunction bpf_prog_offload_compilefunction bpf_prog_offload_info_fillfunction bpf_map_offload_map_freefunction bpf_map_offload_map_mem_usagefunction bpf_map_offload_lookup_elemfunction bpf_map_offload_update_elemfunction bpf_map_offload_delete_elemfunction bpf_map_offload_get_next_keyfunction bpf_map_offload_info_fillfunction __bpf_offload_dev_matchfunction bpf_offload_dev_matchfunction bpf_prog_dev_bound_matchfunction bpf_offload_prog_map_matchfunction bpf_offload_dev_netdev_registerfunction bpf_offload_dev_netdev_unregisterfunction bpf_offload_dev_createfunction bpf_offload_dev_destroyfunction bpf_dev_bound_netdev_unregisterfunction bpf_dev_bound_kfunc_checkfunction bpf_offload_initmodule init bpf_offload_initexport bpf_offload_dev_matchexport bpf_offload_dev_netdev_registerexport bpf_offload_dev_netdev_unregisterexport bpf_offload_dev_createexport bpf_offload_dev_destroy
Annotated Snippet
core_initcall(bpf_offload_init);
Annotation
- Immediate include surface: `linux/bpf.h`, `linux/bpf_verifier.h`, `linux/bug.h`, `linux/kdev_t.h`, `linux/list.h`, `linux/lockdep.h`, `linux/netdevice.h`, `linux/printk.h`.
- Detected declarations: `struct bpf_offload_dev`, `struct bpf_offload_netdev`, `struct ns_get_path_bpf_prog_args`, `struct ns_get_path_bpf_map_args`, `function bpf_dev_offload_check`, `function bpf_offload_find_netdev`, `function __bpf_offload_dev_netdev_register`, `function __bpf_prog_offload_destroy`, `function bpf_map_offload_ndo`, `function __bpf_map_offload_destroy`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.