[dpdk-dev] [PATCH 1/4] lpm: allocation of an existing object should fail

Stephen Hemminger stephen at networkplumber.org
Wed Mar 30 23:46:49 CEST 2016


On Wed, 30 Mar 2016 17:30:24 +0200
Olivier Matz <olivier.matz at 6wind.com> wrote:

> diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c
> index 4c44cd7..9877a30 100644
> --- a/lib/librte_lpm/rte_lpm6.c
> +++ b/lib/librte_lpm/rte_lpm6.c
> @@ -182,8 +182,11 @@ rte_lpm6_create(const char *name, int socket_id,
>  		if (strncmp(name, lpm->name, RTE_LPM6_NAMESIZE) == 0)
>  			break;
>  	}
> -	if (te != NULL)
> +	if (te != NULL) {
> +		lpm = NULL;
> +		rte_errno = EEXIST;
>  		goto exit;
> +	}
>  
>  	/* allocate tailq entry */
>  

with older memzone model, objects in huge memory area were never freed.
That means when application restarts it finds the old LPM and works.
With your change it would break such an application.


More information about the dev mailing list