Skip to content

libbpf: deprecate legacy BPF map definitions

Andrii Nakryiko bpf 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 16 repliesIn review
  2. v14 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- replace missed bpf_map_def case in Documentation/bpf/btf.rst (Alexei).

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4selftests/bpf: fail build on compilation warningtools/testing/selftests/bpf/Makefile+2 -20 replies
2/4selftests/bpf: convert remaining legacy map definitionstools/testing/selftests/bpf/progs/freplace_cls_redirect.c tools/testing/selftests/bpf/progs/sample_map_ret0.c tools/testing/selftests/bpf/progs/test_btf_haskv.c +5 more+48 -420 replies
3/4libbpf: deprecate legacy BPF map definitionstools/bpf/bpftool/main.c tools/lib/bpf/bpf_helpers.h tools/lib/bpf/libbpf.c +2 more+26 -215 replies
4/4docs/bpf: update BPF map definition exampleDocumentation/bpf/btf.rst+14 -180 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJohn Fastabend
SeriesA-b
1/4
2/4
3/4
4/4

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

Read the v2 thread

Cover letter [PATCH v2 bpf-next 0/4] libbpf: deprecate legacy BPF map definitions

Officially deprecate legacy BPF map definitions in libbpf. They've been slated for deprecation for a while in favor of more powerful BTF-defined map definitions and this patch set adds warnings and a way to enforce this in libbpf through LIBBPF_STRICT_MAP_DEFINITIONS strict mode flag.

Selftests are fixed up and updated, BPF documentation is updated, bpftool's strict mode usage is adjusted to avoid breaking users unnecessarily.

v1->v2:
- replace missed bpf_map_def case in Documentation/bpf/btf.rst (Alexei).

Andrii Nakryiko (4):
selftests/bpf: fail build on compilation warning selftests/bpf: convert remaining legacy map definitions
libbpf: deprecate legacy BPF map definitions docs/bpf: update BPF map definition example

 Documentation/bpf/btf.rst                     | 32 ++++++++-----------
 tools/bpf/bpftool/main.c                      |  9 +++++-
 tools/lib/bpf/bpf_helpers.h                   |  2 +-
 tools/lib/bpf/libbpf.c                        |  8 +++++
 tools/lib/bpf/libbpf_legacy.h                 |  5 +++
 tools/testing/selftests/bpf/Makefile          |  4 +--
 tools/testing/selftests/bpf/prog_tests/btf.c  |  4 +++
 .../bpf/progs/freplace_cls_redirect.c         | 12 +++----
 .../selftests/bpf/progs/sample_map_ret0.c     | 24 +++++++-------
 .../selftests/bpf/progs/test_btf_haskv.c      |  3 ++
 .../selftests/bpf/progs/test_btf_newkv.c      |  3 ++
 .../selftests/bpf/progs/test_btf_nokv.c       | 12 +++----
 .../bpf/progs/test_skb_cgroup_id_kern.c       | 12 +++----
 .../testing/selftests/bpf/progs/test_tc_edt.c | 12 +++----
 .../bpf/progs/test_tcp_check_syncookie_kern.c | 12 +++----
 15 files changed, 90 insertions(+), 64 deletions(-)
Signature · 1 line
2.30.2