src/dpdk/drivers/net/iavf/iavf_rxtx.c
uint32_t
iavf_dev_rxq_count(struct rte_eth_dev *dev, uint16_t queue_id)
{
#define IAVF_RXQ_SCAN_INTERVAL 4
	volatile union iavf_rx_desc *rxdp;
	struct iavf_rx_queue *rxq;
	uint16_t desc = 0;

	rxq = dev->data->rx_queues[queue_id];
	rxdp = &rxq->rx_ring[rxq->rx_tail];

	while ((desc < rxq->nb_rx_desc) &&
	       ((rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len) &
		 IAVF_RXD_QW1_STATUS_MASK) >> IAVF_RXD_QW1_STATUS_SHIFT) &
	       (1 << IAVF_RX_DESC_STATUS_DD_SHIFT)) {
		/* Check the DD bit of a rx descriptor of each 4 in a group,
		 * to avoid checking too frequently and downgrading performance
		 * too much.
		 */
		desc += IAVF_RXQ_SCAN_INTERVAL;
		rxdp += IAVF_RXQ_SCAN_INTERVAL;
		if (rxq->rx_tail + desc >= rxq->nb_rx_desc)
			rxdp = &(rxq->rx_ring[rxq->rx_tail +
					desc - rxq->nb_rx_desc]);
	}

	return desc;
}
/* Get the number of used descriptors of a rx queue */
Get the number of used descriptors of a rx queue
Get the number of used descriptors of a rx queue
uint32_t
iavf_dev_rxq_count(struct rte_eth_dev *dev, uint16_t queue_id)
{
#define IAVF_RXQ_SCAN_INTERVAL 4
	volatile union iavf_rx_desc *rxdp;
	struct iavf_rx_queue *rxq;
	uint16_t desc = 0;
	rxq = dev->data->rx_queues[queue_id];
	rxdp = &rxq->rx_ring[rxq->rx_tail];
	while ((desc < rxq->nb_rx_desc) &&
	       ((rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len) &
		 IAVF_RXD_QW1_STATUS_MASK) >> IAVF_RXD_QW1_STATUS_SHIFT) &
	       (1 << IAVF_RX_DESC_STATUS_DD_SHIFT)) {
		desc += IAVF_RXQ_SCAN_INTERVAL;
		rxdp += IAVF_RXQ_SCAN_INTERVAL;
		if (rxq->rx_tail + desc >= rxq->nb_rx_desc)
			rxdp = &(rxq->rx_ring[rxq->rx_tail +
					desc - rxq->nb_rx_desc]);
	}
	return desc;
}
uint32_t iavf_dev_rxq_count ( struct rte_eth_dev * dev , uint16_t queue_id ) { #define IAVF_RXQ_SCAN_INTERVAL  4 volatile union iavf_rx_desc * rxdp ; struct iavf_rx_queue * rxq ; uint16_t desc = 0 ; rxq = dev -> data -> rx_queues [ queue_id ] ; rxdp = & rxq -> rx_ring [ rxq -> rx_tail ] ; while ( ( desc < rxq -> nb_rx_desc ) && ( ( rte_le_to_cpu_64 ( rxdp -> wb . qword1 . status_error_len ) & IAVF_RXD_QW1_STATUS_MASK ) >> IAVF_RXD_QW1_STATUS_SHIFT ) & ( 1 << IAVF_RX_DESC_STATUS_DD_SHIFT ) ) { desc += IAVF_RXQ_SCAN_INTERVAL ; rxdp += IAVF_RXQ_SCAN_INTERVAL ; if ( rxq -> rx_tail + desc >= rxq -> nb_rx_desc ) rxdp = & ( rxq -> rx_ring [ rxq -> rx_tail + desc - rxq -> nb_rx_desc ] ) ; } return desc ; }
Get the number of used descriptors of a rx queue
Get the number of used descriptors of a rx queue
/* Check the DD bit of a rx descriptor of each 4 in a group,
		 * to avoid checking too frequently and downgrading performance
		 * too much.
		 */