BPF List
 help / color / mirror / Atom feed
From: Mahe Tardy <mahe.tardy@gmail.com>
To: bot+bpf-ci@kernel.org
Cc: bpf@vger.kernel.org, andrew+netdev@lunn.ch, andrii@kernel.org,
	ast@kernel.org, daniel@iogearbox.net, davem@davemloft.net,
	eddyz87@gmail.com, edumazet@google.com, john.fastabend@gmail.com,
	kuba@kernel.org, martin.lau@linux.dev, pabeni@redhat.com,
	song@kernel.org, liamwisehart@meta.com, martin.lau@kernel.org,
	yonghong.song@linux.dev, clm@meta.com, ihor.solodrai@linux.dev
Subject: Re: [PATCH v1 1/4] bpf: Add netpoll kfuncs for sending UDP packets
Date: Mon, 11 May 2026 11:51:16 +0200	[thread overview]
Message-ID: <agGmlIqgqTX_w2l1@gmail.com> (raw)
In-Reply-To: <a310c8a6fbd8442e4976bb9b80156376bc6c1fe668ddcf94052822924835949c@mail.kernel.org>

On Mon, May 11, 2026 at 09:40:32AM +0000, bot+bpf-ci@kernel.org wrote:
> > The API consists of four kfuncs:
> >
> >   bpf_netpoll_create()   - Allocate and set up a netpoll context
> >                            (sleepable, SYSCALL prog type only)
> >   bpf_netpoll_acquire()  - Acquire a reference to a netpoll context
> >   bpf_netpoll_release()  - Release a reference (cleanup via
> >                            queue_rcu_work since netpoll_cleanup sleeps)
> >   bpf_netpoll_send_udp() - Send a UDP packet (any context, LSM prog
> >                            type only for now)
> 
> The commit message states bpf_netpoll_send_udp() is "LSM prog type only
> for now," but looking at the implementation in bpf_netpoll_kfunc_init(),
> the function registers netpoll_kfunc_set using BPF_PROG_TYPE_UNSPEC:
> 
> net/core/bpf_netpoll.c:bpf_netpoll_kfunc_init() {
>     ...
>     ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_UNSPEC,
>                                            &netpoll_kfunc_set);
>     ...
> }
> 
> Per bpf_prog_type_to_kfunc_hook() in kernel/bpf/btf.c, BPF_PROG_TYPE_UNSPEC
> maps to BTF_KFUNC_HOOK_COMMON, which makes the kfunc available to ALL BPF
> program types, not just LSM.
> 
> The check in btf_kfunc_is_allowed() tests BTF_KFUNC_HOOK_COMMON first and
> returns true if the kfunc is present there, so any program type (tracing,
> kprobe, XDP, sched-cls, etc.) can call bpf_netpoll_send_udp().
> 
> Is the commit message stale, or should the registration be
> BPF_PROG_TYPE_LSM instead of BPF_PROG_TYPE_UNSPEC to match the stated
> design?

Ah indeed, this a stale commit message, will fix in v2. The real
intention is to make it BPF_PROG_TYPE_UNSPEC. Will wait on some more
reviews before submitting.

> ---
> AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
> See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
> 
> CI run summary: https://github.com/kernel-patches/bpf/actions/runs/25660780250


  reply	other threads:[~2026-05-11  9:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11  8:53 [PATCH v1 0/4] bpf: Introduce bpf_netpoll Mahe Tardy
2026-05-11  8:53 ` [PATCH v1 1/4] bpf: Add netpoll kfuncs for sending UDP packets Mahe Tardy
2026-05-11  9:40   ` bot+bpf-ci
2026-05-11  9:51     ` Mahe Tardy [this message]
2026-05-11 12:05   ` Daniel Borkmann
2026-05-12  8:51     ` Mahe Tardy
2026-05-12  1:20   ` Jakub Kicinski
2026-05-12  1:59     ` Alexei Starovoitov
2026-05-12  2:36       ` Jakub Kicinski
2026-05-12  2:59         ` Alexei Starovoitov
2026-05-11  8:53 ` [PATCH v1 2/4] selftests/bpf: Add netpoll kfunc sanity test Mahe Tardy
2026-05-11  8:53 ` [PATCH v1 3/4] selftests/bpf: Add netpoll kfunc IPv6 variant test Mahe Tardy
2026-05-11  8:53 ` [PATCH v1 4/4] selftests/bpf: Add netpoll setup basic tests Mahe Tardy

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=agGmlIqgqTX_w2l1@gmail.com \
    --to=mahe.tardy@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bot+bpf-ci@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=liamwisehart@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=pabeni@redhat.com \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox