src/dpdk/drivers/net/mlx4/mlx4_txq.c
int
mlx4_tx_uar_init_secondary(struct rte_eth_dev *dev, int fd)
{
	const unsigned int txqs_n = dev->data->nb_tx_queues;
	struct txq *txq;
	unsigned int i;
	int ret;

	MLX4_ASSERT(rte_eal_process_type() == RTE_PROC_SECONDARY);
	for (i = 0; i != txqs_n; ++i) {
		txq = dev->data->tx_queues[i];
		if (!txq)
			continue;
		MLX4_ASSERT(txq->stats.idx == (uint16_t)i);
		ret = txq_uar_init_secondary(txq, fd);
		if (ret)
			goto error;
	}
	return 0;
error:
	/* Rollback. */
	do {
		txq = dev->data->tx_queues[i];
		if (!txq)
			continue;
		txq_uar_uninit_secondary(txq);
	} while (i--);
	return -rte_errno;
}
/**
 * Initialize Tx UAR registers for secondary process.
 *
 * @param dev
 *   Pointer to Ethernet device.
 * @param fd
 *   Verbs file descriptor to map UAR pages.
 *
 * @return
 *   0 on success, a negative errno value otherwise and rte_errno is set.
 */
Initialize Tx UAR registers for secondary process.
@param dev
Pointer to Ethernet device.
@param fd
Verbs file descriptor to map UAR pages.

@return
0 on success, a negative errno value otherwise and rte_errno is set.
Initialize Tx UAR registers for secondary process . @param dev Pointer to Ethernet device . @param fd Verbs file descriptor to map UAR pages . @return 0 on success a negative errno value otherwise and rte_errno is set .
int
mlx4_tx_uar_init_secondary(struct rte_eth_dev *dev, int fd)
{
	const unsigned int txqs_n = dev->data->nb_tx_queues;
	struct txq *txq;
	unsigned int i;
	int ret;
	MLX4_ASSERT(rte_eal_process_type() == RTE_PROC_SECONDARY);
	for (i = 0; i != txqs_n; ++i) {
		txq = dev->data->tx_queues[i];
		if (!txq)
			continue;
		MLX4_ASSERT(txq->stats.idx == (uint16_t)i);
		ret = txq_uar_init_secondary(txq, fd);
		if (ret)
			goto error;
	}
	return 0;
error:
	do {
		txq = dev->data->tx_queues[i];
		if (!txq)
			continue;
		txq_uar_uninit_secondary(txq);
	} while (i--);
	return -rte_errno;
}
int mlx4_tx_uar_init_secondary ( struct rte_eth_dev * dev , int fd ) { const unsigned int txqs_n = dev -> data -> nb_tx_queues ; struct txq * txq ; unsigned int i ; int ret ; MLX4_ASSERT ( rte_eal_process_type ( ) == RTE_PROC_SECONDARY ) ; for ( i = 0 ; i != txqs_n ; ++ i ) { txq = dev -> data -> tx_queues [ i ] ; if ( ! txq ) continue ; MLX4_ASSERT ( txq -> stats . idx == ( uint16_t ) i ) ; ret = txq_uar_init_secondary ( txq , fd ) ; if ( ret ) goto error ; } return 0 ; error : do { txq = dev -> data -> tx_queues [ i ] ; if ( ! txq ) continue ; txq_uar_uninit_secondary ( txq ) ; } while ( i -- ) ; return - rte_errno ; }
Initialize Tx UAR registers for secondary process.
Initialize Tx UAR registers for secondary process .
/* Rollback. */