From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 1/4] lpm: allocation of an existing object should fail Date: Wed, 30 Mar 2016 14:46:49 -0700 Message-ID: <20160330144649.670d66d1@xeon-e3> References: <1458044745-32764-1-git-send-email-olivier.matz@6wind.com> <1459351827-3346-1-git-send-email-olivier.matz@6wind.com> <1459351827-3346-2-git-send-email-olivier.matz@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, bruce.richardson@intel.com To: Olivier Matz Return-path: Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by dpdk.org (Postfix) with ESMTP id 463B13238 for ; Wed, 30 Mar 2016 23:46:35 +0200 (CEST) Received: by mail-pa0-f52.google.com with SMTP id fe3so50062619pab.1 for ; Wed, 30 Mar 2016 14:46:35 -0700 (PDT) In-Reply-To: <1459351827-3346-2-git-send-email-olivier.matz@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 30 Mar 2016 17:30:24 +0200 Olivier Matz 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.