All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: Mahe Tardy <mahe.tardy@gmail.com>
Cc: daniel@iogearbox.net, john.fastabend@gmail.com, ast@kernel.org,
	andrii@kernel.org, jolsa@kernel.org, bpf@vger.kernel.org,
	Network Development <netdev@vger.kernel.org>
Subject: Re: [PATCH bpf-next 1/2] bpf: add get_netns_cookie helper to tracing programs
Date: Thu, 27 Feb 2025 12:32:43 -0800	[thread overview]
Message-ID: <96dbd7df-1fa7-4caa-a52c-372d696e0f38@linux.dev> (raw)
In-Reply-To: <20250227182830.90863-1-mahe.tardy@gmail.com>

On 2/27/25 10:28 AM, Mahe Tardy wrote:
> 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>
> ---
> This is a follow-up of c221d3744ad3 ("bpf: add get_netns_cookie helper
> to cgroup_skb programs") and eb62f49de7ec ("bpf: add get_netns_cookie
> helper to tc programs"), adding this helper respectively to cgroup_skb
> and tcx programs.
> 
> I looked up a patch doing a similar thing c5dbb89fc2ac ("bpf: Expose
> bpf_get_socket_cookie to tracing programs") and there was an item about
> "sleepable context". It seems it indeed concerns tracing and LSM progs
> from reading 1e6c62a88215 ("bpf: Introduce sleepable BPF programs"). Is
> this needed here?

Regarding sleepable, I think the bpf_get_netns_cookie_sock is only reading, 
should be fine.

The immediate question is whether sock_net(sk) must be non-NULL for tracing.


  parent reply	other threads:[~2025-02-27 20:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27 18:28 [PATCH bpf-next 1/2] bpf: add get_netns_cookie helper to tracing programs Mahe Tardy
2025-02-27 18:28 ` [PATCH bpf-next 2/2] selftests/bpf: add tracing netns cookie tests Mahe Tardy
2025-02-27 20:32 ` Martin KaFai Lau [this message]
2025-03-03 10:14   ` [PATCH bpf-next 1/2] bpf: add get_netns_cookie helper to tracing programs Mahe Tardy
2025-03-03 19:14     ` Martin KaFai Lau
2025-03-06 17:03       ` Mahe Tardy
2025-03-07 23:06         ` Martin KaFai Lau
2025-03-08  6:17           ` Yonghong Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96dbd7df-1fa7-4caa-a52c-372d696e0f38@linux.dev \
    --to=martin.lau@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=mahe.tardy@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.