aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorAmery Hung <ameryhung@gmail.com>2025-09-25 10:00:12 -0700
committerMartin KaFai Lau <martin.lau@kernel.org>2025-09-25 14:29:46 -0700
commitbc8712f2b5250825968e6b0c3d2709a4b9d5d570 (patch)
treef53b52c3c847c7d32c5d34762323c63b7846cfb8 /net/core
parentselftests/bpf: Task_work selftest cleanup fixes (diff)
downloadlinux-bc8712f2b5250825968e6b0c3d2709a4b9d5d570.tar.gz
linux-bc8712f2b5250825968e6b0c3d2709a4b9d5d570.zip
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
Diffstat (limited to 'net/core')
-rw-r--r--net/core/filter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index b20d59bb19b8..2af0a5f1d748 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -7439,6 +7439,8 @@ u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type,
offsetof(struct xdp_sock, FIELD)); \
} while (0)
+ BTF_TYPE_EMIT(struct bpf_xdp_sock);
+
switch (si->off) {
case offsetof(struct bpf_xdp_sock, queue_id):
BPF_XDP_SOCK_GET(queue_id);