Home
last modified time | relevance | path

Searched refs:lru_map_fd (Results 1 – 2 of 2) sorted by relevance

/openbmc/linux/tools/testing/selftests/bpf/
H A Dtest_lru_map.c152 int lru_map_fd, expected_map_fd; in test_lru_sanity0() local
161 lru_map_fd = create_map(map_type, map_flags, 2 * nr_cpus); in test_lru_sanity0()
163 lru_map_fd = create_map(map_type, map_flags, 2); in test_lru_sanity0()
164 assert(lru_map_fd != -1); in test_lru_sanity0()
174 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
179 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity0()
182 assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -EINVAL); in test_lru_sanity0()
188 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
191 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity0()
194 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
[all …]
/openbmc/linux/samples/bpf/
H A Dtest_lru_dist.c273 unsigned int lru_map_fd = ((unsigned int *)data)[0]; in do_test_lru_dist() local
284 if (!bpf_map_lookup_elem(lru_map_fd, &key, &value)) in do_test_lru_dist()
287 if (bpf_map_update_elem(lru_map_fd, &key, &value, BPF_NOEXIST)) { in do_test_lru_dist()
304 close(lru_map_fd); in do_test_lru_dist()
311 int lru_map_fd; in test_parallel_lru_dist() local
317 lru_map_fd = create_map(map_type, map_flags, in test_parallel_lru_dist()
320 lru_map_fd = create_map(map_type, map_flags, in test_parallel_lru_dist()
322 assert(lru_map_fd != -1); in test_parallel_lru_dist()
324 child_data[0] = lru_map_fd; in test_parallel_lru_dist()
329 close(lru_map_fd); in test_parallel_lru_dist()