src/dpdk/lib/librte_eventdev/rte_eventdev.h
static inline 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)
{
	struct rte_eventdev *dev = &rte_eventdevs[dev_id];

#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
	if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
		rte_errno = EINVAL;
		return 0;
	}

	if (port_id >= dev->data->nb_ports) {
		rte_errno = EINVAL;
		return 0;
	}
#endif
	rte_eventdev_trace_deq_burst(dev_id, port_id, ev, nb_events);
	/*
	 * Allow zero cost non burst mode routine invocation if application
	 * requests nb_events as const one
	 */
	if (nb_events == 1)
		return (*dev->dequeue)(
			dev->data->ports[port_id], ev, timeout_ticks);
	else
		return (*dev->dequeue_burst)(
			dev->data->ports[port_id], ev, nb_events,
				timeout_ticks);
}
/**
 * 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.
 *
 * @param dev_id
 *   The identifier of the device.
 * @param port_id
 *   The identifier of the event port.
 * @param[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.
 * @param nb_events
 *   The maximum number of event objects to dequeue, typically number of
 *   rte_event_port_dequeue_depth() available for this port.
 *
 * @param 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()
 *
 * @return
 * 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 rte_event_port_dequeue_depth()
 */
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 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.

@param dev_id
The identifier of the device.
@param port_id
The identifier of the event port.
@param[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.
@param nb_events
The maximum number of event objects to dequeue, typically number of
rte_event_port_dequeue_depth() available for this port.

@param 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()

@return
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.


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 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 . @param dev_id The identifier of the device . @param port_id The identifier of the event port . @param [ 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 . @param nb_events The maximum number of event objects to dequeue typically number of rte_event_port_dequeue_depth () available for this port . @param 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 () @return 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 .
static inline 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)
{
	struct rte_eventdev *dev = &rte_eventdevs[dev_id];
#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
	if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
		rte_errno = EINVAL;
		return 0;
	}
	if (port_id >= dev->data->nb_ports) {
		rte_errno = EINVAL;
		return 0;
	}
#endif
	rte_eventdev_trace_deq_burst(dev_id, port_id, ev, nb_events);
	if (nb_events == 1)
		return (*dev->dequeue)(
			dev->data->ports[port_id], ev, timeout_ticks);
	else
		return (*dev->dequeue_burst)(
			dev->data->ports[port_id], ev, nb_events,
				timeout_ticks);
}
static inline 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 ) { struct rte_eventdev * dev = & rte_eventdevs [ dev_id ] ; #ifdef RTE_LIBRTE_EVENTDEV_DEBUG if ( dev_id >= RTE_EVENT_MAX_DEVS || ! rte_eventdevs [ dev_id ] . attached ) { rte_errno = EINVAL ; return 0 ; } if ( port_id >= dev -> data -> nb_ports ) { rte_errno = EINVAL ; return 0 ; } #endif rte_eventdev_trace_deq_burst ( dev_id , port_id , ev , nb_events ) ; if ( nb_events == 1 ) return ( * dev -> dequeue ) ( dev -> data -> ports [ port_id ] , ev , timeout_ticks ) ; else return ( * dev -> dequeue_burst ) ( dev -> data -> ports [ port_id ] , ev , nb_events , timeout_ticks ) ; }
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*.
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 * .
/*
	 * Allow zero cost non burst mode routine invocation if application
	 * requests nb_events as const one
	 */