Skip to content

skip ENOTSUPP BPF selftests

Geliang Tang bpf linux-kselftest 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 4 repliesIn review
  2. v16 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Although all CI tests passed on x86_64 "bpf/vmtest-bpf-next-VM_Test-22
Logs for x86_64-gcc / test (test_progs, false, 360) / test_progs on x86_64 with gcc", some unexpect "SKIP"s are showed in the log:

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6selftests/bpf: Define ENOTSUPP in testing_helpers.htools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c tools/testing/selftests/bpf/prog_tests/lsm_cgroup.c tools/testing/selftests/bpf/prog_tests/sock_addr.c +3 more+4 -200 replies
2/6selftests/bpf: Skip ENOTSUPP in ASSERT_OKtools/testing/selftests/bpf/prog_tests/lsm_cgroup.c tools/testing/selftests/bpf/test_progs.h+22 -72 replies
3/6selftests/bpf: Use ASSERT_OK to skip ENOTSUPPtools/testing/selftests/bpf/prog_tests/d_path.c tools/testing/selftests/bpf/prog_tests/module_attach.c tools/testing/selftests/bpf/prog_tests/ringbuf.c +3 more+6 -60 replies
4/6selftests/bpf: Null checks for link in bpf_tcp_catools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c+12 -42 replies
5/6selftests/bpf: Skip ENOTSUPP in ASSERT_OK_PTRtools/testing/selftests/bpf/test_progs.h+2 -10 replies
6/6selftests/bpf: Skip ENOTSUPP in ASSERT_GEtools/testing/selftests/bpf/test_progs.h+4 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/6] skip ENOTSUPP BPF selftests

From: Geliang Tang <[email protected]>

v2:
- Although all CI tests passed on x86_64 "bpf/vmtest-bpf-next-VM_Test-22
Logs for x86_64-gcc / test (test_progs, false, 360) / test_progs on x86_64 with gcc", some unexpect "SKIP"s are showed in the log:

  #29/1    bpf_tcp_ca/dctcp:SKIP
  #29/2    bpf_tcp_ca/cubic:OK
  #29/3    bpf_tcp_ca/invalid_license:OK
  #29/4    bpf_tcp_ca/dctcp_fallback:SKIP
  #29/5    bpf_tcp_ca/rel_setsockopt:OK
  #29/6    bpf_tcp_ca/write_sk_pacing:OK
  #29/7    bpf_tcp_ca/incompl_cong_ops:OK
  #29/8    bpf_tcp_ca/unsupp_cong_op:OK
  #29/9    bpf_tcp_ca/update_ca:OK
  #29/10   bpf_tcp_ca/update_wrong:OK
  #29/11   bpf_tcp_ca/mixed_links:OK
  #29/12   bpf_tcp_ca/multi_links:OK
  #29/13   bpf_tcp_ca/link_replace:OK
  #29/14   bpf_tcp_ca/tcp_ca_kfunc:OK
  #29/15   bpf_tcp_ca/cc_cubic:OK
  #29/16   bpf_tcp_ca/dctcp_autoattach_map:SKIP
  #29      bpf_tcp_ca:OK (SKIP: 3/16)

Shouldn't skip any tests on X86_64. Fix this in v2.

- add a new helper test_progs_get_error.

BPF selftests seem to have not been fully tested on Loongarch platforms. There are so many "ENOTSUPP" (-524) errors when running BPF selftests on them since lacking BPF trampoline on Loongarch.

For these "ENOTSUPP" tests, it's better to skip them, instead of reporting some "ENOTSUPP" errors. This patchset skips ENOTSUPP in ASSERT_OK/ ASSERT_OK_PTR/ASSERT_GE helpers to fix them. This is useful for running BPF selftests for other architectures too.

Geliang Tang (6):
selftests/bpf: Define ENOTSUPP in testing_helpers.h selftests/bpf: Skip ENOTSUPP in ASSERT_OK selftests/bpf: Use ASSERT_OK to skip ENOTSUPP selftests/bpf: Null checks for link in bpf_tcp_ca selftests/bpf: Skip ENOTSUPP in ASSERT_OK_PTR selftests/bpf: Skip ENOTSUPP in ASSERT_GE

 .../selftests/bpf/prog_tests/bpf_tcp_ca.c     | 20 ++++++-----
 .../testing/selftests/bpf/prog_tests/d_path.c |  2 +-
 .../selftests/bpf/prog_tests/lsm_cgroup.c     | 10 +-----
 .../selftests/bpf/prog_tests/module_attach.c  |  2 +-
 .../selftests/bpf/prog_tests/ringbuf.c        |  2 +-
 .../selftests/bpf/prog_tests/sock_addr.c      |  4 ---
 .../selftests/bpf/prog_tests/test_bprm_opts.c |  2 +-
 .../selftests/bpf/prog_tests/test_ima.c       |  2 +-
 .../selftests/bpf/prog_tests/trace_ext.c      |  2 +-
 tools/testing/selftests/bpf/test_maps.c       |  4 ---
 tools/testing/selftests/bpf/test_progs.h      | 33 +++++++++++++++----
 tools/testing/selftests/bpf/test_verifier.c   |  4 ---
 tools/testing/selftests/bpf/testing_helpers.h |  4 +++
 13 files changed, 50 insertions(+), 41 deletions(-)
Signature · 1 line
2.43.0