From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hemant Agrawal Subject: [PATCH v2] mempool: Free memzone if mempool populate phys fails Date: Fri, 11 Nov 2016 21:17:10 +0530 Message-ID: <1478879230-15729-1-git-send-email-hemant.agrawal@nxp.com> References: <1478875378-15398-1-git-send-email-hemant.agrawal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , Nipun Gupta To: Return-path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0066.outbound.protection.outlook.com [104.47.36.66]) by dpdk.org (Postfix) with ESMTP id 37C3B2BDF for ; Fri, 11 Nov 2016 11:13:18 +0100 (CET) In-Reply-To: <1478875378-15398-1-git-send-email-hemant.agrawal@nxp.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" 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; -- 1.9.1