Skip to content

capture integers in BTF type info for map defs

Andrii Nakryiko bpf netdev 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 4 repliesIn review
  2. v44 patches 0 repliesSuperseded
  3. v34 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v24 patches7 repliesSuperseded
v13 patches5 repliesSuperseded

Changes in v5 from the cover letter

- revert sample_map_ret0.c, which is loaded with iproute2 (kernel test robot); v3->v4:
- add acks;
- fix int -> uint type in commit message;

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4libbpf: capture value in BTF type info for BTF-defined map defstools/lib/bpf/libbpf.c+28 -300 replies
2/4selftests/bpf: add __uint and __type macro for BTF-defined mapstools/testing/selftests/bpf/bpf_helpers.h+3 -00 replies
3/4selftests/bpf: convert selftests using BTF-defined maps to new syntaxtools/testing/selftests/bpf/progs/bpf_flow.c tools/testing/selftests/bpf/progs/netcnt_prog.c tools/testing/selftests/bpf/progs/socket_cookie_prog.c +17 more+300 -4940 replies
4/4selftests/bpf: convert legacy BPF maps to BTF-defined onestools/testing/selftests/bpf/progs/get_cgroup_id_kern.c tools/testing/selftests/bpf/progs/pyperf.h tools/testing/selftests/bpf/progs/sockmap_verdict_prog.c +8 more+228 -2360 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchSong LiuYonghong Song
1/4A-b A-b
2/4A-b A-b
3/4A-b A-b
4/4A-b A-b

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

Read the v5 thread

Cover letter [PATCH v5 bpf-next 0/4] capture integers in BTF type info for map defs

This patch set implements an update to how BTF-defined maps are specified. The change is in how integer attributes, e.g., type, max_entries, map_flags, are
specified: now they are captured as part of map definition struct's BTF type information (using array dimension), eliminating the need for compile-time data initialization and keeping all the metadata in one place.

All existing selftests that were using BTF-defined maps are updated, along with some other selftests, that were switched to new syntax.

v4->v5:
- revert sample_map_ret0.c, which is loaded with iproute2 (kernel test robot); v3->v4:
- add acks;
- fix int -> uint type in commit message;
v2->v3:
- rename __int into __uint (Yonghong);
v1->v2:
- split bpf_helpers.h change from libbpf change (Song).

Andrii Nakryiko (4):
libbpf: capture value in BTF type info for BTF-defined map defs selftests/bpf: add __uint and __type macro for BTF-defined maps selftests/bpf: convert selftests using BTF-defined maps to new syntax selftests/bpf: convert legacy BPF maps to BTF-defined ones

 tools/lib/bpf/libbpf.c                        |  58 +++++----
 tools/testing/selftests/bpf/bpf_helpers.h     |   3 +
 tools/testing/selftests/bpf/progs/bpf_flow.c  |  28 ++---
 .../selftests/bpf/progs/get_cgroup_id_kern.c  |  26 ++---
 .../testing/selftests/bpf/progs/netcnt_prog.c |  20 ++--
 tools/testing/selftests/bpf/progs/pyperf.h    |  90 +++++++-------
 .../selftests/bpf/progs/socket_cookie_prog.c  |  13 +--
 .../bpf/progs/sockmap_verdict_prog.c          |  48 ++++----
 .../testing/selftests/bpf/progs/strobemeta.h  |  68 +++++------
 .../selftests/bpf/progs/test_btf_newkv.c      |  13 +--
 .../bpf/progs/test_get_stack_rawtp.c          |  39 +++----
 .../selftests/bpf/progs/test_global_data.c    |  37 +++---
 tools/testing/selftests/bpf/progs/test_l4lb.c |  65 ++++-------
 .../selftests/bpf/progs/test_l4lb_noinline.c  |  65 ++++-------
 .../selftests/bpf/progs/test_map_in_map.c     |  30 ++---
 .../selftests/bpf/progs/test_map_lock.c       |  26 ++---
 .../testing/selftests/bpf/progs/test_obj_id.c |  12 +-
 .../bpf/progs/test_select_reuseport_kern.c    |  67 ++++-------
 .../bpf/progs/test_send_signal_kern.c         |  26 ++---
 .../bpf/progs/test_sock_fields_kern.c         |  78 +++++--------
 .../selftests/bpf/progs/test_spin_lock.c      |  36 +++---
 .../bpf/progs/test_stacktrace_build_id.c      |  55 ++++-----
 .../selftests/bpf/progs/test_stacktrace_map.c |  52 +++------
 .../selftests/bpf/progs/test_tcp_estats.c     |  13 +--
 .../selftests/bpf/progs/test_tcpbpf_kern.c    |  26 ++---
 .../selftests/bpf/progs/test_tcpnotify_kern.c |  28 ++---
 tools/testing/selftests/bpf/progs/test_xdp.c  |  26 ++---
 .../selftests/bpf/progs/test_xdp_loop.c       |  26 ++---
 .../selftests/bpf/progs/test_xdp_noinline.c   |  81 +++++--------
 .../selftests/bpf/progs/xdp_redirect_map.c    |  12 +-
 .../testing/selftests/bpf/progs/xdping_kern.c |  12 +-
 .../selftests/bpf/test_queue_stack_map.h      |  30 ++---
 .../testing/selftests/bpf/test_sockmap_kern.h | 110 +++++++++---------
 33 files changed, 559 insertions(+), 760 deletions(-)
Signature · 1 line
2.17.1