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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/20191123110751.6729-1-jakub@xxxxxxxxxxxxxx/T/#m607d822caeb1eb5db101172821a78cc3896ff1c3
[1] https://lore.kernel.org/bpf/20191123110751.6729-1-jakub@xxxxxxxxxxxxxx/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%)

-- 
2.23.0




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux