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 authored and Andrii Nakryiko committed 2021-12-10 14:03:13 -08:00
1 parent 5f887b332c
commit a7935b996f
3 files changed
+31 -3

No files matched your search

+3 -3
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);
}