src/dpdk/drivers/net/mlx5/mlx5_rxq.c
int
mlx5_ind_table_obj_setup(struct rte_eth_dev *dev,
			 struct mlx5_ind_table_obj *ind_tbl)
{
	struct mlx5_priv *priv = dev->data->dev_private;
	uint32_t queues_n = ind_tbl->queues_n;
	uint16_t *queues = ind_tbl->queues;
	unsigned int i, j;
	int ret = 0, err;
	const unsigned int n = rte_is_power_of_2(queues_n) ?
			       log2above(queues_n) :
			       log2above(priv->config.ind_table_max_size);

	for (i = 0; i != queues_n; ++i) {
		if (!mlx5_rxq_get(dev, queues[i])) {
			ret = -rte_errno;
			goto error;
		}
	}
	ret = priv->obj_ops.ind_table_new(dev, n, ind_tbl);
	if (ret)
		goto error;
	__atomic_fetch_add(&ind_tbl->refcnt, 1, __ATOMIC_RELAXED);
	return 0;
error:
	err = rte_errno;
	for (j = 0; j < i; j++)
		mlx5_rxq_release(dev, ind_tbl->queues[j]);
	rte_errno = err;
	DEBUG("Port %u cannot setup indirection table.", dev->data->port_id);
	return ret;
}
/**
 * Setup an indirection table structure fields.
 *
 * @param dev
 *   Pointer to Ethernet device.
 * @param ind_table
 *   Indirection table to modify.
 *
 * @return
 *   0 on success, a negative errno value otherwise and rte_errno is set.
 */
Setup an indirection table structure fields.
@param dev
Pointer to Ethernet device.
@param ind_table
Indirection table to modify.

@return
0 on success, a negative errno value otherwise and rte_errno is set.
Setup an indirection table structure fields . @param dev Pointer to Ethernet device . @param ind_table Indirection table to modify . @return 0 on success a negative errno value otherwise and rte_errno is set .
int
mlx5_ind_table_obj_setup(struct rte_eth_dev *dev,
			 struct mlx5_ind_table_obj *ind_tbl)
{
	struct mlx5_priv *priv = dev->data->dev_private;
	uint32_t queues_n = ind_tbl->queues_n;
	uint16_t *queues = ind_tbl->queues;
	unsigned int i, j;
	int ret = 0, err;
	const unsigned int n = rte_is_power_of_2(queues_n) ?
			       log2above(queues_n) :
			       log2above(priv->config.ind_table_max_size);
	for (i = 0; i != queues_n; ++i) {
		if (!mlx5_rxq_get(dev, queues[i])) {
			ret = -rte_errno;
			goto error;
		}
	}
	ret = priv->obj_ops.ind_table_new(dev, n, ind_tbl);
	if (ret)
		goto error;
	__atomic_fetch_add(&ind_tbl->refcnt, 1, __ATOMIC_RELAXED);
	return 0;
error:
	err = rte_errno;
	for (j = 0; j < i; j++)
		mlx5_rxq_release(dev, ind_tbl->queues[j]);
	rte_errno = err;
	DEBUG("Port %u cannot setup indirection table.", dev->data->port_id);
	return ret;
}
int mlx5_ind_table_obj_setup ( struct rte_eth_dev * dev , struct mlx5_ind_table_obj * ind_tbl ) { struct mlx5_priv * priv = dev -> data -> dev_private ; uint32_t queues_n = ind_tbl -> queues_n ; uint16_t * queues = ind_tbl -> queues ; unsigned int i , j ; int ret = 0 , err ; const unsigned int n = rte_is_power_of_2 ( queues_n ) ? log2above ( queues_n ) : log2above ( priv -> config . ind_table_max_size ) ; for ( i = 0 ; i != queues_n ; ++ i ) { if ( ! mlx5_rxq_get ( dev , queues [ i ] ) ) { ret = - rte_errno ; goto error ; } } ret = priv -> obj_ops . ind_table_new ( dev , n , ind_tbl ) ; if ( ret ) goto error ; __atomic_fetch_add ( & ind_tbl -> refcnt , 1 , __ATOMIC_RELAXED ) ; return 0 ; error : err = rte_errno ; for ( j = 0 ; j < i ; j ++ ) mlx5_rxq_release ( dev , ind_tbl -> queues [ j ] ) ; rte_errno = err ; DEBUG ( " " , dev -> data -> port_id ) ; return ret ; }
Setup an indirection table structure fields.
Setup an indirection table structure fields .