Lines Matching refs:key

42 static int bpf_map_lookup_elem_with_ref_bit(int fd, unsigned long long key,  in bpf_map_lookup_elem_with_ref_bit()  argument
48 BPF_LD_IMM64(BPF_REG_3, key), in bpf_map_lookup_elem_with_ref_bit()
151 unsigned long long key, value[nr_cpus]; in test_lru_sanity0() local
173 key = 1; in test_lru_sanity0()
174 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
175 assert(!bpf_map_update_elem(expected_map_fd, &key, value, 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()
187 key = 2; 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()
199 key = 3; in test_lru_sanity0()
200 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
205 key = 1; in test_lru_sanity0()
206 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity0()
209 key = 3; in test_lru_sanity0()
210 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
211 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
215 key = 2; in test_lru_sanity0()
216 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
219 key = 1; in test_lru_sanity0()
220 assert(!bpf_map_lookup_and_delete_elem(lru_map_fd, &key, &value)); in test_lru_sanity0()
224 assert(!bpf_map_delete_elem(expected_map_fd, &key)); in test_lru_sanity0()
242 unsigned long long key, end_key, value[nr_cpus]; in test_lru_sanity1() local
271 for (key = 1; key < end_key; key++) in test_lru_sanity1()
272 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
277 for (key = 1; key < end_key; key++) { in test_lru_sanity1()
278 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity1()
279 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
287 key = 1 + tgt_free; in test_lru_sanity1()
288 end_key = key + tgt_free; in test_lru_sanity1()
289 for (; key < end_key; key++) { in test_lru_sanity1()
290 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
292 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
318 unsigned long long key, value[nr_cpus]; in test_lru_sanity2() local
348 for (key = 1; key < end_key; key++) in test_lru_sanity2()
349 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
363 key = 1; 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()
378 for (key = 1; key < end_key; key++) { 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()
384 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity2()
392 for (key = 1 + tgt_free; key < end_key; key++) in test_lru_sanity2()
396 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
400 end_key = key + tgt_free; in test_lru_sanity2()
401 for (; key < end_key; key++) { in test_lru_sanity2()
402 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
404 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity2()
425 unsigned long long key, end_key, value[nr_cpus]; in test_lru_sanity3() local
454 for (key = 1; key < end_key; key++) in test_lru_sanity3()
455 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
460 for (key = 1; key < end_key; key++) { in test_lru_sanity3()
461 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity3()
462 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity3()
469 key = 2 * tgt_free + 1; in test_lru_sanity3()
470 end_key = key + batch_size; in test_lru_sanity3()
471 for (; key < end_key; key++) { in test_lru_sanity3()
472 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
474 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity3()
490 unsigned long long key, value[nr_cpus]; in test_lru_sanity4() local
512 for (key = 1; key <= 2 * tgt_free; key++) in test_lru_sanity4()
513 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
516 key = 1; in test_lru_sanity4()
517 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity4()
519 for (key = 1; key <= tgt_free; key++) { in test_lru_sanity4()
520 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity4()
521 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity4()
525 for (; key <= 2 * tgt_free; key++) { 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()
530 end_key = key + 2 * tgt_free; in test_lru_sanity4()
531 for (; key < end_key; key++) { in test_lru_sanity4()
532 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
534 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity4()
548 unsigned long long key, value[nr_cpus]; in do_test_lru_sanity5() local
554 key = last_key + 1; in do_test_lru_sanity5()
555 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in do_test_lru_sanity5()
556 assert(!bpf_map_lookup_elem_with_ref_bit(map_fd, key, value)); in do_test_lru_sanity5()
565 unsigned long long key, value[nr_cpus]; in test_lru_sanity5() local
579 key = 0; in test_lru_sanity5()
580 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity5()
587 do_test_lru_sanity5(key, map_fd); in test_lru_sanity5()
591 key); in test_lru_sanity5()
598 key++; in test_lru_sanity5()
604 assert(key > 0); in test_lru_sanity5()
613 unsigned long long key, value[nr_cpus]; in test_lru_sanity6() local
633 for (key = 1; key <= tgt_free; key++) { in test_lru_sanity6()
634 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
636 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity6()
640 for (; key <= tgt_free * 2; key++) { in test_lru_sanity6()
649 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
653 for (; key <= tgt_free * 3; key++) { in test_lru_sanity6()
654 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
656 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity6()
679 unsigned long long key, value[nr_cpus]; in test_lru_sanity7() local
701 key = 1; in test_lru_sanity7()
702 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
703 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity7()
707 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity7()
713 key = 2; 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()
725 key = 3; in test_lru_sanity7()
726 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
731 key = 1; in test_lru_sanity7()
732 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity7()
738 key = 2; in test_lru_sanity7()
739 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity7()
742 key = 3; in test_lru_sanity7()
743 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
744 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity7()
748 key = 2; in test_lru_sanity7()
749 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
770 unsigned long long key, value[nr_cpus]; in test_lru_sanity8() local
792 key = 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()
802 key = 2; 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()
810 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity8()
816 key = 3; in test_lru_sanity8()
817 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
822 key = 1; in test_lru_sanity8()
823 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity8()
829 key = 2; in test_lru_sanity8()
830 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity8()
833 key = 3; in test_lru_sanity8()
834 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
835 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity8()
839 key = 1; in test_lru_sanity8()
840 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()