From patchwork Thu Feb 11 14:16:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 381009 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2123194jah; Thu, 11 Feb 2021 06:30:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGbWHVushy4GKHTtw8FNxEuEDBwf6xd5KdcIYBKqq3saWOF6u2S7Rjrc4zY0JBEY3zG6hp X-Received: by 2002:a05:6402:105a:: with SMTP id e26mr8280703edu.60.1613053809794; Thu, 11 Feb 2021 06:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613053809; cv=none; d=google.com; s=arc-20160816; b=yNV2tGlutSGP9a6eGHrRoDzK4+fOhIE9QWC40HHJ8uRHmRx2pD/kuSE0mMn+2xmJpO NsVROWbwCT3bpCtPN7XxUUmpp/bDG8S4FfUxC4OBYiaAhCWa6yDbTPlh3OBqADiy/En8 xttn9GqAdSdncXPlSwQt1gD8j53USN2I5v/O1w4+RZGishWgVVixxmkdpOnWalq2txCm JTTSN+DOaSS27m2sS23SbKxllkOMKK/IZQtERlGVM16LB2ciHtivAPgDmQ4AI7sUMJZq SrGlMjEEme7Qrqd3QrZAs3u0zF8RsNHkgyBfW9Vi91tXnvSSj0g4PR4BkK4SWI0UwRGy g8HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=Wz7/A9p4qXA/+HS+ZouubJsWsxxGrZl0d2t5GqRXOAk=; b=F/ht+HLanSci4UhYbYYLofdmfBPBlE/8AIYMbDfD1LCNDuVxaIbyq7/BY9u6NtuKDd 4tiQ3cAhhb2Hlv2jNHztnpOJ9lptvg69luhw6TsFxLd6RUNVcUFr70jA8Vv7Pezox+UB OKsA13CUv4VGThjPNgsoAHesa1DG2vGu8byHvNZ/lYkacoixe1oNutPhixtf1otKvGzV QteCs5puMQn8RmKU6gTYTaBmsYn8nmy3SjxP7Edkn8ilc5YSuRYyAuvUEJ4fFo/tK85X 6LUiEgJBGJGYKsfMQMcNw6IEDcu4l+py0vr0OBsR9INSXD9Bvn4krGTS07G8uYjA9YBi hmLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id dp17si3607308ejc.439.2021.02.11.06.30.09; Thu, 11 Feb 2021 06:30:09 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 448891CC5A7; Thu, 11 Feb 2021 15:28:20 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 644071CC566 for ; Thu, 11 Feb 2021 15:28:06 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E24A52008DC; Thu, 11 Feb 2021 15:28:05 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A34C3200807; Thu, 11 Feb 2021 15:28:04 +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 02D4E402A2; Thu, 11 Feb 2021 15:28:02 +0100 (CET) From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Date: Thu, 11 Feb 2021 19:46:15 +0530 Message-Id: <20210211141620.12482-16-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210211141620.12482-1-hemant.agrawal@nxp.com> References: <20210120142723.14090-1-hemant.agrawal@nxp.com> <20210211141620.12482-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 15/20] 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(-) -- 2.17.1 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)",