Lines Matching refs:maps
265 static int load_maps(struct bpf_map_data *maps, int nr_maps, in load_maps() argument
272 fixup_map(&maps[i], i); in load_maps()
274 if (maps[i].fd != -1) { in load_maps()
275 map_fd[i] = maps[i].fd; in load_maps()
280 numa_node = maps[i].def.map_flags & BPF_F_NUMA_NODE ? in load_maps()
281 maps[i].def.numa_node : -1; in load_maps()
283 if (maps[i].def.type == BPF_MAP_TYPE_ARRAY_OF_MAPS || in load_maps()
284 maps[i].def.type == BPF_MAP_TYPE_HASH_OF_MAPS) { in load_maps()
285 int inner_map_fd = map_fd[maps[i].def.inner_map_idx]; in load_maps()
287 map_fd[i] = bpf_create_map_in_map_node(maps[i].def.type, in load_maps()
288 maps[i].name, in load_maps()
289 maps[i].def.key_size, in load_maps()
291 maps[i].def.max_entries, in load_maps()
292 maps[i].def.map_flags, in load_maps()
295 map_fd[i] = bpf_create_map_node(maps[i].def.type, in load_maps()
296 maps[i].name, in load_maps()
297 maps[i].def.key_size, in load_maps()
298 maps[i].def.value_size, in load_maps()
299 maps[i].def.max_entries, in load_maps()
300 maps[i].def.map_flags, in load_maps()
305 i, maps[i].name, errno, strerror(errno)); in load_maps()
308 maps[i].fd = map_fd[i]; in load_maps()
310 if (maps[i].def.type == BPF_MAP_TYPE_PROG_ARRAY) in load_maps()
341 struct bpf_map_data *maps, int nr_maps) in parse_relo_and_apply() argument
369 if (maps[map_idx].elf_offset == sym.st_value) { in parse_relo_and_apply()
375 insn[insn_idx].imm = maps[map_idx].fd; in parse_relo_and_apply()
399 static int load_elf_maps_section(struct bpf_map_data *maps, int maps_shndx, in load_elf_maps_section() argument
476 maps[i].name = strdup(map_name); in load_elf_maps_section()
477 if (!maps[i].name) { in load_elf_maps_section()
487 maps[i].elf_offset = offset; in load_elf_maps_section()
488 memset(&maps[i].def, 0, sizeof(struct bpf_load_map_def)); in load_elf_maps_section()
489 memcpy(&maps[i].def, def, map_sz_copy); in load_elf_maps_section()