public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH bpf-next 0/4] bpf: Introduce bpf_netpoll
@ 2026-03-09 13:16 Mahe Tardy
  2026-03-09 13:16 ` [RFC PATCH bpf-next 1/4] bpf: Add netpoll kfuncs for sending UDP packets Mahe Tardy
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Mahe Tardy @ 2026-03-09 13:16 UTC (permalink / raw)
  To: bpf
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, martin.lau, daniel,
	john.fastabend, ast, andrii, eddyz87, song, Mahe Tardy

This patch series introduces bpf_netpoll, a set of BPF kfuncs that allow
BPF programs to send UDP packets via the netpoll infrastructure. This
provides a mechanism for BPF programs (e.g., LSM hooks) to emit
telemetry over UDP without depending on the regular networking stack.

For reference, this was discussed at LSF/MM/BPF 2025[^1] in Montreal,
and again at Plumbers 2025 in Tokyo. Liam Wisehart mentioned this work
during his presentation of BpfJailer[^2].

The main use case is to be able to completely dispense with
agents/daemons for BPF programs after startup. In the case of
Isovalent's Tetragon, the idea would be to be able to emit security
alerts or export data from BPF even when the agent is down. For meta,
according to Liam presentation[^2], this could replace logging via
ringbuffers which created cross-binary versioning issues.

The implementation follows the established kfunc lifecycle pattern
(create/acquire/release with refcounting, kptr map storage, dtor
registration), for example used by the network bpf_crypto kfuncs.

Further patches would extend the bpf_netpoll_send kfunc to more program
types. Note that network program types should not encounter recursion
issues as netpoll bypasses the network stack and sends directly to the
driver.

[^1]: https://lwn.net/Articles/1022034/
[^2]: https://lpc.events/event/19/contributions/2159/

Mahe Tardy (2):
  selftests/bpf: Add netpoll kfunc IPv6 variant test
  selftests/bpf: Add netpoll setup basic tests

Song Liu (2):
  bpf: Add netpoll kfuncs for sending UDP packets
  selftests/bpf: Add netpoll kfunc sanity test

 drivers/net/Kconfig                           |  11 +
 include/linux/bpf_netpoll.h                   |  38 ++++
 kernel/bpf/verifier.c                         |   3 +
 net/core/Makefile                             |   1 +
 net/core/bpf_netpoll.c                        | 209 ++++++++++++++++++
 tools/testing/selftests/bpf/config            |   1 +
 .../selftests/bpf/prog_tests/netpoll.c        | 140 ++++++++++++
 .../selftests/bpf/progs/netpoll_basic.c       |  47 ++++
 .../selftests/bpf/progs/netpoll_common.h      |  64 ++++++
 .../selftests/bpf/progs/netpoll_sanity.c      | 135 +++++++++++
 10 files changed, 649 insertions(+)
 create mode 100644 include/linux/bpf_netpoll.h
 create mode 100644 net/core/bpf_netpoll.c
 create mode 100644 tools/testing/selftests/bpf/prog_tests/netpoll.c
 create mode 100644 tools/testing/selftests/bpf/progs/netpoll_basic.c
 create mode 100644 tools/testing/selftests/bpf/progs/netpoll_common.h
 create mode 100644 tools/testing/selftests/bpf/progs/netpoll_sanity.c

-- 
2.34.1


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

end of thread, other threads:[~2026-03-10  5:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 13:16 [RFC PATCH bpf-next 0/4] bpf: Introduce bpf_netpoll Mahe Tardy
2026-03-09 13:16 ` [RFC PATCH bpf-next 1/4] bpf: Add netpoll kfuncs for sending UDP packets Mahe Tardy
2026-03-09 13:57   ` bot+bpf-ci
2026-03-09 16:26   ` Alexei Starovoitov
2026-03-09 18:52     ` Mahe Tardy
2026-03-10  5:07       ` Song Liu
2026-03-10  5:22         ` Alexei Starovoitov
2026-03-09 13:16 ` [RFC PATCH bpf-next 2/4] selftests/bpf: Add netpoll kfunc sanity test Mahe Tardy
2026-03-09 13:16 ` [RFC PATCH bpf-next 3/4] selftests/bpf: Add netpoll kfunc IPv6 variant test Mahe Tardy
2026-03-09 13:16 ` [RFC PATCH bpf-next 4/4] selftests/bpf: Add netpoll setup basic tests Mahe Tardy
2026-03-09 17:59 ` [RFC PATCH bpf-next 0/4] bpf: Introduce bpf_netpoll Jakub Kicinski
2026-03-09 19:29 ` Martin KaFai Lau
2026-03-10  4:56   ` Song Liu

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