Lines Matching refs:map_fd

105 	int map_fd;  member
111 lru->map_fd = bpf_create_map(BPF_MAP_TYPE_HASH, in pfect_lru_init()
115 assert(lru->map_fd != -1); in pfect_lru_init()
128 close(lru->map_fd); in pfect_lru_destroy()
139 if (!bpf_map_lookup_elem(lru->map_fd, &key, &node)) { in pfect_lru_lookup_or_insert()
156 bpf_map_update_elem(lru->map_fd, &node->key, &null_node, BPF_EXIST); in pfect_lru_lookup_or_insert()
164 assert(!bpf_map_update_elem(lru->map_fd, &key, &node, BPF_EXIST)); in pfect_lru_lookup_or_insert()
167 assert(!bpf_map_update_elem(lru->map_fd, &key, &node, BPF_NOEXIST)); in pfect_lru_lookup_or_insert()
213 int map_fd; in create_map() local
215 map_fd = bpf_create_map(map_type, sizeof(unsigned long long), in create_map()
218 if (map_fd == -1) in create_map()
221 return map_fd; in create_map()
344 int map_fd; in test_lru_loss0() local
352 map_fd = create_map(map_type, map_flags, 900 * nr_cpus); in test_lru_loss0()
354 map_fd = create_map(map_type, map_flags, 900); in test_lru_loss0()
356 assert(map_fd != -1); in test_lru_loss0()
363 assert(bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST) == 0); in test_lru_loss0()
369 bpf_map_lookup_elem(map_fd, &start_key, value); in test_lru_loss0()
375 if (bpf_map_lookup_elem(map_fd, &key, value)) { in test_lru_loss0()
385 close(map_fd); in test_lru_loss0()
395 int map_fd; in test_lru_loss1() local
404 map_fd = create_map(map_type, map_flags, 1000 * nr_cpus); in test_lru_loss1()
406 map_fd = create_map(map_type, map_flags, 1000); in test_lru_loss1()
408 assert(map_fd != -1); in test_lru_loss1()
413 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in test_lru_loss1()
416 if (bpf_map_lookup_elem(map_fd, &key, value)) in test_lru_loss1()
420 close(map_fd); in test_lru_loss1()
430 int map_fd = *(int *)data; in do_test_parallel_lru_loss() local
441 assert(bpf_map_update_elem(map_fd, &next_ins_key, value, in do_test_parallel_lru_loss()
453 bpf_map_lookup_elem(map_fd, &key, value); in do_test_parallel_lru_loss()
455 bpf_map_update_elem(map_fd, &next_ins_key, value, in do_test_parallel_lru_loss()
463 if (bpf_map_lookup_elem(map_fd, &key, value)) in do_test_parallel_lru_loss()
473 int map_fd; in test_parallel_lru_loss() local
480 map_fd = create_map(map_type, map_flags, in test_parallel_lru_loss()
483 map_fd = create_map(map_type, map_flags, in test_parallel_lru_loss()
486 assert(map_fd != -1); in test_parallel_lru_loss()
488 run_parallel(nr_tasks, do_test_parallel_lru_loss, &map_fd); in test_parallel_lru_loss()
490 close(map_fd); in test_parallel_lru_loss()