Lines Matching refs:pos

103 								int32_t pos)  in print_key_info()  argument
111 rte_log(RTE_LOG_DEBUG, hash_logtype_test, " @ pos %d\n", pos); in print_key_info()
503 int pos, expectedPos, delPos; in test_add_delete_free_lf() local
520 pos = rte_hash_add_key_with_hash(handle, &keys[0], hash_value); in test_add_delete_free_lf()
521 print_key_info("Add", &keys[0], pos); in test_add_delete_free_lf()
522 RETURN_IF_ERROR(pos < 0, "failed to add key (pos=%d)", pos); in test_add_delete_free_lf()
523 expectedPos = pos; in test_add_delete_free_lf()
525 pos = rte_hash_del_key_with_hash(handle, &keys[0], hash_value); in test_add_delete_free_lf()
526 print_key_info("Del", &keys[0], pos); in test_add_delete_free_lf()
527 RETURN_IF_ERROR(pos != expectedPos, in test_add_delete_free_lf()
528 "failed to delete key (pos=%d)", pos); in test_add_delete_free_lf()
529 delPos = pos; in test_add_delete_free_lf()
531 pos = rte_hash_free_key_with_position(handle, delPos); in test_add_delete_free_lf()
533 RETURN_IF_ERROR(pos != 0, in test_add_delete_free_lf()
556 pos = rte_hash_add_key_with_hash(handle, &keys[0], hash_value); in test_add_delete_free_lf()
557 print_key_info("Add", &keys[0], pos); in test_add_delete_free_lf()
558 RETURN_IF_ERROR(pos < 0, "failed to add key (pos=%d)", pos); in test_add_delete_free_lf()
559 expectedPos = pos; in test_add_delete_free_lf()
561 pos = rte_hash_del_key_with_hash(handle, &keys[0], hash_value); in test_add_delete_free_lf()
562 print_key_info("Del", &keys[0], pos); in test_add_delete_free_lf()
563 RETURN_IF_ERROR(pos != expectedPos, in test_add_delete_free_lf()
564 "failed to delete key (pos=%d)", pos); in test_add_delete_free_lf()
565 delPos = pos; in test_add_delete_free_lf()
567 pos = rte_hash_free_key_with_position(handle, delPos); in test_add_delete_free_lf()
569 RETURN_IF_ERROR(pos != 0, in test_add_delete_free_lf()
601 int pos, expectedPos, delPos, result; in test_hash_get_key_with_position() local
608 pos = rte_hash_add_key(handle, &keys[0]); in test_hash_get_key_with_position()
609 print_key_info("Add", &keys[0], pos); in test_hash_get_key_with_position()
610 RETURN_IF_ERROR(pos < 0, "failed to add key (pos0=%d)", pos); in test_hash_get_key_with_position()
611 expectedPos = pos; in test_hash_get_key_with_position()
613 result = rte_hash_get_key_with_position(handle, pos, &key); in test_hash_get_key_with_position()
616 pos = rte_hash_del_key(handle, &keys[0]); in test_hash_get_key_with_position()
617 print_key_info("Del", &keys[0], pos); in test_hash_get_key_with_position()
618 RETURN_IF_ERROR(pos != expectedPos, in test_hash_get_key_with_position()
619 "failed to delete key (pos0=%d)", pos); in test_hash_get_key_with_position()
621 result = rte_hash_get_key_with_position(handle, pos, &key); in test_hash_get_key_with_position()
632 pos = rte_hash_add_key(handle, &keys[0]); in test_hash_get_key_with_position()
633 print_key_info("Add", &keys[0], pos); in test_hash_get_key_with_position()
634 RETURN_IF_ERROR(pos < 0, "failed to add key (pos0=%d)", pos); in test_hash_get_key_with_position()
635 expectedPos = pos; in test_hash_get_key_with_position()
637 result = rte_hash_get_key_with_position(handle, pos, &key); in test_hash_get_key_with_position()
704 int pos[5]; in test_five_keys() local
715 pos[i] = rte_hash_add_key(handle, &keys[i]); in test_five_keys()
716 print_key_info("Add", &keys[i], pos[i]); in test_five_keys()
717 RETURN_IF_ERROR(pos[i] < 0, in test_five_keys()
718 "failed to add key (pos[%u]=%d)", i, pos[i]); in test_five_keys()
719 expected_pos[i] = pos[i]; in test_five_keys()
726 ret = rte_hash_lookup_bulk(handle, &key_array[0], 5, (int32_t *)pos); in test_five_keys()
729 print_key_info("Lkp", key_array[i], pos[i]); in test_five_keys()
730 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_five_keys()
731 "failed to find key (pos[%u]=%d)", i, pos[i]); in test_five_keys()
736 pos[i] = rte_hash_add_key(handle, &keys[i]); in test_five_keys()
737 print_key_info("Add", &keys[i], pos[i]); in test_five_keys()
738 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_five_keys()
739 "failed to add key (pos[%u]=%d)", i, pos[i]); in test_five_keys()
744 pos[i] = rte_hash_lookup(handle, &keys[i]); in test_five_keys()
745 print_key_info("Lkp", &keys[i], pos[i]); in test_five_keys()
746 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_five_keys()
747 "failed to find key (pos[%u]=%d)", i, pos[i]); in test_five_keys()
752 pos[i] = rte_hash_del_key(handle, &keys[i]); in test_five_keys()
753 print_key_info("Del", &keys[i], pos[i]); in test_five_keys()
754 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_five_keys()
755 "failed to delete key (pos[%u]=%d)", i, pos[i]); in test_five_keys()
760 pos[i] = rte_hash_lookup(handle, &keys[i]); in test_five_keys()
761 print_key_info("Lkp", &keys[i], pos[i]); in test_five_keys()
762 RETURN_IF_ERROR(pos[i] != -ENOENT, in test_five_keys()
763 "found non-existent key (pos[%u]=%d)", i, pos[i]); in test_five_keys()
767 ret = rte_hash_lookup_bulk(handle, &key_array[0], 5, (int32_t *)pos); in test_five_keys()
770 print_key_info("Lkp", key_array[i], pos[i]); in test_five_keys()
771 RETURN_IF_ERROR(pos[i] != -ENOENT, in test_five_keys()
772 "found not-existent key (pos[%u]=%d)", i, pos[i]); in test_five_keys()
801 int pos[5]; in test_full_bucket() local
810 pos[i] = rte_hash_add_key(handle, &keys[i]); in test_full_bucket()
811 print_key_info("Add", &keys[i], pos[i]); in test_full_bucket()
812 RETURN_IF_ERROR(pos[i] < 0, in test_full_bucket()
813 "failed to add key (pos[%u]=%d)", i, pos[i]); in test_full_bucket()
814 expected_pos[i] = pos[i]; in test_full_bucket()
820 pos[4] = rte_hash_add_key(handle, &keys[4]); in test_full_bucket()
821 print_key_info("Add", &keys[4], pos[4]); in test_full_bucket()
822 RETURN_IF_ERROR(pos[4] < 0, in test_full_bucket()
823 "failed to add key (pos[4]=%d)", pos[4]); in test_full_bucket()
824 expected_pos[4] = pos[4]; in test_full_bucket()
828 pos[i] = rte_hash_lookup(handle, &keys[i]); in test_full_bucket()
829 print_key_info("Lkp", &keys[i], pos[i]); in test_full_bucket()
830 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_full_bucket()
831 "failed to find key (pos[%u]=%d)", i, pos[i]); in test_full_bucket()
836 pos[i] = rte_hash_add_key(handle, &keys[i]); in test_full_bucket()
837 print_key_info("Add", &keys[i], pos[i]); in test_full_bucket()
838 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_full_bucket()
839 "failed to add key (pos[%u]=%d)", i, pos[i]); in test_full_bucket()
844 pos[i] = rte_hash_lookup(handle, &keys[i]); in test_full_bucket()
845 print_key_info("Lkp", &keys[i], pos[i]); in test_full_bucket()
846 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_full_bucket()
847 "failed to find key (pos[%u]=%d)", i, pos[i]); in test_full_bucket()
851 pos[1] = rte_hash_del_key(handle, &keys[1]); in test_full_bucket()
852 print_key_info("Del", &keys[1], pos[1]); in test_full_bucket()
853 RETURN_IF_ERROR(pos[1] != expected_pos[1], in test_full_bucket()
854 "failed to delete key (pos[1]=%d)", pos[1]); in test_full_bucket()
855 pos[3] = rte_hash_lookup(handle, &keys[3]); in test_full_bucket()
856 print_key_info("Lkp", &keys[3], pos[3]); in test_full_bucket()
857 RETURN_IF_ERROR(pos[3] != expected_pos[3], in test_full_bucket()
859 "(pos[3]=%d)", pos[3]); in test_full_bucket()
862 pos[1] = rte_hash_add_key(handle, &keys[1]); in test_full_bucket()
863 print_key_info("Add", &keys[1], pos[1]); in test_full_bucket()
864 expected_pos[1] = pos[1]; in test_full_bucket()
865 RETURN_IF_ERROR(pos[1] < 0, "failed to add key (pos[1]=%d)", pos[1]); in test_full_bucket()
869 pos[i] = rte_hash_del_key(handle, &keys[i]); in test_full_bucket()
870 print_key_info("Del", &keys[i], pos[i]); in test_full_bucket()
871 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_full_bucket()
872 "failed to delete key (pos[%u]=%d)", i, pos[i]); in test_full_bucket()
877 pos[i] = rte_hash_lookup(handle, &keys[i]); in test_full_bucket()
878 print_key_info("Lkp", &keys[i], pos[i]); in test_full_bucket()
879 RETURN_IF_ERROR(pos[i] != -ENOENT, in test_full_bucket()
880 "fail: found non-existent key (pos[%u]=%d)", i, pos[i]); in test_full_bucket()
905 int pos[64]; in test_extendable_bucket() local
920 pos[i] = rte_hash_add_key(handle, &rand_keys[i]); in test_extendable_bucket()
921 print_key_info("Add", &rand_keys[i], pos[i]); in test_extendable_bucket()
922 RETURN_IF_ERROR(pos[i] < 0, in test_extendable_bucket()
923 "failed to add key (pos[%u]=%d)", i, pos[i]); in test_extendable_bucket()
924 expected_pos[i] = pos[i]; in test_extendable_bucket()
929 pos[i] = rte_hash_lookup(handle, &rand_keys[i]); in test_extendable_bucket()
930 print_key_info("Lkp", &rand_keys[i], pos[i]); in test_extendable_bucket()
931 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_extendable_bucket()
932 "failed to find key (pos[%u]=%d)", i, pos[i]); in test_extendable_bucket()
937 pos[i] = rte_hash_add_key(handle, &rand_keys[i]); in test_extendable_bucket()
938 print_key_info("Add", &rand_keys[i], pos[i]); in test_extendable_bucket()
939 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_extendable_bucket()
940 "failed to add key (pos[%u]=%d)", i, pos[i]); in test_extendable_bucket()
945 pos[i] = rte_hash_lookup(handle, &rand_keys[i]); in test_extendable_bucket()
946 print_key_info("Lkp", &rand_keys[i], pos[i]); in test_extendable_bucket()
947 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_extendable_bucket()
948 "failed to find key (pos[%u]=%d)", i, pos[i]); in test_extendable_bucket()
952 pos[35] = rte_hash_del_key(handle, &rand_keys[35]); in test_extendable_bucket()
953 print_key_info("Del", &rand_keys[35], pos[35]); in test_extendable_bucket()
954 RETURN_IF_ERROR(pos[35] != expected_pos[35], in test_extendable_bucket()
955 "failed to delete key (pos[1]=%d)", pos[35]); in test_extendable_bucket()
956 pos[20] = rte_hash_lookup(handle, &rand_keys[20]); in test_extendable_bucket()
957 print_key_info("Lkp", &rand_keys[20], pos[20]); in test_extendable_bucket()
958 RETURN_IF_ERROR(pos[20] != expected_pos[20], in test_extendable_bucket()
960 "(pos[20]=%d)", pos[20]); in test_extendable_bucket()
963 pos[35] = rte_hash_add_key(handle, &rand_keys[35]); in test_extendable_bucket()
964 print_key_info("Add", &rand_keys[35], pos[35]); in test_extendable_bucket()
965 expected_pos[35] = pos[35]; in test_extendable_bucket()
966 RETURN_IF_ERROR(pos[35] < 0, "failed to add key (pos[1]=%d)", pos[35]); in test_extendable_bucket()
970 pos[i] = rte_hash_del_key(handle, &rand_keys[i]); in test_extendable_bucket()
971 print_key_info("Del", &rand_keys[i], pos[i]); in test_extendable_bucket()
972 RETURN_IF_ERROR(pos[i] != expected_pos[i], in test_extendable_bucket()
973 "failed to delete key (pos[%u]=%d)", i, pos[i]); in test_extendable_bucket()
978 pos[i] = rte_hash_lookup(handle, &rand_keys[i]); in test_extendable_bucket()
979 print_key_info("Lkp", &rand_keys[i], pos[i]); in test_extendable_bucket()
980 RETURN_IF_ERROR(pos[i] != -ENOENT, in test_extendable_bucket()
981 "fail: found non-existent key (pos[%u]=%d)", i, pos[i]); in test_extendable_bucket()
986 pos[i] = rte_hash_add_key(handle, &rand_keys[i]); in test_extendable_bucket()
987 print_key_info("Add", &rand_keys[i], pos[i]); in test_extendable_bucket()
988 RETURN_IF_ERROR(pos[i] < 0, in test_extendable_bucket()
989 "failed to add key (pos[%u]=%d)", i, pos[i]); in test_extendable_bucket()
990 expected_pos[i] = pos[i]; in test_extendable_bucket()
1924 int pos[total_entries]; in test_hash_rcu_qsbr_dq_mode() local
1968 pos[i] = rte_hash_add_key(g_handle, &g_rand_keys[i]); in test_hash_rcu_qsbr_dq_mode()
1969 print_key_info("Add", &g_rand_keys[i], pos[i]); in test_hash_rcu_qsbr_dq_mode()
1970 RETURN_IF_ERROR_RCU_QSBR(pos[i] < 0, in test_hash_rcu_qsbr_dq_mode()
1972 pos[i]); in test_hash_rcu_qsbr_dq_mode()
1973 expected_pos[i] = pos[i]; in test_hash_rcu_qsbr_dq_mode()
1983 pos[0] = rte_hash_lookup(g_handle, &g_rand_keys[0]); in test_hash_rcu_qsbr_dq_mode()
1984 print_key_info("Lkp", &g_rand_keys[0], pos[0]); in test_hash_rcu_qsbr_dq_mode()
1985 RETURN_IF_ERROR_RCU_QSBR(pos[0] != expected_pos[0], in test_hash_rcu_qsbr_dq_mode()
1987 pos[0]); in test_hash_rcu_qsbr_dq_mode()
1990 pos[0] = rte_hash_del_key(g_handle, &g_rand_keys[0]); in test_hash_rcu_qsbr_dq_mode()
1991 print_key_info("Del", &g_rand_keys[0], pos[0]); in test_hash_rcu_qsbr_dq_mode()
1992 RETURN_IF_ERROR_RCU_QSBR(pos[0] != expected_pos[0], in test_hash_rcu_qsbr_dq_mode()
1994 pos[0]); in test_hash_rcu_qsbr_dq_mode()
1997 pos[0] = rte_hash_lookup(g_handle, &g_rand_keys[0]); in test_hash_rcu_qsbr_dq_mode()
1998 print_key_info("Lkp", &g_rand_keys[0], pos[0]); in test_hash_rcu_qsbr_dq_mode()
1999 RETURN_IF_ERROR_RCU_QSBR(pos[0] != -ENOENT, in test_hash_rcu_qsbr_dq_mode()
2000 "found deleted key (pos[%u]=%d)", 0, pos[0]); in test_hash_rcu_qsbr_dq_mode()
2003 pos[0] = rte_hash_add_key(g_handle, &g_rand_keys[0]); in test_hash_rcu_qsbr_dq_mode()
2004 print_key_info("Add", &g_rand_keys[0], pos[0]); in test_hash_rcu_qsbr_dq_mode()
2005 RETURN_IF_ERROR_RCU_QSBR(pos[0] != -ENOSPC, in test_hash_rcu_qsbr_dq_mode()
2006 "Added key successfully (pos[%u]=%d)", 0, pos[0]); in test_hash_rcu_qsbr_dq_mode()
2012 pos[0] = rte_hash_add_key(g_handle, &g_rand_keys[0]); in test_hash_rcu_qsbr_dq_mode()
2013 print_key_info("Add", &g_rand_keys[0], pos[0]); in test_hash_rcu_qsbr_dq_mode()
2014 RETURN_IF_ERROR_RCU_QSBR(pos[0] < 0, in test_hash_rcu_qsbr_dq_mode()
2015 "failed to add key (pos[%u]=%d)", 0, pos[0]); in test_hash_rcu_qsbr_dq_mode()
2016 expected_pos[0] = pos[0]; in test_hash_rcu_qsbr_dq_mode()
2022 pos[0] = rte_hash_lookup(g_handle, &g_rand_keys[0]); in test_hash_rcu_qsbr_dq_mode()
2023 print_key_info("Lkp", &g_rand_keys[0], pos[0]); in test_hash_rcu_qsbr_dq_mode()
2024 RETURN_IF_ERROR_RCU_QSBR(pos[0] != expected_pos[0], in test_hash_rcu_qsbr_dq_mode()
2026 pos[0]); in test_hash_rcu_qsbr_dq_mode()
2094 int pos[total_entries]; in test_hash_rcu_qsbr_sync_mode() local
2142 pos[i] = rte_hash_add_key(g_handle, &g_rand_keys[i]); in test_hash_rcu_qsbr_sync_mode()
2143 print_key_info("Add", &g_rand_keys[i], pos[i]); in test_hash_rcu_qsbr_sync_mode()
2144 RETURN_IF_ERROR_RCU_QSBR(pos[i] < 0, in test_hash_rcu_qsbr_sync_mode()
2145 "failed to add key (pos[%u]=%d)", i, pos[i]); in test_hash_rcu_qsbr_sync_mode()
2146 expected_pos[i] = pos[i]; in test_hash_rcu_qsbr_sync_mode()
2152 expected_pos[0] = pos[0]; in test_hash_rcu_qsbr_sync_mode()
2153 pos[0] = rte_hash_del_key(g_handle, &g_rand_keys[0]); in test_hash_rcu_qsbr_sync_mode()
2155 RETURN_IF_ERROR_RCU_QSBR(pos[0] != expected_pos[0], in test_hash_rcu_qsbr_sync_mode()
2157 , 0, pos[0]); in test_hash_rcu_qsbr_sync_mode()
2159 pos[0] = rte_hash_add_key(g_handle, &g_rand_keys[0]); in test_hash_rcu_qsbr_sync_mode()
2160 print_key_info("Add", &g_rand_keys[0], pos[0]); in test_hash_rcu_qsbr_sync_mode()
2161 RETURN_IF_ERROR_RCU_QSBR(pos[0] < 0, in test_hash_rcu_qsbr_sync_mode()
2163 pos[0]); in test_hash_rcu_qsbr_sync_mode()