src/dpdk/lib/librte_eventdev/rte_event_eth_rx_adapter.c
static inline uint32_t
rxa_eth_rx(struct rte_event_eth_rx_adapter *rx_adapter,
	uint16_t port_id,
	uint16_t queue_id,
	uint32_t rx_count,
	uint32_t max_rx,
	int *rxq_empty)
{
	struct rte_mbuf *mbufs[BATCH_SIZE];
	struct rte_eth_event_enqueue_buffer *buf =
					&rx_adapter->event_enqueue_buffer;
	struct rte_event_eth_rx_adapter_stats *stats =
					&rx_adapter->stats;
	uint16_t n;
	uint32_t nb_rx = 0;

	if (rxq_empty)
		*rxq_empty = 0;
	/* Don't do a batch dequeue from the rx queue if there isn't
	 * enough space in the enqueue buffer.
	 */
	while (BATCH_SIZE <= (RTE_DIM(buf->events) - buf->count)) {
		if (buf->count >= BATCH_SIZE)
			rxa_flush_event_buffer(rx_adapter);

		stats->rx_poll_count++;
		n = rte_eth_rx_burst(port_id, queue_id, mbufs, BATCH_SIZE);
		if (unlikely(!n)) {
			if (rxq_empty)
				*rxq_empty = 1;
			break;
		}
		rxa_buffer_mbufs(rx_adapter, port_id, queue_id, mbufs, n);
		nb_rx += n;
		if (rx_count + nb_rx > max_rx)
			break;
	}

	if (buf->count > 0)
		rxa_flush_event_buffer(rx_adapter);

	return nb_rx;
}
/* Enqueue packets from  <port, q>  to event buffer */
Enqueue packets from    to event buffer
Enqueue packets from to event buffer
static inline uint32_t
rxa_eth_rx(struct rte_event_eth_rx_adapter *rx_adapter,
	uint16_t port_id,
	uint16_t queue_id,
	uint32_t rx_count,
	uint32_t max_rx,
	int *rxq_empty)
{
	struct rte_mbuf *mbufs[BATCH_SIZE];
	struct rte_eth_event_enqueue_buffer *buf =
					&rx_adapter->event_enqueue_buffer;
	struct rte_event_eth_rx_adapter_stats *stats =
					&rx_adapter->stats;
	uint16_t n;
	uint32_t nb_rx = 0;
	if (rxq_empty)
		*rxq_empty = 0;
	while (BATCH_SIZE <= (RTE_DIM(buf->events) - buf->count)) {
		if (buf->count >= BATCH_SIZE)
			rxa_flush_event_buffer(rx_adapter);
		stats->rx_poll_count++;
		n = rte_eth_rx_burst(port_id, queue_id, mbufs, BATCH_SIZE);
		if (unlikely(!n)) {
			if (rxq_empty)
				*rxq_empty = 1;
			break;
		}
		rxa_buffer_mbufs(rx_adapter, port_id, queue_id, mbufs, n);
		nb_rx += n;
		if (rx_count + nb_rx > max_rx)
			break;
	}
	if (buf->count > 0)
		rxa_flush_event_buffer(rx_adapter);
	return nb_rx;
}
static inline uint32_t rxa_eth_rx ( struct rte_event_eth_rx_adapter * rx_adapter , uint16_t port_id , uint16_t queue_id , uint32_t rx_count , uint32_t max_rx , int * rxq_empty ) { struct rte_mbuf * mbufs [ BATCH_SIZE ] ; struct rte_eth_event_enqueue_buffer * buf = & rx_adapter -> event_enqueue_buffer ; struct rte_event_eth_rx_adapter_stats * stats = & rx_adapter -> stats ; uint16_t n ; uint32_t nb_rx = 0 ; if ( rxq_empty ) * rxq_empty = 0 ; while ( BATCH_SIZE <= ( RTE_DIM ( buf -> events ) - buf -> count ) ) { if ( buf -> count >= BATCH_SIZE ) rxa_flush_event_buffer ( rx_adapter ) ; stats -> rx_poll_count ++ ; n = rte_eth_rx_burst ( port_id , queue_id , mbufs , BATCH_SIZE ) ; if ( unlikely ( ! n ) ) { if ( rxq_empty ) * rxq_empty = 1 ; break ; } rxa_buffer_mbufs ( rx_adapter , port_id , queue_id , mbufs , n ) ; nb_rx += n ; if ( rx_count + nb_rx > max_rx ) break ; } if ( buf -> count > 0 ) rxa_flush_event_buffer ( rx_adapter ) ; return nb_rx ; }
Enqueue packets from  <port, q>  to event buffer
Enqueue packets from <port q > to event buffer
/* Don't do a batch dequeue from the rx queue if there isn't
	 * enough space in the enqueue buffer.
	 */