]> git.proxmox.com Git - mirror_iproute2.git/commit - lib/bpf.c
bpf: support loading map in map from obj
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 17 Jul 2017 15:18:51 +0000 (17:18 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 19 Jul 2017 00:20:45 +0000 (17:20 -0700)
commit612ff099a11092a6ed4084b84a8810155884baca
treead5f8de8e19c0c34f585205d496e0c9b7eadbf95
parent23b2ed2d647cf2bf9a1542e73de4743b8340f123
bpf: support loading map in map from obj

Add support for map in map in the loader and add a small example program.
The outer map uses inner_id to reference a bpf_elf_map with a given ID
as the inner type. Loading maps is done in three passes, i) all non-map
in map maps are loaded, ii) all map in map maps are loaded based on the
inner_id map spec of a non-map in map with corresponding id, and iii)
related inner maps are attached to the map in map with given inner_idx
key. Pinned objetcs are assumed to be managed externally, so they are
only retrieved from BPF fs.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
examples/bpf/bpf_map_in_map.c [new file with mode: 0644]
include/bpf_elf.h
lib/bpf.c