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()
150 unsigned long long key, value[nr_cpus]; in test_lru_sanity0() local
172 key = 1; in test_lru_sanity0()
173 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
174 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
178 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity0()
181 assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -EINVAL); in test_lru_sanity0()
186 key = 2; in test_lru_sanity0()
187 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
190 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity0()
193 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
198 key = 3; in test_lru_sanity0()
199 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
204 key = 1; in test_lru_sanity0()
205 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity0()
208 key = 3; in test_lru_sanity0()
209 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
210 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
214 key = 2; in test_lru_sanity0()
215 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
218 key = 1; in test_lru_sanity0()
219 assert(!bpf_map_lookup_and_delete_elem(lru_map_fd, &key, &value)); in test_lru_sanity0()
223 assert(!bpf_map_delete_elem(expected_map_fd, &key)); in test_lru_sanity0()
241 unsigned long long key, end_key, value[nr_cpus]; in test_lru_sanity1() local
270 for (key = 1; key < end_key; key++) in test_lru_sanity1()
271 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
276 for (key = 1; key < end_key; key++) { in test_lru_sanity1()
277 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity1()
278 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
286 key = 1 + tgt_free; in test_lru_sanity1()
287 end_key = key + tgt_free; in test_lru_sanity1()
288 for (; key < end_key; key++) { in test_lru_sanity1()
289 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
291 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
317 unsigned long long key, value[nr_cpus]; in test_lru_sanity2() local
347 for (key = 1; key < end_key; key++) in test_lru_sanity2()
348 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
362 key = 1; in test_lru_sanity2()
364 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
366 assert(!bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity2()
368 assert(bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
377 for (key = 1; key < end_key; key++) { in test_lru_sanity2()
378 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity2()
379 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
381 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity2()
383 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity2()
391 for (key = 1 + tgt_free; key < end_key; key++) in test_lru_sanity2()
395 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
399 end_key = key + tgt_free; in test_lru_sanity2()
400 for (; key < end_key; key++) { in test_lru_sanity2()
401 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
403 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity2()
424 unsigned long long key, end_key, value[nr_cpus]; in test_lru_sanity3() local
453 for (key = 1; key < end_key; key++) in test_lru_sanity3()
454 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
459 for (key = 1; key < end_key; key++) { in test_lru_sanity3()
460 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity3()
461 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity3()
468 key = 2 * tgt_free + 1; in test_lru_sanity3()
469 end_key = key + batch_size; in test_lru_sanity3()
470 for (; key < end_key; key++) { in test_lru_sanity3()
471 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
473 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity3()
489 unsigned long long key, value[nr_cpus]; in test_lru_sanity4() local
511 for (key = 1; key <= 2 * tgt_free; key++) in test_lru_sanity4()
512 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
515 key = 1; in test_lru_sanity4()
516 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity4()
518 for (key = 1; key <= tgt_free; key++) { in test_lru_sanity4()
519 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity4()
520 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity4()
524 for (; key <= 2 * tgt_free; key++) { in test_lru_sanity4()
525 assert(!bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity4()
526 assert(bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity4()
529 end_key = key + 2 * tgt_free; in test_lru_sanity4()
530 for (; key < end_key; key++) { in test_lru_sanity4()
531 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
533 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity4()
547 unsigned long long key, value[nr_cpus]; in do_test_lru_sanity5() local
553 key = last_key + 1; in do_test_lru_sanity5()
554 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in do_test_lru_sanity5()
555 assert(!bpf_map_lookup_elem_with_ref_bit(map_fd, key, value)); in do_test_lru_sanity5()
564 unsigned long long key, value[nr_cpus]; in test_lru_sanity5() local
578 key = 0; in test_lru_sanity5()
579 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity5()
586 do_test_lru_sanity5(key, map_fd); in test_lru_sanity5()
590 key); in test_lru_sanity5()
597 key++; in test_lru_sanity5()
603 assert(key > 0); in test_lru_sanity5()
612 unsigned long long key, value[nr_cpus]; in test_lru_sanity6() local
632 for (key = 1; key <= tgt_free; key++) { in test_lru_sanity6()
633 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
635 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity6()
639 for (; key <= tgt_free * 2; key++) { in test_lru_sanity6()
648 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
652 for (; key <= tgt_free * 3; key++) { in test_lru_sanity6()
653 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
655 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity6()
678 unsigned long long key, value[nr_cpus]; in test_lru_sanity7() local
700 key = 1; in test_lru_sanity7()
701 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
702 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity7()
706 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity7()
712 key = 2; in test_lru_sanity7()
713 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
716 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity7()
719 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
724 key = 3; in test_lru_sanity7()
725 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
730 key = 1; in test_lru_sanity7()
731 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity7()
737 key = 2; in test_lru_sanity7()
738 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity7()
741 key = 3; in test_lru_sanity7()
742 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
743 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity7()
747 key = 2; in test_lru_sanity7()
748 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
769 unsigned long long key, value[nr_cpus]; in test_lru_sanity8() local
791 key = 1; in test_lru_sanity8()
792 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
795 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity8()
801 key = 2; in test_lru_sanity8()
802 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
805 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity8()
808 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
809 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity8()
815 key = 3; in test_lru_sanity8()
816 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
821 key = 1; in test_lru_sanity8()
822 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity8()
828 key = 2; in test_lru_sanity8()
829 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity8()
832 key = 3; in test_lru_sanity8()
833 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
834 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity8()
838 key = 1; in test_lru_sanity8()
839 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()