DPDK  23.07.0
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
rte_eventdev.h File Reference
#include <rte_compat.h>
#include <rte_common.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>

Go to the source code of this file.

Data Structures

struct  rte_event_dev_info
 
struct  rte_event_dev_config
 
struct  rte_event_queue_conf
 
struct  rte_event_port_conf
 
struct  rte_event_vector
 
struct  rte_event
 
struct  rte_event_dev_xstats_name
 

Macros

#define RTE_EVENT_DEV_CAP_QUEUE_QOS   (1ULL << 0)
 
#define RTE_EVENT_DEV_CAP_EVENT_QOS   (1ULL << 1)
 
#define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED   (1ULL << 2)
 
#define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES   (1ULL << 3)
 
#define RTE_EVENT_DEV_CAP_BURST_MODE   (1ULL << 4)
 
#define RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE   (1ULL << 5)
 
#define RTE_EVENT_DEV_CAP_NONSEQ_MODE   (1ULL << 6)
 
#define RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK   (1ULL << 7)
 
#define RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT   (1ULL << 8)
 
#define RTE_EVENT_DEV_CAP_CARRY_FLOW_ID   (1ULL << 9)
 
#define RTE_EVENT_DEV_CAP_MAINTENANCE_FREE   (1ULL << 10)
 
#define RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR   (1ULL << 11)
 
#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
 
#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   (1ULL << 0)
 
#define RTE_EVENT_QUEUE_CFG_ALL_TYPES   (1ULL << 0)
 
#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK   (1ULL << 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
 
#define RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL   (1ULL << 0)
 
#define RTE_EVENT_PORT_CFG_SINGLE_LINK   (1ULL << 1)
 
#define RTE_EVENT_PORT_CFG_HINT_PRODUCER   (1ULL << 2)
 
#define RTE_EVENT_PORT_CFG_HINT_CONSUMER   (1ULL << 3)
 
#define RTE_EVENT_PORT_CFG_HINT_WORKER   (1ULL << 4)
 
#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_SCHED_TYPE_ORDERED   0
 
#define RTE_SCHED_TYPE_ATOMIC   1
 
#define RTE_SCHED_TYPE_PARALLEL   2
 
#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_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
 
#define RTE_EVENT_OP_NEW   0
 
#define RTE_EVENT_OP_FORWARD   1
 
#define RTE_EVENT_OP_RELEASE   2
 
#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
 
#define RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT   (1ULL << 0)
 
#define RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC   (1ULL << 1)
 
#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
 
#define RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT   0x1
 
#define RTE_EVENT_ETH_TX_ADAPTER_CAP_EVENT_VECTOR   0x2
 
#define RTE_EVENT_DEV_XSTATS_NAME_SIZE   64
 
#define RTE_EVENT_DEV_MAINT_OP_FLUSH   (1 << 0)
 

Typedefs

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_xstats_mode
 

Functions

uint8_t rte_event_dev_count (void)
 
int rte_event_dev_get_dev_id (const char *name)
 
int 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_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)
 
__rte_experimental int rte_event_queue_attr_set (uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, uint64_t attr_value)
 
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)
 
__rte_experimental 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)
 
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)
 
struct rte_event_vector __rte_aligned (16)
 
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)
 
int rte_event_eth_tx_adapter_caps_get (uint8_t dev_id, uint16_t eth_port_id, uint32_t *caps)
 
int rte_event_dequeue_timeout_ticks (uint8_t dev_id, uint64_t ns, uint64_t *timeout_ticks)
 
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[])
 
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_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)
 
int rte_event_dev_selftest (uint8_t dev_id)
 
struct rte_mempoolrte_event_vector_pool_create (const char *name, unsigned int n, unsigned int cache_size, uint16_t nb_elem, int socket_id)
 
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 __rte_experimental int rte_event_maintain (uint8_t dev_id, uint8_t port_id, int op)
 

Variables

uint16_t nb_elem
 
uint16_t elem_offset
 
uint16_t rsvd
 
uint16_t attr_valid
 
union {
}; 
 

Detailed Description

RTE Event Device API

In a polling model, lcores poll ethdev ports and associated rx queues directly to look for packet. In an event driven model, by contrast, lcores call the scheduler that selects packets for them based on programmer specified criteria. Eventdev library adds support for event driven programming model, which offer applications automatic multicore scaling, dynamic load balancing, pipelining, packet ingress order maintenance and synchronization services to simplify application packet processing.

The Event Device API is composed of two parts:

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  |                                |
       |        +-----------------+                                |
       |                                                           |
       +-----------------------------------------------------------+

Event device: A hardware or software-based event scheduler.

Event: A unit of scheduling that encapsulates a packet or other datatype like SW generated event from the CPU, Crypto work completion notification, Timer expiry event notification etc as well as metadata. The metadata includes flow ID, scheduling type, event priority, event_type, sub_event_type etc.

Event queue: A queue containing events that are scheduled by the event dev. An event queue contains events of different flows associated with scheduling types, such as atomic, ordered, or parallel.

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.

By default, all the functions of the Event Device API exported by a PMD are lock-free functions which assume to not be invoked in parallel on different logical cores to work on the same target object. For instance, the dequeue function of a PMD cannot be invoked in parallel on two logical cores to operates 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

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, a rte_event_dev structure and a new device identifier are allocated for that device. Then, the event_dev_init() function supplied by the Event driver matching the probed device is invoked to properly initialize the device.

The role of the device init function consists of resetting the hardware or software event driver implementations.

If the device init operation is successful, the correspondence between the device identifier assigned to the new device and its associated rte_event_dev structure is effectively registered. Otherwise, both the rte_event_dev structure and the device identifier are freed.

The functions exported by the application Event API to setup a device designated by its device identifier must be invoked in the following order:

Then, the application can invoke, in any order, the functions exported by the Event API to schedule events, dequeue events, enqueue events, change event queue(s) to event port [un]link establishment and so on.

Application may use rte_event_[queue/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.

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 address of the fast-path functions of the Event driver is 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.

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

The dequeue operation gets one or more events from the event ports. The application process the events and send to downstream event queue through rte_event_enqueue_burst() if it is an intermediate stage of event processing, on the final stage, the application may use Tx adapter API for maintaining the ingress order and then send the packet/event on the wire.

The point at which events are scheduled to ports depends on the device. For hardware devices, scheduling occurs asynchronously without any software intervention. Software schedulers can either be distributed (each worker thread schedules events to its own port) or centralized (a dedicated thread schedules to all ports). Distributed software schedulers perform the scheduling in rte_event_dequeue_burst(), whereas centralized scheduler logic need a dedicated service core for scheduling. The RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED capability flag is not set indicates the device is centralized and thus needs a dedicated scheduling thread that repeatedly calls software specific scheduling function.

An event driven worker thread has following typical workflow on fastpath:

while (1) {
(event processing)
}

Definition in file rte_eventdev.h.

Macro Definition Documentation

◆ RTE_EVENT_DEV_CAP_QUEUE_QOS

#define RTE_EVENT_DEV_CAP_QUEUE_QOS   (1ULL << 0)

Event scheduling prioritization is based on the priority and weight associated with each event queue. Events from a queue with highest priority is scheduled first. If the queues are of same priority, weight of the queues are considered to select a queue in a weighted round robin fashion. Subsequent dequeue calls from an event port could see events from the same event queue, if the queue is configured with an affinity count. Affinity count is the number of subsequent dequeue calls, in which an event port should use the same event queue if the queue is non-empty

See also
rte_event_queue_setup(), rte_event_queue_attr_set()

Definition at line 224 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_EVENT_QOS

#define RTE_EVENT_DEV_CAP_EVENT_QOS   (1ULL << 1)

Event scheduling prioritization is based on the priority associated with each event. Priority of each event is supplied in rte_event structure on each enqueue operation.

See also
rte_event_enqueue_burst()

Definition at line 236 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED

#define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED   (1ULL << 2)

Event device operates in distributed scheduling mode. In distributed scheduling mode, event scheduling happens in HW or rte_event_dequeue_burst() or the combination of these two. If the flag is not set then eventdev is centralized and thus needs a dedicated service core that acts as a scheduling thread .

See also
rte_event_dequeue_burst()
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/l2fwd-event/l2fwd_event.c, and examples/l3fwd/main.c.

Definition at line 243 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES

#define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES   (1ULL << 3)

Event device is capable of enqueuing events of any type to any queue. If this capability is not set, the queue only supports events of the RTE_SCHED_TYPE_ type that it was created with.

See also
RTE_SCHED_TYPE_* values
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, and examples/l3fwd/l3fwd_event_internal_port.c.

Definition at line 252 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_BURST_MODE

#define RTE_EVENT_DEV_CAP_BURST_MODE   (1ULL << 4)

Event device is capable of operating in burst mode for enqueue(forward, release) and dequeue operation. If this capability is not set, application still uses the rte_event_dequeue_burst() and rte_event_enqueue_burst() but PMD accepts only one event at a time.

See also
rte_event_dequeue_burst() rte_event_enqueue_burst()
Examples:
examples/eventdev_pipeline/main.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, and examples/l3fwd/l3fwd_event_internal_port.c.

Definition at line 259 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE

#define RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE   (1ULL << 5)

Event device ports support disabling the implicit release feature, in which the port will release all unreleased events in its dequeue operation. If this capability is set and the port is configured with implicit release disabled, the application is responsible for explicitly releasing events using either the RTE_EVENT_OP_FORWARD or the RTE_EVENT_OP_RELEASE event enqueue operations.

See also
rte_event_dequeue_burst() rte_event_enqueue_burst()
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, and examples/l3fwd/l3fwd_event_internal_port.c.

Definition at line 267 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_NONSEQ_MODE

#define RTE_EVENT_DEV_CAP_NONSEQ_MODE   (1ULL << 6)

Event device is capable of operating in none sequential mode. The path of the event is not necessary to be sequential. Application can change the path of event at runtime. If the flag is not set, then event each event will follow a path from queue 0 to queue 1 to queue 2 etc. If the flag is set, events may be sent to queues in any order. If the flag is not set, the eventdev will return an error when the application enqueues an event for a qid which is not the next in the sequence.

Definition at line 278 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK

#define RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK   (1ULL << 7)

Event device is capable of configuring the queue/port link at runtime. If the flag is not set, the eventdev queue/port link is only can be configured during initialization.

Definition at line 288 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT

#define RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT   (1ULL << 8)

Event device is capable of setting up the link between multiple queue with single port. If the flag is not set, the eventdev can only map a single queue to each port or map a single queue to many port.

Definition at line 294 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_CARRY_FLOW_ID

#define RTE_EVENT_DEV_CAP_CARRY_FLOW_ID   (1ULL << 9)

Event device preserves the flow ID from the enqueued event to the dequeued event if the flag is set. Otherwise, the content of this field is implementation dependent.

Definition at line 300 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_MAINTENANCE_FREE

#define RTE_EVENT_DEV_CAP_MAINTENANCE_FREE   (1ULL << 10)

Event device does not require calls to rte_event_maintain(). An event device that does not set this flag requires calls to rte_event_maintain() during periods when neither rte_event_dequeue_burst() nor rte_event_enqueue_burst() are called on a port. This will allow the event device to perform internal processing, such as flushing buffered events, return credits to a global pool, or process signaling related to load balancing.

Definition at line 306 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR

#define RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR   (1ULL << 11)

Event device is capable of changing the queue attributes at runtime i.e after rte_event_queue_setup() or rte_event_start() call sequence. If this flag is not set, eventdev queue attributes can only be configured during rte_event_queue_setup().

Definition at line 316 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_PRIORITY_HIGHEST

#define RTE_EVENT_DEV_PRIORITY_HIGHEST   0

◆ RTE_EVENT_DEV_PRIORITY_NORMAL

#define RTE_EVENT_DEV_PRIORITY_NORMAL   128

◆ RTE_EVENT_DEV_PRIORITY_LOWEST

#define RTE_EVENT_DEV_PRIORITY_LOWEST   255

◆ RTE_EVENT_QUEUE_WEIGHT_HIGHEST

#define RTE_EVENT_QUEUE_WEIGHT_HIGHEST   255

Highest weight of an event queue

See also
rte_event_queue_attr_get(), rte_event_queue_attr_set()

Definition at line 341 of file rte_eventdev.h.

◆ RTE_EVENT_QUEUE_WEIGHT_LOWEST

#define RTE_EVENT_QUEUE_WEIGHT_LOWEST   0

Lowest weight of an event queue

See also
rte_event_queue_attr_get(), rte_event_queue_attr_set()

Definition at line 345 of file rte_eventdev.h.

◆ RTE_EVENT_QUEUE_AFFINITY_HIGHEST

#define RTE_EVENT_QUEUE_AFFINITY_HIGHEST   255

Highest scheduling affinity of an event queue

See also
rte_event_queue_attr_get(), rte_event_queue_attr_set()

Definition at line 351 of file rte_eventdev.h.

◆ RTE_EVENT_QUEUE_AFFINITY_LOWEST

#define RTE_EVENT_QUEUE_AFFINITY_LOWEST   0

Lowest scheduling affinity of an event queue

See also
rte_event_queue_attr_get(), rte_event_queue_attr_set()

Definition at line 355 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_ATTR_PORT_COUNT

#define RTE_EVENT_DEV_ATTR_PORT_COUNT   0

The count of ports.

Definition at line 471 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_ATTR_QUEUE_COUNT

#define RTE_EVENT_DEV_ATTR_QUEUE_COUNT   1

The count of queues.

Definition at line 475 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_ATTR_STARTED

#define RTE_EVENT_DEV_ATTR_STARTED   2

The status of the device, zero for stopped, non-zero for started.

Definition at line 479 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT

#define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT   (1ULL << 0)

Override the global dequeue_timeout_ns and use per dequeue timeout in ns.

See also
rte_event_dequeue_timeout_ticks(), rte_event_dequeue_burst()

Definition at line 499 of file rte_eventdev.h.

◆ RTE_EVENT_QUEUE_CFG_ALL_TYPES

#define RTE_EVENT_QUEUE_CFG_ALL_TYPES   (1ULL << 0)

◆ RTE_EVENT_QUEUE_CFG_SINGLE_LINK

#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK   (1ULL << 1)

◆ RTE_EVENT_QUEUE_ATTR_PRIORITY

#define RTE_EVENT_QUEUE_ATTR_PRIORITY   0

The priority of the queue.

Definition at line 710 of file rte_eventdev.h.

◆ RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS

#define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS   1

The number of atomic flows configured for the queue.

Definition at line 714 of file rte_eventdev.h.

◆ RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES

#define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES   2

The number of atomic order sequences configured for the queue.

Definition at line 718 of file rte_eventdev.h.

◆ RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG

#define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG   3

The cfg flags for the queue.

Definition at line 722 of file rte_eventdev.h.

◆ RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE

#define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE   4

The schedule type of the queue.

Definition at line 726 of file rte_eventdev.h.

◆ RTE_EVENT_QUEUE_ATTR_WEIGHT

#define RTE_EVENT_QUEUE_ATTR_WEIGHT   5

The weight of the queue.

Definition at line 730 of file rte_eventdev.h.

◆ RTE_EVENT_QUEUE_ATTR_AFFINITY

#define RTE_EVENT_QUEUE_ATTR_AFFINITY   6

Affinity of the queue.

Definition at line 734 of file rte_eventdev.h.

◆ RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL

#define RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL   (1ULL << 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.

Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, and examples/l3fwd/l3fwd_event_internal_port.c.

Definition at line 786 of file rte_eventdev.h.

◆ RTE_EVENT_PORT_CFG_SINGLE_LINK

#define RTE_EVENT_PORT_CFG_SINGLE_LINK   (1ULL << 1)

This event port links only to a single event queue.

See also
rte_event_port_setup(), rte_event_port_link()

Definition at line 793 of file rte_eventdev.h.

◆ RTE_EVENT_PORT_CFG_HINT_PRODUCER

#define RTE_EVENT_PORT_CFG_HINT_PRODUCER   (1ULL << 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.

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()
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, and examples/eventdev_pipeline/pipeline_worker_tx.c.

Definition at line 798 of file rte_eventdev.h.

◆ RTE_EVENT_PORT_CFG_HINT_CONSUMER

#define RTE_EVENT_PORT_CFG_HINT_CONSUMER   (1ULL << 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 FORWARD or RELEASE events.

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 808 of file rte_eventdev.h.

◆ RTE_EVENT_PORT_CFG_HINT_WORKER

#define RTE_EVENT_PORT_CFG_HINT_WORKER   (1ULL << 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.

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()
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, and examples/eventdev_pipeline/pipeline_worker_tx.c.

Definition at line 819 of file rte_eventdev.h.

◆ RTE_EVENT_PORT_ATTR_ENQ_DEPTH

#define RTE_EVENT_PORT_ATTR_ENQ_DEPTH   0

The queue depth of the port on the enqueue side

Definition at line 949 of file rte_eventdev.h.

◆ RTE_EVENT_PORT_ATTR_DEQ_DEPTH

#define RTE_EVENT_PORT_ATTR_DEQ_DEPTH   1

The queue depth of the port on the dequeue side

Definition at line 953 of file rte_eventdev.h.

◆ RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD

#define RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD   2

The new event threshold of the port

Definition at line 957 of file rte_eventdev.h.

◆ RTE_EVENT_PORT_ATTR_IMPLICIT_RELEASE_DISABLE

#define RTE_EVENT_PORT_ATTR_IMPLICIT_RELEASE_DISABLE   3

The implicit release disable attribute of the port

Definition at line 961 of file rte_eventdev.h.

◆ RTE_SCHED_TYPE_ORDERED

#define RTE_SCHED_TYPE_ORDERED   0

Ordered scheduling

Events from an ordered flow of an event queue can be scheduled to multiple ports for concurrent processing while maintaining the original event order. This scheme enables the user to achieve high single flow throughput by avoiding SW synchronization for ordering between ports which bound to cores.

The source flow ordering from an event queue is maintained when events are enqueued to their destination queue within the same ordered flow context. An event port holds the context until application call rte_event_dequeue_burst() from the same port, which implicitly releases the context. User may allow the scheduler to release the context earlier than that by invoking rte_event_enqueue_burst() with RTE_EVENT_OP_RELEASE operation.

Events from the source queue appear in their original order when dequeued from a destination queue. Event ordering is based on the received event(s), but also other (newly allocated or stored) events are ordered when enqueued within the same ordered context. Events not enqueued (e.g. released or stored) within the context are considered missing from reordering and are skipped at this time (but can be ordered again within another context).

See also
rte_event_queue_setup(), rte_event_dequeue_burst(), RTE_EVENT_OP_RELEASE
Examples:
examples/eventdev_pipeline/main.c, examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/ipsec-secgw.c, examples/l2fwd-event/main.c, and examples/l3fwd/main.c.

Definition at line 1128 of file rte_eventdev.h.

◆ RTE_SCHED_TYPE_ATOMIC

#define RTE_SCHED_TYPE_ATOMIC   1

Atomic scheduling

Events from an atomic flow of an event queue 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 help to maintain event ordering since only one port at a time can process events from a flow of an event queue.

The atomic queue synchronization context is dedicated to the port until application call rte_event_dequeue_burst() from the same port, which implicitly releases the context. User may allow the scheduler to release the context earlier than that by invoking rte_event_enqueue_burst() with RTE_EVENT_OP_RELEASE operation.

See also
rte_event_queue_setup(), rte_event_dequeue_burst(), RTE_EVENT_OP_RELEASE
Examples:
examples/eventdev_pipeline/main.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/event_helper.c, examples/ipsec-secgw/ipsec-secgw.c, examples/l2fwd-event/main.c, examples/l3fwd/l3fwd_event.c, and examples/l3fwd/main.c.

Definition at line 1155 of file rte_eventdev.h.

◆ RTE_SCHED_TYPE_PARALLEL

#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).

See also
rte_event_queue_setup(), rte_event_dequeue_burst()
Examples:
examples/eventdev_pipeline/main.c, examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/ipsec-secgw.c, examples/l2fwd-event/main.c, and examples/l3fwd/main.c.

Definition at line 1174 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_ETHDEV

#define RTE_EVENT_TYPE_ETHDEV   0x0

The event generated from ethdev subsystem

Examples:
examples/ipsec-secgw/event_helper.c, and examples/ipsec-secgw/ipsec_worker.c.

Definition at line 1188 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_CRYPTODEV

#define RTE_EVENT_TYPE_CRYPTODEV   0x1

The event generated from crypodev subsystem

Examples:
examples/ipsec-secgw/ipsec_worker.c.

Definition at line 1190 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_TIMER

#define RTE_EVENT_TYPE_TIMER   0x2

The event generated from event timer adapter

Definition at line 1192 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_CPU

#define RTE_EVENT_TYPE_CPU   0x3

The event generated from cpu for pipelining. Application may use sub_event_type to further classify the event

Examples:
examples/eventdev_pipeline/pipeline_worker_tx.c.

Definition at line 1194 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_ETH_RX_ADAPTER

#define RTE_EVENT_TYPE_ETH_RX_ADAPTER   0x4

The event generated from event eth Rx adapter

Definition at line 1198 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_VECTOR

#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. }

Examples:
examples/ipsec-secgw/ipsec_worker.c, examples/l2fwd-event/l2fwd_common.c, and examples/l3fwd/l3fwd_event.c.

Definition at line 1200 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_ETHDEV_VECTOR

#define RTE_EVENT_TYPE_ETHDEV_VECTOR   (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETHDEV)

The event vector generated from ethdev subsystem

Examples:
examples/ipsec-secgw/ipsec_worker.c.

Definition at line 1212 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_CPU_VECTOR

#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 1215 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR

#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.

Examples:
examples/ipsec-secgw/ipsec_worker.c.

Definition at line 1217 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_CRYPTODEV_VECTOR

#define RTE_EVENT_TYPE_CRYPTODEV_VECTOR   (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CRYPTODEV)

The event vector generated from cryptodev adapter.

Examples:
examples/ipsec-secgw/ipsec_worker.c.

Definition at line 1220 of file rte_eventdev.h.

◆ RTE_EVENT_TYPE_MAX

#define RTE_EVENT_TYPE_MAX   0x10

Maximum number of event types

Definition at line 1224 of file rte_eventdev.h.

◆ RTE_EVENT_OP_NEW

#define RTE_EVENT_OP_NEW   0

The event producers use this operation to inject a new event to the event device.

Examples:
examples/ipsec-secgw/ipsec.c.

Definition at line 1228 of file rte_eventdev.h.

◆ RTE_EVENT_OP_FORWARD

#define RTE_EVENT_OP_FORWARD   1

The CPU use this operation to forward the event to different event queue or change to new application specific flow or schedule type to enable pipelining.

This operation must only be enqueued to the same port that the event to be forwarded was dequeued from.

Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/l2fwd-event/l2fwd_event.c, examples/l3fwd/l3fwd_em.c, examples/l3fwd/l3fwd_fib.c, and examples/l3fwd/l3fwd_lpm.c.

Definition at line 1232 of file rte_eventdev.h.

◆ RTE_EVENT_OP_RELEASE

#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 function hints the scheduler that the user has completed critical section processing in the current atomic context. The scheduler is now allowed to schedule events from the same flow from an event queue to another port. However, the context may be still held until the next rte_event_dequeue_burst() call, this call allows but does not force the scheduler to release the context early.

Early atomic context 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 function hints the scheduler that the user has done all that need to maintain event order in the current ordered context. The scheduler is allowed to release the ordered context of this port and avoid reordering any following enqueues.

Early ordered context release may increase parallelism and thus system performance.

If current flow's scheduler type method is RTE_SCHED_TYPE_PARALLEL or no scheduling context is held then this function may be an NOOP, depending on the implementation.

This operation must only be enqueued to the same port that the event to be released was dequeued from.

Examples:
examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/ipsec_worker.c, examples/l2fwd-event/l2fwd_common.c, and examples/l3fwd/l3fwd_event.c.

Definition at line 1240 of file rte_eventdev.h.

◆ RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT

#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.

Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, and examples/ipsec-secgw/event_helper.c.

Definition at line 1351 of file rte_eventdev.h.

◆ RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ

#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 1355 of file rte_eventdev.h.

◆ RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID

#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 1359 of file rte_eventdev.h.

◆ RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR

#define RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR   0x8

Adapter supports event vectorization per ethdev.

Examples:
examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, and examples/l3fwd/l3fwd_event_internal_port.c.

Definition at line 1366 of file rte_eventdev.h.

◆ RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT

#define RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT   (1ULL << 0)

This flag is set when the timer mechanism is in HW.

Definition at line 1391 of file rte_eventdev.h.

◆ RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC

#define RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC   (1ULL << 1)

This flag is set if periodic mode is supported.

Definition at line 1394 of file rte_eventdev.h.

◆ RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW

#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 1414 of file rte_eventdev.h.

◆ RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD

#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD   0x2

Flag indicates HW is capable of generating events in RTE_EVENT_OP_FORWARD enqueue operation. Cryptodev will send packets to the event device as forwarded event using an internal event port.

Examples:
examples/ipsec-secgw/event_helper.c.

Definition at line 1421 of file rte_eventdev.h.

◆ RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND

#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND   0x4

Flag indicates HW is capable of mapping crypto queue pair to event queue.

Definition at line 1428 of file rte_eventdev.h.

◆ RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA

#define RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA   0x8

Flag indicates HW/SW supports a mechanism to store and retrieve the private data information along with the crypto session.

Definition at line 1433 of file rte_eventdev.h.

◆ RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR

#define RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR   0x10

Flag indicates HW is capable of aggregating processed crypto operations into rte_event_vector.

Examples:
examples/ipsec-secgw/event_helper.c.

Definition at line 1438 of file rte_eventdev.h.

◆ RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT

#define RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT   0x1

This flag is sent when the PMD supports a packet transmit callback

Examples:
examples/eventdev_pipeline/main.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event.c, and examples/l3fwd/l3fwd_event.c.

Definition at line 1467 of file rte_eventdev.h.

◆ RTE_EVENT_ETH_TX_ADAPTER_CAP_EVENT_VECTOR

#define RTE_EVENT_ETH_TX_ADAPTER_CAP_EVENT_VECTOR   0x2

Indicates that the Tx adapter is capable of handling event vector of mbufs.

Definition at line 1470 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_XSTATS_NAME_SIZE

#define RTE_EVENT_DEV_XSTATS_NAME_SIZE   64

Maximum name length for extended statistics counters

Definition at line 1719 of file rte_eventdev.h.

◆ RTE_EVENT_DEV_MAINT_OP_FLUSH

#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.

See also
rte_event_maintain()

Definition at line 2199 of file rte_eventdev.h.

Typedef Documentation

◆ rte_eventdev_port_flush_t

typedef void(* rte_eventdev_port_flush_t) (uint8_t dev_id, struct rte_event event, void *arg)

Callback function prototype that can be passed during rte_event_port_release(), invoked once per a released event.

Definition at line 910 of file rte_eventdev.h.

◆ rte_eventdev_stop_flush_t

typedef void(* rte_eventdev_stop_flush_t) (uint8_t dev_id, struct rte_event event, void *arg)

Callback function called during rte_event_dev_stop(), invoked once per flushed event.

Definition at line 1023 of file rte_eventdev.h.

Enumeration Type Documentation

◆ rte_event_dev_xstats_mode

Selects the component of the eventdev to retrieve statistics from.

Definition at line 1724 of file rte_eventdev.h.

Function Documentation

◆ rte_event_dev_count()

uint8_t rte_event_dev_count ( void  )

Get the total number of event devices that have been successfully initialised.

Returns
The total number of usable event devices.
Examples:
examples/eventdev_pipeline/main.c, examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event.c, and examples/l3fwd/l3fwd_event.c.

◆ rte_event_dev_get_dev_id()

int rte_event_dev_get_dev_id ( const char *  name)

Get the device identifier for the named event device.

Parameters
nameEvent device name to select the event device identifier.
Returns
Returns event device identifier on success.
  • <0: Failure to find named event device.

◆ rte_event_dev_socket_id()

int rte_event_dev_socket_id ( uint8_t  dev_id)

Return the NUMA socket to which a device is connected.

Parameters
dev_idThe 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. -(-EINVAL) dev_id value is out of range.

◆ rte_event_dev_info_get()

int rte_event_dev_info_get ( uint8_t  dev_id,
struct rte_event_dev_info dev_info 
)

Retrieve the contextual information of an event device.

Parameters
dev_idThe identifier of the device.
[out]dev_infoA pointer to a structure of type rte_event_dev_info to be filled with the contextual information of the device.
Returns
  • 0: Success, driver updates the contextual information of the event device
  • <0: Error code returned by the driver info get function.
Examples:
examples/eventdev_pipeline/main.c, examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event.c, examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, examples/l3fwd/l3fwd_event_internal_port.c, and examples/l3fwd/main.c.

◆ rte_event_dev_attr_get()

int rte_event_dev_attr_get ( uint8_t  dev_id,
uint32_t  attr_id,
uint32_t *  attr_value 
)

Get an attribute from a device.

Parameters
dev_idEventdev id
attr_idThe attribute ID to retrieve
[out]attr_valueA pointer that will be filled in with the attribute value if successful.
Returns
  • 0: Successfully retrieved attribute value
  • -EINVAL: Invalid device or attr_id provided, or attr_value is NULL

◆ rte_event_dev_configure()

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 first before any other function in the API. This function can also be re-invoked when a device is in the stopped state.

The caller may use rte_event_dev_info_get() to get the capability of each resources available for this event device.

Parameters
dev_idThe identifier of the device to configure.
dev_confThe event device configuration structure.
Returns
  • 0: Success, device configured.
  • <0: Error code returned by the driver configuration function.
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, and examples/l3fwd/l3fwd_event_internal_port.c.

◆ rte_event_queue_default_conf_get()

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.

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.

Parameters
dev_idThe identifier of the device.
queue_idThe index of the event queue to get the configuration information. The value must be in the range [0, nb_event_queues - 1] previously supplied to rte_event_dev_configure().
[out]queue_confThe 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()
Examples:
examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, and examples/l3fwd/l3fwd_event_internal_port.c.

◆ 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.

Parameters
dev_idThe identifier of the device.
queue_idThe index of the event queue to setup. The value must be in the range [0, nb_event_queues - 1] previously supplied to rte_event_dev_configure().
queue_confThe pointer to the configuration data to be used for the event queue. NULL value 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
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, and examples/l3fwd/l3fwd_event_internal_port.c.

◆ rte_event_queue_attr_get()

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 from a queue.

Parameters
dev_idEventdev id
queue_idEventdev queue id
attr_idThe attribute ID to retrieve
[out]attr_valueA pointer that will be filled in with the attribute value if successful
Returns
  • 0: Successfully returned value
  • -EINVAL: invalid device, queue or attr_id provided, or attr_value was NULL
  • -EOVERFLOW: returned when attr_id is set to RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE and event_queue_cfg is set to RTE_EVENT_QUEUE_CFG_ALL_TYPES

◆ rte_event_queue_attr_set()

__rte_experimental 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.

Parameters
dev_idEventdev id
queue_idEventdev queue id
attr_idThe attribute ID to set
attr_valueThe attribute value to set
Returns
  • 0: Successfully set attribute.
  • -EINVAL: invalid device, queue or attr_id.
  • -ENOTSUP: device does not support setting the event attribute.
  • <0: failed to set event queue attribute

◆ rte_event_port_default_conf_get()

int rte_event_port_default_conf_get ( uint8_t  dev_id,
uint8_t  port_id,
struct rte_event_port_conf port_conf 
)

Retrieve the default configuration information of an event port designated by its port_id from the event driver for an event device.

This function intended to be used in conjunction with rte_event_port_setup() where caller needs to set up the port by overriding few default values.

Parameters
dev_idThe identifier of the device.
port_idThe index of the event port to get the configuration information. The value must be in the range [0, nb_event_ports - 1] previously supplied to rte_event_dev_configure().
[out]port_confThe pointer to 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.
See also
rte_event_port_setup()
Examples:
examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, and examples/l3fwd/l3fwd_event_internal_port.c.

◆ rte_event_port_setup()

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.

Parameters
dev_idThe identifier of the device.
port_idThe index of the event port to setup. The value must be in the range [0, nb_event_ports - 1] previously supplied to rte_event_dev_configure().
port_confThe pointer to the configuration data to be used for the queue. NULL value is allowed, in which case default configuration used.
See also
rte_event_port_default_conf_get()
Returns
  • 0: Success, event port correctly set up.
  • <0: Port configuration failed
  • (-EDQUOT) Quota exceeded(Application tried to link the queue configured with RTE_EVENT_QUEUE_CFG_SINGLE_LINK to more than one event ports)
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, and examples/l3fwd/l3fwd_event_internal_port.c.

◆ rte_event_port_quiesce()

__rte_experimental 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.

Event ports are generally coupled with lcores, and a given Hardware implementation might require 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 to call rte_event_port_quiesce to make sure that all the data associated with the event port are released from the lcore, this 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_idThe identifier of the device.
port_idThe index of the event port to setup. The value must be in the range [0, nb_event_ports - 1] previously supplied to rte_event_dev_configure().
release_cbCallback function invoked once per flushed event.
argsArgument supplied to callback.
Examples:
examples/ipsec-secgw/ipsec_worker.c, examples/l2fwd-event/l2fwd_common.c, and examples/l3fwd/l3fwd_event.c.

◆ rte_event_port_attr_get()

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.

Parameters
dev_idEventdev id
port_idEventdev port id
attr_idThe attribute ID to retrieve
[out]attr_valueA pointer that will be filled in with the attribute value if successful
Returns
  • 0: Successfully returned value
  • (-EINVAL) Invalid device, port or attr_id, or attr_value was NULL

◆ rte_event_dev_start()

int rte_event_dev_start ( uint8_t  dev_id)

Start an event device.

The device start step is the last one and consists of setting the event queues to start accepting the events and schedules to event ports.

On success, all basic functions exported by the API (event enqueue, event dequeue and so on) can be invoked.

Parameters
dev_idEvent device identifier
Returns
  • 0: Success, device started.
  • -ESTALE : Not all ports of the device are configured
  • -ENOLINK: Not all queues are linked, which could lead to deadlock.
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event.c, and examples/l3fwd/l3fwd_event.c.

◆ rte_event_dev_stop()

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(). 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_idEvent device identifier.
See also
rte_event_dev_stop_flush_callback_register()
Examples:
examples/eventdev_pipeline/main.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/main.c, and examples/l3fwd/main.c.

◆ rte_event_dev_stop_flush_callback_register()

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.

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().

To unregister a callback, call this function with a NULL callback pointer.

Parameters
dev_idThe identifier of the device.
callbackCallback function invoked once per flushed event.
userdataArgument supplied to callback.
Returns
  • 0 on success.
  • -EINVAL if dev_id is invalid
See also
rte_event_dev_stop()

◆ rte_event_dev_close()

int rte_event_dev_close ( uint8_t  dev_id)

Close an event device. The device cannot be restarted!

Parameters
dev_idEvent device identifier
Returns
  • 0 on successfully closing device
  • <0 on failure to close device
  • (-EAGAIN) if device is busy
Examples:
examples/eventdev_pipeline/main.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/main.c, and examples/l3fwd/main.c.

◆ __rte_aligned()

< 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 u64 values.

◆ rte_event_eth_rx_adapter_caps_get()

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_idThe identifier of the device.
eth_port_idThe identifier of the ethernet device.
[out]capsA 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.
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event.c, examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_internal_port.c, and examples/l3fwd/main.c.

◆ rte_event_timer_adapter_caps_get()

int rte_event_timer_adapter_caps_get ( uint8_t  dev_id,
uint32_t *  caps 
)

Retrieve the event device's timer adapter capabilities.

Parameters
dev_idThe identifier of the device.
[out]capsA 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()

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_idThe identifier of the device.
cdev_idThe identifier of the cryptodev device.
[out]capsA 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 cryptodev device.
  • <0: Error code returned by the driver function.
Examples:
examples/ipsec-secgw/event_helper.c.

◆ rte_event_eth_tx_adapter_caps_get()

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_idThe identifier of the device.
eth_port_idThe identifier of the ethernet device.
[out]capsA 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.
Examples:
examples/eventdev_pipeline/main.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event.c, examples/l3fwd/l3fwd_event.c, and examples/l3fwd/main.c.

◆ rte_event_dequeue_timeout_ticks()

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_idThe identifier of the device.
nsWait time in nanosecond
[out]timeout_ticksValue for the timeout_ticks parameter in rte_event_dequeue_burst()
Returns
  • 0 on success.
  • -ENOTSUP if the device doesn't support timeouts
  • -EINVAL if dev_id is invalid or timeout_ticks is NULL
  • other values < 0 on failure.
See also
rte_event_dequeue_burst(), RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT
rte_event_dev_configure()

◆ rte_event_port_link()

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 
)

Link multiple source event queues supplied in queues to the destination event port designated by its port_id with associated service priority supplied in priorities on the event device designated by its dev_id.

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 can be established from an event queue to event port is implementation defined.

Event queue(s) to event port link establishment can be changed at runtime without re-configuring the device to support scaling and to reduce the latency of critical work by establishing the link with more event ports at runtime.

Parameters
dev_idThe identifier of the device.
port_idEvent port identifier to select the destination port to link.
queuesPoints to an array of nb_links event queues to be linked to the event port. NULL value is allowed, in which case this function links all the configured event queues nb_event_queues which previously supplied to rte_event_dev_configure() to the event port port_id
prioritiesPoints to an array of nb_links service priorities associated with each event queue link to event port. The priority defines the event port's servicing priority for event queue, which may be ignored by an implementation. The requested priority should in the range of [RTE_EVENT_DEV_PRIORITY_HIGHEST, RTE_EVENT_DEV_PRIORITY_LOWEST]. The implementation shall normalize the requested priority to implementation supported priority value. NULL value is allowed, in which case this function links the event queues with RTE_EVENT_DEV_PRIORITY_NORMAL servicing priority
nb_linksThe number of links to establish. This parameter is ignored if queues is NULL.
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 the limitation on 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 return value is less than nb_links then implementation shall update the rte_errno accordingly, Possible rte_errno values are (EDQUOT) Quota exceeded(Application tried to link the queue configured with RTE_EVENT_QUEUE_CFG_SINGLE_LINK to more than one event ports) (EINVAL) Invalid parameter
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/l2fwd_event_generic.c, examples/l2fwd-event/l2fwd_event_internal_port.c, examples/l3fwd/l3fwd_event_generic.c, and examples/l3fwd/l3fwd_event_internal_port.c.

◆ rte_event_port_unlink()

int rte_event_port_unlink ( uint8_t  dev_id,
uint8_t  port_id,
uint8_t  queues[],
uint16_t  nb_unlinks 
)

Unlink multiple source event queues supplied in queues from the destination event port designated by its port_id on the event device designated 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. 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_idThe identifier of the device.
port_idEvent port identifier to select the destination port to unlink.
queuesPoints to an array of nb_unlinks event queues to be unlinked from the event port. NULL value is allowed, in which case this function unlinks all the event queue(s) from the event port port_id.
nb_unlinksThe number of unlinks to establish. This parameter is ignored if queues is NULL.
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 the limitation on 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 return value is less than nb_unlinks then implementation shall update the rte_errno accordingly, Possible rte_errno values are (EINVAL) Invalid parameter
Examples:
examples/ipsec-secgw/event_helper.c.

◆ rte_event_port_unlinks_in_progress()

int rte_event_port_unlinks_in_progress ( uint8_t  dev_id,
uint8_t  port_id 
)

Returns the number of unlinks in progress.

This function provides the application with a method to detect when an unlink has been completed by the implementation.

See also
rte_event_port_unlink() to issue unlink requests.
Parameters
dev_idThe identifier of the device.
port_idEvent port identifier to select port to check for unlinks in progress.
Returns
The number of unlinks that are in progress. A return of zero indicates that there are no outstanding unlink requests. A positive return value indicates the number of unlinks that are in progress, but are not yet complete. A negative return value indicates an error, -EINVAL indicates an invalid parameter passed for dev_id or port_id.

◆ rte_event_port_links_get()

int rte_event_port_links_get ( uint8_t  dev_id,
uint8_t  port_id,
uint8_t  queues[],
uint8_t  priorities[] 
)

Retrieve the list of source event queues and its associated service priority linked to the destination event port designated by its port_id on the event device designated by its dev_id.

Parameters
dev_idThe identifier of the device.
port_idEvent port identifier.
[out]queuesPoints to an array of queues for output. The caller has to allocate RTE_EVENT_MAX_QUEUES_PER_DEV bytes to store the event queue(s) linked with event port port_id
[out]prioritiesPoints to an array of priorities for output. The caller has to allocate RTE_EVENT_MAX_QUEUES_PER_DEV bytes 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.
  • <0 on failure.

◆ rte_event_dev_service_id_get()

int rte_event_dev_service_id_get ( uint8_t  dev_id,
uint32_t *  service_id 
)

Retrieve the service ID of the event dev. If the adapter doesn't use a rte_service function, this function returns -ESRCH.

Parameters
dev_idThe identifier of the device.
[out]service_idA 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 a rte_service function, this function returns -ESRCH.
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/l2fwd-event/l2fwd_event.c, and examples/l3fwd/main.c.

◆ rte_event_dev_dump()

int rte_event_dev_dump ( uint8_t  dev_id,
FILE *  f 
)

Dump internal information about dev_id to the FILE* provided in f.

Parameters
dev_idThe identifier of the device.
fA pointer to a file for output
Returns
  • 0: on success
  • <0: on failure.
Examples:
examples/eventdev_pipeline/main.c.

◆ rte_event_dev_xstats_names_get()

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 
)

Retrieve names of extended statistics of an event device.

Parameters
dev_idThe identifier of the event device.
modeThe mode of statistics to retrieve. Choices include the device statistics, port statistics or queue statistics.
queue_port_idUsed to specify the port or queue number in queue or port mode, and is ignored in device mode.
[out]xstats_namesBlock of memory to insert names into. Must be at least size in capacity. If set to NULL, function returns required capacity.
[out]idsBlock of memory to insert ids into. Must be at least size in capacity. If set to NULL, function returns required capacity. The id values returned can be passed to rte_event_dev_xstats_get to select statistics.
sizeCapacity 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.
  • negative value on error: -ENODEV for invalid dev_id -EINVAL for invalid mode, queue port or id parameters -ENOTSUP if the device doesn't support this function.

◆ rte_event_dev_xstats_get()

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 
)

Retrieve extended statistics of an event device.

Parameters
dev_idThe identifier of the device.
modeThe mode of statistics to retrieve. Choices include the device statistics, port statistics or queue statistics.
queue_port_idUsed to specify the port or queue number in queue or port mode, and is ignored in device mode.
idsThe 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 using rte_event_dev_xstats_by_name_get().
[out]valuesThe values for each stats request by ID.
nThe number of stats requested
Returns
  • positive value: number of stat entries filled into the values array
  • negative value on error: -ENODEV for invalid dev_id -EINVAL for invalid mode, queue port or id parameters -ENOTSUP if the device doesn't support this function.

◆ rte_event_dev_xstats_by_name_get()

uint64_t rte_event_dev_xstats_by_name_get ( uint8_t  dev_id,
const char *  name,
uint64_t *  id 
)

Retrieve the value of a single stat by requesting it by name.

Parameters
dev_idThe identifier of the device
nameThe stat name to retrieve
[out]idIf non-NULL, the numerical id of the stat will be returned, so that further requests for the stat can be got using rte_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: -EINVAL if stat not found, -ENOTSUP if not supported.
Examples:
examples/eventdev_pipeline/main.c.

◆ rte_event_dev_xstats_reset()

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 
)

Reset the values of the xstats of the selected component in the device.

Parameters
dev_idThe identifier of the device
modeThe mode of the statistics to reset. Choose from device, queue or port.
queue_port_idThe queue or port to reset. 0 and positive values select ports and queues, while -1 indicates all ports or queues.
idsSelects 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_idsThe number of ids available from the ids array. Ignored when ids is NULL.
Returns
  • zero: successfully reset the statistics to zero
  • negative value: -EINVAL invalid parameters, -ENOTSUP if not supported.

◆ rte_event_dev_selftest()

int rte_event_dev_selftest ( uint8_t  dev_id)

Trigger the eventdev self test.

Parameters
dev_idThe identifier of the device
Returns
  • 0: Selftest successful
  • -ENOTSUP if the device doesn't support selftest
  • other values < 0 on failure.

◆ rte_event_vector_pool_create()

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 
)

Get 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.

Parameters
nameThe name of the vector pool.
nThe number of elements in the mbuf pool.
cache_sizeSize of the per-core object cache. See rte_mempool_create() for details.
nb_elemThe number of elements that a single event vector should be able to hold.
socket_idThe socket identifier where the memory should be allocated. The value can be SOCKET_ID_ANY if 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 to rte_config structure
  • 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.
Examples:
examples/ipsec-secgw/event_helper.c, examples/l2fwd-event/main.c, and examples/l3fwd/main.c.

◆ rte_event_enqueue_burst()

static uint16_t rte_event_enqueue_burst ( uint8_t  dev_id,
uint8_t  port_id,
const struct rte_event  ev[],
uint16_t  nb_events 
)
inlinestatic

Enqueue a burst of events objects or an event object supplied in 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.

The nb_events parameter is the number of event objects to enqueue which are supplied in the ev array of rte_event structure.

Event operations RTE_EVENT_OP_FORWARD and RTE_EVENT_OP_RELEASE must only be enqueued to the same port that their associated events were dequeued from.

The rte_event_enqueue_burst() function returns the number of events objects it actually enqueued. A return value equal to nb_events means that all event objects have been enqueued.

Parameters
dev_idThe identifier of the device.
port_idThe identifier of the event port.
evPoints to an array of nb_events objects of type rte_event structure which contain the event object enqueue operations to be processed.
nb_eventsThe number of event objects to enqueue, typically number of rte_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
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/ipsec_worker.c, examples/l2fwd-event/l2fwd_common.c, examples/l2fwd-event/l2fwd_event.c, examples/l3fwd/l3fwd_em.c, examples/l3fwd/l3fwd_event.c, examples/l3fwd/l3fwd_fib.c, and examples/l3fwd/l3fwd_lpm.c.

Definition at line 1986 of file rte_eventdev.h.

◆ rte_event_enqueue_new_burst()

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 
)
inlinestatic

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.

Provides the same functionality as rte_event_enqueue_burst(), expect that application can use this API when the all objects in the burst contains 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.

The rte_event_enqueue_new_burst() result is undefined if the enqueue burst has event object of operation type != RTE_EVENT_OP_NEW.

Parameters
dev_idThe identifier of the device.
port_idThe identifier of the event port.
evPoints to an array of nb_events objects of type rte_event structure which contain the event object enqueue operations to be processed.
nb_eventsThe number of event objects to enqueue, typically number of rte_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 2038 of file rte_eventdev.h.

◆ rte_event_enqueue_forward_burst()

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 
)
inlinestatic

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.

Provides the same functionality as rte_event_enqueue_burst(), expect that application can use this API when the all objects in the burst contains 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.

The rte_event_enqueue_new_burst() result is undefined if the enqueue burst has event object of operation type != RTE_EVENT_OP_FORWARD.

Parameters
dev_idThe identifier of the device.
port_idThe identifier of the event port.
evPoints to an array of nb_events objects of type rte_event structure which contain the event object enqueue operations to be processed.
nb_eventsThe number of event objects to enqueue, typically number of rte_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 2090 of file rte_eventdev.h.

◆ rte_event_dequeue_burst()

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 
)
inlinestatic

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.

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.

1) Selection of event queue based on a) The list of event queues are linked to the event port. b) If the device has RTE_EVENT_DEV_CAP_QUEUE_QOS capability then event queue selection from list is based on event queue priority relative to other event queue supplied as priority in rte_event_queue_setup() c) If the device has RTE_EVENT_DEV_CAP_EVENT_QOS capability then event queue selection from the list is based on event priority supplied as priority in rte_event_enqueue_burst() 2) Selection of event a) The number of flows available in selected event queue. b) 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 operations RTE_EVENT_OP_FORWARD and RTE_EVENT_OP_RELEASE must only be enqueued to the same port that their associated events were dequeued from.

Parameters
dev_idThe identifier of the device.
port_idThe identifier of the event port.
[out]evPoints to an array of nb_events objects of type rte_event structure for output to be populated with the dequeued event objects.
nb_eventsThe maximum number of event objects to dequeue, typically number of rte_event_port_dequeue_depth() available for this port.
timeout_ticks
  • 0 no-wait, returns immediately if there is no event.
  • >0 wait for the event, if the device is configured with RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT then this function will wait until at least one event is available or timeout_ticks time. if the device is not configured with RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT then this function will wait until the event available or dequeue_timeout_ns ns which was previously supplied to rte_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()
Examples:
examples/eventdev_pipeline/pipeline_worker_generic.c, examples/eventdev_pipeline/pipeline_worker_tx.c, examples/ipsec-secgw/ipsec_worker.c, examples/l2fwd-event/l2fwd_event.c, examples/l3fwd/l3fwd_em.c, examples/l3fwd/l3fwd_fib.c, and examples/l3fwd/l3fwd_lpm.c.

Definition at line 2167 of file rte_eventdev.h.

◆ rte_event_maintain()

static __rte_experimental int rte_event_maintain ( uint8_t  dev_id,
uint8_t  port_id,
int  op 
)
inlinestatic

Maintain an event device.

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.

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.

Parameters
dev_idThe identifier of the device.
port_idThe identifier of the event port.
op0, or RTE_EVENT_DEV_MAINT_OP_FLUSH.
Returns
  • 0 on success.
  • -EINVAL if dev_id, port_id, or op is invalid.
See also
RTE_EVENT_DEV_CAP_MAINTENANCE_FREE

Definition at line 2243 of file rte_eventdev.h.

Variable Documentation

◆ nb_elem

uint16_t nb_elem

Number of elements valid in this event vector.

Examples:
examples/ipsec-secgw/event_helper.c, and examples/l2fwd-event/l2fwd_event.c.

Definition at line 1069 of file rte_eventdev.h.

◆ elem_offset

uint16_t elem_offset

Offset into the vector array where valid elements start from.

Definition at line 1071 of file rte_eventdev.h.

◆ rsvd

uint16_t rsvd

Reserved for future use

Definition at line 1073 of file rte_eventdev.h.

◆ attr_valid

uint16_t attr_valid

Indicates that the below union attributes have valid information.

Definition at line 1075 of file rte_eventdev.h.

◆ @199

union { ... }

Union to hold common attributes of the vector array.