From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Jakub Kicinski" <kuba@kernel.org>
Cc: "Mahe Tardy" <mahe.tardy@gmail.com>, <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>, <martin.lau@linux.dev>,
<pabeni@redhat.com>, <song@kernel.org>, <liamwisehart@meta.com>
Subject: Re: [PATCH v1 1/4] bpf: Add netpoll kfuncs for sending UDP packets
Date: Mon, 11 May 2026 19:59:55 -0700 [thread overview]
Message-ID: <DIGD21MXE0XM.3CLUL6BVK74PK@gmail.com> (raw)
In-Reply-To: <20260511193603.3ef00cee@kernel.org>
On Mon May 11, 2026 at 7:36 PM PDT, Jakub Kicinski wrote:
> On Mon, 11 May 2026 18:59:56 -0700 Alexei Starovoitov wrote:
>> unusable toys? What are you talking about?
>
> Please refer to the comments on the RFC. netpoll bypasses most of
> the networking stack. And there either has to be some user space
> to negotiate crypto or this is unusable for anyone serious.
encryption inside UDP packet is orthogonal.
netpoll as-is is usable and useful to send plain text
best effort messages.
>> netpoll is already called from everywhere.
>
> You mean all contexts because it's used by console?
yes
>> bpf_netpoll_send_udp() won't add any more bugs.
>
> Same as TLS + sockmap didn't? I spend enough time mopping up after
> people.
huh? comparing this to sockmap is apples and oranges.
>> I like this netpoll approach way more then creating and keeping proper socket
>> within bpf and all head aches of keeping it around and doing send from
>> good context. With netpoll all of these issues are gone.
>> Just bpf_netpoll_send_udp() from anywhere and it works just like it does
>> for dmesg.
>
> No, netpoll is high risk / brittle and tightly integrated with NAPI.
>
> "I don't want to run a tiny user space program" is nowhere near strong
> enough justification to expose this API. SMH.
No. Nothing to do with 'user space prog'.
What's brittle in netpoll? It works today in any context and
that's the main point. All the gotchas were resolved over the years
by heavy netconsole usage. Sure, it only works in mainstream
drivers like mlx, brcm and likely broken in niche drivers.
That's not obstacle at all.
netpoll_send_udp() is a perfect building block for best effort
try_to_sendmsg. I don't see the reason to reinvent the whole thing.
Because alternatives are much worse.
bpf progs would need to create UDP socket, split udp_sendmsg
into who knows what. Lots of design questions, code reviews, etc.
Way more headaches for everyone involved.
Doing full networking with dst,fib,nh from kernel context is complicated.
Works for NFS, but it's an uncharted territory for bpf.
While netpoll_send_udp() is available, easy to use and proven to work.
next prev parent reply other threads:[~2026-05-12 2:59 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
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 [this message]
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=DIGD21MXE0XM.3CLUL6BVK74PK@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=edumazet@google.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=liamwisehart@meta.com \
--cc=mahe.tardy@gmail.com \
--cc=martin.lau@linux.dev \
--cc=pabeni@redhat.com \
--cc=song@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox