src/dpdk/lib/librte_lpm/rte_lpm6.c
void
rte_lpm6_free(struct rte_lpm6 *lpm)
{
	struct rte_lpm6_list *lpm_list;
	struct rte_tailq_entry *te;

	/* Check user arguments. */
	if (lpm == NULL)
		return;

	lpm_list = RTE_TAILQ_CAST(rte_lpm6_tailq.head, rte_lpm6_list);

	rte_mcfg_tailq_write_lock();

	/* find our tailq entry */
	TAILQ_FOREACH(te, lpm_list, next) {
		if (te->data == (void *) lpm)
			break;
	}

	if (te != NULL)
		TAILQ_REMOVE(lpm_list, te, next);

	rte_mcfg_tailq_write_unlock();

	rte_free(lpm->tbl8_hdrs);
	rte_free(lpm->tbl8_pool);
	rte_hash_free(lpm->rules_tbl);
	rte_free(lpm);
	rte_free(te);
}
/*
 * Deallocates memory for given LPM table.
 */
Deallocates memory for given LPM table.
Deallocates memory for given LPM table .
void
rte_lpm6_free(struct rte_lpm6 *lpm)
{
	struct rte_lpm6_list *lpm_list;
	struct rte_tailq_entry *te;
	if (lpm == NULL)
		return;
	lpm_list = RTE_TAILQ_CAST(rte_lpm6_tailq.head, rte_lpm6_list);
	rte_mcfg_tailq_write_lock();
	TAILQ_FOREACH(te, lpm_list, next) {
		if (te->data == (void *) lpm)
			break;
	}
	if (te != NULL)
		TAILQ_REMOVE(lpm_list, te, next);
	rte_mcfg_tailq_write_unlock();
	rte_free(lpm->tbl8_hdrs);
	rte_free(lpm->tbl8_pool);
	rte_hash_free(lpm->rules_tbl);
	rte_free(lpm);
	rte_free(te);
}
void rte_lpm6_free ( struct rte_lpm6 * lpm ) { struct rte_lpm6_list * lpm_list ; struct rte_tailq_entry * te ; if ( lpm == NULL ) return ; lpm_list = RTE_TAILQ_CAST ( rte_lpm6_tailq . head , rte_lpm6_list ) ; rte_mcfg_tailq_write_lock ( ) ; TAILQ_FOREACH ( te , lpm_list , next ) { if ( te -> data == ( void * ) lpm ) break ; } if ( te != NULL ) TAILQ_REMOVE ( lpm_list , te , next ) ; rte_mcfg_tailq_write_unlock ( ) ; rte_free ( lpm -> tbl8_hdrs ) ; rte_free ( lpm -> tbl8_pool ) ; rte_hash_free ( lpm -> rules_tbl ) ; rte_free ( lpm ) ; rte_free ( te ) ; }
Deallocates memory for given LPM table.
Deallocates memory for given LPM table .
/* Check user arguments. */ /* find our tailq entry */