Lines Matching refs:map_fd

102 	int map_fd;  member
108 lru->map_fd = bpf_create_map(BPF_MAP_TYPE_HASH, in pfect_lru_init()
112 assert(lru->map_fd != -1); in pfect_lru_init()
125 close(lru->map_fd); in pfect_lru_destroy()
136 if (!bpf_map_lookup_elem(lru->map_fd, &key, &node)) { in pfect_lru_lookup_or_insert()
153 bpf_map_update_elem(lru->map_fd, &node->key, &null_node, BPF_EXIST); in pfect_lru_lookup_or_insert()
161 assert(!bpf_map_update_elem(lru->map_fd, &key, &node, BPF_EXIST)); in pfect_lru_lookup_or_insert()
164 assert(!bpf_map_update_elem(lru->map_fd, &key, &node, BPF_NOEXIST)); in pfect_lru_lookup_or_insert()
210 int map_fd; in create_map() local
212 map_fd = bpf_create_map(map_type, sizeof(unsigned long long), in create_map()
215 if (map_fd == -1) in create_map()
218 return map_fd; in create_map()
341 int map_fd; in test_lru_loss0() local
349 map_fd = create_map(map_type, map_flags, 900 * nr_cpus); in test_lru_loss0()
351 map_fd = create_map(map_type, map_flags, 900); in test_lru_loss0()
353 assert(map_fd != -1); in test_lru_loss0()
360 assert(bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST) == 0); in test_lru_loss0()
366 bpf_map_lookup_elem(map_fd, &start_key, value); in test_lru_loss0()
372 if (bpf_map_lookup_elem(map_fd, &key, value)) { in test_lru_loss0()
382 close(map_fd); in test_lru_loss0()
392 int map_fd; in test_lru_loss1() local
401 map_fd = create_map(map_type, map_flags, 1000 * nr_cpus); in test_lru_loss1()
403 map_fd = create_map(map_type, map_flags, 1000); in test_lru_loss1()
405 assert(map_fd != -1); in test_lru_loss1()
410 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in test_lru_loss1()
413 if (bpf_map_lookup_elem(map_fd, &key, value)) in test_lru_loss1()
417 close(map_fd); in test_lru_loss1()
427 int map_fd = *(int *)data; in do_test_parallel_lru_loss() local
438 assert(bpf_map_update_elem(map_fd, &next_ins_key, value, in do_test_parallel_lru_loss()
450 bpf_map_lookup_elem(map_fd, &key, value); in do_test_parallel_lru_loss()
452 bpf_map_update_elem(map_fd, &next_ins_key, value, in do_test_parallel_lru_loss()
460 if (bpf_map_lookup_elem(map_fd, &key, value)) in do_test_parallel_lru_loss()
470 int map_fd; in test_parallel_lru_loss() local
477 map_fd = create_map(map_type, map_flags, in test_parallel_lru_loss()
480 map_fd = create_map(map_type, map_flags, in test_parallel_lru_loss()
483 assert(map_fd != -1); in test_parallel_lru_loss()
485 run_parallel(nr_tasks, do_test_parallel_lru_loss, &map_fd); in test_parallel_lru_loss()
487 close(map_fd); in test_parallel_lru_loss()