tools/testing/selftests/bpf/prog_tests/test_xsk.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/prog_tests/test_xsk.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/prog_tests/test_xsk.h- Extension
.h- Size
- 10058 bytes
- Lines
- 323
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ethtool.hlinux/if_xdp.h../kselftest.hxsk.h
Detected Declarations
struct ifobjectstruct test_specstruct xsk_socket_infostruct xsk_umem_infostruct set_hw_ringstruct ifobjectstruct pktstruct pkt_streamstruct test_specenum test_modefunction ceil_u32function ceil_u64function read_procfs_valfunction pkt_continues
Annotated Snippet
struct xsk_socket_info {
struct xsk_ring_cons rx;
struct xsk_ring_prod tx;
struct xsk_umem_info *umem_real;
struct xsk_umem_info *umem;
struct xsk_socket *xsk;
struct pkt_stream *pkt_stream;
u32 outstanding_tx;
u32 rxqsize;
u32 batch_size;
u8 dst_mac[ETH_ALEN];
u8 src_mac[ETH_ALEN];
bool check_consumer;
};
int kick_rx(struct xsk_socket_info *xsk);
int kick_tx(struct xsk_socket_info *xsk);
struct xsk_umem_info {
struct xsk_ring_prod fq;
struct xsk_ring_cons cq;
struct xsk_umem *umem;
u64 next_buffer;
u64 mmap_size;
u32 num_frames;
u32 frame_headroom;
void *buffer;
u32 frame_size;
u32 base_addr;
u32 fill_size;
u32 comp_size;
bool unaligned_mode;
};
struct set_hw_ring {
u32 default_tx;
u32 default_rx;
};
int hw_ring_size_reset(struct ifobject *ifobj);
struct ifobject {
char ifname[MAX_INTERFACE_NAME_CHARS];
struct xsk_socket_info *xsk;
struct xsk_socket_info *xsk_arr;
thread_func_t func_ptr;
validation_func_t validation_func;
struct xsk_xdp_progs *xdp_progs;
struct bpf_map *xskmap;
struct bpf_program *xdp_prog;
struct ethtool_ringparam ring;
struct set_hw_ring set_ring;
enum test_mode mode;
int ifindex;
int mtu;
u32 bind_flags;
u32 xdp_zc_max_segs;
u32 umem_tailroom;
u32 max_skb_frags;
bool tx_on;
bool rx_on;
bool use_poll;
bool busy_poll;
bool use_fill_ring;
bool release_rx;
bool shared_umem;
bool use_metadata;
bool unaligned_supp;
bool multi_buff_supp;
bool multi_buff_zc_supp;
bool hw_ring_size_supp;
};
struct ifobject *ifobject_create(void);
void ifobject_delete(struct ifobject *ifobj);
int init_iface(struct ifobject *ifobj, thread_func_t func_ptr);
int xsk_configure_umem(struct ifobject *ifobj, struct xsk_umem_info *umem, void *buffer, u64 size);
int xsk_configure_socket(struct xsk_socket_info *xsk, struct xsk_umem_info *umem,
struct ifobject *ifobject, bool shared);
struct pkt {
int offset;
u32 len;
u32 pkt_nb;
bool valid;
u16 options;
};
struct pkt_stream {
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/if_xdp.h`, `../kselftest.h`, `xsk.h`.
- Detected declarations: `struct ifobject`, `struct test_spec`, `struct xsk_socket_info`, `struct xsk_umem_info`, `struct set_hw_ring`, `struct ifobject`, `struct pkt`, `struct pkt_stream`, `struct test_spec`, `enum test_mode`.
- Atlas domain: Support Tooling And Documentation / tools.
- 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.