From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50078.outbound.protection.outlook.com [40.107.5.78]) by dpdk.org (Postfix) with ESMTP id 836841B47A for ; Wed, 26 Sep 2018 20:06:10 +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=x4mnJ1v7gcmFYehdW20mjk+w23AvVI5OkqfhKopdO1I=; b=hvlNqZ0jn0nDcm0PyGGOyE8pDcdTpB1fY+mY9zMDMnJYheiqGPsyh45DplM2dC5xlQ8rdwnca224yIP8vogSOV8KFHjyrvkEnr4P1qkKOOkuFyWWOVy+OwaDIWnRn82P9HiYPUTLTMr8hhgKst/bK/JHrjRIbkBJk3Hhh7qVJwo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM6PR04MB4679.eurprd04.prod.outlook.com (2603:10a6:20b:1c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.22; Wed, 26 Sep 2018 18:06:08 +0000 From: Shreyansh Jain To: dev@dpdk.org, ferruh.yigit@intel.com Cc: thomas@monjalon.net, Shreyansh Jain Date: Wed, 26 Sep 2018 23:34:35 +0530 Message-Id: <20180926180440.31726-11-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926180440.31726-1-shreyansh.jain@nxp.com> References: <20180917103631.32304-1-shreyansh.jain@nxp.com> <20180926180440.31726-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: MA1PR0101CA0014.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::24) To AM6PR04MB4679.eurprd04.prod.outlook.com (2603:10a6:20b:1c::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0fa64feb-4952-4227-6fe6-08d623dabccb X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4679; X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4679; 3:JSpoXngd+Dm3qG61dZHMuYpgfRB2xrp1HQN5hghzeM0LHIqrxIsWqzL0O2MrNSAHZxhbXv11QvbL8S3GkY1nK7rpSesljPTgfGwBRNz93+oOJLJ+8/SBHAm9VmvDzFm1gzrGFua7OT7QzQcnilsGxpj0iJvf2MUyc3Zd/DMjaWdls27F9IediPcPFRJHOBGQV3zTZdBJimyFVzh2tZsN0Wva1vI5bQbwhTFkhlQrFM1G4zvEEZ6gIMNR1+GMqH/H; 25:lXlqQFa70ObFCZIiJG3Melqy+QFYJ6tfkx8WCPAPzgM5tXV4pcjeT9nMwF402vypxjgc/8lIU+re2O8pCgbcpksMcwZuJvkk3dTtNeA4/gRIundH6Lko+3iL0i/659B8yVbYs49hKavV7V7n7ke3XfZComXE6jgGKUt8A7t6eV0x1x4HmY/86jzaotE4xWqiSJfpLFawfBvw1b7V2nEOm/H6faT3ydgcUe4Qv25XqC7hxu4gppiVnTho8CXpRiNZwoKF65NJo5y/2bXYKVCpz3ZLKbAV6mdrr79nE/B6LVWoHa7qwJGuYgNkuR7wnhxtwiolbxfKS6jOIy+qRmz5RA==; 31:dDjWtJZRccC2rpYjIwRMMkrvmBtDLoIQgDnKgjvFgDPxbut4BSnh0s6xPb4enTTUfIScafOpHYQS9TlgpYUbFOM/+ljJ3CasJsVT8gO+sO6K7+OffIPHESoHJ57ZzM3O9fZTcXw4nQyk780r3YsZ7bfUSbzdpCmUgzTXKxqs+m7f87ozWgQ/lKJ2QuPbiy9B1uFoQHxm6jt/rc3TmPezooVVFuH08mdG4nCfxlvhBM4= X-MS-TrafficTypeDiagnostic: AM6PR04MB4679: X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4679; 20:UqVjGmQd5wyLioFh2hfkTSK3m0tcr177fK4wns9Yr0VD3q9N34OdX+jRJIu7E9y0t7MuOLMNsh2SBBGwemER2eLnMVHg/4CvI+7JZ3NmZWwQezv0MC9rj7yGRyVBbOPYF9AtvXTML32QvHRtEQ5AI/elFxMJY6nMnsFxnlA8Dy6j/cURb5FeO8Pjq0pnL+lTJNoJ7SKfzaqdj2aWSo+9oQOiWxSvrAcFm4xj4BLvql8RameknIxHWAS4KSfZg4YzuvahGJp8faGHRmDUOmieqBONQvOjMMWb1SKIW/1D584J/9z8ePfUIedCi0qm/yrXkLsLUSRbOFCGYzyZiOiuyd0qC+3ZomTP/y3MAW/gq2K/dSx1r1UPlFLHxeTe6Ntu26kxxaBmEYoM30wjWfcAOd6o/XNJXgaLsLB8QVKVJ79dqM9bNnT3EMFp/m0JSkIzqG2fJYO/PgUxRj/BEAef2+OnGM/7nGFeNq0rYC6FO8AsryL7DzuIoNxdn0WKRy5T; 4:SUSOlC5HfCv12T3jbwDzKM+W6uccj4OngMU297o13GAZXQmREgNN59qLR8KyDE+Pv8vyvKMyXvKmgY9jg2wOErp9yjNoZlxHCBLU6up9vece6JIMMFCP3YQ7iEcDgCL9ovWnBzQkQ4fFcr7se2xprBixamJYDsA+KHIneXTY+sNxQmGm8YoHSmVf5fHl2o3w0GJyQNPGbrpQe/8FCmoIJb/0DRXgS/oiSR3a2MsqmYcINxs6Vsx4jHaTy0Hv8rYd9/ok/c1L228iJcEIysd0Z+2gHbHjCMm96NfqKLwMLK/RTPv5vtDeyuK1nwM46dxw 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)(3231355)(944501410)(52105095)(3002001)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051); SRVR:AM6PR04MB4679; BCL:0; PCL:0; RULEID:; SRVR:AM6PR04MB4679; X-Forefront-PRVS: 08076ABC99 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(136003)(396003)(346002)(366004)(39860400002)(189003)(199004)(11346002)(50226002)(446003)(47776003)(44832011)(956004)(476003)(106356001)(486006)(2616005)(6512007)(66066001)(305945005)(7736002)(6486002)(105586002)(36756003)(86362001)(478600001)(8936002)(16526019)(81166006)(50466002)(186003)(26005)(25786009)(8676002)(55236004)(48376002)(81156014)(4326008)(3846002)(6116002)(1076002)(6666003)(52116002)(34290500001)(5009440100003)(2906002)(16586007)(51416003)(316002)(97736004)(6506007)(76176011)(5660300001)(386003)(68736007)(53936002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4679; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR04MB4679; 23:h0UMWo1r3YpxMgxW6Hcy991JoGGFmAn6zsDxchvMA?= =?us-ascii?Q?IyP6WRYU9gUF28x/ABj2GivAoFWrQQyF8NuDE1cmywU/bAbWSaPuhv73oc8O?= =?us-ascii?Q?h4S2O2pzVxTxre+ht0fN1IFj6uNQyQQmda9rEMlsKQkcMQ5uCX7WMRZ5Ho//?= =?us-ascii?Q?UbObZzMxIszkg7w4vl/qB6iS4Hj/TxCnDU1uuiAD7dwNLreZYr9xgAR+/AJ2?= =?us-ascii?Q?G3i9M4KtKdy3f4NJJDV2k15Skt0MSuWMIPkt8XYCbV16M1z4WLDsIIQ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nbuWmLoxi30grLHt7WKfzOYw7jDaxRqqc?= =?us-ascii?Q?SEp23G/wejcBzd+fLit8dF9DtdrPbA6K466YREKmGSJXIGL5qPE9lg016ByE?= =?us-ascii?Q?douOQvL4OSZ/gv0RiZ8TdY2+lpuj264pBUBP5o/LoEPYFznqRWiqG+3bMCIA?= =?us-ascii?B?QT09?= X-Microsoft-Antispam-Message-Info: wXyOViR0ymXPBaO8vWr0EeF/ncf4EjVqJdtmy/LlYjyMGzO7Yco1zec6uPSl3dOghJFx4hFnErirvUfndeLnlc1RCCV521pmWqrC1qnBOYve0X82gxC6Q2QGGFm0kRsOJXFsjW5hPuD/vWKWl2rthaMzkEqZP5wH21XF+51M7l69dTNXovcS4QzkUtvc1xs8Mrq9PKTvKwsYNCFGzcNVqiL/2HW46O9kwrVjtdpJoi2fVaPYlL/Arf6uBQ5CqA16BuLr3n/U8QHIU1FLyk6VxDSQ0uH8Yj6Q6umYkcgToYxbeZhZqNhHt6JV3S6xwrWYgwvZqewgLS6eJoO0AHzpbV5X0wZqy9jKc3FZ4znahGQ= X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4679; 6:JYMRLOnFgkxSFFjinMX9lx9xNCHBSK1nuZMt06iJl5WRx4qLUi4bM1vSBtr8r23TmSISnEfLQsGubPlVWlaXIU73lJJkTEnlwnhqSKt6C50hGrGsgkwO15cTH2D6AknXWVSGpjuPnP7NN1fmVXHZQpFB7qalMNTgJt0C0bk28eQcp6VtSpcjlADIZIuyPsx/wrFcRkoFE8/pzk4QFfkpnNXL+1bXaFLuQg8oG20CIzYpVU52kJtblv14eqi5MvtRfNFGOolqCzoAboM/+y+lurGbwKSbLeRs+jupxA/FbJtezW38rhDoyYqs7AGhPP70Zq+oF5JqtGocZHT/5D3V9JpUip6zIzKFFtmVK4iQ2XSxJfpNTNqRwQfSVXgfw/ZzlyqcmSlM93a7qr01hqugJmAGwC90g5MVcGgbjgs6L4CM489RTWSrKZVttq3q56lMWSpkJvGZs4r9ryyBPJoxNw==; 5:tnxL5bNX/gCzjMhZUVTaCJlp8BoZbUfp5510w6iVnssRLCjNmaZdN+qiBn8bHmvBPqhHo+cgvZPTBs/nVmcuhFafnj0N+XQ8UuTdAmqVReWWrKaECe1gJxNOFA4u0UbxkefXUSLse65tFYTSeHEYkt7YdRadpNzK4GMFUhBNalQ=; 7:OQzCgalpyUhfGiNjq4BCHuw2u0h0rt64U2ZLaQJVqkzKwJi39n9mKiJQ/2y1ScltmDvMex+iaf0k5COxGcx0ZpJdE9et/hJpK/OvgpMMIZh9ZdlWs/YPGi2ZTndNV0bLaGuAM41mKGG0sbrRGAu16rgSuF2Kn2WTvdZy+QnO0+1cNTbMqUrpZ4ClXZQiVVFhj4oZ/1bVUk6zeIlRZ5nRvFFFYX26c+6wzNGFGCJFc8A7bOgXLJ0LYu0lgpXZW8Gi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2018 18:06:08.0233 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fa64feb-4952-4227-6fe6-08d623dabccb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4679 Subject: [dpdk-dev] [PATCH v2 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: Wed, 26 Sep 2018 18:06:11 -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 6ccb8ab15..642a965b8 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