Lines Matching refs:handle

50 		if (handle) rte_hash_free(handle);			\
58 if (handle) rte_fbk_hash_free(handle); \
274 struct rte_hash *handle; in test_add_delete() local
279 handle = rte_hash_create(&ut_params); in test_add_delete()
280 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_add_delete()
282 pos0 = rte_hash_add_key(handle, &keys[0]); in test_add_delete()
287 pos0 = rte_hash_lookup(handle, &keys[0]); in test_add_delete()
292 pos0 = rte_hash_del_key(handle, &keys[0]); in test_add_delete()
297 pos0 = rte_hash_lookup(handle, &keys[0]); in test_add_delete()
302 rte_hash_free(handle); in test_add_delete()
309 handle = rte_hash_create(&ut_params); in test_add_delete()
310 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_add_delete()
313 hash_value = rte_hash_hash(handle, &keys[0]); in test_add_delete()
314 pos1 = rte_hash_add_key_with_hash(handle, &keys[0], hash_value); in test_add_delete()
319 pos1 = rte_hash_lookup_with_hash(handle, &keys[0], hash_value); in test_add_delete()
324 pos1 = rte_hash_del_key_with_hash(handle, &keys[0], hash_value); in test_add_delete()
330 pos1 = rte_hash_lookup_with_hash(handle, &keys[0], hash_value); in test_add_delete()
335 pos1 = rte_hash_free_key_with_position(handle, delPos1); in test_add_delete()
340 rte_hash_free(handle); in test_add_delete()
358 struct rte_hash *handle; in test_add_update_delete() local
362 handle = rte_hash_create(&ut_params); in test_add_update_delete()
363 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_add_update_delete()
365 pos0 = rte_hash_del_key(handle, &keys[0]); in test_add_update_delete()
370 pos0 = rte_hash_add_key(handle, &keys[0]); in test_add_update_delete()
375 pos0 = rte_hash_lookup(handle, &keys[0]); in test_add_update_delete()
380 pos0 = rte_hash_add_key(handle, &keys[0]); in test_add_update_delete()
385 pos0 = rte_hash_lookup(handle, &keys[0]); in test_add_update_delete()
390 pos0 = rte_hash_del_key(handle, &keys[0]); in test_add_update_delete()
395 pos0 = rte_hash_del_key(handle, &keys[0]); in test_add_update_delete()
400 pos0 = rte_hash_lookup(handle, &keys[0]); in test_add_update_delete()
405 rte_hash_free(handle); in test_add_update_delete()
424 struct rte_hash *handle; in test_add_update_delete_free() local
429 handle = rte_hash_create(&ut_params); in test_add_update_delete_free()
430 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_add_update_delete_free()
433 pos0 = rte_hash_del_key(handle, &keys[0]); in test_add_update_delete_free()
438 pos0 = rte_hash_add_key(handle, &keys[0]); in test_add_update_delete_free()
443 pos0 = rte_hash_lookup(handle, &keys[0]); in test_add_update_delete_free()
448 pos0 = rte_hash_add_key(handle, &keys[0]); in test_add_update_delete_free()
453 pos0 = rte_hash_lookup(handle, &keys[0]); in test_add_update_delete_free()
458 delPos0 = rte_hash_del_key(handle, &keys[0]); in test_add_update_delete_free()
463 pos0 = rte_hash_del_key(handle, &keys[0]); in test_add_update_delete_free()
468 pos0 = rte_hash_lookup(handle, &keys[0]); in test_add_update_delete_free()
473 result = rte_hash_free_key_with_position(handle, delPos0); in test_add_update_delete_free()
478 pos0 = rte_hash_lookup(handle, &keys[0]); in test_add_update_delete_free()
483 rte_hash_free(handle); in test_add_update_delete_free()
501 struct rte_hash *handle; in test_add_delete_free_lf() local
509 handle = rte_hash_create(&ut_params); in test_add_delete_free_lf()
510 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_add_delete_free_lf()
519 hash_value = rte_hash_hash(handle, &keys[0]); in test_add_delete_free_lf()
520 pos = rte_hash_add_key_with_hash(handle, &keys[0], hash_value); 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()
531 pos = rte_hash_free_key_with_position(handle, delPos); in test_add_delete_free_lf()
537 rte_hash_free(handle); in test_add_delete_free_lf()
542 handle = rte_hash_create(&ut_params); in test_add_delete_free_lf()
543 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_add_delete_free_lf()
555 hash_value = rte_hash_hash(handle, &keys[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()
561 pos = rte_hash_del_key_with_hash(handle, &keys[0], hash_value); in test_add_delete_free_lf()
567 pos = rte_hash_free_key_with_position(handle, delPos); in test_add_delete_free_lf()
574 rte_hash_free(handle); in test_add_delete_free_lf()
600 struct rte_hash *handle = NULL; in test_hash_get_key_with_position() local
605 handle = rte_hash_create(&ut_params); in test_hash_get_key_with_position()
606 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_hash_get_key_with_position()
608 pos = rte_hash_add_key(handle, &keys[0]); 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()
621 result = rte_hash_get_key_with_position(handle, pos, &key); in test_hash_get_key_with_position()
624 rte_hash_free(handle); in test_hash_get_key_with_position()
628 handle = rte_hash_create(&ut_params); in test_hash_get_key_with_position()
629 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_hash_get_key_with_position()
632 pos = rte_hash_add_key(handle, &keys[0]); 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()
640 delPos = rte_hash_del_key(handle, &keys[0]); in test_hash_get_key_with_position()
645 result = rte_hash_get_key_with_position(handle, delPos, &key); in test_hash_get_key_with_position()
648 result = rte_hash_free_key_with_position(handle, delPos); in test_hash_get_key_with_position()
653 result = rte_hash_get_key_with_position(handle, delPos, &key); in test_hash_get_key_with_position()
656 rte_hash_free(handle); in test_hash_get_key_with_position()
670 struct rte_hash *handle = NULL, *result = NULL; in test_hash_find_existing() local
674 handle = rte_hash_create(&ut_params); in test_hash_find_existing()
675 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_hash_find_existing()
679 RETURN_IF_ERROR(result != handle, "could not find existing hash table"); in test_hash_find_existing()
686 rte_hash_free(handle); in test_hash_find_existing()
702 struct rte_hash *handle; in test_five_keys() local
710 handle = rte_hash_create(&ut_params); in test_five_keys()
711 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_five_keys()
715 pos[i] = rte_hash_add_key(handle, &keys[i]); in test_five_keys()
726 ret = rte_hash_lookup_bulk(handle, &key_array[0], 5, (int32_t *)pos); in test_five_keys()
736 pos[i] = rte_hash_add_key(handle, &keys[i]); in test_five_keys()
744 pos[i] = rte_hash_lookup(handle, &keys[i]); in test_five_keys()
752 pos[i] = rte_hash_del_key(handle, &keys[i]); in test_five_keys()
760 pos[i] = rte_hash_lookup(handle, &keys[i]); in test_five_keys()
767 ret = rte_hash_lookup_bulk(handle, &key_array[0], 5, (int32_t *)pos); in test_five_keys()
775 rte_hash_free(handle); in test_five_keys()
800 struct rte_hash *handle; in test_full_bucket() local
805 handle = rte_hash_create(&params_pseudo_hash); in test_full_bucket()
806 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_full_bucket()
810 pos[i] = rte_hash_add_key(handle, &keys[i]); in test_full_bucket()
820 pos[4] = rte_hash_add_key(handle, &keys[4]); in test_full_bucket()
828 pos[i] = rte_hash_lookup(handle, &keys[i]); in test_full_bucket()
836 pos[i] = rte_hash_add_key(handle, &keys[i]); in test_full_bucket()
844 pos[i] = rte_hash_lookup(handle, &keys[i]); in test_full_bucket()
851 pos[1] = rte_hash_del_key(handle, &keys[1]); in test_full_bucket()
855 pos[3] = rte_hash_lookup(handle, &keys[3]); in test_full_bucket()
862 pos[1] = rte_hash_add_key(handle, &keys[1]); in test_full_bucket()
869 pos[i] = rte_hash_del_key(handle, &keys[i]); in test_full_bucket()
877 pos[i] = rte_hash_lookup(handle, &keys[i]); in test_full_bucket()
883 rte_hash_free(handle); in test_full_bucket()
904 struct rte_hash *handle; in test_extendable_bucket() local
915 handle = rte_hash_create(&params_pseudo_hash); in test_extendable_bucket()
916 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_extendable_bucket()
920 pos[i] = rte_hash_add_key(handle, &rand_keys[i]); in test_extendable_bucket()
929 pos[i] = rte_hash_lookup(handle, &rand_keys[i]); in test_extendable_bucket()
937 pos[i] = rte_hash_add_key(handle, &rand_keys[i]); in test_extendable_bucket()
945 pos[i] = rte_hash_lookup(handle, &rand_keys[i]); in test_extendable_bucket()
952 pos[35] = rte_hash_del_key(handle, &rand_keys[35]); in test_extendable_bucket()
956 pos[20] = rte_hash_lookup(handle, &rand_keys[20]); in test_extendable_bucket()
963 pos[35] = rte_hash_add_key(handle, &rand_keys[35]); in test_extendable_bucket()
970 pos[i] = rte_hash_del_key(handle, &rand_keys[i]); in test_extendable_bucket()
978 pos[i] = rte_hash_lookup(handle, &rand_keys[i]); in test_extendable_bucket()
986 pos[i] = rte_hash_add_key(handle, &rand_keys[i]); in test_extendable_bucket()
993 rte_hash_free(handle); in test_extendable_bucket()
1116 struct rte_fbk_hash_table *handle, *tmp; in fbk_hash_unit_test() local
1127 handle = rte_fbk_hash_create(&invalid_params_1); in fbk_hash_unit_test()
1128 RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed"); in fbk_hash_unit_test()
1130 handle = rte_fbk_hash_create(&invalid_params_2); in fbk_hash_unit_test()
1131 RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed"); in fbk_hash_unit_test()
1133 handle = rte_fbk_hash_create(&invalid_params_3); in fbk_hash_unit_test()
1134 RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed"); in fbk_hash_unit_test()
1136 handle = rte_fbk_hash_create(&invalid_params_4); in fbk_hash_unit_test()
1137 RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed"); in fbk_hash_unit_test()
1139 handle = rte_fbk_hash_create(&invalid_params_5); in fbk_hash_unit_test()
1140 RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed"); in fbk_hash_unit_test()
1142 handle = rte_fbk_hash_create(&invalid_params_6); in fbk_hash_unit_test()
1143 RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed"); in fbk_hash_unit_test()
1145 handle = rte_fbk_hash_create(&invalid_params_7); in fbk_hash_unit_test()
1146 RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed"); in fbk_hash_unit_test()
1149 handle = rte_fbk_hash_create(&invalid_params_8); in fbk_hash_unit_test()
1150 RETURN_IF_ERROR_FBK(handle != NULL, in fbk_hash_unit_test()
1154 handle = rte_fbk_hash_create(&invalid_params_same_name_1); in fbk_hash_unit_test()
1155 RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation should have succeeded"); in fbk_hash_unit_test()
1170 rte_fbk_hash_free(handle); in fbk_hash_unit_test()
1174 handle = rte_fbk_hash_create(&params_jhash); in fbk_hash_unit_test()
1175 RETURN_IF_ERROR_FBK(handle == NULL, "fbk jhash hash creation failed"); in fbk_hash_unit_test()
1178 rte_fbk_hash_free(handle); in fbk_hash_unit_test()
1181 handle = rte_fbk_hash_create(&params_nohash); in fbk_hash_unit_test()
1182 RETURN_IF_ERROR_FBK(handle == NULL, "fbk nohash hash creation failed"); in fbk_hash_unit_test()
1185 rte_fbk_hash_free(handle); in fbk_hash_unit_test()
1188 handle = rte_fbk_hash_create(&params); in fbk_hash_unit_test()
1189 RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation failed"); in fbk_hash_unit_test()
1191 used_entries = rte_fbk_hash_get_load_factor(handle) * LOCAL_FBK_HASH_ENTRIES_MAX; in fbk_hash_unit_test()
1196 status = rte_fbk_hash_add_key(handle, keys[i], vals[i]); in fbk_hash_unit_test()
1200 used_entries = rte_fbk_hash_get_load_factor(handle) * LOCAL_FBK_HASH_ENTRIES_MAX; in fbk_hash_unit_test()
1205 status = rte_fbk_hash_lookup(handle, keys[i]); in fbk_hash_unit_test()
1212 status = rte_fbk_hash_add_key(handle, keys[i], vals[4 - i]); in fbk_hash_unit_test()
1218 status = rte_fbk_hash_lookup(handle, keys[i]); in fbk_hash_unit_test()
1225 status = rte_fbk_hash_delete_key(handle, keys[i]); in fbk_hash_unit_test()
1229 used_entries = rte_fbk_hash_get_load_factor(handle) * LOCAL_FBK_HASH_ENTRIES_MAX; in fbk_hash_unit_test()
1234 status = rte_fbk_hash_lookup(handle, keys[i]); in fbk_hash_unit_test()
1241 status = rte_fbk_hash_add_key(handle, keys[i], vals[i]); in fbk_hash_unit_test()
1247 status = rte_fbk_hash_lookup(handle, keys[i]); in fbk_hash_unit_test()
1253 rte_fbk_hash_clear_all(handle); in fbk_hash_unit_test()
1257 status = rte_fbk_hash_lookup(handle, keys[i]); in fbk_hash_unit_test()
1266 rte_fbk_hash_add_key(handle, i, (uint16_t) i); in fbk_hash_unit_test()
1269 status = rte_fbk_hash_lookup(handle, RTE_FBK_HASH_ENTRIES_MAX + 1); in fbk_hash_unit_test()
1274 status = rte_fbk_hash_delete_key(handle, RTE_FBK_HASH_ENTRIES_MAX + 1); in fbk_hash_unit_test()
1279 status = rte_fbk_hash_delete_key(handle, 1); in fbk_hash_unit_test()
1284 rte_fbk_hash_clear_all(handle); in fbk_hash_unit_test()
1287 rte_fbk_hash_free(handle); in fbk_hash_unit_test()
1311 struct rte_fbk_hash_table *handle = NULL, *result = NULL; in test_fbk_hash_find_existing() local
1314 handle = rte_fbk_hash_create(&params); in test_fbk_hash_find_existing()
1315 RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation failed"); in test_fbk_hash_find_existing()
1319 RETURN_IF_ERROR_FBK(result != handle, "could not find existing fbk hash table"); in test_fbk_hash_find_existing()
1326 rte_fbk_hash_free(handle); in test_fbk_hash_find_existing()
1337 struct rte_hash *handle, *tmp; in test_hash_creation_with_bad_parameters() local
1340 handle = rte_hash_create(NULL); in test_hash_creation_with_bad_parameters()
1341 if (handle != NULL) { in test_hash_creation_with_bad_parameters()
1342 rte_hash_free(handle); in test_hash_creation_with_bad_parameters()
1350 handle = rte_hash_create(&params); in test_hash_creation_with_bad_parameters()
1351 if (handle != NULL) { in test_hash_creation_with_bad_parameters()
1352 rte_hash_free(handle); in test_hash_creation_with_bad_parameters()
1360 handle = rte_hash_create(&params); in test_hash_creation_with_bad_parameters()
1361 if (handle != NULL) { in test_hash_creation_with_bad_parameters()
1362 rte_hash_free(handle); in test_hash_creation_with_bad_parameters()
1370 handle = rte_hash_create(&params); in test_hash_creation_with_bad_parameters()
1371 if (handle != NULL) { in test_hash_creation_with_bad_parameters()
1372 rte_hash_free(handle); in test_hash_creation_with_bad_parameters()
1380 handle = rte_hash_create(&params); in test_hash_creation_with_bad_parameters()
1381 if (handle != NULL) { in test_hash_creation_with_bad_parameters()
1382 rte_hash_free(handle); in test_hash_creation_with_bad_parameters()
1390 handle = rte_hash_create(&params); in test_hash_creation_with_bad_parameters()
1391 if (handle == NULL) { in test_hash_creation_with_bad_parameters()
1398 rte_hash_free(handle); in test_hash_creation_with_bad_parameters()
1402 rte_hash_free(handle); in test_hash_creation_with_bad_parameters()
1416 struct rte_hash *handle; in test_hash_creation_with_good_parameters() local
1423 handle = rte_hash_create(&params); in test_hash_creation_with_good_parameters()
1424 if (handle == NULL) { in test_hash_creation_with_good_parameters()
1429 rte_hash_free(handle); in test_hash_creation_with_good_parameters()
1441 struct rte_hash *handle; in test_average_table_utilization() local
1465 handle = rte_hash_create(&ut_params); in test_average_table_utilization()
1467 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_average_table_utilization()
1475 ret = rte_hash_add_key(handle, simple_key); in test_average_table_utilization()
1482 rte_hash_free(handle); in test_average_table_utilization()
1486 cnt = rte_hash_count(handle); in test_average_table_utilization()
1490 rte_hash_free(handle); in test_average_table_utilization()
1497 rte_hash_free(handle); in test_average_table_utilization()
1505 rte_hash_reset(handle); in test_average_table_utilization()
1517 rte_hash_free(handle); in test_average_table_utilization()
1525 struct rte_hash *handle; in test_hash_iteration() local
1544 handle = rte_hash_create(&ut_params); in test_hash_iteration()
1545 RETURN_IF_ERROR(handle == NULL, "hash creation failed"); in test_hash_iteration()
1552 ret = rte_hash_add_key_data(handle, keys[added_keys], data[added_keys]); in test_hash_iteration()
1563 while (rte_hash_iterate(handle, &next_key, &next_data, &iter) >= 0) { in test_hash_iteration()
1588 rte_hash_free(handle); in test_hash_iteration()
1592 rte_hash_free(handle); in test_hash_iteration()
1616 struct rte_hash *handle; in test_hash_add_delete_jhash2() local
1623 handle = rte_hash_create(&hash_params_ex); in test_hash_add_delete_jhash2()
1624 if (handle == NULL) { in test_hash_add_delete_jhash2()
1628 pos1 = rte_hash_add_key(handle, (void *)&key[0]); in test_hash_add_delete_jhash2()
1634 pos2 = rte_hash_del_key(handle, (void *)&key[0]); in test_hash_add_delete_jhash2()
1642 if (handle != NULL) in test_hash_add_delete_jhash2()
1643 rte_hash_free(handle); in test_hash_add_delete_jhash2()
1655 struct rte_hash *handle; in test_hash_add_delete_2_jhash2() local
1662 handle = rte_hash_create(&hash_params_ex); in test_hash_add_delete_2_jhash2()
1663 if (handle == NULL) in test_hash_add_delete_2_jhash2()
1666 pos1 = rte_hash_add_key(handle, (void *)&key[0]); in test_hash_add_delete_2_jhash2()
1670 pos2 = rte_hash_del_key(handle, (void *)&key[0]); in test_hash_add_delete_2_jhash2()
1677 if (handle != NULL) in test_hash_add_delete_2_jhash2()
1678 rte_hash_free(handle); in test_hash_add_delete_2_jhash2()
1720 struct rte_hash *handle; in test_hash_add_delete_jhash_1word() local
1727 handle = rte_hash_create(&hash_params_ex); in test_hash_add_delete_jhash_1word()
1728 if (handle == NULL) in test_hash_add_delete_jhash_1word()
1731 pos1 = rte_hash_add_key(handle, (void *)&key[0]); in test_hash_add_delete_jhash_1word()
1735 pos2 = rte_hash_del_key(handle, (void *)&key[0]); in test_hash_add_delete_jhash_1word()
1742 if (handle != NULL) in test_hash_add_delete_jhash_1word()
1743 rte_hash_free(handle); in test_hash_add_delete_jhash_1word()
1755 struct rte_hash *handle; in test_hash_add_delete_jhash_2word() local
1762 handle = rte_hash_create(&hash_params_ex); in test_hash_add_delete_jhash_2word()
1763 if (handle == NULL) in test_hash_add_delete_jhash_2word()
1766 pos1 = rte_hash_add_key(handle, (void *)&key[0]); in test_hash_add_delete_jhash_2word()
1770 pos2 = rte_hash_del_key(handle, (void *)&key[0]); in test_hash_add_delete_jhash_2word()
1777 if (handle != NULL) in test_hash_add_delete_jhash_2word()
1778 rte_hash_free(handle); in test_hash_add_delete_jhash_2word()
1790 struct rte_hash *handle; in test_hash_add_delete_jhash_3word() local
1797 handle = rte_hash_create(&hash_params_ex); in test_hash_add_delete_jhash_3word()
1798 if (handle == NULL) in test_hash_add_delete_jhash_3word()
1801 pos1 = rte_hash_add_key(handle, (void *)&key[0]); in test_hash_add_delete_jhash_3word()
1805 pos2 = rte_hash_del_key(handle, (void *)&key[0]); in test_hash_add_delete_jhash_3word()
1812 if (handle != NULL) in test_hash_add_delete_jhash_3word()
1813 rte_hash_free(handle); in test_hash_add_delete_jhash_3word()