MCPcopy Create free account
hub / github.com/F-Stack/f-stack / create_hash_table

Function create_hash_table

dpdk/examples/server_node_efd/efd_node/node.c:193–217  ·  view source on GitHub ↗

Creation of hash table. 8< */

Source from the content-addressed store, hash-verified

191
192/* Creation of hash table. 8< */
193static struct rte_hash *
194create_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
219static void
220populate_hash_table(const struct rte_hash *h, const struct shared_info *info)

Callers 1

mainFunction · 0.85

Calls 4

rte_socket_idFunction · 0.85
snprintfFunction · 0.85
rte_hash_createFunction · 0.85
rte_exitFunction · 0.85

Tested by

no test coverage detected