Skip to content

libbpf: unify low-level map creation APIs

Andrii Nakryiko bpf 2 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 1 replyApplied 4/4
  2. v14 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- fix one instance of bpf_map_create() passing unnecessary opts (CI).

Patches in v2 All 4 applied

#Subject and filesSizeRepliesApplied
1/4libbpf: unify low-level map creation APIs w/ new bpf_map_create()tools/lib/bpf/bpf.c tools/lib/bpf/bpf.h tools/lib/bpf/bpf_gen_internal.h +4 more+126 -1530 repliesApplied
2/4libbpf: use bpf_map_create() consistently internallytools/lib/bpf/libbpf.c tools/lib/bpf/libbpf_probes.c tools/lib/bpf/skel_internal.h +1 more+25 -510 repliesApplied
3/4libbpf: prevent deprecation warnings in xsk.ctools/lib/bpf/xsk.c+5 -00 repliesApplied
4/4selftests/bpf: migrate selftests to bpf_map_create()tools/testing/selftests/bpf/map_tests/array_map_batch_ops.c tools/testing/selftests/bpf/map_tests/htab_map_batch_ops.c tools/testing/selftests/bpf/map_tests/lpm_trie_map_batch_ops.c +18 more+201 -2560 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 bpf-next 0/4] libbpf: unify low-level map creation APIs

Add new OPTS-based bpf_map_create() API. Schedule deprecation of 6 (!) existing non-extensible variants. Clean up both internal libbpf use of to-be-deprecated APIs as well as selftests/bpf.

Thankfully, as opposed to bpf_prog_load() and few other *_opts structs refactorings, this one is very straightforward and doesn't require any macro magic.

Third patch also ensures that when libbpf 0.7 development starts we won't be getting deprecation warning for using our own xsk_* APIs. Without that it's hard to simulate libbpf 0.7 and ensure that there are no upcoming deprecation warnings.

v1->v2:
- fix one instance of bpf_map_create() passing unnecessary opts (CI).

Andrii Nakryiko (4):
libbpf: unify low-level map creation APIs w/ new bpf_map_create()
libbpf: use bpf_map_create() consistently internally
libbpf: prevent deprecation warnings in xsk.c selftests/bpf: migrate selftests to bpf_map_create()

 tools/lib/bpf/bpf.c                           | 140 ++++++++----------
 tools/lib/bpf/bpf.h                           |  33 ++++-
 tools/lib/bpf/bpf_gen_internal.h              |   5 +-
 tools/lib/bpf/gen_loader.c                    |  46 ++----
 tools/lib/bpf/libbpf.c                        |  63 +++-----
 tools/lib/bpf/libbpf.map                      |   1 +
 tools/lib/bpf/libbpf_internal.h               |  21 ---
 tools/lib/bpf/libbpf_probes.c                 |  30 ++--
 tools/lib/bpf/skel_internal.h                 |   3 +-
 tools/lib/bpf/xsk.c                           |  18 +--
 .../bpf/map_tests/array_map_batch_ops.c       |  13 +-
 .../bpf/map_tests/htab_map_batch_ops.c        |  13 +-
 .../bpf/map_tests/lpm_trie_map_batch_ops.c    |  15 +-
 .../selftests/bpf/map_tests/sk_storage_map.c  |  50 +++----
 .../bpf/prog_tests/bloom_filter_map.c         |  36 ++---
 .../selftests/bpf/prog_tests/bpf_iter.c       |   8 +-
 tools/testing/selftests/bpf/prog_tests/btf.c  |  51 +++----
 .../bpf/prog_tests/cgroup_attach_multi.c      |  12 +-
 .../selftests/bpf/prog_tests/pinning.c        |   4 +-
 .../selftests/bpf/prog_tests/ringbuf_multi.c  |   4 +-
 .../bpf/prog_tests/select_reuseport.c         |  21 +--
 .../selftests/bpf/prog_tests/sockmap_basic.c  |   4 +-
 .../selftests/bpf/prog_tests/sockmap_ktls.c   |   2 +-
 .../selftests/bpf/prog_tests/sockmap_listen.c |   4 +-
 .../selftests/bpf/prog_tests/test_bpffs.c     |   2 +-
 .../selftests/bpf/test_cgroup_storage.c       |   8 +-
 tools/testing/selftests/bpf/test_lpm_map.c    |  27 ++--
 tools/testing/selftests/bpf/test_lru_map.c    |  16 +-
 tools/testing/selftests/bpf/test_maps.c       | 110 +++++++-------
 tools/testing/selftests/bpf/test_tag.c        |   5 +-
 tools/testing/selftests/bpf/test_verifier.c   |  52 +++----
 31 files changed, 357 insertions(+), 460 deletions(-)
Signature · 1 line
2.30.2