src/dpdk/lib/librte_lpm/rte_lpm6.c
struct rte_lpm6 *
rte_lpm6_find_existing(const char *name)
{
	struct rte_lpm6 *l = NULL;
	struct rte_tailq_entry *te;
	struct rte_lpm6_list *lpm_list;

	lpm_list = RTE_TAILQ_CAST(rte_lpm6_tailq.head, rte_lpm6_list);

	rte_mcfg_tailq_read_lock();
	TAILQ_FOREACH(te, lpm_list, next) {
		l = (struct rte_lpm6 *) te->data;
		if (strncmp(name, l->name, RTE_LPM6_NAMESIZE) == 0)
			break;
	}
	rte_mcfg_tailq_read_unlock();

	if (te == NULL) {
		rte_errno = ENOENT;
		return NULL;
	}

	return l;
}
/*
 * Find an existing lpm table and return a pointer to it.
 */
Find an existing lpm table and return a pointer to it.
Find an existing lpm table and return a pointer to it .
struct rte_lpm6 *
rte_lpm6_find_existing(const char *name)
{
	struct rte_lpm6 *l = NULL;
	struct rte_tailq_entry *te;
	struct rte_lpm6_list *lpm_list;
	lpm_list = RTE_TAILQ_CAST(rte_lpm6_tailq.head, rte_lpm6_list);
	rte_mcfg_tailq_read_lock();
	TAILQ_FOREACH(te, lpm_list, next) {
		l = (struct rte_lpm6 *) te->data;
		if (strncmp(name, l->name, RTE_LPM6_NAMESIZE) == 0)
			break;
	}
	rte_mcfg_tailq_read_unlock();
	if (te == NULL) {
		rte_errno = ENOENT;
		return NULL;
	}
	return l;
}
struct rte_lpm6 * rte_lpm6_find_existing ( const char * name ) { struct rte_lpm6 * l = NULL ; struct rte_tailq_entry * te ; struct rte_lpm6_list * lpm_list ; lpm_list = RTE_TAILQ_CAST ( rte_lpm6_tailq . head , rte_lpm6_list ) ; rte_mcfg_tailq_read_lock ( ) ; TAILQ_FOREACH ( te , lpm_list , next ) { l = ( struct rte_lpm6 * ) te -> data ; if ( strncmp ( name , l -> name , RTE_LPM6_NAMESIZE ) == 0 ) break ; } rte_mcfg_tailq_read_unlock ( ) ; if ( te == NULL ) { rte_errno = ENOENT ; return NULL ; } return l ; }
Find an existing lpm table and return a pointer to it.
Find an existing lpm table and return a pointer to it .