From patchwork Thu Aug 29 10:27:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172568 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2030736ily; Thu, 29 Aug 2019 03:44:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqynqGxrNdS8bjUQHqXOuIHAFHMtd/wWnOgu0vlZFT7MOdUc0JBKjvowBkT5iXPhq/91mVtO X-Received: by 2002:a50:dec8:: with SMTP id d8mr8930488edl.76.1567075464367; Thu, 29 Aug 2019 03:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075464; cv=none; d=google.com; s=arc-20160816; b=NC2V2KfL9c00njHvuLGIoBoSMAEL+GvRrm5LQCKvmxJ011oneP6sm36blXAMCaYcRb TmF9YrhgSm/lEfzj1dLfETC5igoHeBNjcS7Gk06RVg3GBaCjqE/E5Y6PWWLZNYOX4Cvp lTLaSdgD+9CmHzJQP6dnGEk+7fG0AmSIj7S1x2Lb83veIUcNo3u2WTuurnKU8pYyMF0A eAzxvyYGA+O6OnSCO6G0BAxGz+B5tIOxalWtML4aymbppgywFnID3GmbKaPPqBX7y1/C CirXqWeP/27g8qlHoq3xeSvIaoFifRuIRt84/V5MisylTq0eNFJp5C9rW3X9njJSiXYW NHwQ== 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=NLdNNFAxoyBk08YD8rJ72+TnjizyK4o3CvC5jD+yGe0=; b=jIe2V+Nwxa816EfdG/IJGenLCjUARD/8qIbT6TwVn0kcylzis5Yh+N/WkM8Dj4YNuH kLZ++qlUkqUX0EG1O6KijK2zQaKT7Lo2f2GTUrrEO9Vuld57e2Eg0vpyhaky0d9V1GjY WdpnpBRJN7LYv96V7D7OZuqLiyy/X5CSCdjyJvR29lEdxOy9mhFrx0+F4t5wvPMMrmxo F1roLAjwAhBARERmuTkKNd2402V8FxdzfLkW1mN1rmEgykXXoNNBmVRXvuSVU01bYogC TWUXp6OkFvio518qcd3CKjL+laTG6ux6iYXXSG3V+sBG8VDWOhQsejGFs2pEfOjenNof 6lmg== 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 h1si1003791ede.423.2019.08.29.03.44.24; Thu, 29 Aug 2019 03:44:24 -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 F1B061E877; Thu, 29 Aug 2019 12:42:36 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 80DED1DFE2 for ; Thu, 29 Aug 2019 12:41:55 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 61C6B20032C; Thu, 29 Aug 2019 12:41:55 +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 5F3D720032A; Thu, 29 Aug 2019 12:41:53 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5DD6E402D7; Thu, 29 Aug 2019 18:41:50 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:24 +0530 Message-Id: <20190829102737.13267-18-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 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 877acff94..721e125b4 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[] = { @@ -1371,7 +1373,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) @@ -1398,6 +1400,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]. @@ -1439,7 +1453,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; @@ -1465,6 +1479,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];