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 1E94045954; Tue, 10 Sep 2024 11:08:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF7EE427B6; Tue, 10 Sep 2024 11:08:48 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 073EE402A1 for ; Tue, 10 Sep 2024 11:08:48 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id BBC051B0B4 for ; Tue, 10 Sep 2024 11:08:47 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id ACD5A1B0B3; Tue, 10 Sep 2024 11:08:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.2 Received: from [192.168.1.86] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id DD40F1B0B1; Tue, 10 Sep 2024 11:08:44 +0200 (CEST) Message-ID: <586afa56-d51d-47f2-abea-e9f23d9b90a5@lysator.liu.se> Date: Tue, 10 Sep 2024 11:08:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 0/3] Introduce event prefetching To: pbhagavatula@marvell.com, jerinj@marvell.com, sthotton@marvell.com, abdullah.sevincer@intel.com, hemant.agrawal@nxp.com, sachin.saxena@oss.nxp.com, harry.van.haaren@intel.com, mattias.ronnblom@ericsson.com, liangma@liangbit.com, peter.mccarthy@intel.com Cc: dev@dpdk.org References: <20240910083117.4281-1-pbhagavatula@marvell.com> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: <20240910083117.4281-1-pbhagavatula@marvell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP 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 On 2024-09-10 10:31, pbhagavatula@marvell.com wrote: > From: Pavan Nikhilesh > > Event prefetching improves scheduling performance by pre-scheduling events to > event ports when dequeues are issued. This series introduces various types and > levels of prefetching to the eventdev library. > I would avoid to use the term "prefetch", since that word is used for manual (software) prefetching (preloading in ARM speak). In particular, since having the event device prefetch future event-related data may potentially also be interesting to do (i.e., to have an option to prefetch user-configurable lines in the buffer pointed to by a future event). I suggest RTE_EVENT_DEV_PRESCHEDULE*. If you make prescheduling a hint, you don't need the capability flags, and no error handling. Much smaller API, less fuzz for the application. > Prefetching Types: > * RTE_EVENT_DEV_PREFETCH_NONE: No prefetching. > * RTE_EVENT_DEV_PREFETCH: Always issue a prefetch when dequeue is issued. > * RTE_EVENT_DEV_PREFETCH_INTELLIGENT: Delay issuing prefetch until there > are no forward progress constraints with the held flow contexts. > Maybe RTE_EVENT_DEV_PREFETCH_ADAPTIVE is better. I suggest that being the default. In that case, for event devices which can't preschedule or which always (by design) have to preschedule, can continue doing what they are doing and still calling this "adaptive". RTE_EVENT_DEV_PREFETCH_AUTO would also work. Setting aside the complexity issue, prescheduling hints or configuration seems like a valuable feature to include in the Eventdev API. > Prefetching Levels: > * Event Device Level Prefetch: Prefetching can be enabled or disabled at the > event device during configuration. Event devices can indicate prefetching > capabilities using `RTE_EVENT_DEV_CAP_EVENT_PREFETCH` and > `RTE_EVENT_DEV_CAP_EVENT_INTELLIGENT_PREFETCH` via the event device info > function `info.event_dev_cap`. > * Event Port Level Prefetch: Prefetching can be selectively enabled or disabled > at the event port during runtime. Event devices can indicate this capability > using `RTE_EVENT_PORT_CAP_EVENT_PER_PORT_PREFETCH` via the event device info > function `info.event_port_cap`. > * Application Controlled Prefetch Hint: Applications can provide hints to the > event device to start prefetching events using the new API > `rte_event_port_prefetch`. Event devices can indicate this capabilities using > `RTE_EVENT_DEV_CAP_SW_PREFETCH` via the event device info function > `info.event_dev_cap`. > > The rte_event_dequeue_burst operation initiates the prefetch operation, which > completes in parallel without affecting the dequeued event flow context and > dequeue latency. On the next dequeue operation, the prefetched events are > dequeued, and prefetch is initiated again. > > In the case of application-controlled prefetch hints, the currently held flow > contexts, if any, are not affected by the prefetch operation. On the next > dequeue operation, the prefetched events are returned, but prefetch is not > initiated again until the application provides the hint again. If prefetching > is already enabled at the event device level or event port level, > the hint is ignored. > > Pavan Nikhilesh (3): > eventdev: introduce event prefetching > eventdev: allow event ports to modified prefetches > eventdev: add SW event prefetch hint > > app/test/test_eventdev.c | 113 +++++++++++++++ > doc/guides/prog_guide/eventdev/eventdev.rst | 42 ++++++ > lib/eventdev/eventdev_pmd.h | 4 + > lib/eventdev/eventdev_private.c | 19 +++ > lib/eventdev/eventdev_trace_points.c | 6 + > lib/eventdev/rte_eventdev.h | 152 ++++++++++++++++++++ > lib/eventdev/rte_eventdev_core.h | 9 ++ > lib/eventdev/rte_eventdev_trace_fp.h | 19 ++- > lib/eventdev/version.map | 6 + > 9 files changed, 369 insertions(+), 1 deletion(-) > > -- > 2.46.0