BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 1/2] bpf: add get_netns_cookie helper to cgroup_skb programs
@ 2025-02-25 12:50 Mahe Tardy
  2025-02-25 12:50 ` [PATCH bpf-next 2/2] selftests/bpf: add cgroup_skb netns cookie tests Mahe Tardy
  2025-02-26 15:40 ` [PATCH bpf-next 1/2] bpf: add get_netns_cookie helper to cgroup_skb programs patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Mahe Tardy @ 2025-02-25 12:50 UTC (permalink / raw)
  To: bpf; +Cc: martin.lau, daniel, john.fastabend, ast, andrii, Mahe Tardy

This is needed in the context of Cilium and Tetragon to retrieve netns
cookie from hostns when traffic leaves Pod, so that we can correlate
skb->sk's netns cookie.

Signed-off-by: Mahe Tardy <mahe.tardy@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 2ec162dd83c4..827108c6dad9 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -8075,6 +8075,8 @@ sk_filter_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
 		return &bpf_skb_load_bytes_relative_proto;
 	case BPF_FUNC_get_socket_cookie:
 		return &bpf_get_socket_cookie_proto;
+	case BPF_FUNC_get_netns_cookie:
+		return &bpf_get_netns_cookie_proto;
 	case BPF_FUNC_get_socket_uid:
 		return &bpf_get_socket_uid_proto;
 	case BPF_FUNC_perf_event_output:
--
2.34.1


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

end of thread, other threads:[~2025-02-26 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25 12:50 [PATCH bpf-next 1/2] bpf: add get_netns_cookie helper to cgroup_skb programs Mahe Tardy
2025-02-25 12:50 ` [PATCH bpf-next 2/2] selftests/bpf: add cgroup_skb netns cookie tests Mahe Tardy
2025-02-26 15:40 ` [PATCH bpf-next 1/2] bpf: add get_netns_cookie helper to cgroup_skb programs patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox