DPDK
17.05.2
|
Go to the source code of this file.
Data Structures | |
struct | rte_event_dev_info |
struct | rte_event_dev_config |
struct | rte_event_queue_conf |
struct | rte_event_port_conf |
struct | rte_event |
struct | rte_event_dev_xstats_name |
Enumerations | |
enum | rte_event_dev_xstats_mode |
Functions | |
uint8_t | rte_event_dev_count (void) |
int | rte_event_dev_get_dev_id (const char *name) |
int | rte_event_dev_socket_id (uint8_t dev_id) |
int | rte_event_dev_info_get (uint8_t dev_id, struct rte_event_dev_info *dev_info) |
int | rte_event_dev_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) |
uint8_t | rte_event_queue_count (uint8_t dev_id) |
uint8_t | rte_event_queue_priority (uint8_t dev_id, uint8_t queue_id) |
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) |
uint8_t | rte_event_port_dequeue_depth (uint8_t dev_id, uint8_t port_id) |
uint8_t | rte_event_port_enqueue_depth (uint8_t dev_id, uint8_t port_id) |
uint8_t | rte_event_port_count (uint8_t dev_id) |
int | rte_event_dev_start (uint8_t dev_id) |
void | rte_event_dev_stop (uint8_t dev_id) |
int | rte_event_dev_close (uint8_t dev_id) |
static void | rte_event_schedule (uint8_t dev_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) |
int | rte_event_dequeue_timeout_ticks (uint8_t dev_id, uint64_t ns, uint64_t *timeout_ticks) |
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) |
int | rte_event_port_link (uint8_t dev_id, uint8_t port_id, const uint8_t queues[], const uint8_t priorities[], uint16_t nb_links) |
int | rte_event_port_unlink (uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint16_t nb_unlinks) |
int | rte_event_port_links_get (uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint8_t priorities[]) |
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, unsigned int *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 unsigned int ids[], uint64_t values[], unsigned int n) |
uint64_t | rte_event_dev_xstats_by_name_get (uint8_t dev_id, const char *name, unsigned int *id) |
int | rte_event_dev_xstats_reset (uint8_t dev_id, enum rte_event_dev_xstats_mode mode, int16_t queue_port_id, const uint32_t ids[], uint32_t nb_ids) |
RTE Event Device API
In a polling model, lcores poll ethdev ports and associated rx queues directly to look for packet. In an event driven model, by contrast, lcores call the scheduler that selects packets for them based on programmer specified criteria. Eventdev library adds support for event driven programming model, which offer applications automatic multicore scaling, dynamic load balancing, pipelining, packet ingress order maintenance and synchronization services to simplify application packet processing.
The Event Device API is composed of two parts:
Event device components:
+-----------------+ | +-------------+ | +-------+ | | flow 0 | | |Packet | | +-------------+ | |event | | +-------------+ | | | | | flow 1 | |port_link(port0, queue0) +-------+ | +-------------+ | | +--------+ +-------+ | +-------------+ o-----v-----o |dequeue +------+ |Crypto | | | flow n | | | event +------->|Core 0| |work | | +-------------+ o----+ | port 0 | | | |done ev| | event queue 0 | | +--------+ +------+ +-------+ +-----------------+ | +-------+ | |Timer | +-----------------+ | +--------+ |expiry | | +-------------+ | +------o |dequeue +------+ |event | | | flow 0 | o-----------o event +------->|Core 1| +-------+ | +-------------+ | +----o port 1 | | | Event enqueue | +-------------+ | | +--------+ +------+ o-------------> | | flow 1 | | | enqueue( | +-------------+ | | queue_id, | | | +--------+ +------+ flow_id, | +-------------+ | | | |dequeue |Core 2| sched_type, | | flow n | o-----------o event +------->| | event_type, | +-------------+ | | | port 2 | +------+ subev_type, | event queue 1 | | +--------+ event) +-----------------+ | +--------+ | | |dequeue +------+ +-------+ +-----------------+ | | event +------->|Core n| |Core | | +-------------+ o-----------o port n | | | |(SW) | | | flow 0 | | | +--------+ +--+---+ |event | | +-------------+ | | | +-------+ | +-------------+ | | | ^ | | flow 1 | | | | | | +-------------+ o------+ | | | +-------------+ | | | | | flow n | | | | | +-------------+ | | | | event queue n | | | +-----------------+ | | | +-----------------------------------------------------------+
Event device: A hardware or software-based event scheduler.
Event: A unit of scheduling that encapsulates a packet or other datatype like SW generated event from the CPU, Crypto work completion notification, Timer expiry event notification etc as well as metadata. The metadata includes flow ID, scheduling type, event priority, event_type, sub_event_type etc.
Event queue: A queue containing events that are scheduled by the event dev. An event queue contains events of different flows associated with scheduling types, such as atomic, ordered, or parallel.
Event port: An application's interface into the event dev for enqueue and dequeue operations. Each event port can be linked with one or more event queues for dequeue operations.
By default, all the functions of the Event Device API exported by a PMD are lock-free functions which assume to not be invoked in parallel on different logical cores to work on the same target object. For instance, the dequeue function of a PMD cannot be invoked in parallel on two logical cores to operates on same event port. Of course, this function can be invoked in parallel by different logical cores on different ports. It is the responsibility of the upper level application to enforce this rule.
In all functions of the Event API, the Event device is designated by an integer >= 0 named the device identifier dev_id
At the Event driver level, Event devices are represented by a generic data structure of type rte_event_dev.
Event devices are dynamically registered during the PCI/SoC device probing phase performed at EAL initialization time. When an Event device is being probed, a rte_event_dev structure and a new device identifier are allocated for that device. Then, the event_dev_init() function supplied by the Event driver matching the probed device is invoked to properly initialize the device.
The role of the device init function consists of resetting the hardware or software event driver implementations.
If the device init operation is successful, the correspondence between the device identifier assigned to the new device and its associated rte_event_dev structure is effectively registered. Otherwise, both the rte_event_dev structure and the device identifier are freed.
The functions exported by the application Event API to setup a device designated by its device identifier must be invoked in the following order:
Then, the application can invoke, in any order, the functions exported by the Event API to schedule events, dequeue events, enqueue events, change event queue(s) to event port [un]link establishment and so on.
Application may use rte_event_[queue/port]_default_conf_get() to get the default configuration to set up an event queue or event port by overriding few default values.
If the application wants to change the configuration (i.e. call rte_event_dev_configure(), rte_event_queue_setup(), or rte_event_port_setup()), it must call rte_event_dev_stop() first to stop the device and then do the reconfiguration before calling rte_event_dev_start() again. The schedule, enqueue and dequeue functions should not be invoked when the device is stopped.
Finally, an application can close an Event device by invoking the rte_event_dev_close() function.
Each function of the application Event API invokes a specific function of the PMD that controls the target device designated by its device identifier.
For this purpose, all device-specific functions of an Event driver are supplied through a set of pointers contained in a generic structure of type event_dev_ops. The address of the event_dev_ops structure is stored in the rte_event_dev structure by the device init function of the Event driver, which is invoked during the PCI/SoC device probing phase, as explained earlier.
In other words, each function of the Event API simply retrieves the rte_event_dev structure associated with the device identifier and performs an indirect invocation of the corresponding driver function supplied in the event_dev_ops structure of the rte_event_dev structure.
For performance reasons, the address of the fast-path functions of the Event driver is not contained in the event_dev_ops structure. Instead, they are directly stored at the beginning of the rte_event_dev structure to avoid an extra indirect memory access during their invocation.
RTE event device drivers do not use interrupts for enqueue or dequeue operation. Instead, Event drivers export Poll-Mode enqueue and dequeue functions to applications.
An event driven based application has following typical workflow on fastpath:
The events are injected to event device through enqueue operation by event producers in the system. The typical event producers are ethdev subsystem for generating packet events, CPU(SW) for generating events based on different stages of application processing, cryptodev for generating crypto work completion notification etc
The dequeue operation gets one or more events from the event ports. The application process the events and send to downstream event queue through rte_event_enqueue_burst() if it is an intermediate stage of event processing, on the final stage, the application may send to different subsystem like ethdev to send the packet/event on the wire using ethdev rte_eth_tx_burst() API.
The point at which events are scheduled to ports depends on the device. For hardware devices, scheduling occurs asynchronously without any software intervention. Software schedulers can either be distributed (each worker thread schedules events to its own port) or centralized (a dedicated thread schedules to all ports). Distributed software schedulers perform the scheduling in rte_event_dequeue_burst(), whereas centralized scheduler logic is located in rte_event_schedule(). The RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED capability flag is not set indicates the device is centralized and thus needs a dedicated scheduling thread that repeatedly calls rte_event_schedule().
Definition in file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_QUEUE_QOS (1ULL << 0) |
Event scheduling prioritization is based on the priority associated with each event queue.
Definition at line 253 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_EVENT_QOS (1ULL << 1) |
Event scheduling prioritization is based on the priority associated with each event. Priority of each event is supplied in rte_event structure on each enqueue operation.
Definition at line 259 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED (1ULL << 2) |
Event device operates in distributed scheduling mode. In distributed scheduling mode, event scheduling happens in HW or rte_event_dequeue_burst() or the combination of these two. If the flag is not set then eventdev is centralized and thus needs a dedicated scheduling thread that repeatedly calls rte_event_schedule().
Definition at line 266 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES (1ULL << 3) |
Event device is capable of enqueuing events of any type to any queue. If this capability is not set, the queue only supports events of the RTE_EVENT_QUEUE_CFG_ type that it was created with.
Definition at line 275 of file rte_eventdev.h.
#define RTE_EVENT_DEV_PRIORITY_HIGHEST 0 |
Highest priority expressed across eventdev subsystem
Definition at line 284 of file rte_eventdev.h.
#define RTE_EVENT_DEV_PRIORITY_NORMAL 128 |
Normal priority expressed across eventdev subsystem
Definition at line 289 of file rte_eventdev.h.
#define RTE_EVENT_DEV_PRIORITY_LOWEST 255 |
Lowest priority expressed across eventdev subsystem
Definition at line 294 of file rte_eventdev.h.
#define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT (1ULL << 0) |
Override the global dequeue_timeout_ns and use per dequeue timeout in ns.
Definition at line 400 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_CFG_TYPE_MASK (3ULL << 0) |
Mask for event queue schedule type configuration request
Definition at line 482 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_CFG_ALL_TYPES (0ULL << 0) |
Allow ATOMIC,ORDERED,PARALLEL schedule type enqueue
Definition at line 484 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY (1ULL << 0) |
Allow only ATOMIC schedule type enqueue
The rte_event_enqueue_burst() result is undefined if the queue configured with ATOMIC only and sched_type != RTE_SCHED_TYPE_ATOMIC
Definition at line 490 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY (2ULL << 0) |
Allow only ORDERED schedule type enqueue
The rte_event_enqueue_burst() result is undefined if the queue configured with ORDERED only and sched_type != RTE_SCHED_TYPE_ORDERED
Definition at line 498 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY (3ULL << 0) |
Allow only PARALLEL schedule type enqueue
The rte_event_enqueue_burst() result is undefined if the queue configured with PARALLEL only and sched_type != RTE_SCHED_TYPE_PARALLEL
Definition at line 506 of file rte_eventdev.h.
#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 2) |
This event queue links only to a single event port.
Definition at line 514 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. This scheme enables the user to achieve high single flow throughput by avoiding SW synchronization for ordering between ports which bound to cores.
The source flow ordering from an event queue is maintained when events are enqueued to their destination queue within the same ordered flow context. An event port holds the context until application call rte_event_dequeue_burst() from the same port, which implicitly releases the context. User may allow the scheduler to release the context earlier than that by invoking rte_event_enqueue_burst() with RTE_EVENT_OP_RELEASE operation.
Events from the source queue appear in their original order when dequeued from a destination queue. Event ordering is based on the received event(s), but also other (newly allocated or stored) events are ordered when enqueued within the same ordered context. Events not enqueued (e.g. released or stored) within the context are considered missing from reordering and are skipped at this time (but can be ordered again within another context).
Definition at line 791 of file rte_eventdev.h.
#define RTE_SCHED_TYPE_ATOMIC 1 |
Atomic scheduling
Events from an atomic flow of an event queue can be scheduled only to a single port at a time. The port is guaranteed to have exclusive (atomic) access to the associated flow context, which enables the user to avoid SW synchronization. Atomic flows also help to maintain event ordering since only one port at a time can process events from a flow of an event queue.
The atomic queue synchronization context is dedicated to the port until application call rte_event_dequeue_burst() from the same port, which implicitly releases the context. User may allow the scheduler to release the context earlier than that by invoking rte_event_enqueue_burst() with RTE_EVENT_OP_RELEASE operation.
Definition at line 818 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).
Definition at line 837 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_ETHDEV 0x0 |
The event generated from ethdev subsystem
Definition at line 851 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_CRYPTODEV 0x1 |
The event generated from crypodev subsystem
Definition at line 853 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_TIMERDEV 0x2 |
The event generated from timerdev subsystem
Definition at line 855 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 857 of file rte_eventdev.h.
#define RTE_EVENT_TYPE_MAX 0x10 |
Maximum number of event types
Definition at line 861 of file rte_eventdev.h.
#define RTE_EVENT_OP_NEW 0 |
The event producers use this operation to inject a new event to the event device.
Definition at line 865 of file rte_eventdev.h.
#define RTE_EVENT_OP_FORWARD 1 |
The CPU use this operation to forward the event to different event queue or change to new application specific flow or schedule type to enable pipelining
Definition at line 869 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 function hints the scheduler that the user has completed critical section processing in the current atomic context. The scheduler is now allowed to schedule events from the same flow from an event queue to another port. However, the context may be still held until the next rte_event_dequeue_burst() call, this call allows but does not force the scheduler to release the context early.
Early atomic context release may increase parallelism and thus system performance, but the user needs to design carefully the split into critical vs non-critical sections.
If current flow's scheduler type method is RTE_SCHED_TYPE_ORDERED then this function hints the scheduler that the user has done all that need to maintain event order in the current ordered context. The scheduler is allowed to release the ordered context of this port and avoid reordering any following enqueues.
Early ordered context release may increase parallelism and thus system performance.
If current flow's scheduler type method is RTE_SCHED_TYPE_PARALLEL or no scheduling context is held then this function may be an NOOP, depending on the implementation.
Definition at line 874 of file rte_eventdev.h.
#define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64 |
Maximum name length for extended statistics counters
Definition at line 1443 of file rte_eventdev.h.
Selects the component of the eventdev to retrieve statistics from.
Definition at line 1448 of file rte_eventdev.h.
uint8_t rte_event_dev_count | ( | void | ) |
Get the total number of event devices that have been successfully initialised.
int rte_event_dev_get_dev_id | ( | const char * | name | ) |
Get the device identifier for the named event device.
name | Event device name to select the event device identifier. |
int rte_event_dev_socket_id | ( | uint8_t | dev_id | ) |
Return the NUMA socket to which a device is connected.
dev_id | The identifier of the device. |
int rte_event_dev_info_get | ( | uint8_t | dev_id, |
struct rte_event_dev_info * | dev_info | ||
) |
Retrieve the contextual information of an event device.
dev_id | The identifier of the device. | |
[out] | dev_info | A pointer to a structure of type rte_event_dev_info to be filled with the contextual information of the device. |
int rte_event_dev_configure | ( | uint8_t | dev_id, |
const struct rte_event_dev_config * | dev_conf | ||
) |
Configure an event device.
This function must be invoked first before any other function in the API. This function can also be re-invoked when a device is in the stopped state.
The caller may use rte_event_dev_info_get() to get the capability of each resources available for this event device.
dev_id | The identifier of the device to configure. |
dev_conf | The event device configuration structure. |
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.
dev_id | The identifier of the device. | |
queue_id | The index of the event queue to get the configuration information. The value must be in the range [0, nb_event_queues - 1] previously supplied to rte_event_dev_configure(). | |
[out] | queue_conf | The pointer to the default event queue configuration data. |
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.
dev_id | The identifier of the device. |
queue_id | The index of the event queue to setup. The value must be in the range [0, nb_event_queues - 1] previously supplied to rte_event_dev_configure(). |
queue_conf | The pointer to the configuration data to be used for the event queue. NULL value is allowed, in which case default configuration used. |
uint8_t rte_event_queue_count | ( | uint8_t | dev_id | ) |
Get the number of event queues on a specific event device
dev_id | Event device identifier. |
uint8_t rte_event_queue_priority | ( | uint8_t | dev_id, |
uint8_t | queue_id | ||
) |
Get the priority of the event queue on a specific event device
dev_id | Event device identifier. |
queue_id | Event queue identifier. |
int rte_event_port_default_conf_get | ( | uint8_t | dev_id, |
uint8_t | port_id, | ||
struct rte_event_port_conf * | port_conf | ||
) |
Retrieve the default configuration information of an event port designated by its port_id from the event driver for an event device.
This function intended to be used in conjunction with rte_event_port_setup() where caller needs to set up the port by overriding few default values.
dev_id | The identifier of the device. | |
port_id | The index of the event port to get the configuration information. The value must be in the range [0, nb_event_ports - 1] previously supplied to rte_event_dev_configure(). | |
[out] | port_conf | The pointer to the default event port configuration data |
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.
dev_id | The identifier of the device. |
port_id | The index of the event port to setup. The value must be in the range [0, nb_event_ports - 1] previously supplied to rte_event_dev_configure(). |
port_conf | The pointer to the configuration data to be used for the queue. NULL value is allowed, in which case default configuration used. |
uint8_t rte_event_port_dequeue_depth | ( | uint8_t | dev_id, |
uint8_t | port_id | ||
) |
Get the number of dequeue queue depth configured for event port designated by its port_id on a specific event device
dev_id | Event device identifier. |
port_id | Event port identifier. |
uint8_t rte_event_port_enqueue_depth | ( | uint8_t | dev_id, |
uint8_t | port_id | ||
) |
Get the number of enqueue queue depth configured for event port designated by its port_id on a specific event device
dev_id | Event device identifier. |
port_id | Event port identifier. |
uint8_t rte_event_port_count | ( | uint8_t | dev_id | ) |
Get the number of ports on a specific event device
dev_id | Event device identifier. |
int rte_event_dev_start | ( | uint8_t | dev_id | ) |
Start an event device.
The device start step is the last one and consists of setting the event queues to start accepting the events and schedules to event ports.
On success, all basic functions exported by the API (event enqueue, event dequeue and so on) can be invoked.
dev_id | Event device identifier |
void rte_event_dev_stop | ( | uint8_t | dev_id | ) |
Stop an event device. The device can be restarted with a call to rte_event_dev_start()
dev_id | Event device identifier. |
int rte_event_dev_close | ( | uint8_t | dev_id | ) |
Close an event device. The device cannot be restarted!
dev_id | Event device identifier |
|
inlinestatic |
Schedule one or more events in the event dev.
An event dev implementation may define this is a NOOP, for instance if the event dev performs its scheduling in hardware.
dev_id | The identifier of the device. |
Definition at line 1088 of file rte_eventdev.h.
|
inlinestatic |
Enqueue a burst of events objects or an event object supplied in rte_event structure on an event device designated by its dev_id through the event port specified by port_id. Each event object specifies the event queue on which it will be enqueued.
The nb_events parameter is the number of event objects to enqueue which are supplied in the ev array of rte_event structure.
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.
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_enqueue_depth() available for this port. |
Definition at line 1135 of file rte_eventdev.h.
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()
dev_id | The identifier of the device. | |
ns | Wait time in nanosecond | |
[out] | timeout_ticks | Value for the timeout_ticks parameter in rte_event_dequeue_burst() |
|
inlinestatic |
Dequeue a burst of events objects or an event object from the event port designated by its event_port_id, on an event device designated by its dev_id.
rte_event_dequeue_burst() does not dictate the specifics of scheduling algorithm as each eventdev driver may have different criteria to schedule an event. However, in general, from an application perspective scheduler may use the following scheme to dispatch an event to the port.
1) Selection of event queue based on a) The list of event queues are linked to the event port. b) If the device has RTE_EVENT_DEV_CAP_QUEUE_QOS capability then event queue selection from list is based on event queue priority relative to other event queue supplied as priority in rte_event_queue_setup() c) If the device has RTE_EVENT_DEV_CAP_EVENT_QOS capability then event queue selection from the list is based on event priority supplied as priority in rte_event_enqueue_burst() 2) Selection of event a) The number of flows available in selected event queue. b) Schedule type method associated with the event
The nb_events parameter is the maximum number of event objects to dequeue which are returned in the ev array of rte_event structure.
The rte_event_dequeue_burst() function returns the number of events objects it actually dequeued. A return value equal to nb_events means that all event objects have been dequeued.
The number of events dequeued is the number of scheduler contexts held by this port. These contexts are automatically released in the next rte_event_dequeue_burst() invocation, or invoking rte_event_enqueue_burst() with RTE_EVENT_OP_RELEASE operation can be used to release the contexts early.
dev_id | The identifier of the device. | |
port_id | The identifier of the event port. | |
[out] | 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 |
|
Definition at line 1257 of file rte_eventdev.h.
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.
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. |
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 establishment shall 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.
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. |
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.
dev_id | The identifier of the device. | |
port_id | Event port identifier. | |
[out] | 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 |
[out] | 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 |
int rte_event_dev_dump | ( | uint8_t | dev_id, |
FILE * | f | ||
) |
Dump internal information about dev_id to the FILE* provided in f.
dev_id | The identifier of the device. |
f | A pointer to a file for output |
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, | ||
unsigned int * | ids, | ||
unsigned int | size | ||
) |
Retrieve names of extended statistics of an event device.
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. | |
[out] | xstats_names | Block of memory to insert names into. Must be at least size in capacity. If set to NULL, function returns required capacity. |
[out] | 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). |
int rte_event_dev_xstats_get | ( | uint8_t | dev_id, |
enum rte_event_dev_xstats_mode | mode, | ||
uint8_t | queue_port_id, | ||
const unsigned int | ids[], | ||
uint64_t | values[], | ||
unsigned int | n | ||
) |
Retrieve extended statistics of an event device.
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_eventdev_get_xstats_by_name() | |
[out] | values | The values for each stats request by ID. |
n | The number of stats requested |
uint64_t rte_event_dev_xstats_by_name_get | ( | uint8_t | dev_id, |
const char * | name, | ||
unsigned int * | id | ||
) |
Retrieve the value of a single stat by requesting it by name.
dev_id | The identifier of the device | |
name | The stat name to retrieve | |
[out] | 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_eventdev_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. |
int rte_event_dev_xstats_reset | ( | uint8_t | dev_id, |
enum rte_event_dev_xstats_mode | mode, | ||
int16_t | queue_port_id, | ||
const uint32_t | ids[], | ||
uint32_t | nb_ids | ||
) |
Reset the values of the xstats of the selected component in the device.
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. |