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

Function rte_rib6_free

dpdk/lib/rib/rte_rib6.c:576–610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576void
577rte_rib6_free(struct rte_rib6 *rib)
578{
579 struct rte_tailq_entry *te;
580 struct rte_rib6_list *rib6_list;
581 struct rte_rib6_node *tmp = NULL;
582
583 if (unlikely(rib == NULL)) {
584 rte_errno = EINVAL;
585 return;
586 }
587
588 rib6_list = RTE_TAILQ_CAST(rte_rib6_tailq.head, rte_rib6_list);
589
590 rte_mcfg_tailq_write_lock();
591
592 /* find our tailq entry */
593 TAILQ_FOREACH(te, rib6_list, next) {
594 if (te->data == (void *)rib)
595 break;
596 }
597 if (te != NULL)
598 TAILQ_REMOVE(rib6_list, te, next);
599
600 rte_mcfg_tailq_write_unlock();
601
602 while ((tmp = rte_rib6_get_nxt(rib, 0, 0, tmp,
603 RTE_RIB6_GET_NXT_ALL)) != NULL)
604 rte_rib6_remove(rib, tmp->ip, tmp->depth);
605
606 rte_mempool_free(rib->node_pool);
607
608 rte_free(rib);
609 rte_free(te);
610}

Callers 8

rte_fib6_createFunction · 0.85
rte_fib6_freeFunction · 0.85
test_multiple_createFunction · 0.85
test_free_nullFunction · 0.85
test_insert_invalidFunction · 0.85
test_get_fnFunction · 0.85
test_basicFunction · 0.85
test_tree_traversalFunction · 0.85

Calls 6

rte_rib6_get_nxtFunction · 0.85
rte_rib6_removeFunction · 0.85
rte_mempool_freeFunction · 0.85
rte_freeFunction · 0.85

Tested by 6

test_multiple_createFunction · 0.68
test_free_nullFunction · 0.68
test_insert_invalidFunction · 0.68
test_get_fnFunction · 0.68
test_basicFunction · 0.68
test_tree_traversalFunction · 0.68