From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40060.outbound.protection.outlook.com [40.107.4.60]) by dpdk.org (Postfix) with ESMTP id BD9F6569B for ; Mon, 17 Sep 2018 12:37:59 +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=5tl0SLxeS5Tia0jDM6od3fZ1MGMl4cHgp1hcReV2i7c=; b=u+FtcA3EVHN1Sz/ld499c8XvJBy1T1TIm0Sa81tMJc8XedELu9csqQreDQDO0kwLAeKdrQOFkUJVUHUr+ciwW4UUBkdz6BgZQJe41y2BbQu4GfyuyMZDB+ZMM3VkmKuCnQO4bbLMJqYnLHmiJvLcGcz+FLMol1aePTJm3vdsUYo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4673.eurprd04.prod.outlook.com (2603:10a6:208:75::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 10:37:58 +0000 From: Shreyansh Jain To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Shreyansh Jain Date: Mon, 17 Sep 2018 16:06:30 +0530 Message-Id: <20180917103631.32304-11-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180917103631.32304-1-shreyansh.jain@nxp.com> References: <20180917103631.32304-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0092.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::32) To AM0PR04MB4673.eurprd04.prod.outlook.com (2603:10a6:208:75::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e9f27f95-6fff-42c3-7ad5-08d61c89a2fa X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4673; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4673; 3:c4WmsYAe+yDiJyCJWJhxXv3LUkZPBVUJZcv+QvVW/F5qY/PeCngs0Qa/FJRLOqKUmgBZ1Ru5f7bKgiIWVF31zXCua8erEt1QFWeJJmLBbkhbXcIZQt21UxAVCDrtnlTHlLLyGAqR/0mj/v/467FSf5+DVvmbqlBp3gDy2q9nh0urtwz8ca9OzQuq9tPlSKhvY6fnFBg5hxikYz1FygpDdXmqQBxfIg5Csrh5QvR0yuslybEQ2XbUG5Ibn65P+GKa; 25:MshUsWD3tmaUmPdLfokBhxUCeFAutvVwnYum+lq8/S3jzKKKoVd2of8/WTR9lNjzfSwD67+YrK6Ftz/JjWJCngFojmv4/G3acgnM6v8YN32x6D+la+C3cTDigg9vOQlGWXx3ZXKh6QtboWsfakKPyC4JPBunmJQL1a2/UvM/+E0rwAliX1xrdCfF0N8C9fluse8uhATNR2YDMo3wQPMt2kxLnVqbHXMwAXh8kEzcO/S28mZrJs1Mw8NGqESwjZ5Z2GPrS86scmoXrKmtppEi2IhfE3fl00N0xVTd7IYjfVgT4sts9xmvnacKZKywKDgSflPUV4CY5lZ2vVUcLGnK9A==; 31:LSW8Bg7jmgNiWqq+K7zPlDRmXKFALMiGLXRjBL6Trm2I5KeJUctjukaRbz8CE3t0J+sMYmQvgkGdmTNE2apNMU2kil13dg2d5Hng7hB+7sYI3XfDn02/osI3lq0+LeUzViU6Y1JxHLlF5rFRBWVDnFIrxMQj5NFdTyZiu3hqt762AcFDu0Sl8fdpo1zLUWONt3m9MZdjOTxRSU3pf+/W6Ujzc/blOjEEo1aSTBgXBcc= X-MS-TrafficTypeDiagnostic: AM0PR04MB4673: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4673; 20:rsLvdyy03Jc652LjZC18A4orIPq27bJNzG6O9szOTzB2sYU2kP8VXGGVGMWXbT0d8bVXHOErCFk1WL+MI6M8jQfbzrt8R3tWlae8cTTFtqOvgE+UDLJfXjBwNEoupucNNVXJKB94QPYOnfNSdj7I7mPfsEcQVDQ/CdvCkpLCi4+LPvKybKOejyoq5waadfCkQJeBHjdPs2HywPuFDdIrxyimHy7p4pWBEeAnPW7QEDSxkuSlvJ8HDUu8QKGvbrxcK8SEdF6sthEcIO6PkUSSc8ZqLy/ur5KpwtpF9rr+AWMXUsWmPCH5ArXtk4UFo11V4XKYmVIpfKJHJ4NJdFirbPCpy74TJsJfJkbgl+gh/2llxTkPTe5D1mBrfJ2q6Vm/Plke/iofqhwjkDDay6eRaya9J8ZI0jcFgcxoWRBU+flEsaaE3lb4bQoVw179aszCMv7uEiwm7A3YWC8TVgyeD0bVIoZJgqLe45Olf8rztOJPKEW8urlpKBv3VE7ymaAA; 4:kdTWJbxwj5BrgKfrfD3IgxAv7CS/HnkuAXVi3a6fo04Qa6Qg5xtFclakVBm6/7irNX2t/86p2UqoNjFq52XH9yxzUgGmpnAgTA/MEtjgvgtaAOaAeIDXQDB5WlcDy7uFolEtm5MNb1bQzsKx1uJ2/Eh0YkvxEczUnLZYu3rkNT/T0PxhGg8dSwKdA2GjQ0KdPy1skgJtwErD8YQxV9XxCeZWdufZ5c7WqNu49hqEYvDHG3fIfvnC3ashY5MuHz9P+4tymC4KsL5BV8zmQKQwhkqbH+nL2XEjTjN/dfJdPqpyz8lk3fwfT+R+U5XQAjih 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)(3231355)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:AM0PR04MB4673; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4673; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(396003)(346002)(366004)(376002)(39860400002)(199004)(189003)(16526019)(48376002)(186003)(1076002)(3846002)(5660300001)(486006)(6506007)(386003)(16586007)(316002)(36756003)(44832011)(5009440100003)(52116002)(6116002)(2616005)(76176011)(446003)(51416003)(11346002)(956004)(476003)(6512007)(47776003)(106356001)(25786009)(50226002)(2906002)(68736007)(105586002)(81156014)(81166006)(7736002)(6666003)(305945005)(8676002)(8936002)(4326008)(86362001)(97736004)(6486002)(478600001)(50466002)(66066001)(26005)(53936002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4673; 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; AM0PR04MB4673; 23:sKOfrVdk6DJi8J7untSKblgvn+BVMbzrZwd+djIX+?= =?us-ascii?Q?sM/W7j0p698MNyc4DZwcQup8Vb0CTvinkLqvVc4b2RblnbLnA/pkqHj6YCZT?= =?us-ascii?Q?RaUReKPMo3M1KOpZfUvddVqKbhrysM0WDDmuxc3f2SrJX3T9kyoMIoIkXmEQ?= =?us-ascii?Q?9ouAQfvqVkOECXH7qE3wQcSMcjA00KJx9N6nP0XTX1khCiExu9FLPFcUVIUR?= =?us-ascii?Q?PI4ITnajVwuLHbRLBGH8NNc5g1Ha7eVzuM/slPwodoY+oMF7JonZSq19P5yd?= =?us-ascii?Q?wP60XNeu7QHr2OmVc4b4ovr3IDPYG4Idia92gZdSL5fffG7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xhQuKE17Bx/ZKQSgSrisxWiR5UHySUSafkK6DI1pcby5bFsQi5dZsYEbU=; 7:7uogxi8+oAJu4ErVaEFHuvdkxAqCnbb3oUbBnbVwawyKH6naJaS0HvlzHPqKITkPcCnsCot/jy72UQs/rGcu7O2yvjARFccIdFzPI1XHFhvnewU5anKJYu9DHr4pzVmNiQWe3nZ2GUSATJx5+GIhAOPTOA5uDxQv9hP58LhdFfqocVAlQztYUY0bPJ1s2fbw0KEole9EOYlvhQgyN8y+cqtVEFJsZgTOkCpslP0VgV9sMVp7Hic6pnNsd3MHyaU1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 10:37:58.2425 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9f27f95-6fff-42c3-7ad5-08d61c89a2fa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4673 Subject: [dpdk-dev] [PATCH 10/11] 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: Mon, 17 Sep 2018 10:38:00 -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 01b010312..1715e9f33 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1121,6 +1121,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)); @@ -1168,6 +1170,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: @@ -1327,6 +1344,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(); @@ -1339,6 +1358,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