Skip to content

bpf: Add map-in-map support

Martin KaFai Lau netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bpf: Fix and simplifications on inline map lookupkernel/bpf/arraymap.c kernel/bpf/verifier.c+15 -91 reply
2/4bpf: Add array of maps supportinclude/linux/bpf.h include/uapi/linux/bpf.h kernel/bpf/Makefile +5 more+225 -120 replies
3/4bpf: Add hash of maps supportinclude/linux/bpf.h include/uapi/linux/bpf.h kernel/bpf/hashtab.c +2 more+134 -20 replies
4/4bpf: Add tests for map-in-mapsamples/bpf/Makefile samples/bpf/bpf_helpers.h samples/bpf/bpf_load.c +6 more+451 -180 replies

Reviews trailers per patch

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

PatchAlexei StarovoitovDaniel Borkmann
1/4A-b A-b
2/4A-b A-b
3/4A-b A-b
4/4A-b

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

Read the v1 thread

Cover letter [PATCH net-next 0/4] bpf: Add map-in-map support

This patchset adds map-in-map support (map->map).
One use case is the (vips -> webservers) in the L4 load balancer so that different vips can be backed by different set of webservers.

Please refer to the individual commit log for details.

Martin KaFai Lau (4):
bpf: Fix and simplifications on inline map lookup
bpf: Add array of maps support
bpf: Add hash of maps support
bpf: Add tests for map-in-map

 include/linux/bpf.h                         |   3 +
 include/uapi/linux/bpf.h                    |   3 +
 kernel/bpf/Makefile                         |   2 +-
 kernel/bpf/arraymap.c                       |  74 ++++++++++--
 kernel/bpf/hashtab.c                        | 121 +++++++++++++++++++
 kernel/bpf/map_in_map.c                     |  97 ++++++++++++++++
 kernel/bpf/map_in_map.h                     |  23 ++++
 kernel/bpf/syscall.c                        |  13 ++-
 kernel/bpf/verifier.c                       |  57 +++++++--
 samples/bpf/Makefile                        |   4 +
 samples/bpf/bpf_helpers.h                   |   1 +
 samples/bpf/bpf_load.c                      |  22 +++-
 samples/bpf/test_map_in_map_kern.c          | 173 ++++++++++++++++++++++++++++
 samples/bpf/test_map_in_map_user.c          | 116 +++++++++++++++++++
 tools/include/uapi/linux/bpf.h              |   3 +
 tools/lib/bpf/bpf.c                         |  17 +++
 tools/lib/bpf/bpf.h                         |   2 +
 tools/testing/selftests/bpf/test_verifier.c | 131 ++++++++++++++++++---
 18 files changed, 823 insertions(+), 39 deletions(-)
 create mode 100644 kernel/bpf/map_in_map.c
 create mode 100644 kernel/bpf/map_in_map.h
 create mode 100644 samples/bpf/test_map_in_map_kern.c
 create mode 100644 samples/bpf/test_map_in_map_user.c
Signature · 1 line
2.9.3