From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3BFBBA034F; Wed, 24 Feb 2021 13:45:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D51131608B6; Wed, 24 Feb 2021 13:43:44 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id A109E16085F for ; Wed, 24 Feb 2021 13:43:29 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 72DB71A009C; Wed, 24 Feb 2021 13:43:29 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E3EC61A03AA; Wed, 24 Feb 2021 13:43:26 +0100 (CET) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id C3E16402BB; Wed, 24 Feb 2021 13:43:23 +0100 (CET) From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Nipun Gupta , Hemant Agrawal Date: Wed, 24 Feb 2021 18:13:04 +0530 Message-Id: <20210224124311.29799-17-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210224124311.29799-1-hemant.agrawal@nxp.com> References: <20210211141620.12482-1-hemant.agrawal@nxp.com> <20210224124311.29799-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 16/23] mempool/dpaa2: support stats for secondary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" DPAA2 DPBP object access need availability of MCP object pointer. In case of secondary process, we need to use local MCP pointer instead of primary process. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index ca49a8d42a..bc146e4ce1 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -393,6 +393,7 @@ rte_hw_mbuf_get_count(const struct rte_mempool *mp) unsigned int num_of_bufs = 0; struct dpaa2_bp_info *bp_info; struct dpaa2_dpbp_dev *dpbp_node; + struct fsl_mc_io mc_io; if (!mp || !mp->pool_data) { DPAA2_MEMPOOL_ERR("Invalid mempool provided"); @@ -402,7 +403,12 @@ rte_hw_mbuf_get_count(const struct rte_mempool *mp) bp_info = (struct dpaa2_bp_info *)mp->pool_data; dpbp_node = bp_info->bp_list->buf_pool.dpbp_node; - ret = dpbp_get_num_free_bufs(&dpbp_node->dpbp, CMD_PRI_LOW, + /* In case as secondary process access stats, MCP portal in priv-hw may + * have primary process address. Need the secondary process based MCP + * portal address for this object. + */ + mc_io.regs = dpaa2_get_mcp_ptr(MC_PORTAL_INDEX); + ret = dpbp_get_num_free_bufs(&mc_io, CMD_PRI_LOW, dpbp_node->token, &num_of_bufs); if (ret) { DPAA2_MEMPOOL_ERR("Unable to obtain free buf count (err=%d)", -- 2.17.1