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

Function rte_fbk_hash_free

dpdk/lib/hash/rte_fbk_hash.c:174–205  ·  view source on GitHub ↗

* Free all memory used by a hash table. * * @param ht * Hash table to deallocate. */

Source from the content-addressed store, hash-verified

172 * Hash table to deallocate.
173 */
174void
175rte_fbk_hash_free(struct rte_fbk_hash_table *ht)
176{
177 struct rte_tailq_entry *te;
178 struct rte_fbk_hash_list *fbk_hash_list;
179
180 if (ht == NULL)
181 return;
182
183 fbk_hash_list = RTE_TAILQ_CAST(rte_fbk_hash_tailq.head,
184 rte_fbk_hash_list);
185
186 rte_mcfg_tailq_write_lock();
187
188 /* find out tailq entry */
189 TAILQ_FOREACH(te, fbk_hash_list, next) {
190 if (te->data == (void *) ht)
191 break;
192 }
193
194 if (te == NULL) {
195 rte_mcfg_tailq_write_unlock();
196 return;
197 }
198
199 TAILQ_REMOVE(fbk_hash_list, te, next);
200
201 rte_mcfg_tailq_write_unlock();
202
203 rte_free(ht);
204 rte_free(te);
205}

Callers 5

fbk_cleanFunction · 0.85
fbk_create_freeFunction · 0.85
fbk_hash_perf_testFunction · 0.85
fbk_hash_unit_testFunction · 0.85

Calls 3

rte_freeFunction · 0.85

Tested by 5

fbk_cleanFunction · 0.68
fbk_create_freeFunction · 0.68
fbk_hash_perf_testFunction · 0.68
fbk_hash_unit_testFunction · 0.68