Skip to content

bpftool: Reset map info between queries

Tianyi Chen bpf linux-kselftest 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpftool: Reset map info before each query in show and dump loopstools/bpf/bpftool/map.c+8 -02 replies
2/2selftests/bpf: Check bpftool map info across mixed BTF mapstools/testing/selftests/bpf/prog_tests/bpftool_map_info.c+126 -01 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchQuentin Monnet
1/2A-b
2/2A-b

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 0/2] bpftool: Reset map info between queries

Reset map info before each query in the existing show and dump loops to prevent BTF metadata from a preceding map leaking into a map without BTF.

Patch 1 fixes the four query loops. Patch 2 adds regression tests for full and named listings, JSON dumps, and plain dumps.

All four regression subtests fail on the unmodified bpf-next base and pass with the fix in an x86-64 VM. This series does not depend on recursive dumping or Maxim's series.

Tianyi Chen (2):
bpftool: Reset map info before each query in show and dump loops selftests/bpf: Check bpftool map info across mixed BTF maps

 tools/bpf/bpftool/map.c                       |   8 ++
 .../bpf/prog_tests/bpftool_map_info.c         | 126 ++++++++++++++++++
 2 files changed, 134 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_info.c

base-commit: ea9358e1270ab2c3ba6f36bd9bdda68617665516

Signature · 1 line
2.55.0