From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id B4E66D56C for ; Fri, 11 Nov 2016 15:35:49 +0100 (CET) Received: from lfbn-1-5996-232.w90-110.abo.wanadoo.fr ([90.110.195.232] helo=[192.168.1.13]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1c5Cz6-0001xh-Fq; Fri, 11 Nov 2016 15:39:17 +0100 To: Hemant Agrawal References: <1478875378-15398-1-git-send-email-hemant.agrawal@nxp.com> <1478879230-15729-1-git-send-email-hemant.agrawal@nxp.com> Cc: dev@dpdk.org, Nipun Gupta From: Olivier Matz Message-ID: Date: Fri, 11 Nov 2016 15:35:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.2.0 MIME-Version: 1.0 In-Reply-To: <1478879230-15729-1-git-send-email-hemant.agrawal@nxp.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] mempool: Free memzone if mempool populate phys fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 14:35:49 -0000 Hi Hemant, On 11/11/2016 04:47 PM, Hemant Agrawal wrote: > From: Nipun Gupta > > This patch fixes the issue of memzone not being freed incase the > rte_mempool_populate_phys fails in the rte_mempool_populate_default > > This issue was identified when testing with OVS ~2.6 > - configure the system with low memory (e.g. < 500 MB) > - add bridge and dpdk interfaces > - delete brigde > - keep on repeating the above sequence. > > Fixes: d1d914ebbc25 ("mempool: allocate in several memory chunks by default") > > Signed-off-by: Nipun Gupta > --- > lib/librte_mempool/rte_mempool.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c > index e94e56f..aa513b9 100644 > --- a/lib/librte_mempool/rte_mempool.c > +++ b/lib/librte_mempool/rte_mempool.c > @@ -578,8 +578,10 @@ rte_mempool_populate_default(struct rte_mempool *mp) > mz->len, pg_sz, > rte_mempool_memchunk_mz_free, > (void *)(uintptr_t)mz); > - if (ret < 0) > + if (ret < 0) { > + rte_memzone_free(mz); > goto fail; > + } > } > > return mp->size; > Acked-by: Olivier Matz Thanks Olivier