From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0080.outbound.protection.outlook.com [104.47.0.80]) by dpdk.org (Postfix) with ESMTP id 48F041B4A2 for ; Fri, 12 Oct 2018 12:05:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KpzzEPkJnQoxCZCuyVUeFHkET/14YM3E7ZKO+SESV+E=; b=iYWlS8q6SjO0dcJLTJ+Jipa1MB2i1pEohfvHb5VJ50dSE6KvJqvFDk4pzrB41xY9TbRp4O+ep/rRW5fXZvSUqN0zOUrqwImhK33ZC9NYodIpxVJGR+N1c9snn5kIgYui2gXyR79X6wpTFWo3LKOizrXzWQtRCZ2bH5TRW4v0K3M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:54 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Shreyansh Jain Date: Fri, 12 Oct 2018 15:34:21 +0530 Message-Id: <20181012100426.29349-11-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ab5f5ac9-8036-4745-1f0d-08d6302a4cbf X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:Ni8XJkSw60UZT6oAP0Yz+W1ODUnvQ3ugZNCne3he/Enuru2B80uCmkpw6ochUUR4og2RIoQnEAiPMzNpSJGtV0rWKL7HBaHozBYIO2k6PRK8DInGBrqaNpeA8JAZGNmpEmejUcvNfK+Gi2qPxmboVbZsW7sd/rl4pLMXJ7+/TqT861RDtlNZYWlUuSlzvTUFXGgOct98y2vOaiTSeWsHAJ1T5utpVy8Cjv5f92QhAiCowsLjEh9Y40pB5TcihGqw; 25:vc8DtClAptefyq1Kl2mr8am7Bs5ij4V0/exKrR51a2kr3nhmrFDLbDoqQu27Kf2xaPcyO5EWL+bDL3Gj3M17Ug2jkd21HoP0srL25sleqhSJnEhmN5OgiTIbhPQd/NTtrZ3TZF73GYa9Qc1XYBBqqmcoXhhbwojGR+Wl8Icedezz6rKMo80LP/gOhcmq+XlWjejnViJvgwuKmqJVPtZoARaMt/hgTJou63GD/Ujxl5e5PSv3SOoCB1PaJzMbXtLahtL85hkeZE9MUjVSZxoy0SZZrGen6OkEWvvv6yf7oW6tiWPisYx8fc5o66oyNd7pRULxFLEYWXlThJhxT8UzvQ==; 31:vwMzl9t2TmOZ9HejLoGhoRoKdNfikqWf4GI2t9pHeHAc4mB7KPjgAoyC7pWx5UQNW5G219CAFCr/P+uKn9EtluSALgLpeTliGcMtweHNoJHpjq+RjW8ZSqDVbFu0gjQmrw9YXgZi1CMZ6jdNM3ojrE5UbFvv+yYIi3NoMiBDveFnRC+E+YuJSaXtaI074b6NO1TF/lRoVp1VJOvlbPcbl8qw1VjyEF/P78f/Ny7tHj4= X-MS-TrafficTypeDiagnostic: AM0PR04MB4676: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 20:JoT3+6NpGbUJT/+nmphPNjeXElfg84QNqFIyamUHauqkWVLE28vNWslnJULCdjgNdZJNe0cybXqcPiYO+68e9mBDDxc/4KD4cbPG6i2Sx/K5ie8KNTS35PXxtAXt+1w/THFOs1vMBkiHJUlS2+RMP5fYhGfEtDAhvilxN7Yc0EtD3f2a+fcxXCar6iTqfTVyhrLi5i/MF7CrosJQIuOAvK/I2UYAKTDD6+FIxZ1uUvNchhY34zt9itGqjcmvRfwZL675zEu8Qx9VF7fEX/TFz7jauKTjJZSPOJ5ssOTxVM3LWnUzp666xtSfDMtwv10/tUwNL9ZRV4rYj8DWCUUYQfaKYvBH1jphv77FZwZ5tg6JnZb1nlKbslHpVIqfSlsXT8Gd77q0bZEu6G+15cfK4hsqhnovv8QqFz/TrUK84Gl2vIKniL4MfQz50jXv3vIynopYXa8K5b+4FFfs3K8RZtigdRlycSj8R8BPr/22U3mtfPo/z3uL2AySTfXTZNGU; 4:kHbZBH/RFOezRn+hGsH6w14myPCF5XedHhnBSLE0iT9pn1FzlW6FSwxWAehxYMTaGXCUcE+CjXkux2bWhxihtnHOWWs/anOiHSpEiHBy2gRXujzX+wBtd1r3Moa820ZGLUXrvaaM4DB4jfe2WLqaeFWQoiKYmiI9zHrWHtkv9zcXvfahjo01aostU8S7wV7gb0Gr4ZEyKfEUVHbzVF9gvdkKLqE2c7N2uaRudCBweRvURv518pSgtlLahGIM04bSDZx+UdCVDiOjQ4jn+EE0IBGZ+McFm2cG0M9oNuulLGaedVRxlyRcKmmLYa7rWecP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:5Gyb8FF7AzjccDIH6wnkkljbM5kJOCIyKShD2w7Ie?= =?us-ascii?Q?TeZ/7lNutKOND5pj8Km5BMkQX06EGqkE4LFjzERxHeljaUxOk/46uHunqXUM?= =?us-ascii?Q?sE2f4+55DAXbKUSBkaeGg8nwjLx0Yl6WS2I06P3lZnwCETX7IZUSWfx4KBw+?= =?us-ascii?Q?Pbiwqnm4KTf7t0sUKrqq/zsgox1ekIq+SPErgTGFcjNJHZuUne1Q65f3qCFi?= =?us-ascii?Q?pYneXXRBr4vY0npwc+9mTndBWjKFo1cTfXLS6yF5fE6fGHECRt8H1ZXn5C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ywCVfFFAL2v9qwattqH2rkfhm1EEHIfER1FaRZOa+AFj3kyQ==; 5:FsLlcU/JVOCxI6yJbt09+VB6sfzI7wDuLwWUB8eGFPvNDNG3+26nGViWOT8g9k1Zh40ppbPaa9KzI4qk91c0BALtp5ktyZetTNR7TftoSaasSuIzPBOl32vDlZ6d3t9QAzzltfSAN1k9uDRRVX6sL/h7DOPPovhrUNWeGJHJ1kY=; 7:/aRZVi84o8oAM0wSqekDLA5jFe9tma2eQ4BkUGbXpPrvW0GizN3N8gD+nrDeIcp7/56aQ9iCdxlhKmMlWBRuHC8TC5+xmdKPFrI1oaSaZ9JBNcsEdYaEW0hVlgoJD/V32rNNlXgKGKmt+bmDlS/oI2fwqWXlE5kWV2AMyg7+A8ZbustiUvSHSue2+JdI2VNq7H4YSb3qf1YOKF787uJWOYz3Hfa8ZN4O7o/aFP09Ntnwv4yVx9ZCXrZKPMT/dnmV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:54.3960 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab5f5ac9-8036-4745-1f0d-08d6302a4cbf X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 10/15] net/dpaa2: add per queue stats get and reset support 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: , X-List-Received-Date: Fri, 12 Oct 2018 10:05:56 -0000 For now, only the packet count stats per queue is available. This is part of xstats output (though, per queue stats are actually part of rte_eth_stats basic stats). Signed-off-by: Shreyansh Jain --- drivers/net/dpaa2/dpaa2_ethdev.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 522a827d4..46fa38f4a 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1118,6 +1118,8 @@ int dpaa2_dev_stats_get(struct rte_eth_dev *dev, int32_t retcode; uint8_t page0 = 0, page1 = 1, page2 = 2; union dpni_statistics value; + int i; + struct dpaa2_queue *dpaa2_rxq, *dpaa2_txq; memset(&value, 0, sizeof(union dpni_statistics)); @@ -1165,6 +1167,21 @@ int dpaa2_dev_stats_get(struct rte_eth_dev *dev, stats->oerrors = value.page_2.egress_discarded_frames; stats->imissed = value.page_2.ingress_nobuffer_discards; + /* Fill in per queue stats */ + for (i = 0; (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) && + (i < priv->nb_rx_queues || i < priv->nb_tx_queues); ++i) { + dpaa2_rxq = (struct dpaa2_queue *)priv->rx_vq[i]; + dpaa2_txq = (struct dpaa2_queue *)priv->tx_vq[i]; + if (dpaa2_rxq) + stats->q_ipackets[i] = dpaa2_rxq->rx_pkts; + if (dpaa2_txq) + stats->q_opackets[i] = dpaa2_txq->tx_pkts; + + /* Byte counting is not implemented */ + stats->q_ibytes[i] = 0; + stats->q_obytes[i] = 0; + } + return 0; err: @@ -1324,6 +1341,8 @@ dpaa2_dev_stats_reset(struct rte_eth_dev *dev) struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; int32_t retcode; + int i; + struct dpaa2_queue *dpaa2_q; PMD_INIT_FUNC_TRACE(); @@ -1336,6 +1355,19 @@ dpaa2_dev_stats_reset(struct rte_eth_dev *dev) if (retcode) goto error; + /* Reset the per queue stats in dpaa2_queue structure */ + for (i = 0; i < priv->nb_rx_queues; i++) { + dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[i]; + if (dpaa2_q) + dpaa2_q->rx_pkts = 0; + } + + for (i = 0; i < priv->nb_tx_queues; i++) { + dpaa2_q = (struct dpaa2_queue *)priv->tx_vq[i]; + if (dpaa2_q) + dpaa2_q->tx_pkts = 0; + } + return; error: -- 2.17.1