Skip to content

bpf: adding support for mapinmap in libbpf

Nikita V. Shirokov netdev 5 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 1 replyApplied
  2. v42 patches 1 replySuperseded
  3. v32 patches 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches1 replySuperseded
v12 patches5 repliesSuperseded

Changes in v5 from the cover letter

- naming: renamed everything to map_in_map instead of mapinmap
- start to return nonzero val if set_inner_map_fd failed

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/2bpf: adding support for map in map in libbpftools/lib/bpf/libbpf.c tools/lib/bpf/libbpf.h+36 -60 replies
2/2bpf: adding tests for map_in_map helpber in libbpftools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/test_map_in_map.c tools/testing/selftests/bpf/test_maps.c+141 -10 replies

Reviews trailers per patch

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

PatchYonghong Song
1/2A-b
2/2A-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/2] bpf: adding support for mapinmap in libbpf

in this patch series i'm adding a helper for libbpf which would allow it to load map-in-map(BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_HASH_OF_MAPS).
first patch contains new helper + explains proposed workflow second patch contains tests which also could be used as example of usage

v4->v5:
- naming: renamed everything to map_in_map instead of mapinmap
- start to return nonzero val if set_inner_map_fd failed

v3->v4:
- renamed helper to set_inner_map_fd
- now we set this value only if it haven't been set before and only for (array|hash) of maps

v2->v3:
- fixing typo in patch description
- initializing inner_map_fd to -1 by default

v1->v2:
- addressing nits
- removing const identifier from fd in new helper
- starting to check return val for bpf_map_update_elem

Nikita V. Shirokov (2):
bpf: adding support for map in map in libbpf
bpf: adding tests for mapinmap helpber in libbpf

 tools/lib/bpf/libbpf.c                        | 40 ++++++++++--
 tools/lib/bpf/libbpf.h                        |  2 +
 tools/testing/selftests/bpf/Makefile          |  3 +-
 tools/testing/selftests/bpf/test_map_in_map.c | 49 +++++++++++++++
 tools/testing/selftests/bpf/test_maps.c       | 90 +++++++++++++++++++++++++++
 5 files changed, 177 insertions(+), 7 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/test_map_in_map.c
Signature · 1 line
2.15.1