From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hemant Agrawal Subject: Re: [PATCH 2/2] dpaa2: register dpaa2 mempool ops as active mempool Date: Mon, 18 Dec 2017 14:55:57 +0530 Message-ID: References: <1499170968-23016-1-git-send-email-hemant.agrawal@nxp.com> <1513333483-4372-1-git-send-email-hemant.agrawal@nxp.com> <1513333483-4372-3-git-send-email-hemant.agrawal@nxp.com> <20171218085727.GB20578@jerin> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Cc: , , To: Jerin Jacob Return-path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0066.outbound.protection.outlook.com [104.47.38.66]) by dpdk.org (Postfix) with ESMTP id A93FA200 for ; Mon, 18 Dec 2017 10:26:02 +0100 (CET) In-Reply-To: <20171218085727.GB20578@jerin> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 12/18/2017 2:27 PM, Jerin Jacob wrote: ... >> diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c >> index 334e1f5..5a6f292 100644 >> --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c >> +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c >> @@ -64,6 +64,7 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused, >> { >> struct dpaa2_dpbp_dev *dpbp_node; >> int ret; >> + static int active_pool; >> >> /* Allocate DPAA2 dpbp handle */ >> dpbp_node = rte_malloc(NULL, sizeof(struct dpaa2_dpbp_dev), 0); >> @@ -100,6 +101,11 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused, >> >> RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpbp.%d]\n", dpbp_id); >> >> + if (!active_pool) { > > I think, this global variable can be avoided. Why it needs to be under > active_pool? > This code register the active pool when it physically detect a instance of hw mempool on bus. There can be more than one objects of dpaa2 mempool. Yes! we can do avoid it as the current registration code proposal will not allow re-registration.