Lines Matching refs:lru_map_fd
152 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()
200 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
206 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity0()
210 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
216 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
220 assert(!bpf_map_lookup_and_delete_elem(lru_map_fd, &key, &value)); in test_lru_sanity0()
226 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity0()
229 close(lru_map_fd); in test_lru_sanity0()
243 int lru_map_fd, expected_map_fd; in test_lru_sanity1() local
261 lru_map_fd = create_map(map_type, map_flags, map_size); in test_lru_sanity1()
262 assert(lru_map_fd != -1); in test_lru_sanity1()
272 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
278 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity1()
290 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
296 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity1()
299 close(lru_map_fd); in test_lru_sanity1()
320 int lru_map_fd, expected_map_fd; in test_lru_sanity2() local
338 lru_map_fd = create_map(map_type, map_flags, map_size); in test_lru_sanity2()
339 assert(lru_map_fd != -1); in test_lru_sanity2()
349 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
365 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
367 assert(!bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity2()
369 assert(bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
379 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity2()
380 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
382 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity2()
396 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
402 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
408 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity2()
411 close(lru_map_fd); in test_lru_sanity2()
426 int lru_map_fd, expected_map_fd; in test_lru_sanity3() local
444 lru_map_fd = create_map(map_type, map_flags, map_size); in test_lru_sanity3()
445 assert(lru_map_fd != -1); in test_lru_sanity3()
455 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
461 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity3()
472 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
478 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity3()
481 close(lru_map_fd); in test_lru_sanity3()
489 int lru_map_fd, expected_map_fd; in test_lru_sanity4() local
500 lru_map_fd = create_map(map_type, map_flags, in test_lru_sanity4()
503 lru_map_fd = create_map(map_type, map_flags, 3 * tgt_free); in test_lru_sanity4()
504 assert(lru_map_fd != -1); in test_lru_sanity4()
513 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
517 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity4()
520 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity4()
526 assert(!bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity4()
527 assert(bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity4()
532 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
538 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity4()
541 close(lru_map_fd); in test_lru_sanity4()
612 int lru_map_fd, expected_map_fd; in test_lru_sanity6() local
628 lru_map_fd = create_map(map_type, map_flags, map_size * nr_cpus); in test_lru_sanity6()
629 assert(lru_map_fd != -1); in test_lru_sanity6()
634 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
646 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, in test_lru_sanity6()
649 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
654 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
660 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity6()
663 close(lru_map_fd); in test_lru_sanity6()
680 int lru_map_fd, expected_map_fd; in test_lru_sanity7() local
689 lru_map_fd = create_map(map_type, map_flags, 2 * nr_cpus); in test_lru_sanity7()
691 lru_map_fd = create_map(map_type, map_flags, 2); in test_lru_sanity7()
692 assert(lru_map_fd != -1); in test_lru_sanity7()
702 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
707 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity7()
714 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
717 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity7()
720 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
726 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
732 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity7()
739 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity7()
743 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
749 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
751 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity7()
754 close(lru_map_fd); in test_lru_sanity7()
771 int lru_map_fd, expected_map_fd; in test_lru_sanity8() local
780 lru_map_fd = create_map(map_type, map_flags, 2 * nr_cpus); in test_lru_sanity8()
782 lru_map_fd = create_map(map_type, map_flags, 2); in test_lru_sanity8()
783 assert(lru_map_fd != -1); in test_lru_sanity8()
793 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
796 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity8()
803 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
806 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity8()
809 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
817 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
823 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity8()
830 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity8()
834 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
840 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
842 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity8()
845 close(lru_map_fd); in test_lru_sanity8()