From patchwork Tue Aug 27 07:07:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172265 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5398592ily; Tue, 27 Aug 2019 00:11:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5487SGkYJNSPRzpnNVeSWe6UM3e/uD/Kg4jPbIW6Evi7XHWaspGsdh5yaRpbFlcM1PEpo X-Received: by 2002:a50:a7c2:: with SMTP id i60mr22632736edc.215.1566889918321; Tue, 27 Aug 2019 00:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566889918; cv=none; d=google.com; s=arc-20160816; b=Q9yHIGxDu1vEL4f4MPqXM7y6pqpB7j3rTgxPrf+1GaEAYomlgf/JHstv90NBbAAk3L O4ObeP8FyIfAN7EXWDjhGQIk4Mf9t/KYKTs1XbZujGLTeY6nodrDtI9S85zfBS0W/3DY 0Zk/7gCvQJL0lEEq1BfUcYkmtuT/gEybUrmwjzZdk/VkGrNmPhwyhAV4MFz3h7r6zdYr r3g5RBWBcd8OOqxUTCALC7GxRELuNI6ghCuYN0Eu2nldMfm4nN2+01sJXTvPO68j4YA1 JJrwvNL9d0txjis5O6waJVcXJe8OfwEL3E+BD+CmBpEIf+bUHBUJAtR6a+A51giTaVM5 rR8g== 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=Q4i557/6uZtFCxxNg/+6YnFuuUcFejlKzEEVoA+a8z4=; b=0PyA9FabvIsndKLLUPPYQ63AcF/Z//YpOJTv+hR+0p0oZQnV5A+SYIKCP1D2NPuzTy ajjsdHBKAsvRszYfFKiS5U9VMdc7wSJhhleqVi2CSPZxnwUElvUtOWiYisTWGUToE8Qb dik8JaQAMBdsvBeDaI9KI8veucI/TpuYzBvVF1xAj1LoiNlRtaE83WDFsOmRsD46YsBU VU4AZPazFpZ2qDIi0P5c/YoheyH0jmTIcikj+HrMmSvQeJ1GqrtrHTTizWtYGlUMRzK7 3gZA+clKvDMVTEp2t4ounSEqqVZceeXZaF17/xF3uHZXmIUA4c019sAuXP5gEOpsUuBN esMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.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 dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id e35si7327904eda.401.2019.08.27.00.11.58; Tue, 27 Aug 2019 00:11:58 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0F8751C12F; Tue, 27 Aug 2019 09:09:57 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 290E41BFFA for ; Tue, 27 Aug 2019 09:09:26 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 049182005B6; Tue, 27 Aug 2019 09:09:26 +0200 (CEST) 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 00909200108; Tue, 27 Aug 2019 09:09:24 +0200 (CEST) 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 E1F744031E; Tue, 27 Aug 2019 15:09:20 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Tue, 27 Aug 2019 12:37:17 +0530 Message-Id: <20190827070730.11206-18-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190827070730.11206-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v1 17/30] net/dpaa2: add cgr counters in xtra stats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" From: Hemant Agrawal Add congestion frame drop and byte drop count in xtra stats. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index b30f37ecb..259180e4f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -84,6 +84,8 @@ static const struct rte_dpaa2_xstats_name_off dpaa2_xstats_strings[] = { {"ingress_nobuffer_discards", 2, 2}, {"egress_discarded_frames", 2, 3}, {"egress_confirmed_frames", 2, 4}, + {"cgr_reject_frames", 4, 0}, + {"cgr_reject_bytes", 4, 1}, }; static const enum rte_filter_op dpaa2_supported_filter_ops[] = { @@ -1370,7 +1372,7 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; int32_t retcode; - union dpni_statistics value[3] = {}; + union dpni_statistics value[5] = {}; unsigned int i = 0, num = RTE_DIM(dpaa2_xstats_strings); if (n < num) @@ -1397,6 +1399,18 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, if (retcode) goto err; + for (i = 0; i < priv->max_cgs; i++) { + if (!priv->cgid_in_use[i]) { + /* Get Counters from page_4*/ + retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, + priv->token, + 4, 0, &value[4]); + if (retcode) + goto err; + break; + } + } + for (i = 0; i < num; i++) { xstats[i].id = i; xstats[i].value = value[dpaa2_xstats_strings[i].page_id]. @@ -1438,7 +1452,7 @@ dpaa2_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; int32_t retcode; - union dpni_statistics value[3] = {}; + union dpni_statistics value[5] = {}; if (n < stat_cnt) return stat_cnt; @@ -1464,6 +1478,12 @@ dpaa2_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, if (retcode) return 0; + /* Get Counters from page_4*/ + retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, + 4, 0, &value[4]); + if (retcode) + return 0; + for (i = 0; i < stat_cnt; i++) { values[i] = value[dpaa2_xstats_strings[i].page_id]. raw.counter[dpaa2_xstats_strings[i].stats_id];