mbox

[RFC,v4,0/3] Add event dispatcher

Message ID 20230609070826.149336-1-mattias.ronnblom@ericsson.com (mailing list archive)
Headers

Message

Mattias Rönnblom June 9, 2023, 7:08 a.m. UTC
  The purpose of the event dispatcher is to decouple different parts of
an application (e.g., processing pipeline stages), sharing the same
underlying event device.

The event dispatcher replaces the conditional logic (often, a switch
statement) that typically follows an event device dequeue operation,
where events are dispatched to different parts of the application
based on event meta data, such as the queue id or scheduling type.

The concept is similar to a UNIX file descriptor event loop library.
Instead of tying callback functions to fds as for example libevent
does, the event dispatcher relies on application-supplied matching
callback functions to decide where to deliver events.

An event dispatcher is configured to dequeue events from a specific
event device, and ties into the service core framework, to do its (and
the application's) work.

The event dispatcher provides a convenient way for an eventdev-based
application to use service cores for application-level processing, and
thus for sharing those cores with other DPDK services.

Although the event dispatcher adds some overhead, experience suggests
that the net effect on the application (both syntetic benchmarks and
more real-world applications) may well be positive. This is primarily
due to clustering (see programming guide) reducing cache misses.
Benchmarking indicates that the overhead is ~10 cc/event (on a
large core), with a handful of active handlers.

The event dispatcher does not support runtime reconfiguration.

Outstanding questions:
 o Consider adding possibility to express simple match functions
   (e..queue_id == 7) without a match callback.
 o Consider allowing the application setting the process callback to NULL,
   signalling to the dispatcher that processing will occur already at the
   time of the match call. May provide some slight performance benefits
   for applications where the average number of events supplied per process
   function call is very small.

Mattias Rönnblom (3):
  eventdev: introduce event dispatcher
  test: add event dispatcher test suite
  doc: add event dispatcher programming guide

 app/test/meson.build                       |   1 +
 app/test/test_event_dispatcher.c           | 814 +++++++++++++++++++++
 doc/api/doxy-api-index.md                  |   1 +
 doc/guides/prog_guide/event_dispatcher.rst | 443 +++++++++++
 doc/guides/prog_guide/index.rst            |   1 +
 lib/eventdev/meson.build                   |   2 +
 lib/eventdev/rte_event_dispatcher.c        | 770 +++++++++++++++++++
 lib/eventdev/rte_event_dispatcher.h        | 448 ++++++++++++
 lib/eventdev/version.map                   |  13 +
 9 files changed, 2493 insertions(+)
 create mode 100644 app/test/test_event_dispatcher.c
 create mode 100644 doc/guides/prog_guide/event_dispatcher.rst
 create mode 100644 lib/eventdev/rte_event_dispatcher.c
 create mode 100644 lib/eventdev/rte_event_dispatcher.h