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 91E5DA0C4D; Wed, 13 Oct 2021 10:15:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B8CE4117E; Wed, 13 Oct 2021 10:15:59 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 1A61041162 for ; Wed, 13 Oct 2021 10:15:56 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10135"; a="214321417" X-IronPort-AV: E=Sophos;i="5.85,370,1624345200"; d="scan'208";a="214321417" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2021 01:15:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,370,1624345200"; d="scan'208";a="626248692" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 13 Oct 2021 01:15:55 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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.2242.12; Wed, 13 Oct 2021 01:15:55 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) 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.2242.12; Wed, 13 Oct 2021 01:15:55 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.2242.12 via Frontend Transport; Wed, 13 Oct 2021 01:15:55 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 13 Oct 2021 01:15:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PdBMzY1pL1trsoiFmm9uFCsvYGWeNpCULUVHDAzIvDclKicDj9RCuW+XRqxG6AOcp7cYkaVEQD2gkyAE4M3mUHJ7LpohbZ0PmOUvsTdzhC2eAIPxmXsGJZZYPZNwY6cjwH5txIwslHHVQZVDZaKs8BRYTvR4KY6cIaVRw5LIi1RHygbSTtTJJs8Sk1+cT2KnNGFar1OKZs+8U3AhqCpAa+dS8TY4/uHOsAZDDdl0s08J9uRmx93YZQkZ8EDXqfNWPdq9GcFGjcldZFBxA8JDCgXCgV/06AQluojuqrvprfrBso6hci4gnKXONVJ7ywma2GYqZ6PZlqAWPbb7HmJQ4Q== 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=Pvndtfe9kwyoWdQ0EO7hZ4dPZMy+XGxYXvZKbZeXMnY=; b=ahtHRjCYD68sLJ1KopQRNTc55jC593FKjz09LkB0zHSUIfQUnTR9/gJDtMHq+lzEDAGGx5ki9P+ItSMnepZf4C+2RkNKSTJWEeYGzkEVQ1dTB5UJHXoMU5Z+V09KZ5fy8a0KIsX7NzPinMoC/cDSSs3OoLG7KjBpjAlZAEca+w4I9yi0kheKex7ByNWTq+0F2Go936Io2s6/qkvt3yoH+ZuV5WOWqug0UCR1lJN0SngMs6bySHqT364XzPryZQAUzdIQ7NPyTQ5Bn4K2+e4/N166kkuvtKX/sIi/7zWDm6vmGXx+vAosCYPMI1Ykeq0v1IX1TmMXc3ke30hughtPdA== 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=Pvndtfe9kwyoWdQ0EO7hZ4dPZMy+XGxYXvZKbZeXMnY=; b=aTzcO5JlRe7yEB+skGUewqjYnauN6nlUpvQXpsNx/Vqbsy4lPdjem7PJqT3uu1fxIEqp0qFUJcjxJhMse8lNy20cM5UMi/vIDQ69HdJV8yIAuL2im7FN7MuvbmfB5PMVpY6RWEckIZWLXFYBkdgZ4eidXQvNnjXRIkTbbziy8O4= Received: from CO1PR11MB4882.namprd11.prod.outlook.com (2603:10b6:303:97::8) by CO1PR11MB5044.namprd11.prod.outlook.com (2603:10b6:303:92::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Wed, 13 Oct 2021 08:15:54 +0000 Received: from CO1PR11MB4882.namprd11.prod.outlook.com ([fe80::2df9:a342:1f49:6260]) by CO1PR11MB4882.namprd11.prod.outlook.com ([fe80::2df9:a342:1f49:6260%7]) with mapi id 15.20.4608.016; Wed, 13 Oct 2021 08:15:54 +0000 From: "Kundapura, Ganapati" To: "Naga Harish K, S V" , "Jayatheerthan, Jay" , "jerinjacobk@gmail.com" , "dev@dpdk.org" CC: "Kinsella, Ray" , Thomas Monjalon , David Marchand Thread-Topic: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks Thread-Index: AQHXv2pYRrzdauKWh0SsBMnnkH5GvKvPZbKAgAAgGfCAAPgIAIAAGD+w Date: Wed, 13 Oct 2021 08:15:53 +0000 Message-ID: References: <20211007134607.2351243-1-ganapati.kundapura@intel.com> <20211012102526.361419-1-ganapati.kundapura@intel.com> In-Reply-To: Accept-Language: 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.6.200.16 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2449f79d-8b89-4b53-544c-08d98e21ad47 x-ms-traffictypediagnostic: CO1PR11MB5044: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:334; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: y6/ACiciD2cbf+ij1z5BGICX4NCjxh+6kuwe/e3KdKSPZjne3lrBGoL0W1BF9xVwXV91YCYerJyZyQcfWNMl/s8423PByXAOuyiKcl7G9NyYVTZV/MbCgQNC+/dfHOFubzRg7tVNltBJh/DAJVctGrot+JF94qpvUJZHtA3diqTtuZ6emfIBij/uyAq43qzVY/MWTl/yuoVp4OZqw5oml2PvuIO/3NmcXSieLMsLa6eqrUnyXCFy/R7ekxiriGImKbhEcbYXMbhZesShP2X7ZgUOjKyMbl+i/yfoNBTIJpOebu2H3RUnxyFluYlXu/Q0jEjf2kNC4RGMiTduaNZTDR9RTDO2BCxflrVGUr5CfKHQpoOW1Wi96GyQ5sLQXn0iWFSCDQ8TYKBTkexSqF0nb6zATjB/9+au23RTxFChJpEgpy8fqSiSMS23xMlLgZBNgD9Eh9VvhfRR7akLt0aO3nNyI8Byqzsyl0Knu8q5Lisg2iw4VYWc9eV2A2SoOEQPySf36TvAucYnG/cfP+O3QA70SYdUH7f75inJgxS5UPSY6L8P2vYCBhcokujnZhOQHbazYoAYbEl+rO/GZF5gEYcO2TRRYGxZKJ/DVee2CPiWB6w5Vu+2XNxe5FNvwyWdHvNrgyEkmDsEPW8Je0lb+CTcdp4GQdLMaujImP4qZSYmjGT0e3tp0TYrqcyXmpV9sARR/beHjAxszzmzWFJwMg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB4882.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(5660300002)(4326008)(7696005)(82960400001)(122000001)(38100700002)(86362001)(508600001)(53546011)(9686003)(110136005)(52536014)(54906003)(6506007)(55016002)(316002)(38070700005)(76116006)(33656002)(2906002)(30864003)(8936002)(8676002)(71200400001)(66446008)(64756008)(66476007)(26005)(66946007)(83380400001)(66556008)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?V1TacW5OHdx87x4p1vsmcchUuII4F4k28fib4P8TnvKKtRFD0brxNHfeOud4?= =?us-ascii?Q?mupucYFkzHxwGLqTQlyapvCEg3cbzXGYkDhnQgfAaYnxcJEIkh73fD7SR24x?= =?us-ascii?Q?4/2mabJL0RO7wfp1b9wN3BcLHprn5IGAIBiomxTPKKmqGZaG8lRlG01J2S25?= =?us-ascii?Q?uxnyqTTFL2bG3qRsGNt7GE6yG9eJAp4GYNPuB+ZJx56UEsKVI52INbVoTALo?= =?us-ascii?Q?QOV4O4dAV6seiNdw0OKUqDuiP6cWnBGuggVNVfaYluavLDI3hCc8sOCoro2/?= =?us-ascii?Q?Cjau4H2WfnQLGwt5+lJMtHgiudsW7sDo1EFfCJ6zYnGBMscbiGmOg2/7QpJQ?= =?us-ascii?Q?Ewa6YwaWuT2oCFIfUiGe6z99Jm9uM9tUP941Sz/mqkFstiopu9d1xSkhnWLK?= =?us-ascii?Q?iWK9nS1BbI7ugwgu2SO90PiDBZ9ZAvK/Y7M5THhI0SAxyG6z0MnIIgmkkNPh?= =?us-ascii?Q?viVdXL5ZXxqaoU1qmNX3Dy5Dw+jnFSl0d23w8PNsbqxITyApozSrdzK3X6cC?= =?us-ascii?Q?QcG3xebcYh28djG51CemKnQ/JznywQZsNCRTbzRYsvQM6gdHI+8YpbKCaA4O?= =?us-ascii?Q?/BVyhwDyMkLcDBs2H+p7JsFRy6s4Sw58ddrUElPQ+SYkInSUcrVDkL6KBWOH?= =?us-ascii?Q?u1Ome4tmhjfE16urjx0ZZyNhIYf1l1M3vGA+nppQNPtwEtsM7YNfP7R8AFhp?= =?us-ascii?Q?4Je/E9ZNzXhOe4DXcPmdPREfowjP7Id/YvDjfJ3tXcVOOp80yE8pxU1kfRdZ?= =?us-ascii?Q?uQyGg1BrE6fNeFmKd+P4kO7VxVYhfOCMGf5MOzz4ZTKQHJfR0up008bOP0QI?= =?us-ascii?Q?Ob/PpLP3LCinZDOhmTqpAPWXxehvwRy9jd4J+p6pGn1NhBkZfWPvQnO8dgh2?= =?us-ascii?Q?Pqkl9w2afTHfjM0wKoag0evLdWZjbeybqqUzUsBH5t46KnjvgAVp4zxV5b1H?= =?us-ascii?Q?ybyJo62M6emCwMj/jLrEqq3+XpRoEdBjYqmDz8K5eoVbebfeg03yO11ZOW2P?= =?us-ascii?Q?2wzxP9uTq5QZ40tFWcaaoNLXtf8kyqco50LX/zW9oh+q5jZdblDbg9FwDOvf?= =?us-ascii?Q?6HKH4PY//ajoC2NW0del1RniLpIRABnvFrEayE71CW/4CVi2/vTPIfdBfNrd?= =?us-ascii?Q?6L1WeqAKa4ryPGzxs3UN9Vshu5DixlPya2eQXGW/26xeogqFyxcZ55wAuCtH?= =?us-ascii?Q?I+JCasqlIaMzo7cZaeK5S70Z84jh8631Ptbvr//Thd7K62G9nyF8XnncoGk4?= =?us-ascii?Q?zZU/L6qA8CSDUWo0oUK851NAgAfikm7tVd33GHeDjvBcTSEL4MbR5MOyMXJr?= =?us-ascii?Q?gU06uxGDBv5bZB/EYq9P4yMj?= 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: CO1PR11MB4882.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2449f79d-8b89-4b53-544c-08d98e21ad47 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Oct 2021 08:15:54.0320 (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: aKD+c12hPfwW0vODp7fHwp9r5VlV9nb/aR4miq9DMPAyHQ21tVZVKdXkZziIKt+WX4bd4qLzb3HRzJcZsWj/fg4nXgKca2NZmQ3/BdWouns= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5044 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add telemetry callbacks 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 Sender: "dev" Hi Harish, > -----Original Message----- > From: Naga Harish K, S V > Sent: 13 October 2021 12:18 > To: Kundapura, Ganapati ; Jayatheerthan, Ja= y > ; jerinjacobk@gmail.com; dev@dpdk.org > Cc: Kinsella, Ray ; Thomas Monjalon > ; David Marchand > Subject: RE: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks >=20 >=20 >=20 > > -----Original Message----- > > From: Kundapura, Ganapati > > Sent: Tuesday, October 12, 2021 9:44 PM > > To: Naga Harish K, S V ; Jayatheerthan, > > Jay ; jerinjacobk@gmail.com; dev@dpdk.org > > Cc: Kinsella, Ray ; Thomas Monjalon > > ; David Marchand > > Subject: RE: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > Hi Harish, > > > > > -----Original Message----- > > > From: Naga Harish K, S V > > > Sent: 12 October 2021 19:36 > > > To: Jayatheerthan, Jay ; Kundapura, > > > Ganapati ; jerinjacobk@gmail.com; > > > dev@dpdk.org > > > Cc: Kinsella, Ray ; Thomas Monjalon > > > ; David Marchand > > > > > Subject: RE: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > > > > > > > > > > -----Original Message----- > > > > From: dev On Behalf Of Jayatheerthan, Jay > > > > Sent: Tuesday, October 12, 2021 6:39 PM > > > > To: Kundapura, Ganapati ; > > > > jerinjacobk@gmail.com; dev@dpdk.org > > > > Cc: Kinsella, Ray ; Thomas Monjalon > > > > ; David Marchand > > > > > > Subject: Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add > > > > telemetry callbacks > > > > > > > > Acked by: Jay Jayatheerthan > > > > > > > > + @Ray Kinsella @Thomas Monjalon @David Marchand > > > > > > > > > -----Original Message----- > > > > > From: Kundapura, Ganapati > > > > > Sent: Tuesday, October 12, 2021 3:55 PM > > > > > To: jerinjacobk@gmail.com; dev@dpdk.org > > > > > Cc: Jayatheerthan, Jay > > > > > Subject: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > > > > > > > Added telemetry callbacks to get Rx adapter stats, reset stats > > > > > and to get Rx queue config information. > > > > > > > > > > Signed-off-by: Ganapati Kundapura > > > > > --- > > > > > v3: > > > > > * Updated release notes > > > > > * Addressed review comments > > > > > > > > > > v2: > > > > > * Fixed checkpatch warning > > > > > --- > > > > > > > > > > diff --git a/doc/guides/rel_notes/release_21_11.rst > > > > > b/doc/guides/rel_notes/release_21_11.rst > > > > > index dfc2cbd..9955e52 100644 > > > > > --- a/doc/guides/rel_notes/release_21_11.rst > > > > > +++ b/doc/guides/rel_notes/release_21_11.rst > > > > > @@ -130,6 +130,10 @@ New Features > > > > > * Added tests to validate packets hard expiry. > > > > > * Added tests to verify tunnel header verification in IPsec in= bound. > > > > > > > > > > +* **Updated rte_event_eth_rx_adapter_stats structure > > > > > + * Added 'uint64_t rx_event_buf_count' > > > > > + * Added 'uint64_t rx_event_buf_size' > > > > > + > > > > > > > > > > Removed Items > > > > > ------------- > > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c > > > > > b/lib/eventdev/rte_event_eth_rx_adapter.c > > > > > index 9ac976c..7e3bf62 100644 > > > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > > > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > > > > > @@ -18,6 +18,7 @@ > > > > > #include > > > > > #include > > > > > #include > > > > > +#include > > > > > > > > > > #include "rte_eventdev.h" > > > > > #include "eventdev_pmd.h" > > > > > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t > > id, > > > > > struct rte_event_eth_rx_adapter_stats *stats) { > > > > > struct rte_event_eth_rx_adapter *rx_adapter; > > > > > + struct rte_eth_event_enqueue_buffer *buf; > > > > > struct rte_event_eth_rx_adapter_stats dev_stats_sum =3D { 0 }; > > > > > struct rte_event_eth_rx_adapter_stats dev_stats; > > > > > struct rte_eventdev *dev; > > > > > @@ -2887,8 +2889,11 @@ > > rte_event_eth_rx_adapter_stats_get(uint8_t > > > > id, > > > > > if (rx_adapter->service_inited) > > > > > *stats =3D rx_adapter->stats; > > > > > > > > > > + buf =3D &rx_adapter->event_enqueue_buffer; > > > > > stats->rx_packets +=3D dev_stats_sum.rx_packets; > > > > > stats->rx_enq_count +=3D dev_stats_sum.rx_enq_count; > > > > > + stats->rx_event_buf_count =3D buf->count; > > > > > > When per Rx queue event buffer is used, there is a possibility of > > > segfault here Because of null pointer deference. > > > > > Queue_id is not passed to rte_event_eth_rx_adapter_stats_get() and > > there's no way to retrieve the queue id to return the queue's event > > buffer size and count. We may need to loop through all the queue's in > > the adapter which requires changes in rte_event_eth_rx_adapter_stats > > structure to hold event buffer size and count for all the queues. > > > > Alternatively stats_get() can return event buffer size and count only > > if use_queue_event_buf =3D false i.e only for adapter wide event buffer= . > > >=20 > This approach looks ok. When use_queue_event_buf =3D true, buffer size an= d > count Can be returned as zero. >=20 Posted new patch with the suggested changes. > > Do we need event buffer size and count in Rx adapter stats? > > > > > > > + stats->rx_event_buf_size =3D buf->events_size; > > > > > > > > > > return 0; > > > > > } > > > > > @@ -3052,3 +3057,146 @@ > > > > > rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > > > > > > > > > > return 0; > > > > > } > > > > > + > > > > > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, > > > > > +stats.s) > > > > > + > > > > > +static int > > > > > +handle_rxa_stats(const char *cmd __rte_unused, > > > > > + const char *params, > > > > > + struct rte_tel_data *d) > > > > > +{ > > > > > + uint8_t rx_adapter_id; > > > > > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > > > > > + > > > > > + if (params =3D=3D NULL || strlen(params) =3D=3D 0 || !isdigit(*= params)) > > > > > + return -1; > > > > > + > > > > > + /* Get Rx adapter ID from parameter string */ > > > > > + rx_adapter_id =3D atoi(params); > > > > > + > > > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > > > _id, > > > > > +-EINVAL); > > > > > + > > > > > + /* Get Rx adapter stats */ > > > > > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > > > > > + &rx_adptr_stats)) { > > > > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter > stats\n"); > > > > > + return -1; > > > > > + } > > > > > + > > > > > + rte_tel_data_start_dict(d); > > > > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > > > > > + > > > > > + return 0; > > > > > +} > > > > > + > > > > > +static int > > > > > +handle_rxa_stats_reset(const char *cmd __rte_unused, > > > > > + const char *params, > > > > > + struct rte_tel_data *d __rte_unused) { > > > > > + uint8_t rx_adapter_id; > > > > > + > > > > > + if (params =3D=3D NULL || strlen(params) =3D=3D 0 || ~isdigit(*= params)) > > > > > + return -1; > > > > > + > > > > > + /* Get Rx adapter ID from parameter string */ > > > > > + rx_adapter_id =3D atoi(params); > > > > > + > > > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > > > _id, > > > > > +-EINVAL); > > > > > + > > > > > + /* Reset Rx adapter stats */ > > > > > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > > > > > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter > stats\n"); > > > > > + return -1; > > > > > + } > > > > > + > > > > > + return 0; > > > > > +} > > > > > + > > > > > +static int > > > > > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > > > > > + const char *params, > > > > > + struct rte_tel_data *d) > > > > > +{ > > > > > + uint8_t rx_adapter_id; > > > > > + uint16_t rx_queue_id; > > > > > + int eth_dev_id; > > > > > + char *token, *l_params; > > > > > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > > > > > + > > > > > + if (params =3D=3D NULL || strlen(params) =3D=3D 0 || !isdigit(*= params)) > > > > > + return -1; > > > > > + > > > > > + /* Get Rx adapter ID from parameter string */ > > > > > + l_params =3D strdup(params); > > > > > + token =3D strtok(l_params, ","); > > > > > + rx_adapter_id =3D strtoul(token, NULL, 10); > > > > > + > > > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > > > _id, > > > > > +-EINVAL); > > > > > + > > > > > + token =3D strtok(NULL, ","); > > > > > + if (token =3D=3D NULL || strlen(token) =3D=3D 0 || !isdigit(*to= ken)) > > > > > + return -1; > > > > > + > > > > > + /* Get device ID from parameter string */ > > > > > + eth_dev_id =3D strtoul(token, NULL, 10); > > > > > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, - > EINVAL); > > > > > + > > > > > + token =3D strtok(NULL, ","); > > > > > + if (token =3D=3D NULL || strlen(token) =3D=3D 0 || !isdigit(*to= ken)) > > > > > + return -1; > > > > > + > > > > > + /* Get Rx queue ID from parameter string */ > > > > > + rx_queue_id =3D strtoul(token, NULL, 10); > > > > > + if (rx_queue_id >=3D rte_eth_devices[eth_dev_id].data- > > > > >nb_rx_queues) { > > > > > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", > > > > rx_queue_id); > > > > > + return -EINVAL; > > > > > + } > > > > > + > > > > > + token =3D strtok(NULL, "\0"); > > > > > + if (token !=3D NULL) > > > > > + RTE_EDEV_LOG_ERR("Extra parameters passed to > eventdev" > > > > > + " telemetry command, igrnoring"); > > > > > + > > > > > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, > > > > eth_dev_id, > > > > > + rx_queue_id, > > > > &queue_conf)) { > > > > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue > > > > config"); > > > > > + return -1; > > > > > + } > > > > > + > > > > > + rte_tel_data_start_dict(d); > > > > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > > > > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > > > > > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > > > > > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > > > > > + RXA_ADD_DICT(queue_conf, servicing_weight); > > > > > + RXA_ADD_DICT(queue_conf.ev, queue_id); > > > > > + RXA_ADD_DICT(queue_conf.ev, sched_type); > > > > > + RXA_ADD_DICT(queue_conf.ev, priority); > > > > > + RXA_ADD_DICT(queue_conf.ev, flow_id); > > > > > + > > > > > + return 0; > > > > > +} > > > > > + > > > > > +RTE_INIT(rxa_init_telemetry) > > > > > +{ > > > > > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > > > > > + handle_rxa_stats, > > > > > + "Returns Rx adapter stats. Parameter: rxa_id"); > > > > > + > > > > > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > > > > > + handle_rxa_stats_reset, > > > > > + "Reset Rx adapter stats. Parameter: rxa_id"); > > > > > + > > > > > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > > > > > + handle_rxa_get_queue_conf, > > > > > + "Returns Rx queue config. Parameter: rxa_id, dev_id, > > > > queue_id"); } > > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > > > > > b/lib/eventdev/rte_event_eth_rx_adapter.h > > > > > index 70ca427..c4257e7 100644 > > > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > > > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > > > > > @@ -232,6 +232,10 @@ struct rte_event_eth_rx_adapter_stats { > > > > > */ > > > > > uint64_t rx_intr_packets; > > > > > /**< Received packet count for interrupt mode Rx queues */ > > > > > + uint64_t rx_event_buf_count; > > > > > + /**< Rx event buffered count */ > > > > > + uint64_t rx_event_buf_size; > > > > > + /**< Rx event buffer size */ > > > > > }; > > > > > > > > > > /** > > > > > -- > > > > > 2.6.4