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 13F604404E; Fri, 17 May 2024 15:34:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A32D34029B; Fri, 17 May 2024 15:34:40 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by mails.dpdk.org (Postfix) with ESMTP id 5306140268 for ; Fri, 17 May 2024 15:34:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715952879; x=1747488879; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=GQzFsdVn8HUI8fpCm+CLOpNUWWDtGt8oB1T8Cao0tYI=; b=Q9V8b24CkMol9U+sHXuPiI4tq9xx0Ksc5EjNKrej6n8eyjfueyJW1OaI +QQ185KfxNwqmKmv6RWtk32747btDIfrUfO/frmrMaTuu/x2gtQI7KWnD 1dKqbkdSUpwr1YaSkDiasJLMRC+SBHMe3WlzqAkRpWBWqQhtZpLljo6G5 xOcgumYO9P7oVQ01ipvu4YK4SRumByKFU6HlZF7+M4OjiSIGdI6y127lF VaAbiGEfjXGX1pkxy43SIOl4IR0Jdl5/VkXYehX3vCy1f4LchqvspUE4a RimN0592Debf0iNr2Yh2hekq+0X+TospwjjsG4X2Pp/hoJqv4f8UZjco+ A==; X-CSE-ConnectionGUID: phEWMx3TS7eam4lwGmRQQQ== X-CSE-MsgGUID: zRPtDInvS1ankdByyQIY4g== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="15956103" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="15956103" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 06:34:37 -0700 X-CSE-ConnectionGUID: bVepfsVZTfGAM0OR9oxB0A== X-CSE-MsgGUID: OWgZSFSJTUWBIX/LtLd7Yw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="62991900" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 17 May 2024 06:34:36 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 17 May 2024 06:34:35 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Fri, 17 May 2024 06:34:35 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.41) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 17 May 2024 06:34:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kF2y6dr/DXTD+vEpaTOufKGBXb/+Vau5JawiMHaetEZAhihqg6KqwYzIuCU6IKN2vj/24RNyyxYlYhqFVxxRRiDuObHNzTT2zrknjHxD0/vQPoh4TCWEz0j9yZ6JTnAkUmHRzxt51fXN8WhPV7zgVMvlMZHaxbI5LzLpJwdYM1hyrLSzbbEmtdD2TzA3cFel5m6DGCZ+zpEmXBTd3SsREoDlbHitKJf2Tn/rtvoyOzg10NlbM8dBEobUxso2Y9/MSKx9/M2rDzlH4BXMGGhkB3i/3Tgd6DmyA4rtCuF9rgBA76ok55SRD/GaVIepfVSszAQfXJ5L6Knl55RyriR4dw== 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=SyuanokU7CVy9W0W0FDNWlcuALQieeqT5ysS1PCuQ9s=; b=nfyhq0kGN2u3UK15oleRzJmAHXViepmDrkmNtdyakX98eeYxWON43Fc+K/QW0ci3I7k+cGm3NAs9buVfXSrAfiFf3FLz96Bt7bIDRWwandTBUzrAuStoBt13A1m5vU0LEiSUNtIu45sg0/06uPoinMbOVzcUypRpnuCrPO0MJwUWGik9rlCN19/YVafmoFtbHKs+yL7La+C1/mxwy0LQiFR8tN+ou99X0ko8KXT67yqB4ZxOEQ4eoK4aM+YgYUbOogdZjp+oDfMMnc+80CpSwYWBqUD0jli4vVcER0J+e0RsGkAZ3O2Ovn9hH8Xs2Qi3q9C0YEamt+gYC7P/uMOcJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by CY8PR11MB6843.namprd11.prod.outlook.com (2603:10b6:930:60::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.30; Fri, 17 May 2024 13:34:32 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::6444:ca4c:aa3e:f8d2]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::6444:ca4c:aa3e:f8d2%4]) with mapi id 15.20.7587.028; Fri, 17 May 2024 13:34:30 +0000 From: "Loftus, Ciara" To: Stephen Hemminger CC: "dev@dpdk.org" Subject: RE: [PATCH v6 4/9] net/af_xdp: use generic SW stats Thread-Topic: [PATCH v6 4/9] net/af_xdp: use generic SW stats Thread-Index: AQHap+8QmfmhLE9isEu/4acSfo7zs7GbbHAg Date: Fri, 17 May 2024 13:34:30 +0000 Message-ID: References: <20240510050507.14381-1-stephen@networkplumber.org> <20240517001302.65514-1-stephen@networkplumber.org> <20240517001302.65514-5-stephen@networkplumber.org> In-Reply-To: <20240517001302.65514-5-stephen@networkplumber.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|CY8PR11MB6843:EE_ x-ms-office365-filtering-correlation-id: f58f8143-3ab7-4ce1-d303-08dc7676147e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|366007|376005|1800799015|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?qNJN28LL8y/npogj/YltIKhOJYyoC6ip2CFMKhPUY3gO2SHTuLUoyMkO9Hz3?= =?us-ascii?Q?zO5RyUOq0M8qV9zUNaGddPQC+zvelz8hvyJNLEvnfGLCqS3LhW9ybD1W7qxG?= =?us-ascii?Q?mHOpAKHeTZrN/Qa87191r7DsISsyCpZg36+Q2ej/461MU9vcSadunJT1FbxJ?= =?us-ascii?Q?roNj/ex2GSmZzM/YiFjmqimhY/n6Hl/w7s1Y4ql7cz/9NZ9Gk2AD/+rAOApx?= =?us-ascii?Q?pCsme/lTDrOwU/DICXRbE/AQ2pyiPo0lmIH728UP1ZoVhldRUhNasEmV2Jo1?= =?us-ascii?Q?kvZmpCAzTu1MRvKP5GIoWXI4+Xk6/QCA6K9eBFLRm3lL8IZp290ST72SuQTz?= =?us-ascii?Q?lHY1gijD/z/ShD35O8jNeFd0LTT48HUdVAUPsoh3jWYSrrM9J2ndu3H6NElZ?= =?us-ascii?Q?vnjywL1LUOlijHvJ4fWbabuWEvnujzWedHlYzg3aHHnn2DhuHCH2+OqXePtP?= =?us-ascii?Q?Ye0FEetwRurDILB2gHiXd1CUTMa8KHs+UWNLrkRsVYPZ8516vpuhSvn6hMmA?= =?us-ascii?Q?PyvPSLotNyU6pO+5RXTyaP8lla9EsNsTiN8JMZj/isxewld2y0amTFEE495r?= =?us-ascii?Q?4TlICzDjyGmYHyMNxkbgW/hxnGSdlPbzwcN3Jki3gAmHR5LD1wmL/Kqv3SD+?= =?us-ascii?Q?1NEkVMI38CXmdk2ILVpjLF4RUs9EwIGk56DtW90ABCLzCaEpEDWrIc65PEjj?= =?us-ascii?Q?FlMzmRczVWthbnxsJJnpJBVeXT6kEKYDbOWjUrwqXG7dhFe65Z5XuB39vsif?= =?us-ascii?Q?siQT1jbWhj++ykEckyM6AK2Ado6lnAaauTBlrI3JJLVzLNeX2zw/H+0Ms8vq?= =?us-ascii?Q?174BKTIEYtbu/ZuJtOCxonne1nHZYjt5GSX2ubJJQwIxCAPqj/0K9IdKOoT+?= =?us-ascii?Q?RKtn+BMrQhU3HWUoGLEV3PcSRt4UksHDZS5o9ZqFT4CceXx4clP6niXEDBUd?= =?us-ascii?Q?Pj7Rnzh2KSGMRkq6GiPObdlce8mo7siXsLQ6h9CrbAVrzTnFH1OLqCGYHjY+?= =?us-ascii?Q?WDCOavWjRmzIZXhhLCCFHH4lK8qjvP9dCkq1nfU1qXoLNyi7xUHiaucGXmSn?= =?us-ascii?Q?WFVh1m8ggu0vxtiC049FkEqLwiO4quEt1KODYtNnHlNrwShVJ5jlEAHXLV7I?= =?us-ascii?Q?M8aTkqRBhiIW79qkjGSurs4Fm5MocR4kjWZAp4+7XLcexijB+jOKWSH5P9eq?= =?us-ascii?Q?uqCkz5zVFWS2GgyCjaSHjzPMlLaImlbiqpGTIDq+QzeLeVs9zFEuCejYafgC?= =?us-ascii?Q?JuOmHtOrhEPdheIeNa3LL/7BbLrntfuY/aa5NDf2921lyAl0X/ls7B5DQWRi?= =?us-ascii?Q?aeeGSNc88vZImPBn6dAdlPOk?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR11MB5872.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(376005)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BObjpr4H/xArIh0PiTd7UwCa3pZQm+zrHIFg4JMh60+z8B6simyTwS2KGbhB?= =?us-ascii?Q?2fWrUrA9N2yk+5epVc0QiFftAUF72mIdXBLTkstyQiSumIgkyX8/lfp7UUBH?= =?us-ascii?Q?CakKc9ol3Q7TFsp0HFSVtXmUCUuIeT0SYmtwlwOwAdzaGep7nSk6xS+Kj2yS?= =?us-ascii?Q?HIzaSGFaXb6eEBNO3m44uUBYlgS/vox8sTG1g00PTZG61WX0QyhntO8d6ws3?= =?us-ascii?Q?QLdcOAAYGqR6Rmu+FA5nkzc9k6STOtJN0w/rz+Iw3OwXryrWxs7rhtz0EAXA?= =?us-ascii?Q?gLftMzKKsRSDGrNXKQE3DQFX8mlqqfuQfEpzlVaAF6ZWWNRVq2RxFBkmFP5d?= =?us-ascii?Q?DlwfpAj2F59ezRN6J8ufCkCOoGopYYvS8NVAbiCz54hExA9oIZSOthLWWN9+?= =?us-ascii?Q?ya7fS6fweZisL6R3gvI5oA/bE/9PaypDtgayrupI9LQjZGeZnMsc5bvJ4fW8?= =?us-ascii?Q?HPCl5eNh0SxupltcFle/tb8Ri+3PPzfTqYC2Ez5n4+2BGFdFdYW+0VhItJh1?= =?us-ascii?Q?MAmgkEGaITM580X2a3G72V1oMjqKzZNLx0g+VqLkkCVaN2JiriW/zUa/5YXi?= =?us-ascii?Q?4805Lz7/s8zHh5wiE+C5zamJgMKQ+kH0FbizR0e9oF/7nQq+VAbFwBrzZhTi?= =?us-ascii?Q?x6YLwRe82csDlMFiEkuER47bBkviPrtAQIeorxPQQLIciTWsf0jjilre62rq?= =?us-ascii?Q?/Sw+wplqgiuLca7PMfvtPG1intqlCbH45iFSDIbcqtFSvYrxlUszNRtmSgXp?= =?us-ascii?Q?7qrcBkvhT12/i6dD2e+jdm9CCxmhIf0WI4VxjAyf/GKIeeFtHsbZiT8IzsWU?= =?us-ascii?Q?/wNcBPIUflHrayuwNf+XcPPPwGfWbEtasONTRZws1oTx5TueVpNVc0N/Dvst?= =?us-ascii?Q?DqcZQ9dptlD+rdD7nXKNBPhmHI7oDBvcA2gUdVi8kGMySrsNfubX8Ltd6ibd?= =?us-ascii?Q?pLSb9RKRWANPmz/jiOYIN7gqJXFzMCJcd5IHTZlcz9ccBLB9pDUbNHViswLo?= =?us-ascii?Q?RtnC1osTKeBWNDaXz3lvaLntEBlPHklFzajx9TMmdGnB9FSRVR/+611EvfDw?= =?us-ascii?Q?HcO/hC0jZIRwYNpWjvjjen9OucSNthp2pUQMBznh/zd7iOmUcIFF9TbiSTZ3?= =?us-ascii?Q?/u5k35Po9ZGtTSHX5I55VHmz026mRKMED0wbDodzmiBmHpQC/eVoVYkB28j3?= =?us-ascii?Q?TVP77LdgYjC4PWeLgSY6uuPZdQuKwmU5ro/rIUV6KfJAz68i4K7aewsHU4I6?= =?us-ascii?Q?v3Z/YnRVEuQ/yhlfxGKjp8Rhyilhyj/SznL+jpPrf4juhaAura6yfInAA1Rz?= =?us-ascii?Q?YVgXl82yTnZ0HHMTgMWijICltHEMWEZf5QLqlaRv3QsBOjVxTkWBhl08T7HX?= =?us-ascii?Q?EMc+bsMYIiSN6xfXbHOdexjlE6nT2K49zasfWNkeqhAHTSgbT/zaXy5naok6?= =?us-ascii?Q?Hy594FuocX7xCaUdkan5d491wT3ls4/qeOFgxVIR4PZHDkamCcAc1/ELlPbK?= =?us-ascii?Q?1PfWeRftBkVA2Oqj1rqKPCMgBDPVZROLGtka++msQ40VpsIqKswfHjiDpiQo?= =?us-ascii?Q?oqT7w1J/dSmA9JeoSDB+bQOpVa2EJmHWNV2gk98j?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f58f8143-3ab7-4ce1-d303-08dc7676147e X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2024 13:34:30.1414 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EIcsz1gIj0+MBT18Wm8L1+CShr0YWLLFjDN7kz4Qlyf0dpcgThwwmawyKCy2/iLAKzwLyao58Kps/Mm1QJOUeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6843 X-OriginatorOrg: intel.com 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 > Subject: [PATCH v6 4/9] net/af_xdp: use generic SW stats >=20 > Use common code for all SW stats. >=20 > Signed-off-by: Stephen Hemminger > --- > drivers/net/af_xdp/rte_eth_af_xdp.c | 98 ++++++++--------------------- > 1 file changed, 25 insertions(+), 73 deletions(-) >=20 > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c > b/drivers/net/af_xdp/rte_eth_af_xdp.c > index 268a130c49..65fc2f478f 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c [snip] > @@ -541,6 +521,7 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, > uint16_t nb_pkts) >=20 > for (i =3D 0; i < nb_pkts; i++) { > mbuf =3D bufs[i]; > + pkt_len =3D rte_pktmbuf_pkt_len(mbuf); >=20 > if (mbuf->pool =3D=3D umem->mb_pool) { > if (!xsk_ring_prod__reserve(&txq->tx, 1, &idx_tx)) { > @@ -589,17 +570,13 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, > uint16_t nb_pkts) > count++; > } >=20 > - tx_bytes +=3D mbuf->pkt_len; > + rte_eth_count_packet(&txq->stats, pkt_len); This change resolves the bugzilla you reported recently (1440 - use after f= ree in af_xdp). Should this be mentioned in the commit message? We probably= still need a separate patch for backporting that can be used without this = entire series. > } >=20 > out: > xsk_ring_prod__submit(&txq->tx, count); > kick_tx(txq, cq); >=20 > - txq->stats.tx_pkts +=3D count; > - txq->stats.tx_bytes +=3D tx_bytes; > - txq->stats.tx_dropped +=3D nb_pkts - count; > - > return count; > } > #else > @@ -610,7 +587,6 @@ af_xdp_tx_cp(void *queue, struct rte_mbuf **bufs, > uint16_t nb_pkts) > struct xsk_umem_info *umem =3D txq->umem; > struct rte_mbuf *mbuf; > void *addrs[ETH_AF_XDP_TX_BATCH_SIZE]; > - unsigned long tx_bytes =3D 0; > int i; > uint32_t idx_tx; > struct xsk_ring_cons *cq =3D &txq->pair->cq; > @@ -640,7 +616,8 @@ af_xdp_tx_cp(void *queue, struct rte_mbuf **bufs, > uint16_t nb_pkts) > pkt =3D xsk_umem__get_data(umem->mz->addr, > desc->addr); > rte_memcpy(pkt, rte_pktmbuf_mtod(mbuf, void *), desc- > >len); > - tx_bytes +=3D mbuf->pkt_len; > + rte_eth_qsw_update(&txq->stats, mbuf); Typo? Assume this should be rte_eth_count_packet > + > rte_pktmbuf_free(mbuf); > } >=20 > @@ -648,9 +625,6 @@ af_xdp_tx_cp(void *queue, struct rte_mbuf **bufs, > uint16_t nb_pkts) >=20 > kick_tx(txq, cq); >=20 > - txq->stats.tx_pkts +=3D nb_pkts; > - txq->stats.tx_bytes +=3D tx_bytes; > - > return nb_pkts; > } >=20 > @@ -847,39 +821,26 @@ eth_dev_info(struct rte_eth_dev *dev, struct > rte_eth_dev_info *dev_info) > static int > eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) > { > - struct pmd_internals *internals =3D dev->data->dev_private; > struct pmd_process_private *process_private =3D dev->process_private; > - struct xdp_statistics xdp_stats; > - struct pkt_rx_queue *rxq; > - struct pkt_tx_queue *txq; > - socklen_t optlen; > - int i, ret, fd; > + unsigned int i; >=20 > - for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > - optlen =3D sizeof(struct xdp_statistics); > - rxq =3D &internals->rx_queues[i]; > - txq =3D rxq->pair; > - stats->q_ipackets[i] =3D rxq->stats.rx_pkts; > - stats->q_ibytes[i] =3D rxq->stats.rx_bytes; > + rte_eth_counters_stats_get(dev, offsetof(struct pkt_tx_queue, stats), > + offsetof(struct pkt_rx_queue, stats), stats); >=20 > - stats->q_opackets[i] =3D txq->stats.tx_pkts; > - stats->q_obytes[i] =3D txq->stats.tx_bytes; > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > + struct xdp_statistics xdp_stats; > + socklen_t optlen =3D sizeof(xdp_stats); > + int fd; >=20 > - stats->ipackets +=3D stats->q_ipackets[i]; > - stats->ibytes +=3D stats->q_ibytes[i]; > - stats->imissed +=3D rxq->stats.rx_dropped; > - stats->oerrors +=3D txq->stats.tx_dropped; > fd =3D process_private->rxq_xsk_fds[i]; > - ret =3D fd >=3D 0 ? getsockopt(fd, SOL_XDP, XDP_STATISTICS, > - &xdp_stats, &optlen) : -1; > - if (ret !=3D 0) { > + if (fd < 0) > + continue; > + if (getsockopt(fd, SOL_XDP, XDP_STATISTICS, > + &xdp_stats, &optlen) < 0) { > AF_XDP_LOG(ERR, "getsockopt() failed for > XDP_STATISTICS.\n"); > return -1; > } > stats->imissed +=3D xdp_stats.rx_dropped; > - > - stats->opackets +=3D stats->q_opackets[i]; > - stats->obytes +=3D stats->q_obytes[i]; > } >=20 > return 0; > @@ -888,17 +849,8 @@ eth_stats_get(struct rte_eth_dev *dev, struct > rte_eth_stats *stats) > static int > eth_stats_reset(struct rte_eth_dev *dev) > { > - struct pmd_internals *internals =3D dev->data->dev_private; > - int i; > - > - for (i =3D 0; i < internals->queue_cnt; i++) { > - memset(&internals->rx_queues[i].stats, 0, > - sizeof(struct rx_stats)); > - memset(&internals->tx_queues[i].stats, 0, > - sizeof(struct tx_stats)); > - } > - > - return 0; > + return rte_eth_counters_reset(dev, offsetof(struct pkt_tx_queue, > stats), > + offsetof(struct pkt_rx_queue, stats)); > } >=20 > #ifdef RTE_NET_AF_XDP_LIBBPF_XDP_ATTACH > -- > 2.43.0