Skip to content

Improve BPF selftests and use the library (net-next tree)

Mickaël Salaün lkml netdev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest11 patches 4 repliesIn review
  2. v411 patches 1 replySuperseded
  3. v311 patches 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v23 patches3 repliesSuperseded

Changes in v5 from the cover letter

* align text for function calls as requested by Daniel Borkmann (bpf_load_program and bpf_map_update_elem)
* rebase

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11tools: Sync {,tools/}include/uapi/linux/bpf.htools/include/uapi/linux/bpf.h+22 -10 replies
2/11bpf: Change the include directory for selftesttools/testing/selftests/bpf/Makefile+1 -10 replies
3/11bpf: Always test unprivileged programstools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/test_verifier.c+64 -60 replies
4/11bpf: Use bpf_load_program() from the librarytools/lib/bpf/bpf.c tools/lib/bpf/bpf.h tools/testing/selftests/bpf/Makefile +3 more+17 -322 replies
5/11bpf: Use bpf_map_update_elem() from the librarytools/lib/bpf/bpf.c tools/lib/bpf/bpf.h tools/testing/selftests/bpf/bpf_sys.h +3 more+99 -910 replies
6/11bpf: Use bpf_map_lookup_elem() from the librarytools/lib/bpf/bpf.c tools/lib/bpf/bpf.h tools/testing/selftests/bpf/bpf_sys.h +3 more+39 -500 replies
7/11bpf: Use bpf_map_delete_elem() from the librarytools/lib/bpf/bpf.c tools/lib/bpf/bpf.h tools/testing/selftests/bpf/bpf_sys.h +2 more+16 -260 replies
8/11bpf: Use bpf_map_get_next_key() from the librarytools/lib/bpf/bpf.c tools/lib/bpf/bpf.h tools/testing/selftests/bpf/bpf_sys.h +2 more+20 -310 replies
9/11bpf: Use bpf_create_map() from the librarytools/testing/selftests/bpf/bpf_sys.h tools/testing/selftests/bpf/test_lpm_map.c tools/testing/selftests/bpf/test_lru_map.c +3 more+15 -300 replies
10/11bpf: Remove bpf_sys.h from selfteststools/lib/bpf/bpf.c tools/testing/selftests/bpf/bpf_sys.h tools/testing/selftests/bpf/test_lpm_map.c +4 more+9 -341 reply
11/11bpf: Add test_tag to .gitignoretools/testing/selftests/bpf/.gitignore+1 -00 replies

Reviews trailers per patch

1 of 11 patches has a Reviewed-by or Acked-by.

PatchAlexei StarovoitovDaniel Borkmann
1/11
2/11
3/11A-b A-b
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11

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

Read the v5 thread

Cover letter [PATCH net-next v5 00/11] Improve BPF selftests and use the library (net-next tree)

This series brings some fixes to selftests, add the ability to test unprivileged BPF programs as root and replace bpf_sys.h with calls to the BPF library.

This is intended for the net-next tree and apply on c0e4dadb3494 ("net: dsa:
mv88e6xxx: Move forward declaration to where it is needed").

Changes since v4:
* align text for function calls as requested by Daniel Borkmann (bpf_load_program and bpf_map_update_elem)
* rebase

Changes since v3:
* keep the bzero() calls

Changes since v2:
* use the patches from two previous series (unprivileged tests and bpf_sys.h replacement)
* include one more stdint.h
* rebase on net-next
* add this cover letter

Changes since v1:
* exclude patches not intended for the net-next tree

Regards,

Mickaël Salaün (11):
tools: Sync {,tools/}include/uapi/linux/bpf.h
bpf: Change the include directory for selftest
bpf: Always test unprivileged programs
bpf: Use bpf_load_program() from the library
bpf: Use bpf_map_update_elem() from the library
bpf: Use bpf_map_lookup_elem() from the library
bpf: Use bpf_map_delete_elem() from the library
bpf: Use bpf_map_get_next_key() from the library
bpf: Use bpf_create_map() from the library
bpf: Remove bpf_sys.h from selftests
bpf: Add test_tag to .gitignore

 tools/include/uapi/linux/bpf.h              |  23 +++-
 tools/lib/bpf/bpf.c                         |  20 ++--
 tools/lib/bpf/bpf.h                         |  12 +--
 tools/testing/selftests/bpf/.gitignore      |   1 +
 tools/testing/selftests/bpf/Makefile        |   4 +-
 tools/testing/selftests/bpf/bpf_sys.h       | 108 -------------------
 tools/testing/selftests/bpf/test_lpm_map.c  |  38 +++----
 tools/testing/selftests/bpf/test_lru_map.c  | 138 +++++++++++++-----------
 tools/testing/selftests/bpf/test_maps.c     | 162 ++++++++++++++--------------
 tools/testing/selftests/bpf/test_tag.c      |  11 +-
 tools/testing/selftests/bpf/test_verifier.c |  84 ++++++++++++---
 11 files changed, 301 insertions(+), 300 deletions(-)
 delete mode 100644 tools/testing/selftests/bpf/bpf_sys.h
Signature · 1 line
2.11.0