Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Emit struct bpf_xdp_sock type in vmlinux BTF

Similar to other BPF UAPI struct, force emit BTF of struct bpf_xdp_sock
so that it is defined in vmlinux.h.

In a later patch, a selftest will use vmlinux.h to get the definition of
struct bpf_xdp_sock instead of bpf.h.

Signed-off-by: Amery Hung <ameryhung@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20250925170013.1752561-1-ameryhung@gmail.com

authored by

Amery Hung and committed by
Martin KaFai Lau
bc8712f2 5730dacb

+2
+2
net/core/filter.c
··· 7439 7439 offsetof(struct xdp_sock, FIELD)); \ 7440 7440 } while (0) 7441 7441 7442 + BTF_TYPE_EMIT(struct bpf_xdp_sock); 7443 + 7442 7444 switch (si->off) { 7443 7445 case offsetof(struct bpf_xdp_sock, queue_id): 7444 7446 BPF_XDP_SOCK_GET(queue_id);