From patchwork Wed Feb 24 12:43:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 386854 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp343150jap; Wed, 24 Feb 2021 04:45:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHihXlPIjaZYpVCZKUI4XizksVlezxDc4J9RsXtQVIu9Jh5lMVZLLlEci6mf7d5UoyuDvN X-Received: by 2002:a17:906:1d44:: with SMTP id o4mr28949181ejh.130.1614170752615; Wed, 24 Feb 2021 04:45:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614170752; cv=none; d=google.com; s=arc-20160816; b=PpM9C8YTXLCk2QMSJCFCgO9GjjCvXmnowl+wW3rPerJO2ha1ZxhklOtsC6stwknnIe U+32D1K78KZ2BhKiSK8V8B2UyvOQYhQhFXzA35VD7eUx+tB4ARZQvU70rl9fItKKwuvP /9dN41pAx7pVrKdZZtw+LRhpnrQgqqNJr5p7XN2v/7t7N0gJA1LJ3RLHgEFNW7tKNT4o cPiXwgpg7NrxWB08jJ9mmq5kwPqSDfKuFNynm+TV16dDgI1D+2oJoUv3AP4ibjdI52p8 SqkFZmJ5Lp50cVsaw2NP31PMt7ofNZHWbZUQfOIRu8v/J5Fuxd5XjgHE425xm4qw9vEP F/ew== 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:cc:to:from; bh=Wz7/A9p4qXA/+HS+ZouubJsWsxxGrZl0d2t5GqRXOAk=; b=iGjdR/sWU0ZYT4F0B7YAizE7bm0/LFeked8r3rbnhjgbpDR43y6xAQ0lEPQJ8qFFs9 Z+OxK6YHCE/4ev9uZH8XZLhar4PTfsSi2RQEccwvmFCVBydZVA65dOpxEkpPsUhON+Rq WXhW0rBs+4Qq8MRmj55aW8NhqHMk0TJu0L8/KhDth+JcP7Xwu5GgkUDGnkG+AQG38LLc SOGLzjMzzHxga8HZH7qr5FcX0H2A3Y/86Xu0eNn4cuuqO2hd4mS0pqmXnUn2RBV3CSvs VemY8Dq+nHQpgDLjmp/nnnQaA12DSMCfMj0atHde696wGl0beBvamjap3t8bQzf8H2rt ZvyA== 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 hp19si1257676ejc.733.2021.02.24.04.45.52; Wed, 24 Feb 2021 04:45:52 -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 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(-) -- 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)",