Skip to content

bpf: Allow inner map with different max_entries

Martin KaFai Lau bpf netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 6 repliesIn review
  2. v13 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- New BPF_MAP_TYPE_FL to minimize code churns (Alexei)
- s/capabilities/properties/ (Andrii)
- Describe WHY in commit log (Andrii)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bpf: Consolidate inner-map-compatible properties into bpf_types.hinclude/linux/bpf.h include/linux/bpf_types.h kernel/bpf/btf.c +3 more+46 -235 replies
2/3bpf: Relax the max_entries check for inner mapinclude/linux/bpf.h include/linux/bpf_types.h kernel/bpf/map_in_map.c+18 -31 reply
3/3bpf: selftests: Add test for different inner map sizetools/testing/selftests/bpf/prog_tests/btf_map_in_map.c tools/testing/selftests/bpf/progs/test_btf_map_in_map.c+43 -00 replies

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/3] bpf: Allow inner map with different max_entries

People has a use case that starts with a smaller inner map first and then replaces it with a larger inner map later when it is needed.

This series allows the outer map to be updated with inner map in different size as long as it is safe (meaning the max_entries is not used in the verification time during prog load).

Please see individual patch for details.

v2:
- New BPF_MAP_TYPE_FL to minimize code churns (Alexei)
- s/capabilities/properties/ (Andrii)
- Describe WHY in commit log (Andrii)

Martin KaFai Lau (3):
bpf: Consolidate inner-map-compatible properties into bpf_types.h
bpf: Relax the max_entries check for inner map
bpf: selftests: Add test for different inner map size

 include/linux/bpf.h                           | 20 ++++++++++--
 include/linux/bpf_types.h                     | 25 +++++++++++----
 kernel/bpf/btf.c                              |  4 +--
 kernel/bpf/map_in_map.c                       | 12 +++----
 kernel/bpf/syscall.c                          | 25 +++++++++++----
 kernel/bpf/verifier.c                         |  4 +--
 .../selftests/bpf/prog_tests/btf_map_in_map.c | 12 +++++++
 .../selftests/bpf/progs/test_btf_map_in_map.c | 31 +++++++++++++++++++
 8 files changed, 107 insertions(+), 26 deletions(-)
Signature · 1 line
2.24.1