All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 1/2] bpf: Emit struct bpf_xdp_sock type in vmlinux BTF
@ 2025-09-25 17:00 Amery Hung
  2025-09-25 17:00 ` [PATCH bpf-next 2/2] selftests/bpf: Test changing packet data from global functions with a kfunc Amery Hung
  2025-09-25 21:40 ` [PATCH bpf-next 1/2] bpf: Emit struct bpf_xdp_sock type in vmlinux BTF patchwork-bot+netdevbpf
  0 siblings, 2 replies; 5+ messages in thread
From: Amery Hung @ 2025-09-25 17:00 UTC (permalink / raw)
  To: bpf; +Cc: netdev, alexei.starovoitov, andrii, daniel, martin.lau,
	kernel-team

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>
---
 net/core/filter.c | 2 ++
 1 file changed, 2 insertions(+)

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);
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-09-25 23:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-25 17:00 [PATCH bpf-next 1/2] bpf: Emit struct bpf_xdp_sock type in vmlinux BTF Amery Hung
2025-09-25 17:00 ` [PATCH bpf-next 2/2] selftests/bpf: Test changing packet data from global functions with a kfunc Amery Hung
2025-09-25 21:58   ` Martin KaFai Lau
2025-09-25 23:16     ` Amery Hung
2025-09-25 21:40 ` [PATCH bpf-next 1/2] bpf: Emit struct bpf_xdp_sock type in vmlinux BTF patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.