| 78 | }; |
| 79 | |
| 80 | static int |
| 81 | create_table(unsigned int with_data, unsigned int table_index, |
| 82 | unsigned int with_locks, unsigned int ext) |
| 83 | { |
| 84 | char name[RTE_HASH_NAMESIZE]; |
| 85 | |
| 86 | if (with_data) |
| 87 | /* Table will store 8-byte data */ |
| 88 | snprintf(name, sizeof(name), "test_hash%u_data", |
| 89 | hashtest_key_lens[table_index]); |
| 90 | else |
| 91 | snprintf(name, sizeof(name), "test_hash%u", |
| 92 | hashtest_key_lens[table_index]); |
| 93 | |
| 94 | |
| 95 | if (with_locks) |
| 96 | ut_params.extra_flag = |
| 97 | RTE_HASH_EXTRA_FLAGS_TRANS_MEM_SUPPORT |
| 98 | | RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY; |
| 99 | else |
| 100 | ut_params.extra_flag = 0; |
| 101 | |
| 102 | if (ext) |
| 103 | ut_params.extra_flag |= RTE_HASH_EXTRA_FLAGS_EXT_TABLE; |
| 104 | |
| 105 | ut_params.name = name; |
| 106 | ut_params.key_len = hashtest_key_lens[table_index]; |
| 107 | ut_params.socket_id = rte_socket_id(); |
| 108 | h[table_index] = rte_hash_find_existing(name); |
| 109 | rte_hash_free(h[table_index]); |
| 110 | h[table_index] = rte_hash_create(&ut_params); |
| 111 | if (h[table_index] == NULL) { |
| 112 | printf("Error creating table\n"); |
| 113 | return -1; |
| 114 | } |
| 115 | return 0; |
| 116 | |
| 117 | } |
| 118 | |
| 119 | /* Shuffle the keys that have been added, so lookups will be totally random */ |
| 120 | static void |
no test coverage detected