Add comma-separated BPF_F_* names to map create flags while retaining
base-0 numeric input, with matching documentation, completion and tests.

Changes in v2:
- Complete list elements without adding a trailing space, so the user
  can immediately append another comma-separated flag.

Validation:
- Real Bash readline completion checked with default COMP_WORDBREAKS
  and with comma included: unique first and second flags stay in one
  argument; after an explicit space, entries completion adds its normal
  trailing space. Bash syntax and diff checks passed.
- All 29 map_flags subtests passed in the integration run described below.

v1: https://lore.kernel.org/r/[email protected]
Request: https://github.com/libbpf/bpftool/issues/57

Integration validation: the flags, ring-buffer and batch v2 series plus
recursive dump v3 built together with LLVM 20. All 69 focused BPF subtests
passed in an x86-64 KVM guest running Linux 7.3.0-rc1, with no skips or
failures. The bpftool-map man page also built successfully. This is a
focused run, not the full BPF selftest suite.


Tianyi Chen (2):
  bpftool: Accept symbolic map creation flags
  selftests/bpf: Cover symbolic bpftool map creation flags

 .../bpf/bpftool/Documentation/bpftool-map.rst | 13 ++-
 tools/bpf/bpftool/bash-completion/bpftool     | 26 ++++-
 tools/bpf/bpftool/map.c                       | 77 ++++++++++++++-
 .../bpf/prog_tests/bpftool_map_flags.c        | 99 +++++++++++++++++++
 4 files changed, 209 insertions(+), 6 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_flags.c

-- 
2.55.0


Reply via email to