libbpf: Support init of inner maps in light skeleton.

Add ability to initialize inner maps in light skeleton.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211201181040.23337-11-alexei.starovoitov@gmail.com
This commit is contained in:
Alexei Starovoitov
2021-12-01 10:10:33 -08:00
committed by Andrii Nakryiko
parent 5f887b332c
commit a7935b996f
3 changed files with 31 additions and 3 deletions

View File

@@ -4971,9 +4971,9 @@ static int init_map_in_map_slots(struct bpf_object *obj, struct bpf_map *map)
fd = bpf_map__fd(targ_map);
if (obj->gen_loader) {
pr_warn("// TODO map_update_elem: idx %td key %d value==map_idx %td\n",
map - obj->maps, i, targ_map - obj->maps);
return -ENOTSUP;
bpf_gen__populate_outer_map(obj->gen_loader,
map - obj->maps, i,
targ_map - obj->maps);
} else {
err = bpf_map_update_elem(map->fd, &i, &fd, 0);
}