[v4,0/3] Add dispatcher library

Message ID 20230922073825.351453-1-mattias.ronnblom@ericsson.com (mailing list archive)
Headers
Series Add dispatcher library |

Message

Mattias Rönnblom Sept. 22, 2023, 7:38 a.m. UTC
  The purpose of the dispatcher library is to decouple different parts
of an eventdev-based application (e.g., processing pipeline stages),
sharing the same underlying event device.

The 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 dispatcher relies on application-supplied matching callback
functions to decide where to deliver events.

A 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 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 dispatcher adds some overhead, experience suggests that
the net effect on the application (both synthetic 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 often-used handlers.

The dispatcher does not support run-time reconfiguration.

The use of the dispatcher library is optional, and an eventdev-based
application may still opt to access the event device using direct
eventdev API calls, or by some other means.

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

 MAINTAINERS                              |    5 +
 app/test/meson.build                     |    1 +
 app/test/test_dispatcher.c               | 1054 ++++++++++++++++++++++
 doc/api/doxy-api-index.md                |    1 +
 doc/api/doxy-api.conf.in                 |    1 +
 doc/guides/prog_guide/dispatcher_lib.rst |  434 +++++++++
 doc/guides/prog_guide/index.rst          |    1 +
 lib/dispatcher/meson.build               |   17 +
 lib/dispatcher/rte_dispatcher.c          |  798 ++++++++++++++++
 lib/dispatcher/rte_dispatcher.h          |  484 ++++++++++
 lib/dispatcher/version.map               |   20 +
 lib/meson.build                          |    2 +
 12 files changed, 2818 insertions(+)
 create mode 100644 app/test/test_dispatcher.c
 create mode 100644 doc/guides/prog_guide/dispatcher_lib.rst
 create mode 100644 lib/dispatcher/meson.build
 create mode 100644 lib/dispatcher/rte_dispatcher.c
 create mode 100644 lib/dispatcher/rte_dispatcher.h
 create mode 100644 lib/dispatcher/version.map