Skip to content

libbpf: fix reuse of DEVMAP

Yureka Lilian bpf lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review 1 of 2 applied
  2. v22 patches 4 repliesSuperseded
  3. v11 patch 2 repliesSuperseded

Changes in v3 from the cover letter

- instead of setting BPF_F_RDONLY_PROG on both sides, just clear BPF_F_RDONLY_PROG in map_info.map_flags as suggested by Andrii Nakryiko

- in the test, use ASSERT_* instead of CHECK
- shorten the test by using open_and_load from the skel
- in the test, drop NULL check before unloading/destroying bpf objs

- start the commit messages with "libbpf" and "selftests/bpf" respectively instead of just "bpf"

Patches in v3 1 of 2 applied

#Subject and filesSizeRepliesApplied
1/2libbpf: fix reuse of DEVMAPtools/lib/bpf/libbpf.c+11 -00 replies
2/2selftests/bpf: add test for DEVMAP reusetools/testing/selftests/bpf/prog_tests/pinning_devmap_reuse.c tools/testing/selftests/bpf/progs/test_pinning_devmap.c+70 -01 replyApplied

Reviews trailers per patch

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

PatchEduard Zingerman
1/2
2/2A-b

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

Read the v3 thread

Cover letter [PATCH v3 0/2] libbpf: fix reuse of DEVMAP

changes in v3:

- instead of setting BPF_F_RDONLY_PROG on both sides, just clear BPF_F_RDONLY_PROG in map_info.map_flags as suggested by Andrii Nakryiko

- in the test, use ASSERT_* instead of CHECK
- shorten the test by using open_and_load from the skel
- in the test, drop NULL check before unloading/destroying bpf objs

- start the commit messages with "libbpf" and "selftests/bpf" respectively instead of just "bpf"

changes in v2:

- preserve compatibility with older kernels
- add a basic selftest covering the re-use of DEVMAP maps

Yureka Lilian (2):
libbpf: fix reuse of DEVMAP
selftests/bpf: add test for DEVMAP reuse

 tools/lib/bpf/libbpf.c                        | 11 ++++
 .../bpf/prog_tests/pinning_devmap_reuse.c     | 50 +++++++++++++++++++
 .../selftests/bpf/progs/test_pinning_devmap.c | 20 ++++++++
 3 files changed, 81 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/pinning_devmap_reuse.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_pinning_devmap.c
Signature · 1 line
2.50.1