mbox series

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

Message ID 20211124193233.3115996-1-andrii@kernel.org (mailing list archive)
Headers show
Series libbpf: unify low-level map creation APIs | expand

Message

Andrii Nakryiko Nov. 24, 2021, 7:32 p.m. UTC
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(-)

Comments

Andrii Nakryiko Nov. 24, 2021, 7:39 p.m. UTC | #1
On Wed, Nov 24, 2021 at 11:32 AM Andrii Nakryiko <andrii@kernel.org> wrote:
>
> 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).

This was in test_maps.c, should have mentioned that.

>
> 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(-)
>
> --
> 2.30.2
>
patchwork-bot+netdevbpf@kernel.org Nov. 25, 2021, 10:40 p.m. UTC | #2
Hello:

This series was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Wed, 24 Nov 2021 11:32:29 -0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [v2,bpf-next,1/4] libbpf: unify low-level map creation APIs w/ new bpf_map_create()
    https://git.kernel.org/bpf/bpf-next/c/992c4225419a
  - [v2,bpf-next,2/4] libbpf: use bpf_map_create() consistently internally
    https://git.kernel.org/bpf/bpf-next/c/a9606f405f2c
  - [v2,bpf-next,3/4] libbpf: prevent deprecation warnings in xsk.c
    https://git.kernel.org/bpf/bpf-next/c/99a12a32fee4
  - [v2,bpf-next,4/4] selftests/bpf: migrate selftests to bpf_map_create()
    https://git.kernel.org/bpf/bpf-next/c/2fe256a429cb

You are awesome, thank you!