[dpdk-dev] [PATCH 1/4] lpm: allocation of an existing object should fail
Bruce Richardson
bruce.richardson at intel.com
Thu Mar 31 12:55:03 CEST 2016
On Wed, Mar 30, 2016 at 02:46:49PM -0700, Stephen Hemminger wrote:
> 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.
Is all the memory not zeroed on initialization?
/Bruce
More information about the dev
mailing list