netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v4 00/14] selftests/bpf: Migrate test_xdp_redirect_multi.sh to test_progs
@ 2025-01-31  7:21 Bastien Curutchet (eBPF Foundation)
  2025-01-31  7:21 ` [PATCH bpf-next v4 01/14] selftests/bpf: helpers: Add append_tid() Bastien Curutchet (eBPF Foundation)
                   ` (13 more replies)
  0 siblings, 14 replies; 17+ messages in thread
From: Bastien Curutchet (eBPF Foundation) @ 2025-01-31  7:21 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
	Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend,
	Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
	Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Mykola Lysenko, Shuah Khan
  Cc: Alexis Lothore, Thomas Petazzoni, netdev, bpf, linux-kselftest,
	linux-kernel, Bastien Curutchet (eBPF Foundation)

Hi all,

This patch series continues the work to migrate the *.sh tests into
prog_tests framework.

test_xdp_redirect_multi.sh tests the XDP redirections done through
bpf_redirect_map().

This is already partly covered by test_xdp_veth.c that already tests
map redirections at XDP level. What isn't covered yet by test_xdp_veth is
the use of the broadcast flags (BPF_F_BROADCAST or BPF_F_EXCLUDE_INGRESS)
and XDP egress programs.

Hence, this patch series add test cases to test_xdp_veth.c to get rid of
the test_xdp_redirect_multi.sh:
 - PATCH 1 Add an helper to generate unique names
 - PATCH 2 to 9 rework test_xdp_veth to make it more generic and allow to
   configure different test cases
 - PATCH 10 adds test cases for 'classic' bpf_redirect_map()
 - PATCH 11 and 12 cover the broadcast flags
 - PATCH 13 covers the XDP egress programs
 - PATCH 14 removes test_xdp_redirect_multi.sh

Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
---
Changes in v4:
- Remove the NO_IP #define
- append_tid() takes string's size as input to ensure there is enough
  space to fit the thread ID at the end
- Fix PATCH 12's commit log
- Link to v3: https://lore.kernel.org/r/20250128-redirect-multi-v3-0-c1ce69997c01@bootlin.com

Changes in v3:
- Add append_tid() helper and use unique names to allow parallel testing
- Check create_network()'s return value through ASSERT_OK()
- Remove check_ping() and unused defines
- Change next_veth type (from string to int)
- Link to v2: https://lore.kernel.org/r/20250121-redirect-multi-v2-0-fc9cacabc6b2@bootlin.com

Changes in v2:
- Use serial_test_* to avoid conflict between tests
- Link to v1: https://lore.kernel.org/r/20250121-redirect-multi-v1-0-b215e35ff505@bootlin.com

---
Bastien Curutchet (eBPF Foundation) (14):
      selftests/bpf: helpers: Add append_tid()
      selftests/bpf: test_xdp_veth: Remove unused defines
      selftests/bpf: test_xdp_veth: Remove unecessarry check_ping()
      selftests/bpf: test_xdp_veth: Use int to describe next veth
      selftests/bpf: test_xdp_veth: Split network configuration
      selftests/bpf: test_xdp_veth: Rename config[]
      selftests/bpf: test_xdp_veth: Add prog_config[] table
      selftests/bpf: test_xdp_veth: Add XDP flags to prog_configuration
      selftests/bpf: test_xdp_veth: Use unique names
      selftests/bpf: test_xdp_veth: Add new test cases for XDP flags
      selftests/bpf: Optionally select broadcasting flags
      selftests/bpf: test_xdp_veth: Add XDP broadcast redirection tests
      selftests/bpf: test_xdp_veth: Add XDP program on egress test
      selftests/bpf: Remove test_xdp_redirect_multi.sh

 tools/testing/selftests/bpf/Makefile               |   2 -
 tools/testing/selftests/bpf/network_helpers.c      |  17 +
 tools/testing/selftests/bpf/network_helpers.h      |  12 +
 .../selftests/bpf/prog_tests/test_xdp_veth.c       | 588 ++++++++++++++++-----
 .../testing/selftests/bpf/progs/xdp_redirect_map.c |  89 ++++
 .../selftests/bpf/progs/xdp_redirect_multi_kern.c  |  41 +-
 .../selftests/bpf/test_xdp_redirect_multi.sh       | 214 --------
 tools/testing/selftests/bpf/xdp_redirect_multi.c   | 226 --------
 8 files changed, 615 insertions(+), 574 deletions(-)
---
base-commit: 421ec9c8f46a25743870a8cbaff76de293752e00
change-id: 20250103-redirect-multi-245d6eafb5d1

Best regards,
-- 
Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>


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

end of thread, other threads:[~2025-02-03 13:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-31  7:21 [PATCH bpf-next v4 00/14] selftests/bpf: Migrate test_xdp_redirect_multi.sh to test_progs Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 01/14] selftests/bpf: helpers: Add append_tid() Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 02/14] selftests/bpf: test_xdp_veth: Remove unused defines Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 03/14] selftests/bpf: test_xdp_veth: Remove unecessarry check_ping() Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 04/14] selftests/bpf: test_xdp_veth: Use int to describe next veth Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 05/14] selftests/bpf: test_xdp_veth: Split network configuration Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 06/14] selftests/bpf: test_xdp_veth: Rename config[] Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 07/14] selftests/bpf: test_xdp_veth: Add prog_config[] table Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 08/14] selftests/bpf: test_xdp_veth: Add XDP flags to prog_configuration Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 09/14] selftests/bpf: test_xdp_veth: Use unique names Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 10/14] selftests/bpf: test_xdp_veth: Add new test cases for XDP flags Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 11/14] selftests/bpf: Optionally select broadcasting flags Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 12/14] selftests/bpf: test_xdp_veth: Add XDP broadcast redirection tests Bastien Curutchet (eBPF Foundation)
2025-02-01  1:33   ` Martin KaFai Lau
2025-02-03 12:59     ` Bastien Curutchet
2025-01-31  7:21 ` [PATCH bpf-next v4 13/14] selftests/bpf: test_xdp_veth: Add XDP program on egress test Bastien Curutchet (eBPF Foundation)
2025-01-31  7:21 ` [PATCH bpf-next v4 14/14] selftests/bpf: Remove test_xdp_redirect_multi.sh Bastien Curutchet (eBPF Foundation)

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).