Lines Matching refs:map_fd

96 	int map_fd;  member
102 lru->map_fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL, in pfect_lru_init()
106 assert(lru->map_fd != -1); in pfect_lru_init()
119 close(lru->map_fd); in pfect_lru_destroy()
130 if (!bpf_map_lookup_elem(lru->map_fd, &key, &node)) { in pfect_lru_lookup_or_insert()
147 bpf_map_update_elem(lru->map_fd, &node->key, &null_node, BPF_EXIST); in pfect_lru_lookup_or_insert()
155 assert(!bpf_map_update_elem(lru->map_fd, &key, &node, BPF_EXIST)); in pfect_lru_lookup_or_insert()
158 assert(!bpf_map_update_elem(lru->map_fd, &key, &node, BPF_NOEXIST)); in pfect_lru_lookup_or_insert()
207 int map_fd; in create_map() local
209 map_fd = bpf_map_create(map_type, NULL, sizeof(unsigned long long), in create_map()
212 if (map_fd == -1) in create_map()
215 return map_fd; in create_map()
338 int map_fd; in test_lru_loss0() local
346 map_fd = create_map(map_type, map_flags, 900 * nr_cpus); in test_lru_loss0()
348 map_fd = create_map(map_type, map_flags, 900); in test_lru_loss0()
350 assert(map_fd != -1); in test_lru_loss0()
357 assert(bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST) == 0); in test_lru_loss0()
363 bpf_map_lookup_elem(map_fd, &start_key, value); in test_lru_loss0()
369 if (bpf_map_lookup_elem(map_fd, &key, value)) { in test_lru_loss0()
379 close(map_fd); in test_lru_loss0()
389 int map_fd; in test_lru_loss1() local
398 map_fd = create_map(map_type, map_flags, 1000 * nr_cpus); in test_lru_loss1()
400 map_fd = create_map(map_type, map_flags, 1000); in test_lru_loss1()
402 assert(map_fd != -1); in test_lru_loss1()
407 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in test_lru_loss1()
410 if (bpf_map_lookup_elem(map_fd, &key, value)) in test_lru_loss1()
414 close(map_fd); in test_lru_loss1()
424 int map_fd = *(int *)data; in do_test_parallel_lru_loss() local
435 assert(bpf_map_update_elem(map_fd, &next_ins_key, value, in do_test_parallel_lru_loss()
447 bpf_map_lookup_elem(map_fd, &key, value); in do_test_parallel_lru_loss()
449 bpf_map_update_elem(map_fd, &next_ins_key, value, in do_test_parallel_lru_loss()
457 if (bpf_map_lookup_elem(map_fd, &key, value)) in do_test_parallel_lru_loss()
467 int map_fd; in test_parallel_lru_loss() local
474 map_fd = create_map(map_type, map_flags, in test_parallel_lru_loss()
477 map_fd = create_map(map_type, map_flags, in test_parallel_lru_loss()
480 assert(map_fd != -1); in test_parallel_lru_loss()
482 run_parallel(nr_tasks, do_test_parallel_lru_loss, &map_fd); in test_parallel_lru_loss()
484 close(map_fd); in test_parallel_lru_loss()