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

Function rte_ring_free

dpdk/lib/ring/rte_ring.c:317–358  ·  view source on GitHub ↗

free the ring */

Source from the content-addressed store, hash-verified

315
316/* free the ring */
317void
318rte_ring_free(struct rte_ring *r)
319{
320 struct rte_ring_list *ring_list = NULL;
321 struct rte_tailq_entry *te;
322
323 if (r == NULL)
324 return;
325
326 /*
327 * Ring was not created with rte_ring_create,
328 * therefore, there is no memzone to free.
329 */
330 if (r->memzone == NULL) {
331 RTE_LOG(ERR, RING,
332 "Cannot free ring, not created with rte_ring_create()\n");
333 return;
334 }
335
336 ring_list = RTE_TAILQ_CAST(rte_ring_tailq.head, rte_ring_list);
337 rte_mcfg_tailq_write_lock();
338
339 /* find out tailq entry */
340 TAILQ_FOREACH(te, ring_list, next) {
341 if (te->data == (void *) r)
342 break;
343 }
344
345 if (te == NULL) {
346 rte_mcfg_tailq_write_unlock();
347 return;
348 }
349
350 TAILQ_REMOVE(ring_list, te, next);
351
352 rte_mcfg_tailq_write_unlock();
353
354 if (rte_memzone_free(r->memzone) != 0)
355 RTE_LOG(ERR, RING, "Cannot free memory\n");
356
357 rte_free(te);
358}
359
360/* dump the status of the ring on the console */
361void

Callers 15

rte_member_create_sketchFunction · 0.85
rte_member_free_sketchFunction · 0.85
rte_member_createFunction · 0.85
rte_hash_createFunction · 0.85
rte_hash_freeFunction · 0.85
rte_efd_freeFunction · 0.85
rxa_create_intr_threadFunction · 0.85
rxa_destroy_intr_threadFunction · 0.85
rte_event_ring_freeFunction · 0.85
graph_sched_wq_createFunction · 0.85
graph_sched_wq_destroyFunction · 0.85
rte_rcu_qsbr_dq_deleteFunction · 0.85

Calls 4

rte_memzone_freeFunction · 0.85
rte_freeFunction · 0.85

Tested by 15

ring_cleanFunction · 0.68
test_ring_pmd_perfFunction · 0.68
test_cleanup_resourcesFunction · 0.68
test_ring_freeFunction · 0.68
deinit_portsFunction · 0.68
testsuite_teardownFunction · 0.68
app_free_resourcesFunction · 0.68
test_ring_perf_esizeFunction · 0.68
test_refcnt_mbufFunction · 0.68
test_ring_negative_testsFunction · 0.68