src/dpdk/drivers/net/vmxnet3/vmxnet3_rxtx.c
int
vmxnet3_dev_rxtx_init(struct rte_eth_dev *dev)
{
	struct vmxnet3_hw *hw = dev->data->dev_private;

	int i, ret;
	uint8_t j;

	PMD_INIT_FUNC_TRACE();

	for (i = 0; i < hw->num_rx_queues; i++) {
		vmxnet3_rx_queue_t *rxq = dev->data->rx_queues[i];

		for (j = 0; j < VMXNET3_RX_CMDRING_SIZE; j++) {
			/* Passing 0 as alloc_num will allocate full ring */
			ret = vmxnet3_post_rx_bufs(rxq, j);
			if (ret <= 0) {
				PMD_INIT_LOG(ERR,
					     "ERROR: Posting Rxq: %d buffers ring: %d",
					     i, j);
				return -ret;
			}
			/*
			 * Updating device with the index:next2fill to fill the
			 * mbufs for coming packets.
			 */
			if (unlikely(rxq->shared->ctrl.updateRxProd)) {
				VMXNET3_WRITE_BAR0_REG(hw, rxprod_reg[j] + (rxq->queue_id * VMXNET3_REG_ALIGN),
						       rxq->cmd_ring[j].next2fill);
			}
		}
		rxq->stopped = FALSE;
		rxq->start_seg = NULL;
	}

	for (i = 0; i < dev->data->nb_tx_queues; i++) {
		struct vmxnet3_tx_queue *txq = dev->data->tx_queues[i];

		txq->stopped = FALSE;
	}

	return 0;
}
/*
 * Initializes Receive Unit
 * Load mbufs in rx queue in advance
 */
Initializes Receive Unit
Load mbufs in rx queue in advance
Initializes Receive Unit Load mbufs in rx queue in advance
int
vmxnet3_dev_rxtx_init(struct rte_eth_dev *dev)
{
	struct vmxnet3_hw *hw = dev->data->dev_private;
	int i, ret;
	uint8_t j;
	PMD_INIT_FUNC_TRACE();
	for (i = 0; i < hw->num_rx_queues; i++) {
		vmxnet3_rx_queue_t *rxq = dev->data->rx_queues[i];
		for (j = 0; j < VMXNET3_RX_CMDRING_SIZE; j++) {
			ret = vmxnet3_post_rx_bufs(rxq, j);
			if (ret <= 0) {
				PMD_INIT_LOG(ERR,
					     "ERROR: Posting Rxq: %d buffers ring: %d",
					     i, j);
				return -ret;
			}
			if (unlikely(rxq->shared->ctrl.updateRxProd)) {
				VMXNET3_WRITE_BAR0_REG(hw, rxprod_reg[j] + (rxq->queue_id * VMXNET3_REG_ALIGN),
						       rxq->cmd_ring[j].next2fill);
			}
		}
		rxq->stopped = FALSE;
		rxq->start_seg = NULL;
	}
	for (i = 0; i < dev->data->nb_tx_queues; i++) {
		struct vmxnet3_tx_queue *txq = dev->data->tx_queues[i];
		txq->stopped = FALSE;
	}
	return 0;
}
int vmxnet3_dev_rxtx_init ( struct rte_eth_dev * dev ) { struct vmxnet3_hw * hw = dev -> data -> dev_private ; int i , ret ; uint8_t j ; PMD_INIT_FUNC_TRACE ( ) ; for ( i = 0 ; i < hw -> num_rx_queues ; i ++ ) { vmxnet3_rx_queue_t * rxq = dev -> data -> rx_queues [ i ] ; for ( j = 0 ; j < VMXNET3_RX_CMDRING_SIZE ; j ++ ) { ret = vmxnet3_post_rx_bufs ( rxq , j ) ; if ( ret <= 0 ) { PMD_INIT_LOG ( ERR , " " , i , j ) ; return - ret ; } if ( unlikely ( rxq -> shared -> ctrl . updateRxProd ) ) { VMXNET3_WRITE_BAR0_REG ( hw , rxprod_reg [ j ] + ( rxq -> queue_id * VMXNET3_REG_ALIGN ) , rxq -> cmd_ring [ j ] . next2fill ) ; } } rxq -> stopped = FALSE ; rxq -> start_seg = NULL ; } for ( i = 0 ; i < dev -> data -> nb_tx_queues ; i ++ ) { struct vmxnet3_tx_queue * txq = dev -> data -> tx_queues [ i ] ; txq -> stopped = FALSE ; } return 0 ; }
Initializes Receive Unit
 Load mbufs in rx queue in advance
Initializes Receive Unit Load mbufs in rx queue in advance
/* Passing 0 as alloc_num will allocate full ring */ /*
			 * Updating device with the index:next2fill to fill the
			 * mbufs for coming packets.
			 */