rte_eventdev.h(3)
๐ rte_eventdev.h(3) ๐
okay so bestie, welcome to a page straight out of the Library Functions Manual โ yes, that's the manual name, it's giving very "official docs" energy and honestly? we love that for it. ๐
This one's a header file page. His name is rte_eventdev.h(3) and he is the main character today. โจ
This is a long one, so it's rolling out in 12 parts. You're on part 1. Buckle up, hydrate, and don't you dare leave โ the rest is on the way. ๐ฆ
โจ NAME โจ
rte_eventdev.h
yep. that's the name. short, sweet, iconic, no notes. ๐
ngl this is the calmest section of the whole page, so enjoy it while it lasts. the plot is about to thicken. ๐ญ
โจ SYNOPSIS โจ
okay bestie, before literally anything else you gotta pull in the headers, or nothing's gonna compile and we'll both be sad ๐ซถ
#include <rte_bitops.h>
#include <rte_common.h>
#include <rte_compat.h>
#include <rte_errno.h>
#include <rte_mbuf_pool_ops.h>
#include <rte_mempool.h>
#include 'rte_eventdev_trace_fp.h'
#include <rte_eventdev_core.h>
(yes, rte_eventdev_trace_fp.h is wearing little quotes instead of angle brackets in the original, we love a quirky header ๐
)
๐งธ Data Structures
the structs you're gonna be living in, lowkey:
struct rte_event_dev_infostruct rte_event_dev_configstruct rte_event_queue_confstruct rte_event_port_confstruct rte_eventstruct rte_event_dev_xstats_name
๐ Macros ๐
bestie there are SO many. every single one is right here, i'm not skipping a single one, periodt. ๐
the capability flags (what your device can flex)
#define RTE_EVENT_DEV_CAP_QUEUE_QOS RTE_BIT32(0)
#define RTE_EVENT_DEV_CAP_EVENT_QOS RTE_BIT32(1)
#define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED RTE_BIT32(2)
#define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES RTE_BIT32(3)
#define RTE_EVENT_DEV_CAP_BURST_MODE RTE_BIT32(4)
#define RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE RTE_BIT32(5)
#define RTE_EVENT_DEV_CAP_NONSEQ_MODE RTE_BIT32(6)
#define RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK RTE_BIT32(7)
#define RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT RTE_BIT32(8)
#define RTE_EVENT_DEV_CAP_CARRY_FLOW_ID RTE_BIT32(9)
#define RTE_EVENT_DEV_CAP_MAINTENANCE_FREE RTE_BIT32(10)
#define RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR RTE_BIT32(11)
#define RTE_EVENT_DEV_CAP_PROFILE_LINK RTE_BIT32(12)
#define RTE_EVENT_DEV_CAP_ATOMIC RTE_BIT32(13)
#define RTE_EVENT_DEV_CAP_ORDERED RTE_BIT32(14)
#define RTE_EVENT_DEV_CAP_PARALLEL RTE_BIT32(15)
#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ RTE_BIT32(16)
#define RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE RTE_BIT32(17)
#define RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE RTE_BIT32(18)
#define RTE_EVENT_DEV_CAP_PER_PORT_PRESCHEDULE RTE_BIT32(19)
#define RTE_EVENT_DEV_CAP_PRESCHEDULE_EXPLICIT RTE_BIT32(20)
priority / weight / affinity constants ๐
the whole range of the vibe check, from highest to lowest:
#define RTE_EVENT_DEV_PRIORITY_HIGHEST 0
#define RTE_EVENT_DEV_PRIORITY_NORMAL 128
#define RTE_EVENT_DEV_PRIORITY_LOWEST 255
#define RTE_EVENT_QUEUE_WEIGHT_HIGHEST 255
#define RTE_EVENT_QUEUE_WEIGHT_LOWEST 0
#define RTE_EVENT_QUEUE_AFFINITY_HIGHEST 255
#define RTE_EVENT_QUEUE_AFFINITY_LOWEST 0
device attributes + config flags
#define RTE_EVENT_DEV_ATTR_PORT_COUNT 0
#define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1
#define RTE_EVENT_DEV_ATTR_STARTED 2
#define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT RTE_BIT32(0)
queue config + queue attributes
#define RTE_EVENT_QUEUE_CFG_ALL_TYPES RTE_BIT32(0)
#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK RTE_BIT32(1)
#define RTE_EVENT_QUEUE_ATTR_PRIORITY 0
#define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS 1
#define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES 2
#define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
#define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
#define RTE_EVENT_QUEUE_ATTR_WEIGHT 5
#define RTE_EVENT_QUEUE_ATTR_AFFINITY 6
port config + port attributes ๐ฅ
#define RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL RTE_BIT32(0)
#define RTE_EVENT_PORT_CFG_SINGLE_LINK RTE_BIT32(1)
#define RTE_EVENT_PORT_CFG_HINT_PRODUCER RTE_BIT32(2)
#define RTE_EVENT_PORT_CFG_HINT_CONSUMER RTE_BIT32(3)
#define RTE_EVENT_PORT_CFG_HINT_WORKER RTE_BIT32(4)
#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ RTE_BIT32(5)
#define RTE_EVENT_PORT_ATTR_ENQ_DEPTH 0
#define RTE_EVENT_PORT_ATTR_DEQ_DEPTH 1
#define RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD 2
#define RTE_EVENT_PORT_ATTR_IMPLICIT_RELEASE_DISABLE 3
#define RTE_EVENT_PORT_ATTR_INDEPENDENT_ENQ 4
schedule types
three whole options, choose wisely ๐ฆ
#define RTE_SCHED_TYPE_ORDERED 0
#define RTE_SCHED_TYPE_ATOMIC 1
#define RTE_SCHED_TYPE_PARALLEL 2
event types (and their vector-ified versions) โจ
#define RTE_EVENT_TYPE_ETHDEV 0x0
#define RTE_EVENT_TYPE_CRYPTODEV 0x1
#define RTE_EVENT_TYPE_TIMER 0x2
#define RTE_EVENT_TYPE_CPU 0x3
#define RTE_EVENT_TYPE_ETH_RX_ADAPTER 0x4
#define RTE_EVENT_TYPE_DMADEV 0x5
#define RTE_EVENT_TYPE_VECTOR 0x8
#define RTE_EVENT_TYPE_ETHDEV_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETHDEV)
#define RTE_EVENT_TYPE_CPU_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CPU)
#define RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER)
#define RTE_EVENT_TYPE_CRYPTODEV_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CRYPTODEV)
#define RTE_EVENT_TYPE_MAX 0x10
event operations (the three moods every event can be in ๐)
#define RTE_EVENT_OP_NEW 0
#define RTE_EVENT_OP_FORWARD 1
#define RTE_EVENT_OP_RELEASE 2
ethernet RX adapter capabilities
#define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1
#define RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 0x2
#define RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID 0x4
#define RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR 0x8
timer adapter capabilities โฐ
#define RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT RTE_BIT32(0)
#define RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC RTE_BIT32(1)
crypto adapter capabilities ๐
#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1
#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2
#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND 0x4
#define RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA 0x8
#define RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR 0x10
DMA adapter capabilities
#define RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1
#define RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2
#define RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_VCHAN_EV_BIND 0x4
ethernet TX adapter + vector adapter capabilities
#define RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT 0x1
#define RTE_EVENT_ETH_TX_ADAPTER_CAP_EVENT_VECTOR 0x2
#define RTE_EVENT_VECTOR_ADAPTER_CAP_INTERNAL_PORT 0x1
the randoms (but iconic, obviously) ๐
#define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64
#define RTE_EVENT_DEV_MAINT_OP_FLUSH (1 << 0)
๐ Typedefs
two function-pointer girlies, both taking uint8_t dev_id, a struct rte_event event, and a void *arg:
typedef void(* rte_eventdev_port_flush_t) (uint8_t dev_id, struct rte_event event, void *arg)
typedef void(* rte_eventdev_stop_flush_t) (uint8_t dev_id, struct rte_event event, void *arg)
๐ธ Enumerations
enum rte_event_dev_preschedule_type { RTE_EVENT_PRESCHEDULE_NONE, RTE_EVENT_PRESCHEDULE, RTE_EVENT_PRESCHEDULE_ADAPTIVE }
enum rte_event_dev_xstats_mode
๐ซถ Functions
grab a snack, this is the whole lineup fr fr.
device-level stuff
uint8_t rte_event_dev_count (void)โ how many eventdevs are out thereint rte_event_dev_get_dev_id (const char *name)โ find a dev by nameint rte_event_dev_socket_id (uint8_t dev_id)int rte_event_dev_info_get (uint8_t dev_id, struct rte_event_dev_info *dev_info)int rte_event_dev_attr_get (uint8_t dev_id, uint32_t attr_id, uint32_t *attr_value)int rte_event_dev_configure (uint8_t dev_id, const struct rte_event_dev_config *dev_conf)int rte_event_dev_start (uint8_t dev_id)void rte_event_dev_stop (uint8_t dev_id)int rte_event_dev_stop_flush_callback_register (uint8_t dev_id, rte_eventdev_stop_flush_t callback, void *userdata)int rte_event_dev_close (uint8_t dev_id)int rte_event_dev_service_id_get (uint8_t dev_id, uint32_t *service_id)int rte_event_dev_dump (uint8_t dev_id, FILE *f)int rte_event_dev_selftest (uint8_t dev_id)
queue-level stuff
int rte_event_queue_default_conf_get (uint8_t dev_id, uint8_t queue_id, struct rte_event_queue_conf *queue_conf)int rte_event_queue_setup (uint8_t dev_id, uint8_t queue_id, const struct rte_event_queue_conf *queue_conf)int rte_event_queue_attr_get (uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, uint32_t *attr_value)int rte_event_queue_attr_set (uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, uint64_t attr_value)
port-level stuff
int rte_event_port_default_conf_get (uint8_t dev_id, uint8_t port_id, struct rte_event_port_conf *port_conf)int rte_event_port_setup (uint8_t dev_id, uint8_t port_id, const struct rte_event_port_conf *port_conf)void rte_event_port_quiesce (uint8_t dev_id, uint8_t port_id, rte_eventdev_port_flush_t release_cb, void *args)int rte_event_port_attr_get (uint8_t dev_id, uint8_t port_id, uint32_t attr_id, uint32_t *attr_value)
linking ports to queues ๐
int rte_event_port_link (uint8_t dev_id, uint8_t port_id, const uint8_t queues[], const uint8_t priorities[], uint16_t nb_links)int rte_event_port_unlink (uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint16_t nb_unlinks)int rte_event_port_unlinks_in_progress (uint8_t dev_id, uint8_t port_id)int rte_event_port_links_get (uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint8_t priorities[])
and the experimental profile-linking ones, look for the __rte_experimental glow โจ
__rte_experimental int rte_event_port_profile_links_set (uint8_t dev_id, uint8_t port_id, const uint8_t queues[], const uint8_t priorities[], uint16_t nb_links, uint8_t profile_id)__rte_experimental int rte_event_port_profile_unlink (uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint16_t nb_unlinks, uint8_t profile_id)__rte_experimental int rte_event_port_profile_links_get (uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint8_t priorities[], uint8_t profile_id)
adapter capability checks ๐ง
int rte_event_eth_rx_adapter_caps_get (uint8_t dev_id, uint16_t eth_port_id, uint32_t *caps)int rte_event_timer_adapter_caps_get (uint8_t dev_id, uint32_t *caps)int rte_event_crypto_adapter_caps_get (uint8_t dev_id, uint8_t cdev_id, uint32_t *caps)__rte_experimental int rte_event_dma_adapter_caps_get (uint8_t dev_id, uint8_t dmadev_id, uint32_t *caps)int rte_event_eth_tx_adapter_caps_get (uint8_t dev_id, uint16_t eth_port_id, uint32_t *caps)
timeout math โฑ๏ธ
int rte_event_dequeue_timeout_ticks (uint8_t dev_id, uint64_t ns, uint64_t *timeout_ticks)
xstats besties ๐
int rte_event_dev_xstats_names_get (uint8_t dev_id, enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, struct rte_event_dev_xstats_name *xstats_names, uint64_t *ids, unsigned int size)int rte_event_dev_xstats_get (uint8_t dev_id, enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, const uint64_t ids[], uint64_t values[], unsigned int n)uint64_t rte_event_dev_xstats_by_name_get (uint8_t dev_id, const char *name, uint64_t *id)int rte_event_dev_xstats_reset (uint8_t dev_id, enum rte_event_dev_xstats_mode mode, int16_t queue_port_id, const uint64_t ids[], uint32_t nb_ids)
vector pool + the struct ๐
struct rte_mempool * rte_event_vector_pool_create (const char *name, unsigned int n, unsigned int cache_size, uint16_t nb_elem, int socket_id)struct __rte_aligned (16) rte_event_vector
the data path inlines (these are static, so they're the fast ones ๐ฅ)
static uint16_t rte_event_enqueue_burst (uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events)
static uint16_t rte_event_enqueue_new_burst (uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events)
static uint16_t rte_event_enqueue_forward_burst (uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events)
static uint16_t rte_event_dequeue_burst (uint8_t dev_id, uint8_t port_id, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks)
static int rte_event_maintain (uint8_t dev_id, uint8_t port_id, int op)
static uint8_t rte_event_port_profile_switch (uint8_t dev_id, uint8_t port_id, uint8_t profile_id)
static __rte_experimental int rte_event_port_preschedule_modify (uint8_t dev_id, uint8_t port_id, enum rte_event_dev_preschedule_type type)
static __rte_experimental void rte_event_port_preschedule (uint8_t dev_id, uint8_t port_id, enum rte_event_dev_preschedule_type type)
๐ญ DETAILED DESCRIPTION ๐ญ
and now the part where we actually explain what all of this means โ hold on to your headphones bestie, we're going in ๐ง
So picture the old-school DPDK app model for a sec, bestie: your app just sits there polling Ethdev port RX queues looking for work, does the processing in a run-to-completion kinda way, and then yeets the packets out on an Ethdev TX queue. Load gets spread by statically assigning ports and queues to lcores, and NIC receive-side scaling (RSS), or something similar, is what distributes network flows (and therefore the work) on the same port across multiple RX queues. It's giving very "everyone has their assigned seat" energy. ๐ช
Now contrast that with the event-driven model this "eventdev" library supports: incoming packets (or any other input events) get fed into an event device, and that device schedules those packets across the available lcores according to its configuration. And the glow-up is real, because this model hands your app:
- automatic multicore scaling โจ
- dynamic load balancing โ๏ธ
- pipelining ๐ฐ
- packet order maintenance ๐
- synchronization ๐ค
- prioritization/quality of service ๐
Application-oriented Event API ๐ธ
The Event Device API is composed of two parts, no cap:
- The application-oriented Event API, which includes the functions to set up an event device (configure it, set up its queues, ports and start it), to establish the links between queues and ports so events can be received, and so on. ๐ ๏ธ
- The driver-oriented Event API, which exports a function letting an event poll Mode Driver (PMD) register itself as an event device driver. ๐
Event device components ๐งฉ
+-----------------+
| +-------------+ |
+-------+ | | flow 0 | |
|Packet | | +-------------+ |
|event | | +-------------+ |
| | | | flow 1 | |port_link(port0, queue0)
+-------+ | +-------------+ | | +--------+
+-------+ | +-------------+ o-----v-----o |dequeue +------+
|Crypto | | | flow n | | | event +------->|Core 0|
|work | | +-------------+ o----+ | port 0 | | |
|done ev| | event queue 0 | | +--------+ +------+
+-------+ +-----------------+ |
+-------+ |
|Timer | +-----------------+ | +--------+
|expiry | | +-------------+ | +------o |dequeue +------+
|event | | | flow 0 | o-----------o event +------->|Core 1|
+-------+ | +-------------+ | +----o port 1 | | |
Event enqueue | +-------------+ | | +--------+ +------+
o-------------> | | flow 1 | | |
enqueue( | +-------------+ | |
queue_id, | | | +--------+ +------+
flow_id, | +-------------+ | | | |dequeue |Core 2|
sched_type, | | flow n | o-----------o event +------->| |
event_type, | +-------------+ | | | port 2 | +------+
subev_type, | event queue 1 | | +--------+
event) +-----------------+ | +--------+
| | |dequeue +------+
+-------+ +-----------------+ | | event +------->|Core n|
|Core | | +-------------+ o-----------o port n | | |
|(SW) | | | flow 0 | | | +--------+ +--+---+
|event | | +-------------+ | | |
+-------+ | +-------------+ | | |
^ | | flow 1 | | | |
| | +-------------+ o------+ |
| | +-------------+ | |
| | | flow n | | |
| | +-------------+ | |
| | event queue n | |
| +-----------------+ |
| |
+-----------------------------------------------------------+
Let's break down every character in this cast, because they all matter ๐ :
- Event device โ a hardware or software-based event scheduler. That's the whole main character.
- Event โ represents an item of work and is the smallest unit of scheduling. An event carries metadata, like queue ID, scheduling type, and event priority, plus data like one or more packets or other kinds of buffers. Some examples of events:
- a software-generated item of work originating from a lcore, perhaps carrying a packet to be processed ๐งต
- a crypto work completion notification ๐
- a timer expiry notification โฐ
- Event queue โ a queue containing events that are to be scheduled by the event device. An event queue contains events of different flows associated with scheduling types, such as atomic, ordered, or parallel. Every event you hand to an event device must have a valid event queue id field in the metadata, specifying on which event queue in the device the event must be placed, for later scheduling. ๐ฅ
- Event port โ an application's interface into the event dev for enqueue and dequeue operations. Each event port can be linked with one or more event queues for dequeue operations. Here's the thing though: enqueue and dequeue from a port is not thread-safe, and the expected use-case is that each port is polled by only a single lcore. [If this is not the case, a suitable synchronization mechanism should be used to prevent simultaneous access from multiple lcores.] To schedule events to an lcore, the event device will schedule them to the event port(s) being polled by that lcore. ๐ฏ
NOTE: By default, all the functions of the Event Device API exported by a PMD are non-thread-safe functions, which must not be invoked on the same object in parallel on different logical cores. For instance, the dequeue function of a PMD cannot be invoked in parallel on two logical cores to operate on same event port. Of course, this function can be invoked in parallel by different logical cores on different ports. It is the responsibility of the upper level application to enforce this rule. โ ๏ธ
In all functions of the Event API, the Event device is designated by an integer >= 0 named the device identifier dev_id. ๐ข
Setting it up in order ๐
The functions exported by the application Event API to setup a device must be invoked in the following order, bestie, don't freestyle it:
rte_event_dev_configure()rte_event_queue_setup()rte_event_port_setup()rte_event_port_link()rte_event_dev_start()
Then, the application can invoke, in any order, the functions exported by the Event API to dequeue events, enqueue events, and link and unlink event queue(s) to event ports. ๐
Before configuring a device, an application should call rte_event_dev_info_get() to determine the capabilities of the event device, and any queue or port limits of that device. The parameters set in the various device configuration structures may need to be adjusted based on the max values provided in the device information structure returned from the rte_event_dev_info_get() API. An application may use rte_event_queue_default_conf_get() or rte_event_port_default_conf_get() to get the default configuration to set up an event queue or event port by overriding few default values. ๐๏ธ
If the application wants to change the configuration (i.e. call rte_event_dev_configure(), rte_event_queue_setup(), or rte_event_port_setup()), it must call rte_event_dev_stop() first to stop the device, and then do the reconfiguration before calling rte_event_dev_start() again. The schedule, enqueue and dequeue functions should not be invoked when the device is stopped. ๐
Finally, an application can close an Event device by invoking the rte_event_dev_close() function. Once closed, a device cannot be reconfigured or restarted. Periodt. ๐ซ
Driver-Oriented Event API ๐ง
At the Event driver level, Event devices are represented by a generic data structure of type rte_event_dev. ๐๏ธ
Event devices are dynamically registered during the PCI/SoC device probing phase performed at EAL initialization time. When an Event device is being probed, an rte_event_dev structure is allocated for it and the event_dev_init() function supplied by the Event driver is invoked to properly initialize the device. โจ
The role of the device init function is to reset the device hardware or to initialize the software event driver implementation. ๐
If the device init operation is successful, the device is assigned a device id (dev_id) for application use. Otherwise, the rte_event_dev structure is freed. ๐
Each function of the application Event API invokes a specific function of the PMD that controls the target device designated by its device identifier. ๐
For this purpose, all device-specific functions of an Event driver are supplied through a set of pointers contained in a generic structure of type event_dev_ops. The address of the event_dev_ops structure is stored in the rte_event_dev structure by the device init function of the Event driver, which is invoked during the PCI/SoC device probing phase, as explained earlier. ๐๏ธ
In other words, each function of the Event API simply retrieves the rte_event_dev structure associated with the device identifier and performs an indirect invocation of the corresponding driver function supplied in the event_dev_ops structure of the rte_event_dev structure. ๐ช
For performance reasons, the addresses of the fast-path functions of the event driver are not contained in the event_dev_ops structure. Instead, they are directly stored at the beginning of the rte_event_dev structure to avoid an extra indirect memory access during their invocation. ๐๏ธ๐จ
Event Enqueue, Dequeue and Scheduling ๐
RTE event device drivers do not use interrupts for enqueue or dequeue operation. Instead, Event drivers export Poll-Mode enqueue and dequeue functions to applications. ๐
The events are injected to event device through enqueue operation by event producers in the system. The typical event producers are:
- ethdev subsystem, for generating packet events ๐ฆ
- CPU(SW), for generating events based on different stages of application processing ๐ง
- cryptodev, for generating crypto work completion notification ๐
etc. etc. ๐ซถ
The dequeue operation gets one or more events from the event ports. The application processes the events and sends them to a downstream event queue through rte_event_enqueue_burst(), if it is an intermediate stage of event processing. On the final stage of processing, the application may use the Tx adapter API for maintaining the event ingress order while sending the packet/event on the wire via NIC Tx. ๐
The point at which events get scheduled to ports? That's a device thing, bestie. For hardware devices, scheduling happens asynchronously with zero software intervention โ the HW just does it. Software schedulers can be either distributed (every worker thread schedules events to its own port) or centralized (one dedicated thread schedules to all the ports). Distributed software schedulers do the scheduling inside the enqueue or dequeue functions, while centralized software schedulers need a whole dedicated service core for scheduling. So if the RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED capability flag is not there, that means the device is centralized and therefore needs a dedicated scheduling thread (usually an RTE service that should be mapped to one or more service cores) that just repeatedly calls the software-specific scheduling function. ๐
An event driven worker thread has this typical workflow on fastpath, no cap:
while (1) {
rte_event_dequeue_burst(...);
(event processing)
rte_event_enqueue_burst(...);
}
Definition in file rte_eventdev.h.
โจ Macro Definition Documentation โจ
Ohhh we're in the macro zone now, this is where the capabilities live ๐ Every single one, let's go.
#define RTE_EVENT_DEV_CAP_QUEUE_QOS RTE_BIT32(0)
Event scheduling prioritization is based on the priority and weight associated with each event queue. ๐ฅ
Events from the queue with the highest priority get scheduled first. And if the queues are all the same priority? Then the weight of the queues gets considered to pick a queue in a weighted round robin fashion. โจ
Subsequent dequeue calls from an event port could see events from the same event queue โ but only if that queue is configured with an affinity count. And affinity count is literally the number of subsequent dequeue calls in which an event port should use the same event queue if that queue is non-empty. ๐ซถ
NOTE: A device may use both queue prioritization and event prioritization (RTE_EVENT_DEV_CAP_EVENT_QOS capability) when making packet scheduling decisions.
See also
rte_event_queue_setup()rte_event_queue_attr_set()
Definition at line 253 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_EVENT_QOS RTE_BIT32(1)
Event scheduling prioritization is based on the priority associated with each event. ๐
The priority of each event is supplied in the rte_event structure on each enqueue operation. But if this capability is not set, then the priority field of the event structure is just ignored for each event. Bye ๐
NOTE: A device may use both queue prioritization (RTE_EVENT_DEV_CAP_QUEUE_QOS capability) and event prioritization when making packet scheduling decisions.
See also
rte_event_enqueue_burst()
Definition at line 271 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED RTE_BIT32(2)
Event device operates in distributed scheduling mode. ๐
In distributed scheduling mode, event scheduling happens in HW, or in rte_event_dequeue_burst() / rte_event_enqueue_burst(), or a combination of those two. But if this flag is not set, then the eventdev is centralized, and so it needs a dedicated service core acting as a scheduling thread. Periodt.
See also
rte_event_dev_service_id_get()
Definition at line 285 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES RTE_BIT32(3)
Event device is capable of accepting enqueued events of any type advertised as supported by the device, to all destination queues. ๐
When this capability is set, and the RTE_EVENT_QUEUE_CFG_ALL_TYPES flag is set in event_queue_cfg, then the "schedule_type" field of the rte_event_queue_conf structure gets ignored when a queue is being configured. Instead, the "sched_type" field of each event enqueued is used to select the scheduling to be performed on that event. โจ
If this capability is not set, or the configuration flag is not set, the queue only supports events of the RTE_SCHED_TYPE_ type specified in the rte_event_queue_conf structure at time of configuration. And the behaviour when events of other scheduling types are sent to the queue is undefined. ๐ Not a vibe, don't do it.
See also
RTE_EVENT_QUEUE_CFG_ALL_TYPESRTE_SCHED_TYPE_ATOMICRTE_SCHED_TYPE_ORDEREDRTE_SCHED_TYPE_PARALLELrte_event_queue_conf.event_queue_cfgrte_event_queue_conf.schedule_typerte_event_enqueue_burst()
Definition at line 295 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_BURST_MODE RTE_BIT32(4)
Event device is capable of operating in burst mode for enqueue (forward, release) and dequeue operation. ๐
If this capability is not set, the application can still use rte_event_dequeue_burst() and rte_event_enqueue_burst(), but the PMD accepts or returns only one event at a time. One. Single. Event. ๐ญ
See also
rte_event_dequeue_burst()rte_event_enqueue_burst()
Definition at line 319 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE RTE_BIT32(5)
Event device ports support disabling the implicit release feature โ that's the feature where the port releases all unreleased events in its dequeue operation. ๐
If this capability is set and the port is configured with implicit release disabled, then the application is responsible for explicitly releasing events using either the RTE_EVENT_OP_FORWARD or the RTE_EVENT_OP_RELEASE event enqueue operations. No more free rides, you release your own events bestie ๐ซถ
See also
rte_event_dequeue_burst()rte_event_enqueue_burst()
Definition at line 330 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_NONSEQ_MODE RTE_BIT32(6)
Event device is capable of operating in non-sequential mode. ๐ฆ
The path of the event does not have to be sequential. Application can change the path of an event at runtime, and events may be sent to queues in any order. Main character energy for your packets โจ
If this flag is not set, then each event will follow a path from queue 0 to queue 1 to queue 2 etc. โ locked in that order fr fr. And the eventdev will return an error when the application enqueues an event for a qid which is not the next one in the sequence. โ ๏ธ
Definition at line 343 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK RTE_BIT32(7)
Event device is capable of reconfiguring the queue/port link at runtime. ๐
If this flag is not set, then the eventdev queue/port link can only be configured during initialization โ or by stopping the device and then later restarting it after reconfiguration. Rude, tbh, but that's the deal.
See also
rte_event_port_link()rte_event_port_unlink()
Definition at line 355 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT RTE_BIT32(8)
Event device is capable of setting up links between multiple queues and a single port. ๐
If this flag is not set, each port may only be linked to a single queue, and so can only receive events from that one queue. However โ plot twist โ each queue may still be linked to multiple ports. The math is mathing. ๐งฎ
See also
rte_event_port_link()
Definition at line 366 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_CARRY_FLOW_ID RTE_BIT32(9)
Event device preserves the flow ID from the enqueued event to the dequeued event. โจ Consistency, we love to see it.
If this flag is not set, then the content of the flow-id field in dequeued events is implementation dependent. So likeโฆ whatever the implementation feels like that day ๐
See also
rte_event_dequeue_burst()
Definition at line 376 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_MAINTENANCE_FREE RTE_BIT32(10)
Event device does not require calls to rte_event_maintain(). ๐ Self-sufficient king.
An event device that does not set this flag does require calls to rte_event_maintain() during periods when neither rte_event_dequeue_burst() nor rte_event_enqueue_burst() are called on a port. Why tho? Because it lets the event device do its internal processing โ like flushing buffered events, returning credits to a global pool, or processing signaling related to load balancing. ๐
See also
rte_event_maintain()
Definition at line 385 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR RTE_BIT32(11)
Event device is capable of changing the queue attributes at runtime, i.e. after the rte_event_queue_setup() or rte_event_dev_start() call sequence. Glow-up mid-run, iconic ๐ธ
If this flag is not set, event queue attributes can only be configured during rte_event_queue_setup(). That's the only window, bestie.
See also
rte_event_queue_setup()
Definition at line 398 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_PROFILE_LINK RTE_BIT32(12)
Event device is capable of supporting multiple link profiles per event port. ๐ญ
When this is set, the value of rte_event_dev_info::max_profiles_per_port is greater than one, and multiple profiles may be configured and then switched at runtime. If it's not set, only a single profile may be configured โ though that single profile may itself be runtime adjustable (if RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK is set). ๐
See also
rte_event_port_profile_links_set()rte_event_port_profile_links_get()rte_event_port_profile_switch()RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK
Definition at line 408 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_ATOMIC RTE_BIT32(13)
Event device is capable of atomic scheduling. When this flag is set, the application can configure queues with scheduling type atomic on this event device. ๐ฅ
See also
RTE_SCHED_TYPE_ATOMIC
Definition at line 422 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_ORDERED RTE_BIT32(14)
Event device is capable of ordered scheduling. When this flag is set, the application can configure queues with scheduling type ordered on this event device. โจ
See also
RTE_SCHED_TYPE_ORDERED
Definition at line 430 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_PARALLEL RTE_BIT32(15)
Event device is capable of parallel scheduling. When this flag is set, the application can configure queues with scheduling type parallel on this event device. ๐
See also
RTE_SCHED_TYPE_PARALLEL
Definition at line 438 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ RTE_BIT32(16)
Event device is capable of independent enqueue. ๐ A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev supports the enqueue in any order, or specifically in a different order than the dequeue. Eventdev PMD can either dequeue events in the changed order in which they are enqueued, or restore the original order before sending them to the underlying hardware device. ๐
A flag is provided during the port configuration to inform Eventdev PMD that the application intends to use an independent enqueue order on a particular port. And note that this capability only matters for eventdevs supporting burst mode. ๐
When an implicit release is enabled on a port, Eventdev PMD will also handle the insertion of RELEASE events in place of dropped events. The independent enqueue feature only applies to FORWARD and RELEASE events. ๐ซถ
New events (op=RTE_EVENT_OP_NEW) will be dequeued in the order the application enqueues them, and do not maintain any order relative to FORWARD/RELEASE events. And FORWARD vs NEW relaxed ordering only applies to ports that have enabled the independent enqueue feature. No cap ๐งข
Definition at line 446 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE RTE_BIT32(17)
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_burst() call. Like it's literally doing your homework ahead of time bestie, no cap. ๐
See also
rte_event_dev_configure()
Definition at line 465 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE RTE_BIT32(18)
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_burst() call. So it pre-schedules only when it can, iykyk โ it's giving โจconsiderateโจ.
See also
rte_event_dev_configure()
Definition at line 477 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_PER_PORT_PRESCHEDULE RTE_BIT32(19)
Event device supports event pre-scheduling per event port. ๐
When this flag is set, the event device allows controlling the event pre-scheduling at a event port granularity. Per-port control?? Obsessed. ๐
See also
rte_event_dev_configure()rte_event_port_preschedule_modify()
Definition at line 489 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_PRESCHEDULE_EXPLICIT RTE_BIT32(20)
Event device supports explicit pre-scheduling. ๐
When this flag is set, the application can issue pre-schedule request on a event port. You ask for it, you get it. Main character energy fr fr. ๐
See also
rte_event_port_preschedule()
Definition at line 499 of file rte_eventdev.h.
#define RTE_EVENT_DEV_PRIORITY_HIGHEST 0
Highest priority level for events and queues. ๐ฅ
See also
rte_event_queue_setup()rte_event_enqueue_burst()rte_event_port_link()
Definition at line 509 of file rte_eventdev.h.
#define RTE_EVENT_DEV_PRIORITY_NORMAL 128
Normal priority level for events and queues. The default-ish, mid, unbothered vibe. ๐
See also
rte_event_queue_setup()rte_event_enqueue_burst()rte_event_port_link()
Definition at line 516 of file rte_eventdev.h.
#define RTE_EVENT_DEV_PRIORITY_LOWEST 255
Lowest priority level for events and queues. It's giving "I'll get there when I get there" energy. ๐
See also
rte_event_queue_setup()rte_event_enqueue_burst()rte_event_port_link()
Definition at line 523 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_WEIGHT_HIGHEST 255
Highest weight of an event queue. Big weight = big pull, bestie. ๐ช
See also
rte_event_queue_attr_get()rte_event_queue_attr_set()
Definition at line 532 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_WEIGHT_LOWEST 0
Lowest weight of an event queue. Basically the queue that gets picked last for dodgeball. ๐ญ
See also
rte_event_queue_attr_get()rte_event_queue_attr_set()
Definition at line 538 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_AFFINITY_HIGHEST 255
Highest scheduling affinity of an event queue. Maximum "I belong here" energy. ๐ซถ
See also
rte_event_queue_attr_get()rte_event_queue_attr_set()
Definition at line 546 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_AFFINITY_LOWEST 0
Lowest scheduling affinity of an event queue. Zero attachment, we love a detached queen. ๐
See also
rte_event_queue_attr_get()rte_event_queue_attr_set()
Definition at line 552 of file rte_eventdev.h.
#define RTE_EVENT_DEV_ATTR_PORT_COUNT 0
The count of ports. Just the number, periodt. ๐ข
Definition at line 709 of file rte_eventdev.h.
#define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1
The count of queues. Same vibe, different counter. โจ
Definition at line 713 of file rte_eventdev.h.
#define RTE_EVENT_DEV_ATTR_STARTED 2
The status of the device โ zero for stopped, non-zero for started. Vibe check on the whole device, bestie. ๐
Definition at line 717 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT RTE_BIT32(0)
Override the global dequeue_timeout_ns and use per dequeue timeout in ns. Not me letting each dequeue have its โจownโจ little timeline. ๐
See also
rte_event_dequeue_timeout_ticks(),rte_event_dequeue_burst()
Definition at line 737 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_CFG_ALL_TYPES RTE_BIT32(0)
Allow events with schedule types ATOMIC, ORDERED, and PARALLEL to be enqueued to this queue. The scheduling type to be used is that specified in each individual event. This flag can only be set when configuring queues on devices reporting the RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES capability.
Without this flag, only events with the specific scheduling type configured at queue setup can be sent to the queue.
Literally one queue, all the types. Chaos but make it supported. ๐
See also
RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPESRTE_SCHED_TYPE_ORDERED,RTE_SCHED_TYPE_ATOMIC,RTE_SCHED_TYPE_PARALLELrte_event_enqueue_burst()
Definition at line 877 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK RTE_BIT32(1)
This event queue links only to a single event port. ๐ฏ
No load-balancing of events is performed, as all events sent to this queue end up at the same event port. The number of queues on which this flag is to be set must be configured at device configuration time, by setting nb_single_link_event_port_queues parameter appropriately.
This flag serves as a hint only โ any devices without specific support for single-link queues can fall-back automatically to using regular queues with a single destination port. Delulu? No bestie, that's a documented fallback. ๐
See also
rte_event_dev_info.max_single_link_event_port_queue_pairsrte_event_dev_config.nb_single_link_event_port_queuesrte_event_port_setup(),rte_event_port_link()
Definition at line 891 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_ATTR_PRIORITY 0
Queue attribute id for the priority of the queue. ๐ฅ
Definition at line 1041 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS 1
Queue attribute id for the number of atomic flows configured for the queue. ๐
Definition at line 1045 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES 2
Queue attribute id for the number of atomic order sequences configured for the queue. Sequence girlies rise. โจ
Definition at line 1049 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
Queue attribute id for the configuration flags for the queue. Flags on flags on flags. ๐ฉ
Definition at line 1053 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
Queue attribute id for the schedule type of the queue. Which flavor of scheduling are we today? ๐
Definition at line 1057 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_ATTR_WEIGHT 5
Queue attribute id for the weight of the queue. โ๏ธ
Definition at line 1061 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_ATTR_AFFINITY 6
Queue attribute id for the affinity of the queue. ๐ซถ
Definition at line 1065 of file rte_eventdev.h.
#define RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL RTE_BIT32(0)
Configure the port not to release outstanding events in rte_event_dev_dequeue_burst(). If set, all events received through the port must be explicitly released with RTE_EVENT_OP_RELEASE or RTE_EVENT_OP_FORWARD. Must be unset if the device is not RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE capable.
Bestie listen. If you set this, the device is not cleaning up after you anymore. You release every single event yourself or it's โจundefined-vibe cityโจ. No cap, do not play with this one. ๐
Definition at line 1117 of file rte_eventdev.h.
#define RTE_EVENT_PORT_CFG_SINGLE_LINK RTE_BIT32(1)
This event port links only to a single event queue</hyperpink>single event queue. The queue it links with should be similarly configured with the RTE_EVENT_QUEUE_CFG_SINGLE_LINK flag. Matching set, we love to see it. ๐
See also
RTE_EVENT_QUEUE_CFG_SINGLE_LINKrte_event_port_setup(),rte_event_port_link()
Definition at line 1124 of file rte_eventdev.h.
#define RTE_EVENT_PORT_CFG_HINT_PRODUCER RTE_BIT32(2)
Hint that this event port will primarily enqueue events to the system. A PMD can optimize its internal workings by assuming that this port is primarily going to enqueue NEW events. She's the producer, she makes the content. ๐ฌ
Note that this flag is only a hint, so PMDs must operate under the assumption that any port can enqueue an event with any type of op.
See also
rte_event_port_setup()
Definition at line 1132 of file rte_eventdev.h.
#define RTE_EVENT_PORT_CFG_HINT_CONSUMER RTE_BIT32(3)
Hint that this event port will primarily dequeue events from the system. A PMD can optimize its internal workings by assuming that this port is primarily going to consume events, and not enqueue NEW or FORWARD events. She's the consumer, she watches the content. ๐ฟ
Note that this flag is only a hint, so PMDs must operate under the assumption that any port can enqueue an event with any type of op.
See also
rte_event_port_setup()
Definition at line 1142 of file rte_eventdev.h.
#define RTE_EVENT_PORT_CFG_HINT_WORKER RTE_BIT32(4)
Hint that this event port will primarily pass existing events through. A PMD can optimize its internal workings by assuming that this port is primarily going to FORWARD events, and not enqueue NEW or RELEASE events often. She's the worker, she does the tasks. ๐ช
Note that this flag is only a hint, so PMDs must operate under the assumption that any port can enqueue an event with any type of op.
See also
rte_event_port_setup()
Definition at line 1153 of file rte_eventdev.h.
#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ RTE_BIT32(5)
Flag to enable independent enqueue. Must not be set if the device is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature allows an application to enqueue RTE_EVENT_OP_FORWARD or RTE_EVENT_OP_RELEASE in an order different than the order the events were dequeued from the event device, while maintaining RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics.
Note that this flag only matters for Eventdevs supporting burst mode.
You get to go out of order but the semantics still have to hold. It's giving rules? respected. ๐
See also
rte_event_port_setup()
Definition at line 1164 of file rte_eventdev.h.
#define RTE_EVENT_PORT_ATTR_ENQ_DEPTH 0
Port attribute id for the maximum size of a burst enqueue operation supported on a port. ๐
Definition at line 1307 of file rte_eventdev.h.
#define RTE_EVENT_PORT_ATTR_DEQ_DEPTH 1
Port attribute id for the maximum size of a dequeue burst which can be returned from a port. ๐
Definition at line 1311 of file rte_eventdev.h.
#define RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD 2
Port attribute id for the new event threshold of the port. Once the number of events in the system exceeds this threshold, the enqueue of NEW-type events will fail. Ma'am, the system is full, no more new events bestie. ๐
Definition at line 1317 of file rte_eventdev.h.
#define RTE_EVENT_PORT_ATTR_IMPLICIT_RELEASE_DISABLE 3
Port attribute id for the implicit release disable attribute of the port. ๐ค
Definition at line 1321 of file rte_eventdev.h.
#define RTE_EVENT_PORT_ATTR_INDEPENDENT_ENQ 4
Port attribute id for the Independent Enqueue</hyperpink>Independent Enqueue feature. ๐ฆ
Definition at line 1325 of file rte_eventdev.h.
#define RTE_SCHED_TYPE_ORDERED 0
Ordered scheduling โญ
okay so bestie, we were literally in the middle of the ordered-flow tea and we are NOT stopping now ๐ธ
Events from an ordered flow of an event queue can be scheduled to multiple ports for concurrent processing while maintaining the original event order, i.e. the order in which they were first enqueued to that queue. This scheme allows events pertaining to the same, potentially large, flow to be processed in parallel on multiple cores without incurring any application-level order restoration logic overhead. no cap, zero extra work on your side โจ
After events are dequeued from a set of ports, as those events are re-enqueued to another queue (with the op field set to RTE_EVENT_OP_FORWARD), the event device restores the original event order โ including events returned from all ports in the set โ before the events are placed on the destination queue, for subsequent scheduling to ports. ๐ฆ
Any events not forwarded i.e. dropped explicitly via RELEASE or implicitly released by the next dequeue operation on a port, are skipped by the reordering stage and do not affect the reordering of other returned events. they just leave the group chat, no drama ๐
Any NEW events sent on a port are not ordered with respect to FORWARD events sent on the same port, since they have no original event order. They also are not ordered with respect to NEW events enqueued on other ports. However, NEW events to the same destination queue from the same port are guaranteed to be enqueued in the order they were submitted via rte_event_enqueue_burst(). ๐
NOTE: In restoring event order of forwarded events, the eventdev API guarantees that all events from the same flow (i.e. sameflow_id, priority andqueue_id) will be put in the original order before being forwarded to the destination queue. Some eventdevs may implement stricter ordering to achieve this aim, for example, restoring the order across all flows dequeued from the sameORDEREDqueue.
See also: rte_event_queue_setup(), rte_event_dequeue_burst(), RTE_EVENT_OP_RELEASE
Definition at line 1499 of file rte_eventdev.h.
#define RTE_SCHED_TYPE_ATOMIC 1
Atomic scheduling, bestie!! ๐
Events from an atomic flow, identified by a combination of flow_id, queue_id and priority, can be scheduled only to a single port at a time. The port is guaranteed to have exclusive (atomic) access to the associated flow context, which enables the user to avoid SW synchronization. Atomic flows also maintain event ordering since only one port at a time can process events from each flow of an event queue, and events within a flow are not reordered within the scheduler. ๐
An atomic flow is locked to a port when events from that flow are first scheduled to that port. That lock remains in place until the application calls rte_event_dequeue_burst() from the same port, which implicitly releases the lock (if RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL flag is not set). User may allow the scheduler to release the lock earlier than that by invoking rte_event_enqueue_burst() with RTE_EVENT_OP_RELEASE operation for each event from that flow. ๐
NOTE: Where multiple events from the same queue and atomic flow are scheduled to a port, the lock for that flow is only released once the last event from the flow is released, or forwarded to another queue. So long as there is at least one event from an atomic flow scheduled to a port/core (including any events in the port's dequeue queue, not yet read by the application), that port will hold the synchronization lock for that flow. like it is NOT letting go until every last one of them is handled
See also: rte_event_queue_setup(), rte_event_dequeue_burst(), RTE_EVENT_OP_RELEASE
Definition at line 1537 of file rte_eventdev.h.
#define RTE_SCHED_TYPE_PARALLEL 2
Parallel scheduling โจ
The scheduler performs priority scheduling, load balancing, etc. functions but does not provide additional event synchronization or ordering. It is free to schedule events from a single parallel flow of an event queue to multiple events ports for concurrent processing. The application is responsible for flow context synchronization and event ordering (SW synchronization). ๐ญ yes babe, the sync is on YOU this time
See also: rte_event_queue_setup(), rte_event_dequeue_burst()
Definition at line 1564 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_ETHDEV 0x0
The event generated from ethdev subsystem ๐ง
Definition at line 1578 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_CRYPTODEV 0x1
The event generated from crypodev subsystem ๐
Definition at line 1580 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_TIMER 0x2
The event generated from event timer adapter โฐ
Definition at line 1582 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_CPU 0x3
The event generated from cpu for pipelining. Application may use sub_event_type to further classify the event ๐
Definition at line 1584 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_ETH_RX_ADAPTER 0x4
The event generated from event eth Rx adapter ๐
Definition at line 1588 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_DMADEV 0x5
The event generated from dma subsystem ๐
Definition at line 1590 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_VECTOR 0x8
Indicates that event is a vector. All vector event types should be a logical OR of EVENT_TYPE_VECTOR. This simplifies the pipeline design as one can split processing the events between vector events and normal event across event types. Example: if (ev.event_type & RTE_EVENT_TYPE_VECTOR) { // Classify and handle vector event. } else { // Classify and handle event. } bitwise vibes, iconic ๐ฅ
Definition at line 1592 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_ETHDEV_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETHDEV)
The event vector generated from ethdev subsystem ๐ฆ
Definition at line 1604 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_CPU_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CPU)
The event vector generated from cpu for pipelining. ๐
Definition at line 1607 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER)
The event vector generated from eth Rx adapter. ๐ธ
Definition at line 1609 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_CRYPTODEV_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CRYPTODEV)
The event vector generated from cryptodev adapter. ๐
Definition at line 1612 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_MAX 0x10
Maximum number of event types ๐ฏ
Definition at line 1616 of file rte_eventdev.h.
#define RTE_EVENT_OP_NEW 0
The op field must be set to this operation type to inject a new event, i.e. one not previously dequeued, into the event device, to be scheduled for processing. fresh event, just dropped into the party โจ
Definition at line 1620 of file rte_eventdev.h.
#define RTE_EVENT_OP_FORWARD 1
The application must set the op field to this operation type to return a previously dequeued event to the event device to be scheduled for further processing. ๐ซถ
This event must be enqueued to the same port that the event to be forwarded was dequeued from. same port, bestie, do not switch it up
The event's fields, including (but not limited to) flow_id, scheduling type, destination queue, and event payload e.g. mbuf pointer, may all be updated as desired by the application, but the impl_opaque field must be kept to the same value as was present when the event was dequeued. โ ๏ธ
Definition at line 1625 of file rte_eventdev.h.
#define RTE_EVENT_OP_RELEASE 2
Release the flow context associated with the schedule type. ๐๏ธ
If current flow's scheduler type method is RTE_SCHED_TYPE_ATOMIC then this operation type hints the scheduler that the user has completed critical section processing for this event in the current atomic context, and that the scheduler may unlock any atomic locks held for this event. If this is the last event from an atomic flow, i.e. all flow locks are released (see RTE_SCHED_TYPE_ATOMIC for details), the scheduler is now allowed to schedule events from that flow from to another port. However, the atomic locks may be still held until the next rte_event_dequeue_burst() call; enqueuing an event with opt type RTE_EVENT_OP_RELEASE is a hint only, allowing the scheduler to release the atomic locks early, but not requiring it to do so. a HINT, not a command, iykyk
Early atomic lock release may increase parallelism and thus system performance, but the user needs to design carefully the split into critical vs non-critical sections. ๐
If current flow's scheduler type method is RTE_SCHED_TYPE_ORDERED then this operation type informs the scheduler that the current event has completed processing and will not be returned to the scheduler, i.e. it has been dropped, and so the reordering context for that event should be considered filled. ๐ฆ
Events with this operation type must only be enqueued to the same port that the event to be released was dequeued from. The impl_opaque field in the release event must have the same value as that in the original dequeued event. again: same port, same impl_opaque, periodt
If a dequeued event is re-enqueued with operation type of RTE_EVENT_OP_RELEASE, then any subsequent enqueue of that event - or a copy of it - must be done as event of type RTE_EVENT_OP_NEW, not RTE_EVENT_OP_FORWARD. This is because any context for the originally dequeued event, i.e. atomic locks, or reorder buffer entries, will have been removed or invalidated by the release operation. ๐ญ it's giving "you can never go back", fr fr
Definition at line 1637 of file rte_eventdev.h.
#define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1
This flag is sent when the packet transfer mechanism is in HW. Ethdev can send packets to the event device using internal event port. ๐ฅ
Definition at line 1803 of file rte_eventdev.h.
#define RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 0x2
Adapter supports multiple event queues per ethdev. Every ethdev Rx queue can be connected to a unique event queue. ๐
Definition at line 1807 of file rte_eventdev.h.
#define RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID 0x4
The application can override the adapter generated flow ID in the event. This flow ID can be specified when adding an ethdev Rx queue to the adapter using the ev.flow_id member. ๐
See also: struct rte_event_eth_rx_adapter_queue_conf::ev, struct rte_event_eth_rx_adapter_queue_conf::rx_queue_flags
Definition at line 1811 of file rte_eventdev.h.
#define RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR 0x8
Adapter supports event vectorization per ethdev. ๐
Definition at line 1818 of file rte_eventdev.h.
#define RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT RTE_BIT32(0)
This flag is set when the timer mechanism is in HW. โฐ
Definition at line 1843 of file rte_eventdev.h.
#define RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC RTE_BIT32(1)
This flag is set if periodic mode is supported. ๐
Definition at line 1846 of file rte_eventdev.h.
#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1
Flag indicates HW is capable of generating events in RTE_EVENT_OP_NEW enqueue operation. Cryptodev will send packets to the event device as new events using an internal event port. ๐
Definition at line 1866 of file rte_eventdev.h.
#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2โ so this flag is literally saying the HW can generate events inRTE_EVENT_OP_FORWARDenqueue operation, and Cryptodev will send packets to the event device as forwarded event using an internal event port. It's giving "I got this" energy. ๐- ๐ Definition at line 1873 of file
rte_eventdev.h.
- ๐ Definition at line 1873 of file
#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND 0x4โ bestie, this flag indicates HW is capable of mapping crypto queue pair to event queue. No cap. โจ- ๐ Definition at line 1880 of file
rte_eventdev.h.
- ๐ Definition at line 1880 of file
#define RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA 0x8โ this flag indicates HW/SW supports a mechanism to store and retrieve the private data information along with the crypto session. Periodt. ๐- ๐ Definition at line 1885 of file
rte_eventdev.h.
- ๐ Definition at line 1885 of file
#define RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR 0x10โ flag indicates HW is capable of aggregating processed crypto operations intorte_event_vector. It's giving aggregation slay. ๐- ๐ Definition at line 1890 of file
rte_eventdev.h.
- ๐ Definition at line 1890 of file
#define RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1โ flag indicates HW is capable of generating events inRTE_EVENT_OP_NEWenqueue operation. DMADEV will send packets to the event device as new events using an internal event port. Lowkey iconic. ๐- ๐ Definition at line 1919 of file
rte_eventdev.h.
- ๐ Definition at line 1919 of file
#define RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2โ flag indicates HW is capable of generating events inRTE_EVENT_OP_FORWARDenqueue operation. DMADEV will send packets to the event device as forwarded event using an internal event port. Fr fr. ๐- ๐ Definition at line 1926 of file
rte_eventdev.h.
- ๐ Definition at line 1926 of file
#define RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_VCHAN_EV_BIND 0x4โ flag indicates HW is capable of mapping DMA vchan to event queue. That's the vibe. ๐ฆ- ๐ Definition at line 1933 of file
rte_eventdev.h.
- ๐ Definition at line 1933 of file
#define RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT 0x1โ this flag is sent when the PMD supports a packet transmit callback. Not me being a callback. ๐- ๐ Definition at line 1961 of file
rte_eventdev.h.
- ๐ Definition at line 1961 of file
#define RTE_EVENT_ETH_TX_ADAPTER_CAP_EVENT_VECTOR 0x2โ indicates that the Tx adapter is capable of handling event vector of mbufs. It's giving vector realness. ๐ฆ- ๐ Definition at line 1964 of file
rte_eventdev.h.
- ๐ Definition at line 1964 of file
#define RTE_EVENT_VECTOR_ADAPTER_CAP_INTERNAL_PORT 0x1โ this flag is set when the vector adapter is capable of generating events using an internal event port. Main character energy. ๐- ๐ Definition at line 1990 of file
rte_eventdev.h.
- ๐ Definition at line 1990 of file
#define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64โ maximum name length for extended statistics counters. So like, 64 characters, bestie. Don't exceed. ๐ซ- ๐ Definition at line 2397 of file
rte_eventdev.h.
- ๐ Definition at line 2397 of file
#define RTE_EVENT_DEV_MAINT_OP_FLUSH (1 << 0)โ force an immediately flush of any buffered events in the port, potentially at the cost of additional overhead. The way that overhead is real. ๐ญ- ๐ See also:
rte_event_maintain() - ๐ Definition at line 2868 of file
rte_eventdev.h.
- ๐ See also:
โจ Typedef Documentation โจ
typedef void(* rte_eventdev_port_flush_t) (uint8_t dev_id, struct rte_event event, void *arg)โ callback function prototype that can be passed duringrte_event_port_release(), invoked once per a released event. So it's like, "hey, I'm called when you release an event." ๐- ๐ Definition at line 1269 of file
rte_eventdev.h.
- ๐ Definition at line 1269 of file
typedef void(* rte_eventdev_stop_flush_t) (uint8_t dev_id, struct rte_event event, void *arg)โ callback function called duringrte_event_dev_stop(), invoked once per flushed event. So when you stop, this gets called for each flushed event. No cap. โจ- ๐ Definition at line 1390 of file
rte_eventdev.h.
- ๐ Definition at line 1390 of file
๐ฆ Enumeration Type Documentation ๐ฆ
enum rte_event_dev_preschedule_type
Event device pre-schedule type enumeration. So like, your pre-schedule vibes. โจ
Enumerator
RTE_EVENT_PRESCHEDULE_NONEโ Disable pre-schedule across the event device or on a given event port.preschedule_type rte_event_port_preschedule_modify(). It's giving "none" energy.RTE_EVENT_PRESCHEDULEโ Enable pre-schedule always across the event device or a given event port.preschedule_type rte_event_port_preschedule_modify(). Always on, periodt.- ๐ See also:
RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULERTE_EVENT_DEV_CAP_PER_PORT_PRESCHEDULE
- ๐ See also:
RTE_EVENT_PRESCHEDULE_ADAPTIVEโ Enable adaptive pre-schedule across the event device or a given event port. Delay issuing pre-schedule until there are no forward progress constraints with the held flow contexts.preschedule_type rte_event_port_preschedule_modify(). Adaptive slay. ๐- ๐ See also:
RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVERTE_EVENT_DEV_CAP_PER_PORT_PRESCHEDULE
- ๐ See also:
๐ Definition at line 743 of file rte_eventdev.h.
enum rte_event_dev_xstats_mode
Selects the component of the eventdev to retrieve statistics from. So like, which stats you want? ๐
๐ Definition at line 2402 of file rte_eventdev.h.
๐ Function Documentation ๐
uint8_t rte_event_dev_count (void )
Get the total number of event devices. So how many event devices we got? Let's count. ๐ข
Returns
- The total number of usable event devices.
int rte_event_dev_get_dev_id (const char * name)
Get the device identifier for the named event device. So you give a name, you get the dev_id. Slay. ๐
Parameters
nameโ Event device name to select the event device identifier.
Returns
- Event device identifier (
dev_id >= 0) on success. Negative error code on failure:-EINVALโ inputnameparameter is invalid.-ENODEVโ no event device found with that name.
int rte_event_dev_socket_id (uint8_t dev_id)
Return the NUMA socket to which a device is connected. So like, where does this device live? ๐
Parameters
dev_idโ The identifier of the device.
Returns
- The NUMA socket id to which the device is connected or a default of zero if the socket could not be determined.
-EINVALon error, where the givendev_idvalue does not correspond to any event device.
int rte_event_dev_info_get (uint8_t dev_id, struct rte_event_dev_info * dev_info)
Retrieve details of an event device's capabilities and configuration limits. So you want the tea on this device? Here it is. โ๏ธ
Parameters
dev_idโ The identifier of the device.dev_infoโ A pointer to a structure of typerte_event_dev_infoto be filled with the information about the device's capabilities.
Returns
0: Success, information about the event device is present indev_info.<0: Failure, error code returned by the function.-EINVALโ invalid input parameters, e.g. incorrect device id.-ENOTSUPโ device does not support returning capabilities information.
int rte_event_dev_attr_get (uint8_t dev_id, uint32_t attr_id, uint32_t * attr_value)
Get an attribute from a device. So like, ask for an attribute, get it. ๐
Parameters
dev_idโ Eventdev idattr_idโ The attribute ID to retrieveattr_valueโ A pointer that will be filled in with the attribute value if successful.
Returns
0: Successfully retrieved attribute value-EINVAL: Invalid device orattr_idprovided, orattr_valueisNULL
int rte_event_dev_configure (uint8_t dev_id, const struct rte_event_dev_config * dev_conf)
Configure an event device.
This function must be invoked before any other configuration function in the API, when preparing an event device for application use. This function can also be re-invoked when a device is in the stopped state. So like, you gotta call this first, bestie. No cap.
The caller should use rte_event_dev_info_get() to get the capabilities and resource limits for this event device before calling this API. Many values in the dev_conf input parameter are subject to limits given in the device information returned from rte_event_dev_info_get(). So check the limits first, periodt.
Parameters
dev_idโ The identifier of the device to configure.dev_confโ The event device configuration structure.
Returns
0: Success, device configured.<0: Error code returned by the driver configuration function.-ENOTSUPโ device does not support configuration.-EINVALโ invalid input parameter.-EBUSYโ device has already been started.
int rte_event_queue_default_conf_get (uint8_t dev_id, uint8_t queue_id, struct rte_event_queue_conf * queue_conf)
Retrieve the default configuration information of an event queue designated by its queue_id from the event driver for an event device. So default tea for your queue. ๐ต
This function intended to be used in conjunction with rte_event_queue_setup() where caller needs to set up the queue by overriding few default values. So like, pick and choose what to change.
Parameters
dev_idโ The identifier of the device.queue_idโ The index of the event queue to get the configuration information. The value must be less thannb_event_queuespreviously supplied torte_event_dev_configure().queue_confโ The pointer to the default event queue configuration data.
Returns
0: Success, driver updates the default event queue configuration data.<0: Error code returned by the driver info get function.
๐ See also: rte_event_queue_setup()
int rte_event_queue_setup (uint8_t dev_id, uint8_t queue_id, const struct rte_event_queue_conf * queue_conf)
Allocate and set up an event queue for an event device. So like, build that queue, bestie. ๐ ๏ธ
Parameters
dev_idโ The identifier of the device.queue_idโ The index of the event queue to setup. The value must be less thannb_event_queuespreviously supplied torte_event_dev_configure().queue_confโ The pointer to the configuration data to be used for the event queue.NULLvalue is allowed, in which case default configuration used.
๐ See also: rte_event_queue_default_conf_get()
Returns
0: Success, event queue correctly set up.<0: event queue configuration failed.
int rte_event_queue_attr_get (uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, uint32_t * attr_value)
Get an attribute of an event queue. So like, get that attribute. ๐
Parameters
dev_idโ The identifier of the device.queue_idโ The index of the event queue to query. The value must be less thannb_event_queuespreviously supplied torte_event_dev_configure().attr_idโ The attribute ID to retrieve (RTE_EVENT_QUEUE_ATTR_*).attr_valueโ A pointer that will be filled in with the attribute value if successful.
Returns
0: Successfully returned value-EINVAL: invalid device, queue orattr_idprovided, orattr_valuewasNULL.-EOVERFLOW: returned whenattr_idis set toRTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPEandRTE_EVENT_QUEUE_CFG_ALL_TYPESis set in the queue configuration flags.
int rte_event_queue_attr_set (uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, uint64_t attr_value)
Set an event queue attribute. So like, you're setting it. Slay. ๐
Parameters
dev_idโ The identifier of the device.queue_idโ The index of the event queue to configure. The value must be less thannb_event_queuespreviously supplied torte_event_dev_configure().attr_idโ The attribute ID to set (RTE_EVENT_QUEUE_ATTR_*).attr_valueโ The attribute value to set.
Returns
0: Successfully set attribute.<0: failed to set event queue attribute.-EINVAL: invalid device, queue orattr_id.-ENOTSUP: device does not support setting the event attribute.
rte_event_port_default_conf_get()</p> โ the "give me the factory settings bestie" function ๐
int rte_event_port_default_conf_get(uint8_t dev_id, uint8_t port_id,
struct rte_event_port_conf *port_conf)
Okay so this one pulls the default configuration info of an event port โ the one designated by its port_id โ straight from the event driver for an event device. ๐
It's made to be used hand-in-hand with rte_event_port_setup(), so the caller can set the port up while only overriding a few default values. Like, why rewrite the whole config when you can just tweak the two things you care about? Iconic behavior, honestly. โจ
Parameters (the lore ๐ซถ)
dev_idโ the identifier of the device.port_idโ the index of the event port to get the configuration information. The value must be less thannb_event_portspreviously supplied torte_event_dev_configure().port_confโ the pointer to a structure to store the default event port configuration data.
Returns
0: Success, driver updates the default event port configuration data.<0: Error code returned by the driver info get function.-EINVALโ invalid input parameter.-ENOTSUPโ function is not supported for this device.
See also
rte_event_port_setup()
rte_event_port_setup()</p> โ allocate + set up the port, no cap ๐ง
int rte_event_port_setup(uint8_t dev_id, uint8_t port_id,
const struct rte_event_port_conf *port_conf)
Allocate and set up an event port for an event device. That's it, that's the vibe. ๐
Parameters
dev_idโ the identifier of the device.port_idโ the index of the event port to setup. The value must be less thannb_event_portspreviously supplied torte_event_dev_configure().port_confโ the pointer to the configuration data to be used for the port. ANULLvalue is allowed, in which case the default configuration is used.
See also
rte_event_port_default_conf_get()
Returns
0: Success, event port correctly set up.<0: Port configuration failed.-EINVALโ Invalid input parameter.-EBUSYโ Port already started.-ENOTSUPโ Function not supported on this device, or aNULLpointer passed as theport_confparameter, and no default configuration function available for this device.-EDQUOTโ Application tried to link a queue configured withRTE_EVENT_QUEUE_CFG_SINGLE_LINKto more than one event port.
rte_event_port_quiesce()</p> โ the "wrap it up, we're leaving this lcore" moment ๐ฆ
void rte_event_port_quiesce(uint8_t dev_id, uint8_t port_id,
rte_eventdev_port_flush_t release_cb, void *args)
Quiesce any core-specific resources consumed by the event port. โจ
So here's the tea: event ports are generally coupled with lcores, and a given Hardware implementation might need the PMD to store port-specific data in the lcore. When the application decides to migrate the event port to another lcore, or teardown the current lcore, it may call rte_event_port_quiesce to make sure that all the data associated with the event port are released from the lcore โ and ngl that might also include any prefetched events. While releasing the event port from the lcore, this function calls the user-provided flush callback once per event. ๐
Note โ Invocation of this API does not affect the existing port configuration. ๐
Parameters
dev_idโ the identifier of the device.port_idโ the index of the event port to quiesce. The value must be less thannb_event_portspreviously supplied torte_event_dev_configure().release_cbโ Callback function invoked once per flushed event.argsโ Argument supplied to callback.
rte_event_port_attr_get()</p> โ get an attribute, periodt ๐
int rte_event_port_attr_get(uint8_t dev_id, uint8_t port_id,
uint32_t attr_id, uint32_t *attr_value)
Get an attribute from a port. Simple as that, bestie. ๐ธ
Parameters
dev_idโ the identifier of the device.port_idโ the index of the event port to query. The value must be less thannb_event_portspreviously supplied torte_event_dev_configure().attr_idโ The attribute ID to retrieve (RTE_EVENT_PORT_ATTR_*)attr_valueโ A pointer that will be filled in with the attribute value if successful
Returns
0: Successfully returned value.(-EINVAL)Invalid device, port orattr_id, orattr_valuewasNULL.
rte_event_dev_start()</p> โ press play on the device โถ๏ธ๐ฅ
int rte_event_dev_start(uint8_t dev_id)
Start an event device. It's giving main character energy. ๐ซ
The device start step is the last one in device setup, and it enables the event ports and queues to start accepting events and scheduling them to event ports. ๐
On success, all basic functions exported by the API (event enqueue, event dequeue and so on) can be invoked. Slay. โจ
Parameters
dev_idโ Event device identifier.
Returns
0: Success, device started.-EINVAL: Invalid device id provided.-ENOTSUP: Device does not support this operation.-ESTALE: Not all ports of the device are configured.-ENOLINK: Not all queues are linked, which could lead to deadlock. (yeah, deadlock. not cute. link your queues fr fr)
rte_event_dev_stop()</p> โ the shutdown, but make it graceful ๐ญ
void rte_event_dev_stop(uint8_t dev_id)
Stop an event device. ๐
This function causes all queued events to be drained, including those residing in event ports. While draining events out of the device, this function calls the user-provided flush callback (if one was registered) once per event. ๐ซถ
The device can be restarted with a call to rte_event_dev_start().
Careful bestie: Threads that continue to enqueue/dequeue while the device is stopped, or being stopped, will result in undefined behavior. This includes event adapters, which must be stopped prior to stopping the eventdev.
Parameters
dev_idโ Event device identifier.
See also
rte_event_dev_stop_flush_callback_register()
rte_event_dev_stop_flush_callback_register()</p> โ register the "clean up after me" callback ๐งน๐
int rte_event_dev_stop_flush_callback_register(uint8_t dev_id,
rte_eventdev_stop_flush_t callback, void *userdata)
Registers a callback function to be invoked during rte_event_dev_stop() for each flushed event. This function can be used to properly dispose of queued events โ for example, events containing memory pointers. (Nobody wants a leak, bestie. ๐ซถ)
The callback function is only registered for the calling process. The callback function must be registered in every process that can call rte_event_dev_stop().
Only one callback function may be registered. Each new call replaces the existing registered callback function with the new function passed in. ๐
To unregister a callback, call this function with a NULL callback pointer.
Parameters
dev_idโ The identifier of the device.callbackโ Callback function to be invoked once per flushed event. PassNULLto unset any previously-registered callback function.userdataโ Argument supplied to callback.
Returns
0on success.-EINVALifdev_idis invalid.
See also
rte_event_dev_stop()
rte_event_dev_close()</p> โ the final goodbye, no takebacks ๐
int rte_event_dev_close(uint8_t dev_id)
Close an event device. The device cannot be restarted! Like, at all. It's over. It's giving end of an era. ๐ญ
Parameters
dev_idโ Event device identifier.
Returns
0on successfully closing device<0on failure to close device.-EINVALโ invalid device id.-ENOTSUPโ operation not supported for this device.-EAGAINโ device is busy.
struct __rte_aligned(16)</p> โ the event vector glow-up ๐ฆโจ
struct __rte_aligned(16)
Event vector structure. Here's what's inside her ๐
- < Number of elements valid in this event vector.
- < Offset into the vector array where valid elements start from.
- < Reserved for future use
- < Indicates that the below union attributes have valid information.
- < Ethernet device port id.
- < Ethernet device queue id.
- < Union to hold common attributes of the vector array.
- < Implementation specific opaque value. An implementation may use this field to hold implementation specific value to share between dequeue and enqueue operation. The application should not modify this field.
- < Start of the vector array union. Depending upon the event type the vector array can be an array of mbufs or pointers or opaque
u64values.
Definition at line 1441 of file rte_eventdev.h.
rte_event_eth_rx_adapter_caps_get()</p> โ what can the Rx adapter do ๐
int rte_event_eth_rx_adapter_caps_get(uint8_t dev_id, uint16_t eth_port_id,
uint32_t *caps)
Retrieve the event device's ethdev Rx adapter capabilities for the specified ethernet port. ๐
Parameters
dev_idโ The identifier of the device.eth_port_idโ The identifier of the ethernet device.capsโ A pointer to memory filled with Rx event adapter capabilities.
Returns
0: Success, driver provides Rx event adapter capabilities for the ethernet device.<0: Error code returned by the driver function.
rte_event_timer_adapter_caps_get()</p> โ timer adapter tea โฐ
int rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps)
Retrieve the event device's timer adapter capabilities. โจ
Parameters
dev_idโ The identifier of the device.capsโ A pointer to memory to be filled with event timer adapter capabilities.
Returns
0: Success, driver provided event timer adapter capabilities.<0: Error code returned by the driver function.
rte_event_crypto_adapter_caps_get()</p> โ crypto adapter capabilities ๐
int rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id,
uint32_t *caps)
Retrieve the event device's crypto adapter capabilities for the specified cryptodev device. ๐
Parameters
dev_idโ The identifier of the device.cdev_idโ The identifier of the cryptodev device.capsโ A pointer to memory filled with event adapter capabilities. It is expected to be pre-allocated & initialized by caller. (yes, you. don't be lazy bestie ๐ซถ)
Returns
0: Success, driver provides event adapter capabilities for the cryptodev device.<0: Error code returned by the driver function.
rte_event_dma_adapter_caps_get()</p> โ DMA adapter capabilities, experimental era ๐งช
__rte_experimental
int rte_event_dma_adapter_caps_get(uint8_t dev_id, uint8_t dmadev_id,
uint32_t *caps)
Retrieve the event device's DMA adapter capabilities for the specified dmadev device. ๐ฅ
Heads up: this one is marked __rte_experimental, so iykyk โ experimental APIs can shift under you. ๐
Parameters
dev_idโ The identifier of the device.dmadev_idโ The identifier of the dmadev device.capsโ A pointer to memory filled with event adapter capabilities. It is expected to be pre-allocated & initialized by caller.
Returns
0: Success, driver provides event adapter capabilities for the dmadev device.<0: Error code returned by the driver function.
rte_event_eth_tx_adapter_caps_get()</p> โ Tx adapter capabilities ๐ค
int rte_event_eth_tx_adapter_caps_get(uint8_t dev_id, uint16_t eth_port_id,
uint32_t *caps)
Retrieve the event device's eth Tx adapter capabilities. ๐ธ
Parameters
dev_idโ The identifier of the device.eth_port_idโ The identifier of the ethernet device.capsโ A pointer to memory filled with eth Tx adapter capabilities.
Returns
0: Success, driver provides eth Tx adapter capabilities.<0: Error code returned by the driver function.
rte_event_dequeue_timeout_ticks()</p> โ nanoseconds in, ticks out ๐
int rte_event_dequeue_timeout_ticks(uint8_t dev_id, uint64_t ns,
uint64_t *timeout_ticks)
Converts nanoseconds to timeout_ticks value for rte_event_dequeue_burst(). ๐ฆ
If the device is configured with RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT flag then application can use this function to convert timeout value in nanoseconds to implementations specific timeout value supplied in rte_event_dequeue_burst()
Parameters
dev_idโ the identifier of the device, like which one, bestie ๐nsโ how long we're waiting, in nanoseconds โณtimeout_ticksโ the value that gets handed over to thetimeout_ticksparameter ofrte_event_dequeue_burst()โจ
Returns
0on success โ we love to see it ๐-ENOTSUPif the device does not support timeouts, rip ๐ญ-EINVALifdev_idis invalid, or iftimeout_ticksisNULL- other values
< 0on failure ๐
See also
rte_event_dequeue_burst(), RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT, rte_event_dev_configure()
int rte_event_port_link (uint8_t dev_id, uint8_t port_id, const uint8_t queues[], const uint8_t priorities[], uint16_t nb_links)
OK so this one links a whole bunch of source event queues (the ones you dropped into queues) to the destination event port, which is picked out by its port_id, and every link carries its own service priority that you supply in priorities. All of this happens on the event device you named with its dev_id ๐ฆ
Setting up the link shall enable the event port port_id to actually receive events from the event queue(s) you listed in queues โจ
And lowkey, an event queue can link to one or more event ports. How many links you can establish from an event queue to an event port? That's implementation defined, so vibe check your device first ๐
The whole event queue(s)-to-event-port link establishment situation can be changed at runtime, no re-configuring the device needed โ that's for supporting scaling, and for reducing the latency of critical work by establishing the link with more event ports at runtime ๐ฅ
When the value of rte_event_dev_info::max_profiles_per_port is greater than or equal to one, this function links the event queues to the default profile_id, i.e. profile_id 0 of the event port. Noted, bestie ๐
Parameters
dev_idโ the identifier of the device ๐port_idโ the event port identifier, so it knows which destination port to link ๐ฏqueuesโ points to an array ofnb_linksevent queues that are getting linked to the event port. ANULLvalue is allowed! In that case this function links all the configured event queuesnb_event_queuesthat you previously supplied torte_event_dev_configure(), over to the event portport_id๐ธprioritiesโ points to an array ofnb_linksservice priorities, one associated with each event queue link to the event port. The priority defines the event port's servicing priority for that event queue โ although, ngl, an implementation may just ignore it. The requested priority should land in the range of[RTE_EVENT_DEV_PRIORITY_HIGHEST, RTE_EVENT_DEV_PRIORITY_LOWEST]. The implementation shall normalize the requested priority down to whatever priority value it actually supports. ANULLvalue is allowed too โ in that case the function links the event queues withRTE_EVENT_DEV_PRIORITY_NORMALservicing priority ๐ซถnb_linksโ the number of links to establish. Heads up: this parameter is ignored ifqueuesisNULL๐
Returns
The number of links actually established, so don't just assume it's all of them ๐ญ That return value can be less than the value of the nb_links parameter when the implementation has a limitation on a specific queue-to-port link establishment, or if invalid parameters got specified in queues.
If the return value is less than nb_links, the remaining links at the end of link[] are not established, and the caller has to take care of them โ no cap, that's on you ๐ซก If the return value is less than nb_links then the implementation shall update rte_errno accordingly. Possible rte_errno values are:
- (
EDQUOT) Quota exceeded โ the application tried to link the queue configured withRTE_EVENT_QUEUE_CFG_SINGLE_LINKto more than one event ports - (
EINVAL) Invalid parameter
int rte_event_port_unlink (uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint16_t nb_unlinks)
This is the breakup function ๐ It unlinks multiple source event queues (supplied in queues) from the destination event port picked out by its port_id, on the event device named by its dev_id.
The unlink call issues an async request to disable the event port port_id from receiving events from the specified event queue queue_id. And yes, event queue(s)-to-event-port unlink establishment can be changed at runtime, no re-configuring the device required ๐
When the value of rte_event_dev_info::max_profiles_per_port is greater than or equal to one, this function unlinks the event queues from the default profile identifier, i.e. profile 0 of the event port โจ
See also
rte_event_port_unlinks_in_progress() โ use it to poll for completed unlinks ๐
Parameters
dev_idโ the identifier of the device ๐port_idโ the event port identifier, so it knows which destination port to unlink ๐ซqueuesโ points to an array ofnb_unlinksevent queues to be unlinked from the event port.NULLvalue is allowed โ in that case this function unlinks all the event queue(s) from the event portport_id๐nb_unlinksโ the number of unlinks to establish. This parameter is ignored ifqueuesisNULL๐
Returns
The number of unlinks successfully requested. The return value can be less than the value of the nb_unlinks parameter when the implementation has a limitation on a specific queue-to-port unlink establishment, or if invalid parameters are specified ๐ญ
If the return value is less than nb_unlinks, the remaining queues at the end of queues[] are not unlinked, and the caller has to take care of them โ yeah, that's your problem now ๐ซก If the return value is less than nb_unlinks then the implementation shall update rte_errno accordingly. Possible rte_errno values are:
- (
EINVAL) Invalid parameter
__rte_experimental int rte_event_port_profile_links_set (uint8_t dev_id, uint8_t port_id, const uint8_t queues[], const uint8_t priorities[], uint16_t nb_links, uint8_t profile_id)
__rte_experimental โ girl, this is experimental, so proceed with main character caution ๐
This one links multiple source event queues (in queues) to the destination event port designated by its port_id, with an associated profile identifier supplied in profile_id, and service priorities supplied in priorities, all on the event device designated by its dev_id ๐ฆ
If profile_id is set to 0 then, get this, the links created by the call rte_event_port_link will be overwritten ๐
Event ports by default use profile_id 0 unless it's changed using the call rte_event_port_profile_switch() โจ
The link establishment shall enable the event port port_id from receiving events from the specified event queue(s) supplied in queues ๐ธ
An event queue may link to one or more event ports. The number of links that can be established from an event queue to an event port is implementation defined, iykyk ๐
Event queue(s)-to-event-port link establishment can be changed at runtime without re-configuring the device, for supporting scaling and for reducing the latency of critical work by establishing the link with more event ports at runtime ๐ฅ
Parameters
dev_idโ the identifier of the device ๐port_idโ the event port identifier, selecting the destination port to link ๐ฏqueuesโ points to an array ofnb_linksevent queues to be linked to the event port.NULLvalue is allowed โ in which case this function links all the configured event queuesnb_event_queueswhich were previously supplied torte_event_dev_configure(), to the event portport_id๐prioritiesโ points to an array ofnb_linksservice priorities associated with each event queue link to the event port. The priority defines the event port's servicing priority for the event queue, which may be ignored by an implementation. The requested priority should be in the range of[RTE_EVENT_DEV_PRIORITY_HIGHEST, RTE_EVENT_DEV_PRIORITY_LOWEST]. The implementation shall normalize the requested priority to an implementation-supported priority value.NULLvalue is allowed โ in which case this function links the event queues withRTE_EVENT_DEV_PRIORITY_NORMALservicing priority ๐ซถnb_linksโ the number of links to establish. This parameter is ignored ifqueuesisNULL๐profile_idโ the profile identifier associated with the links between event queues and the event port. Should be less than the max capability reported byrte_event_dev_info::max_profiles_per_port๐
Returns
The number of links actually established. The return value can be less than the value of the nb_links parameter when the implementation has a limitation on a specific queue-to-port link establishment, or if invalid parameters are specified in queues. If the return value is less than nb_links, the remaining links at the end of link[] are not established, and the caller has to take care of them ๐ญ If the return value is less than nb_links then the implementation shall update rte_errno accordingly. Possible rte_errno values are:
- (
EDQUOT) Quota exceeded โ the application tried to link the queue configured withRTE_EVENT_QUEUE_CFG_SINGLE_LINKto more than one event ports - (
EINVAL) Invalid parameter
__rte_experimental int rte_event_port_profile_unlink (uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint16_t nb_unlinks, uint8_t profile_id)
__rte_experimental โ experimental again, bestie, be aware ๐
Unlinks multiple source event queues supplied in queues that belong to the profile designated by profile_id, from the destination event port designated by its port_id, on the event device designated by its dev_id ๐
If profile_id is set to 0, i.e. the default profile, then this function will act as rte_event_port_unlink โจ
The unlink call issues an async request to disable the event port port_id from receiving events from the specified event queue queue_id. Event queue(s)-to-event-port unlink establishment can be changed at runtime without re-configuring the device ๐ฆ
See also
rte_event_port_unlinks_in_progress() โ to poll for completed unlinks ๐
Parameters
dev_idโ the identifier of the device ๐port_idโ the event port identifier, to select the destination port to unlink ๐ซqueuesโ points to an array ofnb_unlinksevent queues to be unlinked from the event port.NULLvalue is allowed โ in which case this function unlinks all the event queue(s) from the event portport_id๐nb_unlinksโ the number of unlinks to establish. This parameter is ignored ifqueuesisNULL๐profile_idโ the profile identifier associated with the links between event queues and the event port. Should be less than the max capability reported byrte_event_dev_info::max_profiles_per_port๐
Returns
The number of unlinks successfully requested. The return value can be less than the value of the nb_unlinks parameter when the implementation has a limitation on a specific queue-to-port unlink establishment, or if invalid parameters are specified ๐ญ
If the return value is less than nb_unlinks, the remaining queues at the end of queues[] are not unlinked, and the caller has to take care of them ๐ซก If the return value is less than nb_unlinks then the implementation shall update rte_errno accordingly. Possible rte_errno values are:
- (
EINVAL) Invalid parameter
int rte_event_port_unlinks_in_progress (uint8_t dev_id, uint8_t port_id)
Returns the number of unlinks in progress ๐
Bestie, quick vibe check: this function is how you find out when an unlink has actually been finished by the implementation. That's it, that's the whole job. It's giving "are we there yet" but for teardown.
See also: rte_event_port_unlink() โ that's the one you use to actually issue the unlink requests. This one just watches ๐
Parameters:
- dev_id โ the identifier of the device.
- port_id โ event port identifier, picks which port you're checking for unlinks in progress.
Returns:
- The number of unlinks that are in progress. A return of zero means there are no outstanding unlink requests at all โ clean slate, we love that ๐
- A positive return value means that many unlinks are in progress but not finished yet.
- A negative return value means an error, and
-EINVALspecifically means you passed an invalid parameter fordev_idorport_id. Oops ๐
int rte_event_port_links_get (uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint8_t priorities[])
Okay so this one retrieves the list of source event queues and their associated service priority that are linked to the destination event port โ the port being the one designated by its port_id, on the event device designated by its dev_id. Receipts for your links โจ
Parameters:
- dev_id โ the identifier of the device.
- port_id โ event port identifier.
- queues โ points to an array of queues for output. The caller has to allocate
RTE_EVENT_MAX_QUEUES_PER_DEVbytes to store the event queue(s) linked with event port port_id. Yes, YOU allocate it, it does not do it for you, no cap. - priorities โ points to an array of priorities for output. The caller has to allocate
RTE_EVENT_MAX_QUEUES_PER_DEVbytes to store the service priority associated with each event queue linked.
Returns:
- The number of links established on the event port designated by its
port_id. <0on failure. ๐
__rte_experimental int rte_event_port_profile_links_get (uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint8_t priorities[], uint8_t profile_id)
Same energy as above but make it profile-aware ๐ โ this retrieves the list of source event queues and their service priority associated to a profile_id, and linked to the destination event port designated by its port_id, on the event device designated by its dev_id.
Heads up bestie: this one is __rte_experimental, so act accordingly.
Parameters:
- dev_id โ the identifier of the device.
- port_id โ event port identifier.
- queues โ points to an array of queues for output. The caller has to allocate
RTE_EVENT_MAX_QUEUES_PER_DEVbytes to store the event queue(s) linked with event port port_id. - priorities โ points to an array of priorities for output. The caller has to allocate
RTE_EVENT_MAX_QUEUES_PER_DEVbytes to store the service priority associated with each event queue linked. - profile_id โ the profile identifier associated with the links between event queues and event port. Should be less than the max capability reported by
rte_event_dev_info::max_profiles_per_port. Don't overshoot it ๐
Returns:
- The number of links established on the event port designated by its
port_id. <0on failure.
int rte_event_dev_service_id_get (uint8_t dev_id, uint32_t * service_id)
Retrieves the service ID of the event dev. And here's the plot twist: if the adapter doesn't use a rte_service function, this function returns -ESRCH. It's literally giving "no such thing boo" ๐
Parameters:
- dev_id โ the identifier of the device.
- service_id โ a pointer to a
uint32_t, to be filled in with the service id.
Returns:
0: success ๐<0: error code on failure. If the event dev doesn't use arte_servicefunction, this function returns-ESRCH.
int rte_event_dev_dump (uint8_t dev_id, FILE * f)
Dumps internal information about dev_id to the FILE* provided in f. It's giving "spill the tea but into a file" ๐
Parameters:
- dev_id โ the identifier of the device.
- f โ a pointer to a file for output.
Returns:
0: on success โจ<0: on failure.
int rte_event_dev_xstats_names_get (uint8_t dev_id, enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, struct rte_event_dev_xstats_name * xstats_names, uint64_t * ids, unsigned int size)
Retrieves the names of the extended statistics of an event device. Name-dropping, but for stats ๐
Parameters:
- dev_id โ the identifier of the event device.
- mode โ the mode of statistics to retrieve. Choices include the device statistics, port statistics or queue statistics.
- queue_port_id โ used to specify the port or queue number in queue or port mode, and is ignored in device mode.
- xstats_names โ block of memory to insert names into. Must be at least size in capacity. If set to
NULL, the function returns required capacity. - ids โ block of memory to insert ids into. Must be at least size in capacity. If set to
NULL, the function returns required capacity. The id values returned can be passed torte_event_dev_xstats_getto select statistics. - size โ capacity of
xstats_names(number of names).
Returns:
- positive value lower or equal to size: success. The return value is the number of entries filled in the stats table. ๐ซถ
- positive value higher than size: error, the given statistics table is too small. The return value corresponds to the size that should be given to succeed. The entries in the table are not valid and shall not be used by the caller. Do not touch, bestie, I'm serious ๐ญ
- negative value on error:
-ENODEVfor invaliddev_id,-EINVALfor invalid mode, queue port or id parameters,-ENOTSUPif the device doesn't support this function.
int rte_event_dev_xstats_get (uint8_t dev_id, enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, const uint64_t ids[], uint64_t values[], unsigned int n)
Retrieves extended statistics of an event device. The numbers era ๐
Parameters:
- dev_id โ the identifier of the device.
- mode โ the mode of statistics to retrieve. Choices include the device statistics, port statistics or queue statistics.
- queue_port_id โ used to specify the port or queue number in queue or port mode, and is ignored in device mode.
- ids โ the id numbers of the stats to get. The ids can be got from the stat position in the stat list from
rte_event_dev_get_xstats_names(), or by usingrte_event_dev_xstats_by_name_get(). - values โ the values for each stats request by ID.
- n โ the number of stats requested.
Returns:
- positive value: number of stat entries filled into the values array.
- negative value on error:
-ENODEVfor invaliddev_id,-EINVALfor invalid mode, queue port or id parameters,-ENOTSUPif the device doesn't support this function.
uint64_t rte_event_dev_xstats_by_name_get (uint8_t dev_id, const char * name, uint64_t * id)
Retrieves the value of a single stat by requesting it by name. Main character energy: no ids needed, just say the name ๐ง
Parameters:
- dev_id โ the identifier of the device.
- name โ the stat name to retrieve.
- id โ if non-
NULL, the numerical id of the stat will be returned, so that further requests for the stat can be got usingrte_event_dev_xstats_get, which will be faster as it doesn't need to scan a list of names for the stat. If the stat cannot be found, the id returned will be(unsigned)-1.
Returns:
- positive value or zero: the stat value โญ
- negative value:
-EINVALif stat not found,-ENOTSUPif not supported.
int rte_event_dev_xstats_reset (uint8_t dev_id, enum rte_event_dev_xstats_mode mode, int16_t queue_port_id, const uint64_t ids[], uint32_t nb_ids)
Resets the values of the xstats of the selected component in the device. Fresh start, clean slate, reset era ๐
Parameters:
- dev_id โ the identifier of the device.
- mode โ the mode of the statistics to reset. Choose from device, queue or port.
- queue_port_id โ the queue or port to reset.
0and positive values select ports and queues, while-1indicates all ports or queues. - ids โ selects specific statistics to be reset. When
NULL, all statistics selected by mode will be reset. If non-NULL, must point to array of at least nb_ids size. - nb_ids โ the number of ids available from the ids array. Ignored when ids is
NULL.
Returns:
- zero: successfully reset the statistics to zero โ
- negative value:
-EINVALinvalid parameters,-ENOTSUPif not supported.
int rte_event_dev_selftest (uint8_t dev_id)
Triggers the eventdev self test. The device is gonna check itself, we love a self-aware icon ๐
Parameters:
- dev_id โ the identifier of the device.
Returns:
0: selftest successful ๐-ENOTSUPif the device doesn't support selftest.- other values
< 0on failure.
struct rte_mempool * rte_event_vector_pool_create (const char * name, unsigned int n, unsigned int cache_size, uint16_t nb_elem, int socket_id)
Gets the memory required per event vector based on the number of elements per vector. This should be used to create the mempool that holds the event vectors. Pool party setup, basically ๐ฆ
Parameters:
- name โ the name of the vector pool.
- n โ the number of elements in the mbuf pool.
- cache_size โ size of the per-core object cache. See
rte_mempool_create()for details. - nb_elem โ the number of elements that a single event vector should be able to hold.
- socket_id โ the socket identifier where the memory should be allocated. The value can be
SOCKET_ID_ANYif there is no NUMA constraint for the reserved zone.
Returns: the pointer to the newly allocated mempool, on success. NULL on error with rte_errno set appropriately. Possible rte_errno values include:
E_RTE_NO_CONFIGโ function could not get pointer torte_configstructure.E_RTE_SECONDARYโ function was called from a secondary process instance.EINVALโ cache size provided is too large, or priv_size is not aligned.ENOSPCโ the maximum number of memzones has already been allocated.EEXISTโ a memzone with the same name already exists.ENOMEMโ no appropriate memory area found in which to create memzone.ENAMETOOLONGโ mempool name requested is too long.
uint16_t rte_event_enqueue_burst (uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events) [inline], [static]
Enqueues a burst of event objects, or one single event object supplied in an rte_event structure, on an event device designated by its dev_id through the event port specified by port_id. Each event object specifies the event queue on which it will be enqueued. Go off, events ๐ฅ
The nb_events parameter is the number of event objects to enqueue which are supplied in the ev array of rte_event structure.
โ ๏ธ Real talk: the event operationsRTE_EVENT_OP_FORWARDandRTE_EVENT_OP_RELEASEmust only be enqueued to the same port that their associated events were dequeued from. Do not mix that up, I am begging ๐ญ๐
The rte_event_enqueue_burst() function returns the number of event objects it actually enqueued. A return value equal to nb_events means that all event objects have been enqueued. Full send, every single one, periodt ๐
๐ซถ Parameters
dev_idโ the identifier of the device, bestie. That's how we know which eventdev we're talking to.port_idโ the identifier of the event port. Which door we're knocking on.evโ points to an array ofnb_eventsobjects of typerte_eventstructure which contain the event object enqueue operations to be processed.nb_eventsโ the number of event objects to enqueue, typically number ofrte_event_port_attr_get(...RTE_EVENT_PORT_ATTR_ENQ_DEPTH...)available for this port.
โจ Returns
The number of event objects actually enqueued on the event device. And here's the tea: the return value can be less than the value of the nb_events parameter when the event devices queue is full, or if invalid parameters are specified in a rte_event. If the return value is less than nb_events, the remaining events at the end of ev[] are not consumed and the caller has to take care of them, and rte_errno is set accordingly. Possible errno values include:
EINVALโ the port ID is invalid, device ID is invalid, an event's queue ID is invalid, or an event's sched type doesn't match the capabilities of the destination queue.ENOSPCโ the event port was backpressured and unable to enqueue one or more events. This error code is only applicable to closed systems.
๐ See also
rte_event_port_attr_get(), RTE_EVENT_PORT_ATTR_ENQ_DEPTH
Definition at line 2662 of file rte_eventdev.h.
๐
uint16_t rte_event_enqueue_new_burst (uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events) [inline], [static]
Enqueue a burst of events objects of operation type RTE_EVENT_OP_NEW on an event device designated by its dev_id through the event port specified by port_id.
It gives you the same functionality as rte_event_enqueue_burst(), with the difference that the application can use this API when all objects in the burst contain the enqueue operation of the type RTE_EVENT_OP_NEW. This specialized function can provide the additional hint to the PMD and optimize if possible. ๐
๐จ Therte_event_enqueue_new_burst()result is undefined if the enqueue burst has event object of operation type !=RTE_EVENT_OP_NEW. Like, do not do that. Fr fr.
๐ซถ Parameters
dev_idโ the identifier of the device.port_idโ the identifier of the event port.evโ points to an array ofnb_eventsobjects of typerte_eventstructure which contain the event object enqueue operations to be processed.nb_eventsโ the number of event objects to enqueue, typically number ofrte_event_port_attr_get(...RTE_EVENT_PORT_ATTR_ENQ_DEPTH...)available for this port.
โจ Returns
The number of event objects actually enqueued on the event device. The return value can be less than the value of the nb_events parameter when the event devices queue is full or if invalid parameters are specified in a rte_event. If the return value is less than nb_events, the remaining events at the end of ev[] are not consumed and the caller has to take care of them, and rte_errno is set accordingly. Possible errno values include:
EINVALโ the port ID is invalid, device ID is invalid, an event's queue ID is invalid, or an event's sched type doesn't match the capabilities of the destination queue.ENOSPCโ the event port was backpressured and unable to enqueue one or more events. This error code is only applicable to closed systems.
๐ See also
rte_event_port_attr_get(), RTE_EVENT_PORT_ATTR_ENQ_DEPTH
rte_event_enqueue_burst()
Definition at line 2714 of file rte_eventdev.h.
๐ฆ uint16_t rte_event_enqueue_forward_burst (uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events) [inline], [static]
Enqueue a burst of events objects of operation type RTE_EVENT_OP_FORWARD on an event device designated by its dev_id through the event port specified by port_id.
Same functionality as rte_event_enqueue_burst(), except that the application can use this API when all objects in the burst contain the enqueue operation of the type RTE_EVENT_OP_FORWARD. This specialized function can provide the additional hint to the PMD and optimize if possible. Slay.
๐จ Therte_event_enqueue_new_burst()result is undefined if the enqueue burst has event object of operation type !=RTE_EVENT_OP_FORWARD.
๐ซถ Parameters
dev_idโ the identifier of the device.port_idโ the identifier of the event port.evโ points to an array ofnb_eventsobjects of typerte_eventstructure which contain the event object enqueue operations to be processed.nb_eventsโ the number of event objects to enqueue, typically number ofrte_event_port_attr_get(...RTE_EVENT_PORT_ATTR_ENQ_DEPTH...)available for this port.
โจ Returns
The number of event objects actually enqueued on the event device. The return value can be less than the value of the nb_events parameter when the event devices queue is full or if invalid parameters are specified in a rte_event. If the return value is less than nb_events, the remaining events at the end of ev[] are not consumed and the caller has to take care of them, and rte_errno is set accordingly. Possible errno values include:
EINVALโ the port ID is invalid, device ID is invalid, an event's queue ID is invalid, or an event's sched type doesn't match the capabilities of the destination queue.ENOSPCโ the event port was backpressured and unable to enqueue one or more events. This error code is only applicable to closed systems.
๐ See also
rte_event_port_attr_get(), RTE_EVENT_PORT_ATTR_ENQ_DEPTH
rte_event_enqueue_burst()
Definition at line 2766 of file rte_eventdev.h.
๐ uint16_t rte_event_dequeue_burst (uint8_t dev_id, uint8_t port_id, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks) [inline], [static]
Dequeue a burst of events objects or an event object from the event port designated by its event_port_id, on an event device designated by its dev_id. The main character of the whole API tbh. ๐
rte_event_dequeue_burst() does not dictate the specifics of scheduling algorithm as each eventdev driver may have different criteria to schedule an event. However, in general, from an application perspective scheduler may use the following scheme to dispatch an event to the port:
- Selection of event queue based on
- The list of event queues are linked to the event port.
- If the device has
RTE_EVENT_DEV_CAP_QUEUE_QOScapability then event queue selection from list is based on event queue priority relative to other event queue supplied as priority inrte_event_queue_setup() - If the device has
RTE_EVENT_DEV_CAP_EVENT_QOScapability then event queue selection from the list is based on event priority supplied as priority inrte_event_enqueue_burst()
- Selection of event
- The number of flows available in selected event queue.
- Schedule type method associated with the event
The nb_events parameter is the maximum number of event objects to dequeue which are returned in the ev array of rte_event structure.
The rte_event_dequeue_burst() function returns the number of events objects it actually dequeued. A return value equal to nb_events means that all event objects have been dequeued. ๐
The number of events dequeued is the number of scheduler contexts held by this port. These contexts are automatically released in the next rte_event_dequeue_burst() invocation if the port supports implicit releases, or invoking rte_event_enqueue_burst() with RTE_EVENT_OP_RELEASE operation can be used to release the contexts early.
๐จ Event operationsRTE_EVENT_OP_FORWARDandRTE_EVENT_OP_RELEASEmust only be enqueued to the same port that their associated events were dequeued from. No shipping them to a different port, bestie, that's not it.
๐ซถ Parameters
dev_idโ the identifier of the device.port_idโ the identifier of the event port.evโ points to an array ofnb_eventsobjects of typerte_eventstructure for output to be populated with the dequeued event objects.nb_eventsโ the maximum number of event objects to dequeue, typically number ofrte_event_port_dequeue_depth()available for this port.timeout_ticks0โ no-wait, returns immediately if there is no event.>0โ wait for the event, if the device is configured withRTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUTthen this function will wait until at least one event is available ortimeout_tickstime. if the device is not configured withRTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUTthen this function will wait until the event available ordequeue_timeout_nsns which was previously supplied torte_event_dev_configure()
โจ Returns
The number of event objects actually dequeued from the port. The return value can be less than the value of the nb_events parameter when the event port's queue is not full.
๐ See also
rte_event_port_dequeue_depth()
Definition at line 2843 of file rte_eventdev.h.
๐ง int rte_event_maintain (uint8_t dev_id, uint8_t port_id, int op) [inline], [static]
Maintain an event device. Yes, it's giving housekeeping, and yes, it matters. ๐งน
This function is only relevant for event devices which do not have the RTE_EVENT_DEV_CAP_MAINTENANCE_FREE flag set. Such devices require an application thread using a particular port to periodically call rte_event_maintain() on that port during periods which it is neither attempting to enqueue events to nor dequeue events from the port. rte_event_maintain() is a low-overhead function and should be called at a high rate (e.g., in the application's poll loop).
โ ๏ธ No port may be left unmaintained. Periodt. Don't skip it.
At the application thread's convenience, rte_event_maintain() may (but is not required to) be called even during periods when enqueue or dequeue functions are being called, at the cost of a slight increase in overhead.
rte_event_maintain() may be called on event devices which have set RTE_EVENT_DEV_CAP_MAINTENANCE_FREE, in which case it is a no-operation. So harmless, lowkey free.
๐ซถ Parameters
dev_idโ the identifier of the device.port_idโ the identifier of the event port.opโ0, orRTE_EVENT_DEV_MAINT_OP_FLUSH.
โจ Returns
0on success.-EINVALifdev_id,port_id, oropis invalid.
๐ See also
RTE_EVENT_DEV_CAP_MAINTENANCE_FREE
Definition at line 2911 of file rte_eventdev.h.
๐ uint8_t rte_event_port_profile_switch (uint8_t dev_id, uint8_t port_id, uint8_t profile_id) [inline], [static]
Change the active profile on an event port. Glow-up time. โจ
This function is used to change the current active profile on an event port when multiple link profiles are configured on an event port through the function call rte_event_port_profile_links_set.
On the subsequent rte_event_dequeue_burst call, only the event queues that were associated with the newly active profile will participate in scheduling.
Parameters
dev_idโ which device we're talking about, the identifier of it bestie ๐port_idโ the identifier of the event portprofile_idโ the identifier of the profile
Returns
0on success, slay โจ-EINVALifdev_id,port_id, orprofile_idis invalid ๐
Definition at line 2959 of file rte_eventdev.h.
๐
rte_event_port_preschedule_modify ๐
__rte_experimental int rte_event_port_preschedule_modify (uint8_t dev_id,
uint8_t port_id, enum rte_event_dev_preschedule_type type) [inline],
[static]
Okay so this one modifies the pre-schedule type that's being used on an event port ๐
It changes the current pre-schedule type that's configured on an event port, and ngl you can set that type to none to straight up disable pre-scheduling. This affects the subsequent rte_event_dequeue_burst call. And heads up bestie, the event device should support the RTE_EVENT_DEV_CAP_PER_PORT_PRESCHEDULE capability or this isn't happening ๐ฅ
The way that this avoids fastpath capability checks: if an event device does not support RTE_EVENT_DEV_CAP_PER_PORT_PRESCHEDULE capability, then this function returns -ENOTSUP. Periodt.
Parameters
dev_idโ the identifier of the deviceport_idโ the identifier of the event porttypeโ the preschedule type to use on the event port
Returns
0on success ๐ซถ-EINVALifdev_id,port_id, ortypeis invalid-ENOTSUPif the device does not support per port preschedule capability ๐ญ
Definition at line 3008 of file rte_eventdev.h.
๐ธ rte_event_port_preschedule ๐ธ
__rte_experimental void rte_event_port_preschedule (uint8_t dev_id, uint8_t
port_id, enum rte_event_dev_preschedule_type type) [inline], [static]
This one is literally just a hint to the event device to pre-schedule events to the event port, it's giving suggestion not command ๐
So you're hinting the event device to pre-schedule events to the event port. But โ and this is important โ the call does not guarantee that the events will be pre-scheduled, so don't come for me if they aren't ๐. Also the call does not release the flow context that the event port is currently holding. And yeah, the event device should support the RTE_EVENT_DEV_CAP_PRESCHEDULE_EXPLICIT capability โญ
When pre-scheduling is enabled at an event device/port level, or if the capability just isn't supported, then the hint gets ignored. Not a vibe, but that's the rules ๐
Subsequent calls to rte_event_dequeue_burst() will dequeue the pre-schedule events, but the pre-schedule operation is not issued again. ikyk โจ
Parameters
dev_idโ the identifier of the deviceport_idโ the identifier of the event porttypeโ the pre-schedule type to use on the event port
Definition at line 3052 of file rte_eventdev.h.
๐ Author ๐
Generated automatically by Doxygen for DPDK from the source code. Bestie wrote zero of this by hand and honestly? iconic ๐
and that's a wrap on rte_eventdev.h(3) !! ๐ฆ you made it to the end, main character energy fr fr ๐ this whole glow-up came from DPDK Version 25.11.3, page rte_eventdev.h(3), and yes the date lives down here in the footer with the version, so mwah, go forth and dequeue ๐ซถโจ๐
๐ฆ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 ยท BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms