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 598E4459C6; Thu, 19 Sep 2024 00:39:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1049E40156; Thu, 19 Sep 2024 00:38:59 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by mails.dpdk.org (Postfix) with ESMTP id DF9744003C for ; Thu, 19 Sep 2024 00:38:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726699137; x=1758235137; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=8cc4+7gJs/r6J9Y4rd7MyN5NZUuC+90u2iSjF0u9nOQ=; b=WhwHfg6ULIJjDON8ZqSXPp95e/sLJ9P/8FsX3s/sWMIIXhnaND/CIq2r TBTLfc35e+PSr0faqhBQNRt76672qn2udOgvUGEGhAiGB+JrsoMbq9nGt h+Rzx1+SHmEwaveem2uTSnYy99IgCAUvVhh858FKkpIJ9FmFD0FCqELW6 VzpJLn3uMwGoXBPqrHCxkRfPMMme33ETLgepTbCLjfxCe3pJI/kW2MZOf 5awn0vUwC3BmVuciC1+HDekU5mLUyswJ2I2GeAu50g8/lIG55DS/YsHim we3z9az483HG/d4L+xf7VyQpWkq3TjWZvquP3q2sBaSIQkF1Y9pVxvpFt Q==; X-CSE-ConnectionGUID: FrURqec8Tse6FGeoo0lnWA== X-CSE-MsgGUID: 8Li6oO4jRlyNRIpFyRG19Q== X-IronPort-AV: E=McAfee;i="6700,10204,11199"; a="29534529" X-IronPort-AV: E=Sophos;i="6.10,240,1719903600"; d="scan'208";a="29534529" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2024 15:38:56 -0700 X-CSE-ConnectionGUID: ckV/w7vyTri/f2CaDNw7eQ== X-CSE-MsgGUID: uuH7nwaIRkSntxFcQqcD8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,240,1719903600"; d="scan'208";a="69326707" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmviesa006.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 18 Sep 2024 15:38:55 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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; Wed, 18 Sep 2024 15:38:55 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.2507.39; Wed, 18 Sep 2024 15:38:54 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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; Wed, 18 Sep 2024 15:38:54 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.170) 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.2507.39; Wed, 18 Sep 2024 15:38:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ks4mcwl7CwHoHvgX6fvuIym7hONg98aXEB8XLFjOVeWDFT9mV+a2QtbI12T8v1JOsSf2IAlIQcWwpwXegptxoj/rDJ9Yxzbca+r9aiymf4irjfq7StOG5EejbP6YI8zopgle2ZJREBl7VkLl1fTutNAKFk51sAqEezQ/VHmE1BIQ8IqzyhWiHZBEFqhv/FIBaoSyW1QOvmG9IjC7a5LLQ8jCqhy+/3NJhpoAJXjBAGvaLmHxzeM8Dgo2afsgzICHjD2biPhdYPbYDIG5r8Tb5vTSaDnEVoit82EhCAxojM5JXikCDGh1SB9Ce6+GhZNCNCSjfnblC8VTf+iQIcD04Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=H1yyarZeTRm5CCL58v6LqnovvZqQeA9Es25DtoTXaCw=; b=qi82riRY9TH93Dm5ghJP0h4c5C+i5f3/vfwJn9eRSQVXccoIV/GM1OjS/yK2AB7R7GsnsP1t6MGwwnlXlwutvKSFCsDO/E5fD99HugAS85qiI8bzObAHiVAM4CpVJged2jo0HIaD6trLZUIO3zOl7F+lzB+0OROziVE5ix2zgBb6bcxJh+CKcbO71QzhozjXBxR8mq9uma+SYExDez+92md3Y182Jut+Sb79kE17d42PBAS95c7Uv/ye6Sx+WmShxMQFDzhb6X+8oSPJmxaA5HU5HWRCj9eMkLQ5D+CE7L1TMlJMQ82PYzwU3H/hNXT9AhwhSt0PcBidon0CdNZj+g== 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 BL1PR11MB5461.namprd11.prod.outlook.com (2603:10b6:208:30b::17) by LV8PR11MB8697.namprd11.prod.outlook.com (2603:10b6:408:1fe::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.16; Wed, 18 Sep 2024 22:38:51 +0000 Received: from BL1PR11MB5461.namprd11.prod.outlook.com ([fe80::8d83:7a30:43c4:835a]) by BL1PR11MB5461.namprd11.prod.outlook.com ([fe80::8d83:7a30:43c4:835a%7]) with mapi id 15.20.7962.022; Wed, 18 Sep 2024 22:38:51 +0000 From: "Pathak, Pravin" To: "pbhagavatula@marvell.com" , "jerinj@marvell.com" , "sthotton@marvell.com" , "Sevincer, Abdullah" , "hemant.agrawal@nxp.com" , "sachin.saxena@oss.nxp.com" , "Van Haaren, Harry" , "mattias.ronnblom@ericsson.com" , "liangma@liangbit.com" , "Mccarthy, Peter" CC: "dev@dpdk.org" Subject: RE: [PATCH v2 1/3] eventdev: introduce event pre-scheduling Thread-Topic: [PATCH v2 1/3] eventdev: introduce event pre-scheduling Thread-Index: AQHbCNDcT5AdjdUdJEysyuTDvRXJHLJeJMIw Date: Wed, 18 Sep 2024 22:38:51 +0000 Message-ID: References: <20240910083117.4281-1-pbhagavatula@marvell.com> <20240917071106.8815-1-pbhagavatula@marvell.com> <20240917071106.8815-2-pbhagavatula@marvell.com> In-Reply-To: <20240917071106.8815-2-pbhagavatula@marvell.com> Accept-Language: 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: BL1PR11MB5461:EE_|LV8PR11MB8697:EE_ x-ms-office365-filtering-correlation-id: 0d0aef70-9aec-4ac9-3883-08dcd832ab81 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018|921020; x-microsoft-antispam-message-info: =?us-ascii?Q?ovZS14hgHC4uGpex1mEB3eqF49Xnpfp+bIOSLEerUIiW0yd/VG01lGhfC56m?= =?us-ascii?Q?Rbgq9m2b/MhrqQMhw0qkui2FzNny2HnjBRjjTqaWROiPYeAnHVXMfiHjQ2Ue?= =?us-ascii?Q?2HX99s3Em82AiuNm0HDlTf8GnFKwPX3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Q?/cC1uG+CgKP4ktWE6uHF6nsTVJGab31+rZqiipNJGRcP66R4LwGQCAzkWbbZ?= =?us-ascii?Q?Se+VtnKmV7hpwRT9zdt6Ht5dytwXSwwywHg8FZSeSGL7R7isO1vm+UwJfJOk?= =?us-ascii?Q?Pik5LBt96aWqhjnmHUSNWQUq9XLylwAJrandaqBha4OEPNU/3WusTsKoeaL5?= =?us-ascii?Q?9T8mh9ddKliFWYIv7ehYjohUSu4ImifDQgFp1CSopeyjYeBNqw/ucsSQ/2IX?= =?us-ascii?Q?wr7/P7GjKTYbOIcmPm1Uf/PSW+V0XyUq2yZsaFHJ8fR3rwx2kAH4FshwNOQm?= =?us-ascii?Q?O2rgxw50sJxLVyINnxXpxL0MikgJ1tsUF9p96s4DEiZ9HdSi3I4qZA5jUxob?= =?us-ascii?Q?a3AZrwRgYrR6zUNbKpu4zzKz4h8GQcJaG9fewF56oetPt+Gt8ZP/6H4NX1CX?= =?us-ascii?Q?kdIXWyK5oiM=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL1PR11MB5461.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018)(921020); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?PoQzEaZ5cL4dUWFCX7Yb8c8JrZVNNEl5ru4zCjv5rd0pVDR8RFP/L4UYIBFu?= =?us-ascii?Q?AdH4Yg+AsbuPZS2IKNBaTX7g75eRk9wdQDsgsZt29S7FBzN8K5TRNHkjuR7R?= =?us-ascii?Q?wqtiBSy7CG3aUQmYoQxgFymZUZKfg2q0GKahgS1wdH+y6lrX4RxFjLihtQmi?= =?us-ascii?Q?USynh9Hg/h2rSBi8JE9eUmJOjDU3vj87V+xZbqPTs7rNIwlnf5ICx+nANVFS?= =?us-ascii?Q?xQ23DNzH5UZV3o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m?= =?us-ascii?Q?cV0spG/fwtSRcZHB2WCNLNXA/+XmokSbA30eHOvA7ajm2z+7cm7o/tqMYmEo?= =?us-ascii?Q?tSSr+tyePsXdxatcMH36O/0pjVQhuNkX5r6NJJmegif65Rg4CyxI1Rw7MiQH?= =?us-ascii?Q?dFt6d1j78V988M1bhvq/HkgMp48e6JaPNEGqgOgG1Zler9UQ72tNSYd1Pfk+?= =?us-ascii?Q?8UZFcpKxLeQdBlUOKViCKVXl1OmSyFy2L0FnnXa3QkqjNrFF5zl471fkZnP+?= =?us-ascii?Q?sBAZyJMc7qarRuszWrrbUdnlixwUN7KZtURzY66tsf6T2+Yc7wwItRQdLA3Z?= =?us-ascii?Q?WxyKCYQG5zw6W0WwLkvizcunAvLRy4/xDykk0URRl5nft5fDBpzcntFNbfH8?= =?us-ascii?Q?SfMKRljXPJB6A046/qNGCecyrReViqZN14U6nbqI5tyiAjoEJKv/4ENd3jL3?= =?us-ascii?Q?aOb1SnLwK5/pP4egLTK1fGWt5+68A3rTlJbnnvbR?= 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: BL1PR11MB5461.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d0aef70-9aec-4ac9-3883-08dcd832ab81 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Sep 2024 22:38:51.7055 (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: XwZX1Wg1Wy3tlFA89vKfGuvqECNFH3EPXz/kBQPUQb2niznGDZR68FO4urvDG6RPwrJhE+jNPbtEkMkB/Xag4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR11MB8697 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 > -----Original Message----- > From: pbhagavatula@marvell.com > Sent: Tuesday, September 17, 2024 3:11 AM > To: jerinj@marvell.com; sthotton@marvell.com; Sevincer, Abdullah > ; hemant.agrawal@nxp.com; > sachin.saxena@oss.nxp.com; Van Haaren, Harry = ; > mattias.ronnblom@ericsson.com; liangma@liangbit.com; Mccarthy, Peter > > Cc: dev@dpdk.org; Pavan Nikhilesh > Subject: [PATCH v2 1/3] eventdev: introduce event pre-scheduling >=20 > From: Pavan Nikhilesh >=20 > Event pre-scheduling improves scheduling performance by assigning events = to > event ports in advance when dequeues are issued. > The dequeue operation initiates the pre-schedule operation, which complet= es in > parallel without affecting the dequeued event flow contexts and dequeue > latency. >=20 Is the prescheduling done to get the event more quickly in the next dequeue= ? The first dequeue executes pre-schedule to make events available for the ne= xt dequeue. Is this how it is supposed to work? > Event devices can indicate pre-scheduling capabilities using > `RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE` and > `RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE` via the event device > info function `info.event_dev_cap`. >=20 > Applications can select the pre-schedule type and configure it through > `rte_event_dev_config.preschedule_type` during `rte_event_dev_configure`. >=20 > The supported pre-schedule types are: > * `RTE_EVENT_DEV_PRESCHEDULE_NONE` - No pre-scheduling. > * `RTE_EVENT_DEV_PRESCHEDULE` - Always issue a pre-schedule on dequeue. > * `RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE` - Delay issuing pre-schedule > until > there are no forward progress constraints with the held flow contexts. >=20 > Signed-off-by: Pavan Nikhilesh > --- > app/test/test_eventdev.c | 63 +++++++++++++++++++++ > doc/guides/prog_guide/eventdev/eventdev.rst | 22 +++++++ > lib/eventdev/rte_eventdev.h | 48 ++++++++++++++++ > 3 files changed, 133 insertions(+) >=20 > diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c index > e4e234dc98..cf496ee88d 100644 > --- a/app/test/test_eventdev.c > +++ b/app/test/test_eventdev.c > @@ -1250,6 +1250,67 @@ test_eventdev_profile_switch(void) > return TEST_SUCCESS; > } >=20 > +static int > +preschedule_test(rte_event_dev_preschedule_type_t preschedule_type, > +const char *preschedule_name) { > +#define NB_EVENTS 1024 > + uint64_t start, total; > + struct rte_event ev; > + int rc, cnt; > + > + ev.event_type =3D RTE_EVENT_TYPE_CPU; > + ev.queue_id =3D 0; > + ev.op =3D RTE_EVENT_OP_NEW; > + ev.u64 =3D 0xBADF00D0; > + > + for (cnt =3D 0; cnt < NB_EVENTS; cnt++) { > + ev.flow_id =3D cnt; > + rc =3D rte_event_enqueue_burst(TEST_DEV_ID, 0, &ev, 1); > + TEST_ASSERT(rc =3D=3D 1, "Failed to enqueue event"); > + } > + > + RTE_SET_USED(preschedule_type); > + total =3D 0; > + while (cnt) { > + start =3D rte_rdtsc_precise(); > + rc =3D rte_event_dequeue_burst(TEST_DEV_ID, 0, &ev, 1, 0); > + if (rc) { > + total +=3D rte_rdtsc_precise() - start; > + cnt--; > + } > + } > + printf("Preschedule type : %s, avg cycles %" PRIu64 "\n", > preschedule_name, > + total / NB_EVENTS); > + > + return TEST_SUCCESS; > +} > + > +static int > +test_eventdev_preschedule_configure(void) > +{ > + struct rte_event_dev_config dev_conf; > + struct rte_event_dev_info info; > + int rc; > + > + rte_event_dev_info_get(TEST_DEV_ID, &info); > + > + if ((info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE) > =3D=3D 0) > + return TEST_SKIPPED; > + > + devconf_set_default_sane_values(&dev_conf, &info); > + dev_conf.preschedule_type =3D RTE_EVENT_DEV_PRESCHEDULE; > + rc =3D rte_event_dev_configure(TEST_DEV_ID, &dev_conf); > + TEST_ASSERT_SUCCESS(rc, "Failed to configure eventdev"); > + > + rc =3D preschedule_test(RTE_EVENT_DEV_PRESCHEDULE_NONE, > "RTE_EVENT_DEV_PRESCHEDULE_NONE"); > + rc |=3D preschedule_test(RTE_EVENT_DEV_PRESCHEDULE, > "RTE_EVENT_DEV_PRESCHEDULE"); > + if (info.event_dev_cap & > RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE) > + rc |=3D > preschedule_test(RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE, > + > "RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE"); > + > + return rc; > +} > + > static int > test_eventdev_close(void) > { > @@ -1310,6 +1371,8 @@ static struct unit_test_suite > eventdev_common_testsuite =3D { > test_eventdev_start_stop), > TEST_CASE_ST(eventdev_configure_setup, > eventdev_stop_device, > test_eventdev_profile_switch), > + TEST_CASE_ST(eventdev_configure_setup, NULL, > + test_eventdev_preschedule_configure), > TEST_CASE_ST(eventdev_setup_device, eventdev_stop_device, > test_eventdev_link), > TEST_CASE_ST(eventdev_setup_device, eventdev_stop_device, > diff --git a/doc/guides/prog_guide/eventdev/eventdev.rst > b/doc/guides/prog_guide/eventdev/eventdev.rst > index fb6dfce102..341b9bb2c6 100644 > --- a/doc/guides/prog_guide/eventdev/eventdev.rst > +++ b/doc/guides/prog_guide/eventdev/eventdev.rst > @@ -357,6 +357,28 @@ Worker path: > // Process the event received. > } >=20 > +Event Pre-scheduling > +~~~~~~~~~~~~~~~~~~~~ > + > +Event pre-scheduling improves scheduling performance by assigning > +events to event ports in advance when dequeues are issued. > +The `rte_event_dequeue_burst` operation initiates the pre-schedule > +operation, which completes in parallel without affecting the dequeued ev= ent > flow contexts and dequeue latency. > +On the next dequeue operation, the pre-scheduled events are dequeued > +and pre-schedule is initiated again. > + > +An application can use event pre-scheduling if the event device > +supports it at either device level or at a individual port level. > +The application can check pre-schedule capability by checking if > +``rte_event_dev_info.event_dev_cap`` > +has the bit ``RTE_EVENT_DEV_CAP_PRESCHEDULE`` set, if present > +pre-scheduling can be enabled at device configuration time by setting > appropriate pre-schedule type in ``rte_event_dev_config.preschedule``. > + > +Currently, the following pre-schedule types are supported: > + * ``RTE_EVENT_DEV_PRESCHEDULE_NONE`` - No pre-scheduling. > + * ``RTE_EVENT_DEV_PRESCHEDULE`` - Always issue a pre-schedule when > dequeue is issued. > + * ``RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE`` - Issue pre-schedule when > dequeue is issued and there are > + no forward progress constraints. > + > Starting the EventDev > ~~~~~~~~~~~~~~~~~~~~~ >=20 > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h in= dex > 08e5f9320b..5ea7f5a07b 100644 > --- a/lib/eventdev/rte_eventdev.h > +++ b/lib/eventdev/rte_eventdev.h > @@ -446,6 +446,30 @@ struct rte_event; > * @see RTE_SCHED_TYPE_PARALLEL > */ >=20 > +#define RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE (1ULL << 16) /**< Event > +device supports event pre-scheduling. > + * > + * When this capability is available, the application can enable event > +pre-scheduling on the event > + * device to pre-schedule events to a event port when > +`rte_event_dequeue_burst()` > + * is issued. > + * The pre-schedule process starts with the `rte_event_dequeue_burst()` > +call and the > + * pre-scheduled events are returned on the next `rte_event_dequeue_burs= t()` > call. > + * > + * @see rte_event_dev_configure() > + */ > + > +#define RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE (1ULL << 17) > /**< > +Event device supports adaptive event pre-scheduling. > + * > + * When this capability is available, the application can enable > +adaptive pre-scheduling > + * on the event device where the events are pre-scheduled when there > +are no forward > + * progress constraints with the currently held flow contexts. > + * The pre-schedule process starts with the `rte_event_dequeue_burst()` > +call and the > + * pre-scheduled events are returned on the next `rte_event_dequeue_burs= t()` > call. > + * > + * @see rte_event_dev_configure() > + */ > + > /* Event device priority levels */ > #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0 > /**< Highest priority level for events and queues. > @@ -680,6 +704,25 @@ rte_event_dev_attr_get(uint8_t dev_id, uint32_t > attr_id, > * @see rte_event_dequeue_timeout_ticks(), rte_event_dequeue_burst() > */ >=20 > +typedef enum { > + RTE_EVENT_DEV_PRESCHEDULE_NONE =3D 0, > + /* Disable pre-schedule across the event device or on a given event por= t. > + * @ref rte_event_dev_config.preschedule_type > + */ > + RTE_EVENT_DEV_PRESCHEDULE, > + /* Enable pre-schedule always across the event device or a given event > port. > + * @ref rte_event_dev_config.preschedule_type > + * @see RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE > + */ > + RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE, > + /* Enable adaptive pre-schedule across the event device or a given even= t > port. > + * Delay issuing pre-schedule until there are no forward progress > constraints with > + * the held flow contexts. > + * @ref rte_event_dev_config.preschedule_type > + * @see RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE > + */ > +} rte_event_dev_preschedule_type_t; > + > /** Event device configuration structure */ struct rte_event_dev_config= { > uint32_t dequeue_timeout_ns; > @@ -752,6 +795,11 @@ struct rte_event_dev_config { > * optimized for single-link usage, this field is a hint for how many > * to allocate; otherwise, regular event ports and queues will be used. > */ > + rte_event_dev_preschedule_type_t preschedule_type; > + /**< Event pre-schedule type to use across the event device, if > supported. > + * @see RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE > + * @see RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE > + */ > }; >=20 > /** > -- > 2.25.1