From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BFE75A00C3; Tue, 16 Aug 2022 07:34:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57A464068E; Tue, 16 Aug 2022 07:34:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id C87AD4067C for ; Tue, 16 Aug 2022 07:34:02 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27FLBD4u028935 for ; Mon, 15 Aug 2022 22:34:02 -0700 Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2048.outbound.protection.outlook.com [104.47.51.48]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3hxbfksvmx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 15 Aug 2022 22:34:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nry0TRdZ7W/6kIu97p25A7NKiqbcaO0lXj0Ujgkb6lbJHfF1mRR5sbDJ5B1GzSX7WpG4sq0svdrNuiLqPcjJ6aAZ4dPcwQ+EjCeVYJ3VnUFmnmZDvpekma6XADf+G4npxtVravIX1aui3/AM7tuieI6arn9kkz8PerxgHzxEQTtE1/h4FQveGHveq8SomjBYFG4EenVdA8VYDtroOfeofU4QeHA6kV4qi698EBr8XX3IlUq/mktsgr+X0YUHYXstwZudNnCidRBiS5OiLpcIklyZlaJFvn99/7XoUeKrS2t5INH+es246TPNYW4UJiP6HRC0KT13fy7vaZT3+Yd0mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=h/821YMv1RnakhMNMXQmmkbzIY9oYbCwFlYzfLfv0fM=; b=B8f96wotaTuylp1OkncQXfGnbUi7ecpv3fgv+E7ZmCad97aTDPcjpU8rNT/VoLZpvf3q4J5L/Sm0l6+bSuVZ3TuRd8vhtOmL1b4IfQiroM/GqoVjYyNYO6JEBoOvjXMd4NljxOyDSmyIBiVK5S2zqQxUmKixxQjqe8Tetf2po02JYvNnv8NoAs6pkQlaUt1Smyj+Oj9qbR/R6oUMmDEXNA6ayGe7NX3sozj5JkykmapGXKHH7mS6K2M2b8uN2pGlxlD8qZyG1ff6cpvC0iTf+eRu/o2DgCvdwYeaJ0j+Odyfz9CWrv3ftMWOsuY8WH0poVfourQ6YQZDJ5/jvT2hOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h/821YMv1RnakhMNMXQmmkbzIY9oYbCwFlYzfLfv0fM=; b=LkyrZCd/Ie1HJIQryB4N+zNgD/ASWoS3hIs7ed5SUNfgOZv1mO5KZTS9OquHHgfNRz08yERIVqKF9+fc8skzzKji2BL5CzT90vk563xRxnrFhcLiH+a/2chvrgg4PKWMb1OyN+vc3e0e+QpOlypSaZfKEwSFE2JwE0z+6ql0yC4= Received: from BYAPR18MB2423.namprd18.prod.outlook.com (2603:10b6:a03:132::28) by CO1PR18MB4713.namprd18.prod.outlook.com (2603:10b6:303:e8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Tue, 16 Aug 2022 05:34:00 +0000 Received: from BYAPR18MB2423.namprd18.prod.outlook.com ([fe80::9d02:201d:e63d:ada1]) by BYAPR18MB2423.namprd18.prod.outlook.com ([fe80::9d02:201d:e63d:ada1%5]) with mapi id 15.20.5504.027; Tue, 16 Aug 2022 05:34:00 +0000 From: Veerasenareddy Burru To: Sathesh B Edara , Satananda Burla , Jerin Jacob Kollanukkaran , Sathesh B Edara , Radha Chintakuntla CC: "dev@dpdk.org" Subject: RE: [PATCH v2 2/3] net/octeon_ep: support basic stats Thread-Topic: [PATCH v2 2/3] net/octeon_ep: support basic stats Thread-Index: AQHYoZpMzNkqkGKLwEKIUst+7QmlFa2xIEyA Date: Tue, 16 Aug 2022 05:34:00 +0000 Message-ID: References: <20220727092134.141530-1-sedara@marvell.com> <20220727092134.141530-3-sedara@marvell.com> In-Reply-To: <20220727092134.141530-3-sedara@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a2013181-4912-4d9f-b814-08da7f48ec55 x-ms-traffictypediagnostic: CO1PR18MB4713:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yrb94ZPbzpvnB5T1cHBEDdit6EHXUEPRT8xmf/DBChgUs3fFMQf8w/i2RT9eglPCCubCNK3J7coD1GlkqkBg2G0cjqU3ZEZlRjDMFP/MpjG8SMn9tNT9c2emq4tYx3qGahgFjSWEha7lrwmqcCFf/dXSFYkJNJ7dWEUz9mNzb6MRVs2DDh/oCUwQgvtOWm3YIiI5K2obcOAhDnaNRCl3yPhFyFgbYwoaeTWLqsFCRyY38hJfyuiYbkVkiu7sxyCtWRYOgtl89SV69OKTKFIsTpu76VgMLxADvpdVe+6LOsWW7RktCUQvnWT6jd2WAXyBlo3JBmkcCd0RyNUjsDUCfvLkqF8ByuGOv2wB5ItHoa6yGAGW97Uufd5QJ/rk4fOVcvvWCHZpfXbKcZCua9cGLUktkbmeSjPIQqqAa0gu2KJO3lPdd0PjXSGRIxVPLTcaNdLmkancywKF9SmSCXuJdMaQMrrk9F2TwEOHiaQu2Fep0bNL9lSPupXk6o99dqyRwm/4PF819VwvYV5j87FGwXyHbqzV7nRC9Q83d6JNZb8njlBWSs1Fvp36az8jSaU/IDNl/8iFqiJu3KC3iercvwNQyA6/hvplOjo9vsStVhw9Ynf5ruwhHRflDUjtYe6wEIaTIuf4fer2iOtl2n6g1cql84sIhyWMFER4aPI0NFGSXvYBC8hXlOG68JDK3UYVsDHnGljs57S+HsBvsdbQ1hf+D7suOABMvyVGk54W9CxUA7iI8G2EwDPLH5SXdqWxkfqN7KD6dbVdAUCKFGQDWpbdobFXNa2ujMTGX73xqCSoED149ffWJz5NBlMseSLf x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR18MB2423.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(376002)(39860400002)(366004)(396003)(136003)(346002)(83380400001)(110136005)(71200400001)(478600001)(41300700001)(52536014)(8936002)(64756008)(55016003)(8676002)(4326008)(7696005)(66476007)(5660300002)(66946007)(316002)(66446008)(6636002)(76116006)(66556008)(2906002)(122000001)(33656002)(186003)(53546011)(38100700002)(26005)(38070700005)(86362001)(6506007)(9686003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?u+vGfiAGbxgr1htkisKF7lfkon1p2ZvOWJbgcI03TqCrFz0z1QzSIZnHQl3I?= =?us-ascii?Q?X290wXeKp515p+tFzcinCJ1MHPP6ifRiHA8eHvh3Tb1xoaMJTatQ89PWH+C1?= =?us-ascii?Q?gJaGfmAcjNSYAZnVMN6H9Ptj8yx2HEFvj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?us-ascii?Q?Q7ZtFm8vHqOniobgmhGfnUhE/Uw5JoD2y9yWX+2rObu2nmBrgR0Lb/ZREHqO?= =?us-ascii?Q?WVQhJa/Po+du3bNFRwI3LDI7wS11Yh4vbt28v/DFJLUFACfH20lLxBLaNctN?= =?us-ascii?Q?K6yVdR3j4pCsZDV+Mq7HEFj2SLB9FE9ksWBZEuf1MSWRO9yATqL5+KQjbdL/?= =?us-ascii?Q?+kIVWUTD06x0fc/dp2ImZlUIsLm53fKBNi+VdESuLW25A24QSKWN7IojxWe6?= =?us-ascii?Q?LcgGv7J1m/fK0tAJPqM9fJ52sp2ZALwfF5Jwl5N+nZLkl65GVDHGhHTRUxcz?= =?us-ascii?Q?M5bDEabea1GOfdwfsV5OIJ5C8vz4h6GmNuGLKBa1HoXWSr3v114SJj3v+fbP?= =?us-ascii?Q?J45gPF4a2gCt4WRYgsceRNRXcvS8oarlFJJCOJRX0dPGDn8oVPTfATYhcRFU?= =?us-ascii?Q?Lzj70ZRHu1vriAEhIe9abG1sZ9BGda0ynNVn8c9XPX/ZLdd8pv8dxsxk4soD?= =?us-ascii?Q?HbhUYBHmJz2CRDKSD55WBZO8LPufZqwzAUzwUiEaxy0Qrj5qiZj9lhyRXnAT?= =?us-ascii?Q?nYX/BnX6qaIL6bnxnHM=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR18MB2423.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2013181-4912-4d9f-b814-08da7f48ec55 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2022 05:34:00.5291 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: kPw2xw8BbOn49soHzvNkQKHk0wLTWaWztGMQZXZzMRlaeSDg3myAunJCCvfX9csZ7dTK9pAblq7ArSvnECoFfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4713 X-Proofpoint-GUID: BEHROamGKyHF4Rrs46Ue7gxKH94ci4eC X-Proofpoint-ORIG-GUID: BEHROamGKyHF4Rrs46Ue7gxKH94ci4eC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-16_03,2022-08-16_01,2022-06-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Sathesh Edara > Sent: Wednesday, July 27, 2022 2:22 AM > To: Satananda Burla ; Jerin Jacob Kollanukkaran > ; Sathesh B Edara ; Radha > Chintakuntla ; Veerasenareddy Burru > > Cc: dev@dpdk.org > Subject: [PATCH v2 2/3] net/octeon_ep: support basic stats >=20 > Added functionality to fetch and reset ethdev stats. >=20 > Signed-off-by: Sathesh Edara > --- > doc/guides/nics/features/octeon_ep.ini | 1 + > drivers/net/octeon_ep/otx_ep_ethdev.c | 52 > ++++++++++++++++++++++++++ > 2 files changed, 53 insertions(+) >=20 > diff --git a/doc/guides/nics/features/octeon_ep.ini > b/doc/guides/nics/features/octeon_ep.ini > index 141d918466..b304ff8877 100644 > --- a/doc/guides/nics/features/octeon_ep.ini > +++ b/doc/guides/nics/features/octeon_ep.ini > @@ -8,4 +8,5 @@ Speed capabilities =3D P > SR-IOV =3D Y > Linux =3D Y > x86-64 =3D Y > +Basic stats =3D Y > Usage doc =3D Y > diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c > b/drivers/net/octeon_ep/otx_ep_ethdev.c > index 806add246b..cb45bd7a8a 100644 > --- a/drivers/net/octeon_ep/otx_ep_ethdev.c > +++ b/drivers/net/octeon_ep/otx_ep_ethdev.c > @@ -337,6 +337,56 @@ otx_ep_tx_queue_release(struct rte_eth_dev > *dev, uint16_t q_no) > otx_ep_delete_iqs(tq->otx_ep_dev, tq->q_no); } >=20 > +static int > +otx_ep_dev_stats_reset(struct rte_eth_dev *dev) { > + struct otx_ep_device *otx_epvf =3D OTX_EP_DEV(dev); > + uint32_t i; > + > + for (i =3D 0; i < otx_epvf->nb_tx_queues; i++) > + memset(&otx_epvf->instr_queue[i]->stats, 0, > + sizeof(struct otx_ep_iq_stats)); > + > + for (i =3D 0; i < otx_epvf->nb_rx_queues; i++) > + memset(&otx_epvf->droq[i]->stats, 0, > + sizeof(struct otx_ep_droq_stats)); > + > + return 0; > +} > + > +static int > +otx_ep_dev_stats_get(struct rte_eth_dev *eth_dev, > + struct rte_eth_stats *stats) > +{ > + struct otx_ep_device *otx_epvf =3D OTX_EP_DEV(eth_dev); > + struct otx_ep_iq_stats *ostats; > + struct otx_ep_droq_stats *istats; > + uint32_t i; > + > + memset(stats, 0, sizeof(struct rte_eth_stats)); > + > + for (i =3D 0; i < otx_epvf->nb_tx_queues; i++) { > + ostats =3D &otx_epvf->instr_queue[i]->stats; > + stats->q_opackets[i] =3D ostats->tx_pkts; > + stats->q_obytes[i] =3D ostats->tx_bytes; > + stats->opackets +=3D ostats->tx_pkts; > + stats->obytes +=3D ostats->tx_bytes; > + stats->oerrors +=3D ostats->instr_dropped; > + } > + for (i =3D 0; i < otx_epvf->nb_rx_queues; i++) { > + istats =3D &otx_epvf->droq[i]->stats; > + stats->q_ipackets[i] =3D istats->pkts_received; > + stats->q_ibytes[i] =3D istats->bytes_received; > + stats->q_errors[i] =3D istats->rx_err; > + stats->ipackets +=3D istats->pkts_received; > + stats->ibytes +=3D istats->bytes_received; > + stats->imissed +=3D istats->rx_alloc_failure; > + stats->ierrors +=3D istats->rx_err; > + stats->rx_nombuf +=3D istats->rx_alloc_failure; > + } > + return 0; > +} > + > /* Define our ethernet definitions */ > static const struct eth_dev_ops otx_ep_eth_dev_ops =3D { > .dev_configure =3D otx_ep_dev_configure, > @@ -347,6 +397,8 @@ static const struct eth_dev_ops otx_ep_eth_dev_ops > =3D { > .tx_queue_setup =3D otx_ep_tx_queue_setup, > .tx_queue_release =3D otx_ep_tx_queue_release, > .dev_infos_get =3D otx_ep_dev_info_get, > + .stats_get =3D otx_ep_dev_stats_get, > + .stats_reset =3D otx_ep_dev_stats_reset, > }; >=20 Ack > static int > -- > 2.36.1