linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v3 0/2] bpf: Allow XDP_REDIRECT for XDP dev-bound programs
@ 2025-04-28 15:44 Lorenzo Bianconi
  2025-04-28 15:44 ` [PATCH bpf-next v3 1/2] bpf: Allow XDP dev-bound programs to perform XDP_REDIRECT into maps Lorenzo Bianconi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lorenzo Bianconi @ 2025-04-28 15:44 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
	Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
	Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
	Mykola Lysenko, Shuah Khan
  Cc: bpf, netdev, linux-kselftest, Lorenzo Bianconi

In the current implementation if the program is dev-bound to a specific
device, it will not be possible to perform XDP_REDIRECT into a DEVMAP or
CPUMAP even if the program is running in the driver NAPI context.
Fix the issue introducing __bpf_prog_map_compatible utility routine in
order to avoid bpf_prog_is_dev_bound() during the XDP program load.
Continue forbidding to attach a dev-bound program to XDP maps.

---
Changes in v3:
- move seltest changes in a dedicated patch
- Link to v2: https://lore.kernel.org/r/20250423-xdp-prog-bound-fix-v2-1-51742a5dfbce@kernel.org

Changes in v2:
- Introduce __bpf_prog_map_compatible() utility routine in order to skip
  bpf_prog_is_dev_bound check in bpf_check_tail_call()
- Extend xdp_metadata selftest
- Link to v1: https://lore.kernel.org/r/20250422-xdp-prog-bound-fix-v1-1-0b581fa186fe@kernel.org

---
Lorenzo Bianconi (2):
      bpf: Allow XDP dev-bound programs to perform XDP_REDIRECT into maps
      selftests/bpf: xdp_metadata: check XDP_REDIRCT support for dev-bound progs

 kernel/bpf/core.c                                  | 27 +++++++++++++---------
 .../selftests/bpf/prog_tests/xdp_metadata.c        | 22 +++++++++++++++++-
 tools/testing/selftests/bpf/progs/xdp_metadata.c   | 13 +++++++++++
 3 files changed, 50 insertions(+), 12 deletions(-)
---
base-commit: 91dbac4076537b464639953c055c460d2bdfc7ea
change-id: 20250422-xdp-prog-bound-fix-9f30f3e134aa

Best regards,
-- 
Lorenzo Bianconi <lorenzo@kernel.org>


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

end of thread, other threads:[~2025-05-01 20:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-28 15:44 [PATCH bpf-next v3 0/2] bpf: Allow XDP_REDIRECT for XDP dev-bound programs Lorenzo Bianconi
2025-04-28 15:44 ` [PATCH bpf-next v3 1/2] bpf: Allow XDP dev-bound programs to perform XDP_REDIRECT into maps Lorenzo Bianconi
2025-04-28 15:44 ` [PATCH bpf-next v3 2/2] selftests/bpf: xdp_metadata: check XDP_REDIRCT support for dev-bound progs Lorenzo Bianconi
2025-05-01 21:00 ` [PATCH bpf-next v3 0/2] bpf: Allow XDP_REDIRECT for XDP dev-bound 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;
as well as URLs for NNTP newsgroup(s).