BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v4 0/2] bpftool: Batch bounded hash map dumps
@ 2026-09-11  3:47 Tianyi Chen
  2026-09-11  3:47 ` [PATCH bpf-next v4 1/2] bpftool: Use batch lookups for " Tianyi Chen
  2026-09-11  3:47 ` [PATCH bpf-next v4 2/2] selftests/bpf: Check bpftool batch map dump contents Tianyi Chen
  0 siblings, 2 replies; 3+ messages in thread
From: Tianyi Chen @ 2026-09-11  3:47 UTC (permalink / raw)
  To: qmo, bpf; +Cc: andrii, eddyz87, ihor.solodrai, linux-kselftest

Use lookup batches for ordinary hash maps whose maximum key/value
storage fits within 4 MiB, with selftests for complete output around
batch boundaries, short keys, odd-sized values and BTF formatting.

Changes in v4:
- Name MAP_DUMP_BATCH_FALLBACK at both return sites and the caller,
  replacing the literal 1 while preserving the existing control flow.

The helper retains three outcomes: zero for completion, -1 for error,
and the named fallback result. Internal errno values are normalized
before return, so EPERM does not escape as the fallback result.
A separate output parameter is unnecessary for this distinction.

v3: https://lore.kernel.org/r/20260911025130.191011-1-diannaaav@gmail.com
Review: https://lore.kernel.org/r/7aea07c4220781305b7e972abfa9d2e4776276a64bc4837b80325d177799a371@mail.kernel.org

Validation:
- Rebuilt bpftool, its manual pages and the focused selftest runner.
- All 11 bpftool_map_batch subtests passed. The three revised series
  were tested together: 52 subtests passed with no skips or failures in
  an x86-64 KVM guest running Linux 7.3.0-rc2 from bpf/master, with
  LLVM 20-built BPF test objects.
- Bash syntax, bpftool synchronization checks and diff checks passed.
- The generated patches apply cleanly to current bpf-next.

This was a focused run. Unrelated selftests requiring unavailable kernel
features were excluded from the build with PERMISSIVE=1.

Tianyi Chen (2):
  bpftool: Use batch lookups for bounded hash map dumps
  selftests/bpf: Check bpftool batch map dump contents

 tools/bpf/bpftool/map.c                       | 117 ++++++++++-
 .../bpf/prog_tests/bpftool_map_batch.c        | 187 ++++++++++++++++++
 2 files changed, 296 insertions(+), 8 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_batch.c


base-commit: af0b84a9215d951d16f26b7ee34353b970cf5d4e
-- 
2.55.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-11  3:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11  3:47 [PATCH bpf-next v4 0/2] bpftool: Batch bounded hash map dumps Tianyi Chen
2026-09-11  3:47 ` [PATCH bpf-next v4 1/2] bpftool: Use batch lookups for " Tianyi Chen
2026-09-11  3:47 ` [PATCH bpf-next v4 2/2] selftests/bpf: Check bpftool batch map dump contents Tianyi Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox