All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpftool: Don't report an empty map when key iteration fails
@ 2026-09-24 16:07 Maxim Skokov
  2026-09-24 16:07 ` [PATCH bpf-next 1/2] " Maxim Skokov
  2026-09-24 16:07 ` [PATCH bpf-next 2/2] selftests/bpf: Check that bpftool reports a map it can't dump Maxim Skokov
  0 siblings, 2 replies; 11+ messages in thread
From: Maxim Skokov @ 2026-09-24 16:07 UTC (permalink / raw)
  To: bpf
  Cc: qmo, ast, daniel, andrii, eddyz87, memxor, martin.lau, song,
	yonghong.song, jolsa, kuba, shuah, linux-kselftest, Maxim Skokov

"bpftool map dump" stops at the first bpf_map_get_next_key() error and only
treats ENOENT as the end of the map. Any other error gives an empty dump
with no message, only a non-zero exit status. Local storage maps always
fail that way, so a socket storage map holding elements dumps as "[]".

Patch 1 reports the error like "bpftool map getnext" already does, with a
hint when the map type can't be iterated. Patch 2 adds a test_progs case.

The new test fails without patch 1 and passes with it; the other bpftool_*
selftests pass. Tested on x86_64 under a bpf-next kernel with KASAN and
lockdep, and through BPF CI (x86_64, aarch64, s390x).

Maxim Skokov (2):
  bpftool: Don't report an empty map when key iteration fails
  selftests/bpf: Check that bpftool reports a map it can't dump

 tools/bpf/bpftool/map.c                       | 11 ++-
 .../bpf/prog_tests/bpftool_map_dump.c         | 76 +++++++++++++++++++
 2 files changed, 85 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c


base-commit: 4f3a5eae895b9995e93425a75235d8f1f3268caa
-- 
2.47.3


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

end of thread, other threads:[~2026-09-24 19:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24 16:07 [PATCH bpf-next 0/2] bpftool: Don't report an empty map when key iteration fails Maxim Skokov
2026-09-24 16:07 ` [PATCH bpf-next 1/2] " Maxim Skokov
2026-09-24 16:24   ` Alexei Starovoitov
2026-09-24 16:35     ` Maxim Skokov
2026-09-24 16:56   ` bot+bpf-ci
2026-09-24 19:19     ` Maxim Skokov
2026-09-24 16:07 ` [PATCH bpf-next 2/2] selftests/bpf: Check that bpftool reports a map it can't dump Maxim Skokov
2026-09-24 16:17   ` sashiko-bot
2026-09-24 19:18     ` Maxim Skokov
2026-09-24 16:56   ` bot+bpf-ci
2026-09-24 19:19     ` Maxim Skokov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.