* Sequence of operations for find existing fbk hash table * * - create table * - find existing table: hit * - find non-existing table: miss * */
| 1304 | * |
| 1305 | */ |
| 1306 | static int test_fbk_hash_find_existing(void) |
| 1307 | { |
| 1308 | struct rte_fbk_hash_params params = { |
| 1309 | .name = "fbk_hash_find_existing", |
| 1310 | .entries = LOCAL_FBK_HASH_ENTRIES_MAX, |
| 1311 | .entries_per_bucket = 4, |
| 1312 | .socket_id = 0, |
| 1313 | }; |
| 1314 | struct rte_fbk_hash_table *handle = NULL, *result = NULL; |
| 1315 | |
| 1316 | /* Create hash table. */ |
| 1317 | handle = rte_fbk_hash_create(¶ms); |
| 1318 | RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation failed"); |
| 1319 | |
| 1320 | /* Try to find existing fbk hash table */ |
| 1321 | result = rte_fbk_hash_find_existing("fbk_hash_find_existing"); |
| 1322 | RETURN_IF_ERROR_FBK(result != handle, "could not find existing fbk hash table"); |
| 1323 | |
| 1324 | /* Try to find non-existing fbk hash table */ |
| 1325 | result = rte_fbk_hash_find_existing("fbk_hash_find_non_existing"); |
| 1326 | RETURN_IF_ERROR_FBK(!(result == NULL), "found fbk table that shouldn't exist"); |
| 1327 | |
| 1328 | /* Cleanup. */ |
| 1329 | rte_fbk_hash_free(handle); |
| 1330 | |
| 1331 | return 0; |
| 1332 | } |
| 1333 | |
| 1334 | #define BUCKET_ENTRIES 4 |
| 1335 | /* |
no test coverage detected