Skip to content

Switch reuseport tests for test_progs framework

Jakub Sitnicki bpf 1 version Applied

Status from this message: Applied. Thanks

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/10libbpf: Recognize SK_REUSEPORT programs from section nametools/lib/bpf/libbpf.c+1 -00 replies
2/10selftests/bpf: Let libbpf determine program type from section nametools/testing/selftests/bpf/progs/test_select_reuseport_kern.c tools/testing/selftests/bpf/test_select_reuseport.c+4 -100 replies
3/10selftests/bpf: Use sa_family_t everywhere in reuseport teststools/testing/selftests/bpf/test_select_reuseport.c+3 -30 replies
4/10selftests/bpf: Add helpers for getting socket family & type nametools/testing/selftests/bpf/test_select_reuseport.c+25 -30 replies
5/10selftests/bpf: Unroll the main loop in reuseport testtools/testing/selftests/bpf/test_select_reuseport.c+41 -320 replies
6/10selftests/bpf: Run reuseport tests in a looptools/testing/selftests/bpf/test_select_reuseport.c+34 -210 replies
7/10selftests/bpf: Propagate errors during setup for reuseport teststools/testing/selftests/bpf/test_select_reuseport.c+85 -510 replies
8/10selftests/bpf: Pull up printing the test name into test runnertools/testing/selftests/bpf/test_select_reuseport.c+12 -150 replies
9/10selftests/bpf: Move reuseport tests under prog_tests/tools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/prog_tests/select_reuseport.c+1 -10 replies
10/10selftests/bpf: Switch reuseport tests for test_progs frameworktools/testing/selftests/bpf/prog_tests/select_reuseport.c+131 -1360 replies

Reviews trailers per patch

None of the 10 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMartin KaFai Lau
SeriesA-b
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH bpf-next 00/10] Switch reuseport tests for test_progs framework

This change has been suggested by Martin Lau [0] during a review of a related patch set that extends reuseport tests [1].

Patches 1 & 2 address a warning due to unrecognized section name from libbpf when running reuseport tests. We don't want to carry this warning into test_progs.

Patches 3-8 massage the reuseport tests to ease the switch to test_progs framework. The intention here is to show the work. Happy to squash these, if needed.

Patches 9-10 do the actual move and conversion to test_progs.

Output from a test_progs run after changes pasted below.

Thanks,
Jakub

[0] https://lore.kernel.org/bpf/[email protected]/T/#m607d822caeb1eb5db101172821a78cc3896ff1c3
[1] https://lore.kernel.org/bpf/[email protected]/T/#m55881bae9fb6e34837d07a0c0a7ffbc138f8d06f

---8<---
bash-5.0# ./test_progs -t select_reuseport #33/1 IPv4/TCP LOOPBACK test_err_inner_map:OK #33/2 IPv4/TCP LOOPBACK test_err_skb_data:OK #33/3 IPv4/TCP LOOPBACK test_err_sk_select_port:OK #33/4 IPv4/TCP LOOPBACK test_pass:OK
#33/5 IPv4/TCP LOOPBACK test_syncookie:OK #33/6 IPv4/TCP LOOPBACK test_pass_on_err:OK #33/7 IPv4/TCP LOOPBACK test_detach_bpf:OK #33/8 IPv4/TCP INANY test_err_inner_map:OK #33/9 IPv4/TCP INANY test_err_skb_data:OK #33/10 IPv4/TCP INANY test_err_sk_select_port:OK #33/11 IPv4/TCP INANY test_pass:OK
#33/12 IPv4/TCP INANY test_syncookie:OK #33/13 IPv4/TCP INANY test_pass_on_err:OK #33/14 IPv4/TCP INANY test_detach_bpf:OK #33/15 IPv6/TCP LOOPBACK test_err_inner_map:OK #33/16 IPv6/TCP LOOPBACK test_err_skb_data:OK #33/17 IPv6/TCP LOOPBACK test_err_sk_select_port:OK #33/18 IPv6/TCP LOOPBACK test_pass:OK #33/19 IPv6/TCP LOOPBACK test_syncookie:OK #33/20 IPv6/TCP LOOPBACK test_pass_on_err:OK #33/21 IPv6/TCP LOOPBACK test_detach_bpf:OK #33/22 IPv6/TCP INANY test_err_inner_map:OK #33/23 IPv6/TCP INANY test_err_skb_data:OK #33/24 IPv6/TCP INANY test_err_sk_select_port:OK #33/25 IPv6/TCP INANY test_pass:OK
#33/26 IPv6/TCP INANY test_syncookie:OK #33/27 IPv6/TCP INANY test_pass_on_err:OK #33/28 IPv6/TCP INANY test_detach_bpf:OK #33/29 IPv4/UDP LOOPBACK test_err_inner_map:OK #33/30 IPv4/UDP LOOPBACK test_err_skb_data:OK #33/31 IPv4/UDP LOOPBACK test_err_sk_select_port:OK #33/32 IPv4/UDP LOOPBACK test_pass:OK #33/33 IPv4/UDP LOOPBACK test_syncookie:OK #33/34 IPv4/UDP LOOPBACK test_pass_on_err:OK #33/35 IPv4/UDP LOOPBACK test_detach_bpf:OK #33/36 IPv6/UDP LOOPBACK test_err_inner_map:OK #33/37 IPv6/UDP LOOPBACK test_err_skb_data:OK #33/38 IPv6/UDP LOOPBACK test_err_sk_select_port:OK #33/39 IPv6/UDP LOOPBACK test_pass:OK #33/40 IPv6/UDP LOOPBACK test_syncookie:OK #33/41 IPv6/UDP LOOPBACK test_pass_on_err:OK #33/42 IPv6/UDP LOOPBACK test_detach_bpf:OK #33 select_reuseport:OK
Summary: 1/42 PASSED, 0 SKIPPED, 0 FAILED --->8---

Jakub Sitnicki (10):
libbpf: Recognize SK_REUSEPORT programs from section name selftests/bpf: Let libbpf determine program type from section name selftests/bpf: Use sa_family_t everywhere in reuseport tests selftests/bpf: Add helpers for getting socket family & type name selftests/bpf: Unroll the main loop in reuseport test selftests/bpf: Run reuseport tests in a loop selftests/bpf: Propagate errors during setup for reuseport tests selftests/bpf: Pull up printing the test name into test runner selftests/bpf: Move reuseport tests under prog_tests/ selftests/bpf: Switch reuseport tests for test_progs framework

 tools/lib/bpf/libbpf.c                        |   1 +
 tools/testing/selftests/bpf/Makefile          |   2 +-
 .../select_reuseport.c}                       | 514 ++++++++++--------
 .../bpf/progs/test_select_reuseport_kern.c    |   2 +-
 4 files changed, 292 insertions(+), 227 deletions(-)
 rename tools/testing/selftests/bpf/{test_select_reuseport.c => prog_tests/select_reuseport.c} (54%)
Signature · 1 line
2.23.0