From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E16D9A052A; Tue, 22 Dec 2020 14:05:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7B8EFCA54; Tue, 22 Dec 2020 14:05:13 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6AA06CA52 for ; Tue, 22 Dec 2020 14:05:11 +0100 (CET) IronPort-SDR: p+fLNZLHDyjmHaC1IZefVIbRpvKA6UtXpvT7PvBLwdR3cxnsuzmADVt2SPb8u7BM96rkUsb58Q Z/JUYtKYXsXg== X-IronPort-AV: E=McAfee;i="6000,8403,9842"; a="239949277" X-IronPort-AV: E=Sophos;i="5.78,438,1599548400"; d="scan'208";a="239949277" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2020 05:05:09 -0800 IronPort-SDR: iIrCRC9DvFumjZv4Jgv45g1mPhBITmqfaetdrzwl2Qyhf8j8pUja8XtwmeF6RyLaKneRjE2VSD 2baqhq+63XTQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,438,1599548400"; d="scan'208";a="373300731" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga008.jf.intel.com with ESMTP; 22 Dec 2020 05:05:08 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 22 Dec 2020 05:05:08 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 22 Dec 2020 05:05:08 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 22 Dec 2020 05:05:08 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) 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.1713.5; Tue, 22 Dec 2020 05:05:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hr9IVje0vdGzsyY/yNCxvFAxp+UIxuGfQAOirqFrGNX80IAn1KNnSDVKacOcJtcvNNhgU/jHgTrwFYRp6TxRhEYYTLLaoP7yhAJzt68FO9ZV/UhE8D2cHcKko0goIUFD/r2UDVrzEvwSXft/coItBY9URcbzGsZpaylcyElvIOx53COoAxXg9DTHgZFSgyetpjeBtC4E2ORQ31e3wxubUmttIu1IZXg82pnt+MgjqsgKAUlf4AoUW4N+dhT5F9HO/d+t/0PrfGNJ1TC8K37rCJEDflI9BREg+SRhxuZo8rfwLhOOJ01yLFg7sTrZwd2W4E620TvefwI0m2vGPfq+RQ== 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-SenderADCheck; bh=Vu2dqD1M89corhMOjjLRdgXxWQjNPcm703ir0u/lhwU=; b=CvUydDpjmyzbafVwR+ex26Exivsl9PLlGXcaRzFP2scV1m76FnYAhRTltbLs7d4GtG/df3M7RcfWZmER0Sz9YZYzUwiwbOtFVM46nvGhpvcybtFukmn2Dv9D7PTtSI/tbmGLrEtbCg4iFVh3AYep5SwrDhp4DYMk0gqvk5TaOmmCjbPh9LAKXGpk1O6Rd0D+b+r6XKsXsmrDsIAW3tcvjVUgzC1DkeEkMtRECfDw935mEULn0vaK1fSJHt3ds69lvB/I/UN8fGK2F7Vra48zxC3RPeL7vBNKAiH0qJQdNGW9UEFkb5fp6ie2TF0Lwnq9Nq9vOQXRoRenllkdlkL77A== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vu2dqD1M89corhMOjjLRdgXxWQjNPcm703ir0u/lhwU=; b=d1mPqDEh8RYkmsrA6OGbNLHxGyDrPiaUNHSSgXepbysI0bwtig/63pxjsHnVax1MLIaHcNV7sG5AfuTxsjkyQvbCdHxIgGzfLYsUo9vVyQd21seC1ld4No+lKkt6yE3l9ps0bYoU4e49o1GeJsxx2L/e3180J0oUXy9x02bVPqw= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BY5PR11MB4228.namprd11.prod.outlook.com (2603:10b6:a03:1bd::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.33; Tue, 22 Dec 2020 13:05:02 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::e59d:1af1:8575:8435]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::e59d:1af1:8575:8435%6]) with mapi id 15.20.3700.026; Tue, 22 Dec 2020 13:05:02 +0000 From: "Ananyev, Konstantin" To: Hideyuki Yamashita CC: Thomas Monjalon , "Yigit, Ferruh" , Andrew Rybchenko , Ray Kinsella , Neil Horman , "Burakov, Anatoly" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 5/5] librte_ethdev: add to use apistats Thread-Index: AQHWyhKlWfzw8YlBo0q7fGArv5n7L6nrlSZwgBbxBICAAKXyYA== Date: Tue, 22 Dec 2020 13:05:02 +0000 Message-ID: References: <20201204075109.14694-6-yamashita.hideyuki@ntt-tx.co.jp> <20201222115006.CFA6.17218CA3@ntt-tx.co.jp> In-Reply-To: <20201222115006.CFA6.17218CA3@ntt-tx.co.jp> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: ntt-tx.co.jp; dkim=none (message not signed) header.d=none;ntt-tx.co.jp; dmarc=none action=none header.from=intel.com; x-originating-ip: [46.7.39.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bfe211b2-afe5-43e8-3df6-08d8a67a31f9 x-ms-traffictypediagnostic: BY5PR11MB4228: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: m+S4znv4kxh84x+P7jxLb4sdDRse9OCPuEKX7pNQ90N30h9qdHdHRwnYgcDdTHynTO42nsE11mtsIsW8ztVo319yzqIXdsTx0QbAwijxmfuJrzXVpTlCoClRRsE+DNMiq9jlLT4V8S7Rv4WUTHrqMjoXqWpkP2n+uf5Pz54J9w2738acLHBiSd1tFGEqZTmcSHXaelfBKCQdTwBWwGilqQT8YPv4o/F7tilFXMrOiEsRYlRMuz7hNuXXWlCdqjf1RBg3ChwO9j4TYFAztC3/fSZpFzZKWP6xiNr9QgreChjkdrAw4ei+0NB1+MwIb2InEBkpazkgdfzTKUnZZnm2+YsYxu94uVLyycs4K5Fasuz+DQurRa8Zj6hu2kNUxmj5rGD1VUtxDkh3GyMdRP0MYw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(136003)(366004)(396003)(186003)(8676002)(71200400001)(26005)(9686003)(64756008)(52536014)(6506007)(6916009)(86362001)(316002)(4326008)(54906003)(33656002)(66556008)(76116006)(55016002)(2906002)(66446008)(83380400001)(8936002)(66946007)(5660300002)(478600001)(66476007)(7696005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?jewf4YCvsTf7JL13swW/hbN7CWcRaGGOMZkRE5PxPlbPIuY/2RxBS9HAVNxE?= =?us-ascii?Q?T5j1f7pESd/PtNQHjbTMgSCWj/8iJObGcj3acORpor2I+aN5W0Ty1iy/zcBz?= =?us-ascii?Q?Cv6FS2VvCFPb0PDkBOohjUqKNOofF7sAwwj5VGRgLS6AQVi8N5dmcH8homTa?= =?us-ascii?Q?s9R3AbIYrXUDlTf0OFVxJcVAowXm3swuUYQOD0mSVQFMh9owNLpx80LkpvS0?= =?us-ascii?Q?E+2h6tv5M3XWXuNYiXDdYiZXnxqbT/JTiebXQarCC8SDr4OZMH6z6fovVHpr?= =?us-ascii?Q?fth1Dkfw+6a/IBN+d9uWHKY2LLMHmDFBNrFWLb1JNcU/sxMalfqKADINXrI9?= =?us-ascii?Q?cB51eGKjkyvYhViA6FfgwH3006xPfNI5b1MugVmhoSmk87ohce4angHiInLc?= =?us-ascii?Q?8MfJPD6yNwPkMaY0LKaWeduJvWxdwhOjHUHafc85gSH+aSKpAjeDT+tstFcZ?= =?us-ascii?Q?EI6YVI3ORkVU8q3YFtPFL/zZzY/n+0mlZzRScDxJlRPCPwG5cE5da0/YS1qL?= =?us-ascii?Q?a8Z5uPex/7zDhivZRMqT8hKu78KWWo2/BOGwbIuTdhtlDYO0kzKObbVVUXze?= =?us-ascii?Q?fNIIqYOuZaKABsXHqbKjnFnt7SM3PCMie6LzUnro2/sLpINyBLhEjMX9f8M7?= =?us-ascii?Q?Isjjmz4H6v5bRIXsrnZalc+RVIlhHGBhIKknYU4BIZmlGJCGZqIft1JzWdxF?= =?us-ascii?Q?7tZFqOWBOCzMEU2rVLB3YDYbCuzuRLywO4ATeD9h2mW23ky4QEoL6+MDeo/W?= =?us-ascii?Q?jznxOXVOBTxIOttGC1pY6VENoRAM77El2vWO6w9oUj1zGQ+jeWr1rXJR/jSs?= =?us-ascii?Q?NHLSedEAvnPEcuxD3P4UJjHi5uA19hedHMYDh+Owvp2y+MRy9vO9IQdmdjEC?= =?us-ascii?Q?3X/iHxYZOQDx8bRrqqYmbn1ToQ5bL7B1CTrKBXuiqBdz3YDk7kEN7yCGT075?= =?us-ascii?Q?HZ7J0R8VfBt1vu1hOGBFb5NMEgC9tnEyIxgrUxxvYYo=3D?= 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: BYAPR11MB3301.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfe211b2-afe5-43e8-3df6-08d8a67a31f9 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Dec 2020 13:05:02.6164 (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: ESkRWtYOehQ4+9eAVSrhfPE0BtWm0o9VetXxMv5Q/dnu1bwbixpNRkGZNQhdGBh+d6TcjE6yKYi9D6QLr8rxWo1jRA1o0Xc8GiBxK4zPpis= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4228 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 5/5] librte_ethdev: add to use apistats 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > Hello, >=20 > Thanks for your comments. > Please see my comments inline tagged with [HY]. >=20 > > Hi, > > > > > > > > This patch modifies to use apistats by librte_ethdev. > > > > > > Signed-off-by: Hideyuki Yamashita > > > --- > > > lib/librte_ethdev/meson.build | 6 ++- > > > lib/librte_ethdev/rte_apistats.c | 64 ++++++++++++++++++++++++++++++= ++ > > > lib/librte_ethdev/rte_apistats.h | 64 ++++++++++++++++++++++++++++++= ++ > > > lib/librte_ethdev/rte_ethdev.h | 7 ++++ > > > lib/librte_ethdev/version.map | 5 +++ > > > 5 files changed, 144 insertions(+), 2 deletions(-) > > > create mode 100644 lib/librte_ethdev/rte_apistats.c > > > create mode 100644 lib/librte_ethdev/rte_apistats.h > > > > > > diff --git a/lib/librte_ethdev/meson.build b/lib/librte_ethdev/meson.= build > > > index e4b6102..d03e784 100644 > > > --- a/lib/librte_ethdev/meson.build > > > +++ b/lib/librte_ethdev/meson.build > > > @@ -8,7 +8,8 @@ sources =3D files('ethdev_private.c', > > > 'rte_ethdev.c', > > > 'rte_flow.c', > > > 'rte_mtr.c', > > > - 'rte_tm.c') > > > + 'rte_tm.c' , > > > + 'rte_apistats.c') > > > > > > headers =3D files('rte_ethdev.h', > > > 'rte_ethdev_driver.h', > > > @@ -24,6 +25,7 @@ headers =3D files('rte_ethdev.h', > > > 'rte_mtr.h', > > > 'rte_mtr_driver.h', > > > 'rte_tm.h', > > > - 'rte_tm_driver.h') > > > + 'rte_tm_driver.h', > > > + 'rte_apistats.h') > > > > > > deps +=3D ['net', 'kvargs', 'meter', 'telemetry'] > > > diff --git a/lib/librte_ethdev/rte_apistats.c b/lib/librte_ethdev/rte= _apistats.c > > > new file mode 100644 > > > index 0000000..c4bde34 > > > --- /dev/null > > > +++ b/lib/librte_ethdev/rte_apistats.c > > > @@ -0,0 +1,64 @@ > > > +/* SPDX-License-Identifier: BSD-3-Clause > > > + * Copyright(c) 2019 NTT TechnoCross Corporation > > > + */ > > > + > > > + > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +#include "rte_apistats.h" > > > + > > > +/* Macros for printing using RTE_LOG */ > > > +#define RTE_LOGTYPE_APISTATS RTE_LOGTYPE_USER1 > > > + > > > +#define MZ_APISTATS "rte_apistats" > > > + > > > +struct rte_apistats *rte_apicounts; > > > + > > > +int rte_apistats_init(void) > > > +{ > > > + int i; > > > + const struct rte_memzone *mz =3D NULL; > > > + const unsigned int flags =3D 0; > > > + > > > + /** Allocate stats in shared memory fo multi process support */ > > > + if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) { > > > + mz =3D rte_memzone_lookup(MZ_APISTATS); > > > + if (mz =3D=3D NULL) { > > > + RTE_LOG(ERR, APISTATS, "Cannot get info structure\n"); > > > + return -1; > > > + } > > > + rte_apicounts =3D mz->addr; > > > + } else { > > > + /* RTE_PROC_PRIMARY */ > > > + mz =3D rte_memzone_reserve(MZ_APISTATS, sizeof(*rte_apicounts), > > > + rte_socket_id(), flags); > > > + if (mz =3D=3D NULL) { > > > + RTE_LOG(ERR, APISTATS, "Cannot reserve memory zone\n"); > > > + return -ENOMEM; > > > + } > > > + rte_apicounts =3D mz->addr; > > > + memset(rte_apicounts, 0, sizeof(*rte_apicounts)); > > > + } > > > + > > > + /* set up array for data */ > > > + RTE_LCORE_FOREACH(i) { > > > + rte_apicounts->lcoreid_list[i] =3D 1; > > > + RTE_LOG(INFO, APISTATS, "Enable core usage for lcore %u\n", i); > > > + } > > > + return 0; > > > +} > > > + > > > +int rte_apistats_uninit(void) > > > +{ > > > + const struct rte_memzone *mz =3D NULL; > > > + /* free up the memzone */ > > > + mz =3D rte_memzone_lookup(MZ_APISTATS); > > > + if (mz) > > > + rte_memzone_free(mz); > > > + return 0; > > > +} > > > diff --git a/lib/librte_ethdev/rte_apistats.h b/lib/librte_ethdev/rte= _apistats.h > > > new file mode 100644 > > > index 0000000..afea50e > > > --- /dev/null > > > +++ b/lib/librte_ethdev/rte_apistats.h > > > @@ -0,0 +1,64 @@ > > > +/* SPDX-License-Identifier: BSD-3-Clause > > > + * Copyright(c) 2019 NTT TechnoCross Corporation > > > + */ > > > + > > > +#ifndef _RTE_APISTATS_H_ > > > +#define _RTE_APISTATS_H_ > > > + > > > +/** > > > + * @file > > > + * RTE apistats > > > + * > > > + * library to provide rte_rx_burst/tx_burst api stats. > > > + */ > > > + > > > + > > > +#ifdef __cplusplus > > > +extern "C" { > > > +#endif > > > + > > > +#include > > > +#include > > > + > > > +/** > > > + * A structure for rte_rx_burst/tx_burst api statistics. > > > + */ > > > +struct rte_apistats { > > > + int lcoreid_list[RTE_MAX_LCORE]; /**< In use lcoreid list */ > > > + /**< Total rte_rx_burst call counts */ > > > + uint64_t rx_burst_counts[RTE_MAX_LCORE]; > > > + > > > + /**< Total rte_tx_burst call counts */ > > > + uint64_t tx_burst_counts[RTE_MAX_LCORE]; > > > +}; > > > + > > > +extern struct rte_apistats *rte_apicounts; > > > + > > > +/** > > > + * Initialize rte_rx_burst/tx_burst call count area. > > > + * @b EXPERIMENTAL: this API may change without prior notice. > > > + * > > > + * @return > > > + * -1 : On error > > > + * -ENOMEM: On error > > > + * 0 : On success > > > + */ > > > +__rte_experimental > > > +int rte_apistats_init(void); > > > + > > > +/** > > > + * Clean up and free memory. > > > + * @b EXPERIMENTAL: this API may change without prior notice. > > > + * > > > + * @return > > > + * -1: On error > > > + * 0: On success > > > + */ > > > +__rte_experimental > > > +int rte_apistats_uninit(void); > > > + > > > +#ifdef __cplusplus > > > +} > > > +#endif > > > + > > > +#endif /* _RTE_APISTATS_H_ */ > > > diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_e= thdev.h > > > index f5f8919..bef9bc6 100644 > > > --- a/lib/librte_ethdev/rte_ethdev.h > > > +++ b/lib/librte_ethdev/rte_ethdev.h > > > @@ -160,6 +160,7 @@ extern "C" { > > > > > > #include "rte_ethdev_trace_fp.h" > > > #include "rte_dev_info.h" > > > +#include > > > > > > extern int rte_eth_dev_logtype; > > > > > > @@ -4849,6 +4850,9 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t que= ue_id, > > > nb_rx =3D (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id], > > > rx_pkts, nb_pkts); > > > > > > + int lcore_id =3D rte_lcore_id(); > > > + rte_apicounts->rx_burst_counts[lcore_id]++; > > > > There are few problems with current implementation: > > 1. rx_burst() can be called by non-EAL thread (rte_lcore_id() =3D=3D -= 1) > > In that case it would cause a crash. > [HY] > Thanks for your info. > I think by adding code like following. >=20 > if(rte_lcore_id() =3D -1){ > return > } That's not a good idea, as it would break existing functionality. =20 >=20 > > 2. Because of the layout of struct rte_apistats it would cause signific= ant > > performance degradation (false cache-lines sharing). > [HY] > I think you are correct. > This affects change in core 1 to all other cores > even thogh change in core 1 does NOT affect other cores. >=20 > Root cause is using array like [RTE_MAX_LCORE], correct? Yes, you have several arrays in which each elem used by different thread, but these elems share the same cache-line. > I will change it in revised patcheset. >=20 > +struct rte_apistats { > + int lcoreid_list[RTE_MAX_LCORE]; /**< In use lcoreid list = */ > + /**< Total rte_rx_burst call counts */ > + uint64_t rx_burst_counts[RTE_MAX_LCORE]; > + > + /**< Total rte_tx_burst call counts */ > + uint64_t tx_burst_counts[RTE_MAX_LCORE]; > +}; >=20 >=20 > > As a generic one: such sort of statistics can be easily collected by th= e app itself. > > Either by just incrementing counters before rx/tx_burst function call d= irectly or > > via rx/tx callbacks. > > So I don't see any point to push it inside ethdev layer. > > Konstantin > [HY] > You are correct. > Application can do it. > But if applications want to do it, then every applicaiton needs > to do it. Not *every* application needs that sort of stats. Some can happily exist without it, while others might want to collect something more sophisticated. Let say not only for per lcore_id, but also per lcore+port_id, or lcore+port_id+queue_id, or ... It is not possible to predict all combinations here. If we'll allow people to add into rx_burst() every stats their apps need, very soon rx_burst() will become slow and umnaintenable.=20 > The reason why I propose my patchset is to provide such > common function (count invocation of rx_burst/tx_burst) > so that application only needs to "retrieve the information". > > I think it is benefitical than all application do similar thing. If you have several apps that do need that sort of app, then there is at least two easy ways to achieve that: 1. have a common wrapper function around rx_burst(), that would do rx_burst() plus stats collection. Then use this wrapper function inside your apps. 2. If you want it to be totally 'transparent' to the app: create/install an rx callback function that would do such stats collection= . =20 > Your feedback is highly appreciated. >=20 > Thanks! > BR, > Hideyuki Yamashita > NTT TechnoCross >=20 > > > #ifdef RTE_ETHDEV_RXTX_CALLBACKS > > > struct rte_eth_rxtx_callback *cb; > > > > > > @@ -5124,6 +5128,9 @@ rte_eth_tx_burst(uint16_t port_id, uint16_t que= ue_id, > > > } > > > #endif > > > > > > + int lcore_id =3D rte_lcore_id(); > > > + rte_apicounts->tx_burst_counts[lcore_id]++; > > > #ifdef RTE_ETHDEV_RXTX_CALLBACKS > > > struct rte_eth_rxtx_callback *cb; > > > > > > diff --git a/lib/librte_ethdev/version.map b/lib/librte_ethdev/versio= n.map > > > index d3f5410..adea432 100644 > > > --- a/lib/librte_ethdev/version.map > > > +++ b/lib/librte_ethdev/version.map > > > @@ -240,6 +240,11 @@ EXPERIMENTAL { > > > rte_flow_get_restore_info; > > > rte_flow_tunnel_action_decap_release; > > > rte_flow_tunnel_item_release; > > > + > > > + # added in 21.02 > > > + rte_apistats_init; > > > + rte_apistats_uninit; > > > + rte_apicounts; > > > }; > > > > > > INTERNAL { > > > -- > > > 2.18.0 >=20