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

Function create_table

dpdk/app/test/test_hash_perf.c:80–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78};
79
80static int
81create_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 */
120static void

Callers 1

run_all_tbl_perf_testsFunction · 0.70

Calls 6

snprintfFunction · 0.85
rte_socket_idFunction · 0.85
rte_hash_find_existingFunction · 0.85
rte_hash_freeFunction · 0.85
rte_hash_createFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected