Creation of hash table. 8< */
| 191 | |
| 192 | /* Creation of hash table. 8< */ |
| 193 | static struct rte_hash * |
| 194 | create_hash_table(const struct shared_info *info) |
| 195 | { |
| 196 | uint32_t num_flows_node = info->num_flows / info->num_nodes; |
| 197 | char name[RTE_HASH_NAMESIZE]; |
| 198 | struct rte_hash *h; |
| 199 | |
| 200 | /* create table */ |
| 201 | struct rte_hash_parameters hash_params = { |
| 202 | .entries = num_flows_node * 2, /* table load = 50% */ |
| 203 | .key_len = sizeof(uint32_t), /* Store IPv4 dest IP address */ |
| 204 | .socket_id = rte_socket_id(), |
| 205 | .hash_func_init_val = 0, |
| 206 | }; |
| 207 | |
| 208 | snprintf(name, sizeof(name), "hash_table_%d", node_id); |
| 209 | hash_params.name = name; |
| 210 | h = rte_hash_create(&hash_params); |
| 211 | |
| 212 | if (h == NULL) |
| 213 | rte_exit(EXIT_FAILURE, |
| 214 | "Problem creating the hash table for node %d\n", |
| 215 | node_id); |
| 216 | return h; |
| 217 | } |
| 218 | |
| 219 | static void |
| 220 | populate_hash_table(const struct rte_hash *h, const struct shared_info *info) |
no test coverage detected