• Home
  • Raw
  • Download

Lines Matching refs:map_fd

428 	int map_fd;  in test_lpm_delete()  local
434 map_fd = bpf_create_map(BPF_MAP_TYPE_LPM_TRIE, in test_lpm_delete()
437 assert(map_fd >= 0); in test_lpm_delete()
454 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
459 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
464 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
469 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
474 assert(bpf_map_lookup_elem(map_fd, key, &value) == -1 && in test_lpm_delete()
479 assert(bpf_map_delete_elem(map_fd, key) == -1 && in test_lpm_delete()
484 assert(bpf_map_delete_elem(map_fd, key) == -1 && in test_lpm_delete()
490 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
496 assert(bpf_map_delete_elem(map_fd, key) == 0); in test_lpm_delete()
500 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
506 assert(bpf_map_delete_elem(map_fd, key) == 0); in test_lpm_delete()
510 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
516 assert(bpf_map_delete_elem(map_fd, key) == 0); in test_lpm_delete()
520 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
526 assert(bpf_map_delete_elem(map_fd, key) == 0); in test_lpm_delete()
530 assert(bpf_map_lookup_elem(map_fd, key, &value) == -1 && in test_lpm_delete()
533 close(map_fd); in test_lpm_delete()
541 int map_fd; in test_lpm_get_next_key() local
547 map_fd = bpf_create_map(BPF_MAP_TYPE_LPM_TRIE, key_size, sizeof(value), in test_lpm_get_next_key()
549 assert(map_fd >= 0); in test_lpm_get_next_key()
552 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == -1 && in test_lpm_get_next_key()
558 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
561 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
565 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 && in test_lpm_get_next_key()
570 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
577 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
580 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
585 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
590 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 && in test_lpm_get_next_key()
596 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
599 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
604 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
609 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
614 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 && in test_lpm_get_next_key()
620 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
623 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
628 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
633 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
638 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
643 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 && in test_lpm_get_next_key()
649 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
652 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
657 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
663 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
668 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
673 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
678 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 && in test_lpm_get_next_key()
684 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
688 close(map_fd); in test_lpm_get_next_key()
695 int map_fd; member
721 assert(bpf_map_update_elem(info->map_fd, key_p, &value, 0) == 0); in lpm_test_command()
723 ret = bpf_map_delete_elem(info->map_fd, key_p); in lpm_test_command()
727 ret = bpf_map_lookup_elem(info->map_fd, key_p, &value); in lpm_test_command()
731 ret = bpf_map_get_next_key(info->map_fd, key_p, next_key_p); in lpm_test_command()
740 static void setup_lpm_mt_test_info(struct lpm_mt_test_info *info, int map_fd) in setup_lpm_mt_test_info() argument
743 info->map_fd = map_fd; in setup_lpm_mt_test_info()
759 int i, map_fd; in test_lpm_multi_thread() local
765 map_fd = bpf_create_map(BPF_MAP_TYPE_LPM_TRIE, key_size, value_size, in test_lpm_multi_thread()
769 setup_lpm_mt_test_info(&info[0], map_fd); in test_lpm_multi_thread()
780 close(map_fd); in test_lpm_multi_thread()