---
name: "rte_event_dev_xstats_mode"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_eventdev.h"
---

# rte\_event\_dev\_xstats\_mode(3)

Part of [rte\_eventdev.h(3)](/rte_eventdev.h/3.md).

## NAME

rte\_eventdev.h

## SYNOPSIS

`#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>`\

### 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**\
 struct **rte\_event\_dev\_xstats\_name**\

### Macros

\#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)](/RTE_BIT32/3.md)\
 \#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)\
 \#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**   **RTE\_BIT32**(0)\
 \#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\
 \#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)](/RTE_BIT32/3.md)\
 \#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\_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\_DMADEV**   0x5\
 \#define **RTE\_EVENT\_TYPE\_VECTOR**   0x8\
 \#define **RTE\_EVENT\_TYPE\_CPU\_VECTOR**   (**RTE\_EVENT\_TYPE\_VECTOR** \| **RTE\_EVENT\_TYPE\_CPU**)\
 \#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**   **RTE\_BIT32**(0)\
 \#define **RTE\_EVENT\_TIMER\_ADAPTER\_CAP\_PERIODIC**   **RTE\_BIT32**(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\_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\
 \#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\_preschedule\_type** { **RTE\_EVENT\_PRESCHEDULE\_NONE**, **RTE\_EVENT\_PRESCHEDULE**, **RTE\_EVENT\_PRESCHEDULE\_ADAPTIVE** }\
 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)\
 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)\
 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\_aligned** (16) rte\_event\_vector\
 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)\
 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)\
 \_\_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)\
 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\[\])\
 \_\_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)\
 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\_mempool** \* **rte\_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 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

## RTE Event Device API

In a traditional DPDK application model, the application polls Ethdev port RX queues to look for work, and processing is done in a run-to-completion manner, after which the packets are transmitted on a Ethdev TX queue. Load is distributed by statically assigning ports and queues to lcores, and NIC receive-side scaling (RSS), or similar, is employed to distribute network flows (and thus work) on the same port across multiple RX queues.

In contrast, in an event-driven model, as supported by this 'eventdev' library, incoming packets (or other input events) are fed into an event device, which schedules those packets across the available lcores, in accordance with its configuration. This event-driven programming model offers applications automatic multicore scaling, dynamic load balancing, pipelining, packet order maintenance, synchronization, and prioritization/quality of service.

The Event Device API is composed of two parts:

- •

  The application-oriented Event API that includes functions to setup an event device (configure it, setup its queues, ports and start it), to establish the links between queues and ports to receive events, and so on.

- •

  The driver-oriented Event API that exports a function allowing an event poll Mode Driver (PMD) to register itself as an event device driver.

### Application-oriented Event API

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**: Represents an item of work and is the smallest unit of scheduling. An event carries metadata, such as queue ID, scheduling type, and event priority, and data such as one or more packets or other kinds of buffers. Some examples of events are:

- •

  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. Each event given to an event device must have a valid event queue id field in the metadata, to specify 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. 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*

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

- •

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

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

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 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 inside the enqueue or dequeue functions, whereas centralized software schedulers need a dedicated service core for scheduling. The absence of the RTE\_EVENT\_DEV\_CAP\_DISTRIBUTED\_SCHED capability flag indicates that the device is centralized and thus needs a dedicated scheduling thread (generally an RTE service that should be mapped to one or more service cores) that repeatedly calls the software specific scheduling function.

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

```
while (1) {
   rte_event_dequeue_burst(...);
   (event processing)
   rte_event_enqueue_burst(...);
}
```

Definition in file **rte\_eventdev.h**.

## Macro Definition Documentation

### #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 a queue with highest priority are 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

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 **270** 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.

Priority of each event is supplied in **rte\_event structure on each enqueue operation. If this capability is not set, the priority field of the event structure is ignored for each event.**

**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 284 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 rte\_event\_dequeue\_burst() / rte\_event\_enqueue\_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\_dev\_service\_id\_get()**

**Definition at line 294 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 RTE\_EVENT\_QUEUE\_CFG\_ALL\_TYPES flag is set in rte\_event\_queue\_conf::event\_queue\_cfg, the 'schedule\_type' field of the rte\_event\_queue\_conf structure is 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. The behaviour when events of other scheduling types are sent to the queue is undefined.**

**See also**

**RTE\_EVENT\_QUEUE\_CFG\_ALL\_TYPES**

**RTE\_SCHED\_TYPE\_ATOMIC**

**RTE\_SCHED\_TYPE\_ORDERED**

**RTE\_SCHED\_TYPE\_PARALLEL**

**rte\_event\_queue\_conf.event\_queue\_cfg**

**rte\_event\_queue\_conf.schedule\_type**

**rte\_event\_enqueue\_burst()**

**Definition at line 318 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, application can still use the rte\_event\_dequeue\_burst() and rte\_event\_enqueue\_burst() but PMD accepts or returns only one event at a time.**

**See also**

**rte\_event\_dequeue\_burst()**

**rte\_event\_enqueue\_burst()**

**Definition at line 329 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, 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()**

**Definition at line 341 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 is not necessary to be sequential. Application can change the path of event at runtime and events may be sent to queues in any order.**

**If the flag is not set, then event each event will follow a path from queue 0 to queue 1 to queue 2 etc. 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 353 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 the flag is not set, the eventdev queue/port link is only can be configured during initialization, or by stopping the device and then later restarting it after reconfiguration.**

**See also**

**rte\_event\_port\_link()**

**rte\_event\_port\_unlink()**

**Definition at line 364 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 the flag is not set, each port may only be linked to a single queue, and so can only receive events from that queue. However, each queue may be linked to multiple ports.**

**See also**

**rte\_event\_port\_link()**

**Definition at line 374 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.**

**If this flag is not set, the content of the flow-id field in dequeued events is implementation dependent.**

**See also**

**rte\_event\_dequeue\_burst()**

**Definition at line 383 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().**

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

**See also**

**rte\_event\_maintain()**

**Definition at line 396 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 rte\_event\_queue\_setup() or rte\_event\_dev\_start() call sequence.**

**If this flag is not set, event queue attributes can only be configured during rte\_event\_queue\_setup().**

**See also**

**rte\_event\_queue\_setup()**

**Definition at line 406 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 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 not set, only a single profile may be configured, which 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 420 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 428 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 436 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 444 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. 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. FORWARD vs NEW relaxed ordering only applies to ports that have enabled independent enqueue feature.**

**Definition at line 463 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.**

**See also**

**rte\_event\_dev\_configure()**

**Definition at line 475 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.**

**See also**

**rte\_event\_dev\_configure()**

**Definition at line 487 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.**

**See also**

**rte\_event\_dev\_configure()**

**rte\_event\_port\_preschedule\_modify()**

**Definition at line 497 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.**

**See also**

**rte\_event\_port\_preschedule()**

**Definition at line 506 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 515 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_DEV\_PRIORITY\_NORMAL 128

**Normal priority level for events and queues.**

**See also**

**rte\_event\_queue\_setup()**

**rte\_event\_enqueue\_burst()**

**rte\_event\_port\_link()**

**Definition at line 522 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_DEV\_PRIORITY\_LOWEST 255

**Lowest priority level for events and queues.**

**See also**

**rte\_event\_queue\_setup()**

**rte\_event\_enqueue\_burst()**

**rte\_event\_port\_link()**

**Definition at line 529 of file rte\_eventdev.h.**

### #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 537 of file rte\_eventdev.h.**

### #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 543 of file rte\_eventdev.h.**

### #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 551 of file rte\_eventdev.h.**

### #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 557 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_DEV\_ATTR\_PORT\_COUNT 0

**The count of ports.**

**Definition at line 709 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_DEV\_ATTR\_QUEUE\_COUNT 1

**The count of queues.**

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

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

**See also**

**rte\_event\_dequeue\_timeout\_ticks(), rte\_event\_dequeue\_burst()**

**Definition at line 740 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.**

**See also**

**RTE\_EVENT\_DEV\_CAP\_QUEUE\_ALL\_TYPES**

**RTE\_SCHED\_TYPE\_ORDERED, RTE\_SCHED\_TYPE\_ATOMIC, RTE\_SCHED\_TYPE\_PARALLEL**

**rte\_event\_enqueue\_burst()**

**Definition at line 890 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 rte\_event\_dev\_config::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.**

**See also**

**rte\_event\_dev\_info.max\_single\_link\_event\_port\_queue\_pairs**

**rte\_event\_dev\_config.nb\_single\_link\_event\_port\_queues**

**rte\_event\_port\_setup(), rte\_event\_port\_link()**

**Definition at line 908 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.**

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

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

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

**Definition at line 1123 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. The queue it links with should be similarly configured with the RTE\_EVENT\_QUEUE\_CFG\_SINGLE\_LINK flag.**

**See also**

**RTE\_EVENT\_QUEUE\_CFG\_SINGLE\_LINK**

**rte\_event\_port\_setup(), rte\_event\_port\_link()**

**Definition at line 1131 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.**

**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 1141 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.**

**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 1152 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.**

**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 1163 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.**

**See also**

**rte\_event\_port\_setup()**

**Definition at line 1175 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.**

**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\_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, 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.**

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

**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. same rte\_event::flow\_id, rte\_event::priority and rte\_event::queue\_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 same ORDERED queue.**

**See also**

**rte\_event\_queue\_setup(), rte\_event\_dequeue\_burst(), RTE\_EVENT\_OP\_RELEASE**

**Definition at line 1531 of file rte\_eventdev.h.**

### #define RTE\_SCHED\_TYPE\_ATOMIC 1

**Atomic scheduling**

**Events from an atomic flow, identified by a combination of rte\_event::flow\_id, rte\_event::queue\_id and rte\_event::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.**

**See also**

**rte\_event\_queue\_setup(), rte\_event\_dequeue\_burst(), RTE\_EVENT\_OP\_RELEASE**

**Definition at line 1558 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).**

**See also**

**rte\_event\_queue\_setup(), rte\_event\_dequeue\_burst()**

**Definition at line 1571 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_TYPE\_ETHDEV 0x0

**The event generated from ethdev subsystem**

**Definition at line 1575 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_TYPE\_CRYPTODEV 0x1

**The event generated from crypodev subsystem**

**Definition at line 1577 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_TYPE\_TIMER 0x2

**The event generated from event timer adapter**

**Definition at line 1579 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 1583 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_TYPE\_ETH\_RX\_ADAPTER 0x4

**The event generated from event eth Rx adapter**

**Definition at line 1585 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_TYPE\_DMADEV 0x5

**The event generated from dma subsystem**

**Definition at line 1587 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. }**

**Definition at line 1599 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_TYPE\_CPU\_VECTOR (RTE\_EVENT\_TYPE\_VECTOR \| RTE\_EVENT\_TYPE\_CPU)

**\< The event vector generated from ethdev subsystem The event vector generated from cpu for pipelining.**

**Definition at line 1604 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_TYPE\_CRYPTODEV\_VECTOR (RTE\_EVENT\_TYPE\_VECTOR \| RTE\_EVENT\_TYPE\_CRYPTODEV)

**\< The event vector generated from eth Rx adapter.**

**Definition at line 1608 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_TYPE\_MAX 0x10

**\< The event vector generated from cryptodev adapter. Maximum number of event types**

**Definition at line 1613 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_OP\_NEW 0

**The rte\_event::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.**

**Definition at line 1620 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_OP\_FORWARD 1

**The application must set the rte\_event::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.**

**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 rte\_event::impl\_opaque field must be kept to the same value as was present when the event was dequeued.**

**Definition at line 1632 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.**

**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 rte\_event::impl\_opaque field in the release event must have the same value as that in the original dequeued event.**

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

**Definition at line 1666 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 1802 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 1806 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 1813 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_ETH\_RX\_ADAPTER\_CAP\_EVENT\_VECTOR 0x8

**Adapter supports event vectorization per ethdev.**

**Definition at line 1815 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 1840 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 1843 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 1867 of file rte\_eventdev.h.**

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

**Definition at line 1874 of file rte\_eventdev.h.**

### #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 1879 of file rte\_eventdev.h.**

### #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 1884 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_CRYPTO\_ADAPTER\_CAP\_EVENT\_VECTOR 0x10

**Flag indicates HW is capable of aggregating processed crypto operations into rte\_event\_vector.**

**Definition at line 1889 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_DMA\_ADAPTER\_CAP\_INTERNAL\_PORT\_OP\_NEW 0x1

**Flag indicates HW is capable of generating events in RTE\_EVENT\_OP\_NEW enqueue operation. DMADEV will send packets to the event device as new events using an internal event port.**

**Definition at line 1920 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_DMA\_ADAPTER\_CAP\_INTERNAL\_PORT\_OP\_FWD 0x2

**Flag indicates HW is capable of generating events in RTE\_EVENT\_OP\_FORWARD enqueue operation. DMADEV will send packets to the event device as forwarded event using an internal event port.**

**Definition at line 1927 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_DMA\_ADAPTER\_CAP\_INTERNAL\_PORT\_VCHAN\_EV\_BIND 0x4

**Flag indicates HW is capable of mapping DMA vchan to event queue.**

**Definition at line 1930 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_ETH\_TX\_ADAPTER\_CAP\_INTERNAL\_PORT 0x1

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

**Definition at line 1959 of file rte\_eventdev.h.**

### #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 1963 of file rte\_eventdev.h.**

### #define RTE\_EVENT\_DEV\_XSTATS\_NAME\_SIZE 64

**Maximum name length for extended statistics counters**

**Definition at line 2383 of file rte\_eventdev.h.**

### #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 2859 of file rte\_eventdev.h.**

## 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 during rte\_event\_port\_release(), invoked once per a released event.**

**Definition at line 1269 of file rte\_eventdev.h.**

### 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 1386 of file rte\_eventdev.h.**

## Enumeration Type Documentation

### enum rte\_event\_dev\_preschedule\_type

**Event device pre-schedule type enumeration.**

**Enumerator**

- *RTE\_EVENT\_PRESCHEDULE\_NONE*

  *Disable pre-schedule across the event device or on a given event port.* **rte\_event\_dev\_config::preschedule\_type** **rte\_event\_port\_preschedule\_modify()**

- *RTE\_EVENT\_PRESCHEDULE*

  *Enable pre-schedule always across the event device or a given event port.* **rte\_event\_dev\_config::preschedule\_type** **rte\_event\_port\_preschedule\_modify()**

**See also**

**RTE\_EVENT\_DEV\_CAP\_EVENT\_PRESCHEDULE**

**RTE\_EVENT\_DEV\_CAP\_PER\_PORT\_PRESCHEDULE**

- *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.* **rte\_event\_dev\_config::preschedule\_type** **rte\_event\_port\_preschedule\_modify()**

**See also**

**RTE\_EVENT\_DEV\_CAP\_EVENT\_PRESCHEDULE\_ADAPTIVE**

**RTE\_EVENT\_DEV\_CAP\_PER\_PORT\_PRESCHEDULE**

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

*Definition at line* **2388** *of file* **rte\_eventdev.h***.*

## Function Documentation

### uint8\_t rte\_event\_dev\_count (void)

*Get the total number of event devices.*

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

**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 - input name parameter 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.*

**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. -EINVAL on error, where the given dev\_id value 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.*

**Parameters**

*dev\_id The identifier of the device.*\
 *dev\_info A pointer to a structure of type* **rte\_event\_dev\_info to be filled with the information about the device's capabilities.**

**Returns**

- •

  **0: Success, information about the event device is present in dev\_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.**

**Parameters**

*dev\_id* **Eventdev id** \
 *attr\_id* **The attribute ID to retrieve** \
 *attr\_value* **A 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**

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

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

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

**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\_id* **The identifier of the device.** \
 *queue\_id* **The index of the event queue to get the configuration information. The value must be less than rte\_event\_dev\_config::nb\_event\_queues previously supplied to rte\_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.**

**Parameters**

*dev\_id* **The identifier of the device.** \
 *queue\_id* **The index of the event queue to setup. The value must be less than rte\_event\_dev\_config::nb\_event\_queues previously supplied to rte\_event\_dev\_configure().** \
 *queue\_conf* **The 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.**

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

**Parameters**

*dev\_id* **The identifier of the device.** \
 *queue\_id* **The index of the event queue to query. The value must be less than rte\_event\_dev\_config::nb\_event\_queues previously supplied to rte\_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 or attr\_id provided, or attr\_value was NULL.**

- •

  **-EOVERFLOW: returned when attr\_id is set to RTE\_EVENT\_QUEUE\_ATTR\_SCHEDULE\_TYPE and RTE\_EVENT\_QUEUE\_CFG\_ALL\_TYPES is 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.**

**Parameters**

*dev\_id* **The identifier of the device.** \
 *queue\_id* **The index of the event queue to configure. The value must be less than rte\_event\_dev\_config::nb\_event\_queues previously supplied to rte\_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 or attr\_id.**

- •

  **-ENOTSUP: device does not support setting the event attribute.**

### 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 is intended to be used in conjunction with rte\_event\_port\_setup() where the caller can set up the port by just overriding few default values.**

**Parameters**

*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 than rte\_event\_dev\_config::nb\_event\_ports previously supplied to rte\_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()**

### 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\_id* **The identifier of the device.** \
 *port\_id* **The index of the event port to setup. The value must be less than rte\_event\_dev\_config::nb\_event\_ports previously supplied to rte\_event\_dev\_configure().** \
 *port\_conf* **The pointer to the configuration data to be used for the port. NULL value 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 a NULL pointer passed as the port\_conf parameter, and no default configuration function available for this device.**

- •

  **-EDQUOT - Application tried to link a queue configured with RTE\_EVENT\_QUEUE\_CFG\_SINGLE\_LINK to more than one event port.**

### 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\_id* **The identifier of the device.** \
 *port\_id* **The index of the event port to quiesce. The value must be less than rte\_event\_dev\_config::nb\_event\_ports previously supplied to rte\_event\_dev\_configure().** \
 *release\_cb* **Callback function invoked once per flushed event.** \
 *args* **Argument supplied to callback.**

### 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\_id* **The identifier of the device.** \
 *port\_id* **The index of the event port to query. The value must be less than rte\_event\_dev\_config::nb\_event\_ports previously supplied to rte\_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 or attr\_id, or attr\_value was NULL.**

### int rte\_event\_dev\_start (uint8\_t dev\_id)

**Start an event device.**

**The device start step is the last one in device setup, and 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.**

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

### 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\_id* **Event device identifier.**

**See also**

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

**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. Pass NULL to unset any previously-registered callback function.** \
 *userdata* **Argument supplied to callback.**

**Returns**

- •

  **0 on success.**

- •

  **-EINVAL if** *dev\_id* **is invalid.**

**See also**

**rte\_event\_dev\_stop()**

### int rte\_event\_dev\_close (uint8\_t dev\_id)

**Close an event device. The device cannot be restarted!**

**Parameters**

*dev\_id* **Event device identifier.**

**Returns**

- •

  **0 on successfully closing device**

- •

  **\<0 on failure to close device.**

- •

  **-EINVAL - invalid device id.**

- •

  **-ENOTSUP - operation not supported for this device.**

- •

  **-EAGAIN - device is busy.**

### struct \_\_rte\_aligned (16)

**Event vector structure. \< 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 u64 values.**

**Definition at line 1437 of file rte\_eventdev.h.**

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

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

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

**Returns**

- •

  **0: Success, driver provides event adapter capabilities for the cryptodev device.**

- •

  **\<0: Error code returned by the driver function.**

### \_\_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**

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

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

### 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.** \
 *ns* **Wait time in nanosecond** \
 *timeout\_ticks* **Value 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()**

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

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

**Parameters**

*dev\_id* **The identifier of the device.**\
 *port\_id* **Event port identifier to select the destination port to link.**\
 *queues* **Points 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*\
 *priorities* **Points 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\_links* **The 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**

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

**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() to poll for completed unlinks.**

**Parameters**

*dev\_id* **The identifier of the device.**\
 *port\_id* **Event port identifier to select the destination port to unlink.**\
 *queues* **Points 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\_unlinks* **The 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**

### \_\_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)

**Link multiple source event queues supplied in** *queues* **to the destination event port designated by its** *port\_id* **with associated profile identifier supplied in** *profile\_id* **with service priorities supplied in** *priorities* **on the event device designated by its** *dev\_id***.**

**If** *profile\_id* **is set to 0 then, the links created by the call** `rte_event_port_link` **will be overwritten.**

**Event ports by default use profile\_id 0 unless it is 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 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\_id* **The identifier of the device.**\
 *port\_id* **Event port identifier to select the destination port to link.**\
 *queues* **Points 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*\
 *priorities* **Points 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\_links* **The number of links to establish. This parameter is ignored if queues is NULL.**\
 *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**

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

### \_\_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)

**Unlink multiple source event queues supplied in** *queues* **that belong to 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, 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* **Event port identifier to select the destination port to unlink.**\
 *queues* **Points 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\_unlinks* **The number of unlinks to establish. This parameter is ignored if queues is NULL.**\
 *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**

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

### 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\_id* **The identifier of the device.**\
 *port\_id* **Event 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***.**

### 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\_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\_DEV* **bytes 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\_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\_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)

**Retrieve the list of source event queues and its 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***.**

**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\_DEV* **bytes 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\_DEV* **bytes 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**

**Returns**

**The number of links established on the event port designated by its** *port\_id***.**

- •

  **\<0 on failure.**

### 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\_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 a rte\_service function, this function returns -ESRCH.**

### 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\_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)

**Retrieve names of extended statistics of an event device.**

**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, function returns required capacity.** \
 *ids* **Block 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.** \
 *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.**

- •

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

### 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\_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 using rte\_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: -ENODEV for invalid** *dev\_id* **-EINVAL for invalid mode, queue port or id parameters -ENOTSUP if 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)

**Retrieve the value of a single stat by requesting it by 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 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.**

### 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\_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. 0 and positive values select ports and queues, while -1 indicates 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: -EINVAL invalid parameters, -ENOTSUP if not supported.**

### int rte\_event\_dev\_selftest (uint8\_t dev\_id)

**Trigger the eventdev self test.**

**Parameters**

*dev\_id* **The identifier of the device**

**Returns**

- •

  **0: Selftest successful**

- •

  **-ENOTSUP if the device doesn't support selftest**

- •

  **other values \< 0 on 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)

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

*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\_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.**

### static 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]`

**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\_id* **The identifier of the device.** \
 *port\_id* **The identifier of the event port.** \
 *ev* **Points to an array of** *nb\_events* **objects of type rte\_event structure which contain the event object enqueue operations to be processed.** \
 *nb\_events* **The 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**

**Definition at line 2648 of file rte\_eventdev.h.**

### 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)` [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***.**

**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\_id* **The identifier of the device.** \
 *port\_id* **The identifier of the event port.** \
 *ev* **Points to an array of** *nb\_events* **objects of type rte\_event structure which contain the event object enqueue operations to be processed.** \
 *nb\_events* **The 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 2700 of file rte\_eventdev.h.**

### 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)` [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***.**

**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\_id* **The identifier of the device.** \
 *port\_id* **The identifier of the event port.** \
 *ev* **Points to an array of** *nb\_events* **objects of type rte\_event structure which contain the event object enqueue operations to be processed.** \
 *nb\_events* **The 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 2752 of file rte\_eventdev.h.**

### 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)` [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***.**

**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\_id* **The identifier of the device.** \
 *port\_id* **The identifier of the event port.** \
 *ev* **Points to an array of** *nb\_events* **objects of type rte\_event structure for output to be populated with the dequeued event objects.** \
 *nb\_events* **The 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()**

**Definition at line 2829 of file rte\_eventdev.h.**

### static int rte\_event\_maintain (uint8\_t dev\_id, uint8\_t port\_id, int op)` [inline]`, ` [static]`

**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\_id* **The identifier of the device.** \
 *port\_id* **The identifier of the event port.** \
 *op* **0, 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 2897 of file rte\_eventdev.h.**

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

**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* **The identifier of the device.** \
 *port\_id* **The identifier of the event port.** \
 *profile\_id* **The identifier of the profile.**

**Returns**

- •

  **0 on success.**

- •

  **-EINVAL if** *dev\_id***,** *port\_id***, or** *profile\_id* **is invalid.**

**Definition at line 2945 of file rte\_eventdev.h.**

### static \_\_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]`

**Modify the pre-schedule type to use on an event port.**

**This function is used to change the current pre-schedule type configured on an event port, the pre-schedule type can be set to none to disable pre-scheduling. This effects the subsequent** `rte_event_dequeue_burst` **call. The event device should support RTE\_EVENT\_DEV\_CAP\_PER\_PORT\_PRESCHEDULE capability.**

**To avoid fastpath capability checks if an event device does not support RTE\_EVENT\_DEV\_CAP\_PER\_PORT\_PRESCHEDULE capability, then this function will return -ENOTSUP.**

**Parameters**

*dev\_id* **The identifier of the device.** \
 *port\_id* **The identifier of the event port.** \
 *type* **The preschedule type to use on the event port.**

**Returns**

- •

  **0 on success.**

- •

  **-EINVAL if** *dev\_id***,** *port\_id***, or** *type* **is invalid.**

- •

  **-ENOTSUP if the device does not support per port preschedule capability.**

**Definition at line 2994 of file rte\_eventdev.h.**

### static \_\_rte\_experimental void rte\_event\_port\_preschedule (uint8\_t dev\_id, uint8\_t port\_id, enum rte\_event\_dev\_preschedule\_type type)` [inline]`, ` [static]`

**Provide a hint to the event device to pre-schedule events to event port .**

**Hint the event device to pre-schedule events to the event port. The call doesn't not guarantee that the events will be pre-scheduleed. The call doesn't release the flow context currently held by the event port. The event device should support RTE\_EVENT\_DEV\_CAP\_PRESCHEDULE\_EXPLICIT capability.**

**When pre-scheduling is enabled at an event device/port level or if the capability is not supported, then the hint is ignored.**

**Subsequent calls to rte\_event\_dequeue\_burst() will dequeue the pre-schedule events but pre-schedule operation is not issued again.**

**Parameters**

*dev\_id* **The identifier of the device.** \
 *port\_id* **The identifier of the event port.** \
 *type* **The pre-schedule type to use on the event port.**

**Definition at line 3038 of file rte\_eventdev.h.**

## Author

**Generated automatically by Doxygen for DPDK from the source code.**
