From: "Mattias Rönnblom" <mattias.ronnblom@ericsson.com>
To: <dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>
Cc: "Mattias Rönnblom" <hofors@lysator.liu.se>,
"Maria Lingemark" <maria.lingemark@ericsson.com>,
"Luka Jankovic" <luka.jankovic@ericsson.com>,
"Sriram Yagnaraman" <sriram.yagnaraman@ericsson.com>,
"Mattias Rönnblom" <mattias.ronnblom@ericsson.com>
Subject: [RFC 0/4] Add support for event credit preallocation
Date: Sun, 29 Jun 2025 18:52:10 +0200 [thread overview]
Message-ID: <20250629165214.3468-1-mattias.ronnblom@ericsson.com> (raw)
Events of type RTE_EVENT_OP_NEW are often generated as a result of
some stimuli from the world outside the event machine. Examples of
such input can be a timeout in an application-managed timer wheel, a
control plane message on a lockless ring, an incoming packet
triggering the release of buffered packets, or a descriptor arriving
on some hardware queue.
In non-event-triggered cases, the external-trigger-to-eventdev-event
mechanism serves the same role as various Eventdev adapters, but for
input that does not have native Eventdev support.
The actual RTE_EVENT_OP_NEW event enqueue is often preceded by a
processing. Such processing may be both expensive or effectively
irreversible. In addition, in case the enqueue is likely to fail,
there is not even a point in polling the external source for new
input.
In such a scenario, efficiency could potentially be improved and code
complexity reduced in case the application could know ahead of time,
with some certainty, that the enqueue operation will succeed.
Event devices have a mechanism that puts an upper bound to the number
of in-flight (buffered) events. In many cases (e.g., DLB, DSW, and SW)
there is a credit system putting an upper bound on the number of
in-flight events. A new event consumes a credit, which is returned
to the credit pool when the event is released. In the current
Eventdev API, all this happens "under the hood" and is not visible
to the application.
This patchset optionally splits the enqueue operation into two steps:
1) rte_event_credit_alloc() to allocate "slots" for the events, in the
form of credits. One credit grants the application the right to
enqueue one event of the type RTE_EVENT_OP_NEW_PREALLOCED.
2) The actual enqueue operation, with the rte_event.op set to
RTE_EVENT_OP_NEW_PREALLOCED.
The new operation type RTE_EVENT_OP_NEW_PREALLOCED is identical to
RTE_EVENT_OP_NEW, with the only exception that credit allocation
(either conceptually or literally) has already been successfully
completed.
Whether or not a credit allocation will succeed depends on the
new_event_threshold of the request. In the current Eventdev API,
new_event_threshold is strictly a port-level configuration. Beyond
simply allocating a credit, this patchset also address flexibility in
terms of making the new_event_threshold a per-allocation property.
Control over new_event_threshold is very important to tune system
behavior at overload.
In the general case, failure to allocate a credit is only one reason
an enqueue operation may fail. API semantics-wise, the possession of a
credit does not guarantee that the subsequent enqueue operation will
succeed. Certain event device implementations may come with stronger
guarantees.
In case the application decides not to (or fails to) spend its credits
enqueuing RTE_EVENT_OP_NEW_PREALLOCED events, it may return them using
the new rte_event_credit_free() function.
For performance and API consistency reasons, a new preallocation-optimized
enqueue function rte_event_enqueue_prealloced_burst() is added.
To allow the application to query if the credit management and the new
enqueue function are available on a particular event device, a new
capability RTE_EVENT_DEV_CAP_CREDIT_PREALLOCATION is added.
Mattias Rönnblom (4):
eventdev: add support for credit preallocation
event/dsw: add support for credit preallocation
eventdev: add enqueue optimized for prealloced events
event/dsw: implement enqueue optimized for prealloced events
drivers/event/dsw/dsw_evdev.c | 6 +-
drivers/event/dsw/dsw_evdev.h | 9 ++
drivers/event/dsw/dsw_event.c | 86 ++++++++++--
drivers/event/dsw/dsw_xstats.c | 3 +
lib/eventdev/eventdev_pmd.h | 6 +
lib/eventdev/eventdev_private.c | 24 ++++
lib/eventdev/eventdev_trace_points.c | 8 ++
lib/eventdev/rte_eventdev.h | 193 +++++++++++++++++++++++++++
lib/eventdev/rte_eventdev_core.h | 12 ++
lib/eventdev/rte_eventdev_trace_fp.h | 19 +++
10 files changed, 354 insertions(+), 12 deletions(-)
--
2.43.0
next reply other threads:[~2025-06-29 17:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-29 16:52 Mattias Rönnblom [this message]
2025-06-29 16:52 ` [RFC 1/4] eventdev: add support for " Mattias Rönnblom
2025-06-29 16:52 ` [RFC 2/4] event/dsw: " Mattias Rönnblom
2025-06-29 16:52 ` [RFC 3/4] eventdev: add enqueue optimized for prealloced events Mattias Rönnblom
2025-06-29 16:52 ` [RFC 4/4] event/dsw: implement " Mattias Rönnblom
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250629165214.3468-1-mattias.ronnblom@ericsson.com \
--to=mattias.ronnblom@ericsson.com \
--cc=dev@dpdk.org \
--cc=hofors@lysator.liu.se \
--cc=jerinj@marvell.com \
--cc=luka.jankovic@ericsson.com \
--cc=maria.lingemark@ericsson.com \
--cc=sriram.yagnaraman@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).