rte_ring_dequeue_burst() :__inli
2020-03-20 本文已影响0人
Then丶
rte_ring_dequeue_burst();
rte_common.h
#define __rte_always_inline inline __attribute__((always_inline))
mian.c:
const uint16_t nb_in_deq = rte_ring_dequeue_burst(ring,
(void *)rxtx_bufs, BURST_SIZE, NULL);
rte_ring.h
/**
* Dequeue multiple objects from a ring up to a maximum number.
*
* This function calls the multi-consumers or the single-consumer
* version, depending on the default behaviour that was specified at
* ring creation time (see flags).
*
* @param r
* A pointer to the ring structure.
* @param obj_table
* A pointer to a table of void * pointers (objects) that will be filled.
* @param n
* The number of objects to dequeue from the ring to the obj_table.
* @param available
* If non-NULL, returns the number of remaining ring entries after the
* dequeue has finished.
* @return
* - Number of objects dequeued
*/
static __rte_always_inline unsigned
rte_ring_dequeue_burst(struct rte_ring *r, void **obj_table,
unsigned int n, unsigned int *available)
{
return __rte_ring_do_dequeue(r, obj_table, n,
RTE_RING_QUEUE_VARIABLE,
r->cons.single, available);
}