src/dpdk/drivers/net/mlx5/mlx5_rxq.c
static struct mlx5_ind_table_obj *
mlx5_ind_table_obj_new(struct rte_eth_dev *dev, const uint16_t *queues,
		       uint32_t queues_n, bool standalone)
{
	struct mlx5_priv *priv = dev->data->dev_private;
	struct mlx5_ind_table_obj *ind_tbl;
	int ret;

	ind_tbl = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*ind_tbl) +
			      queues_n * sizeof(uint16_t), 0, SOCKET_ID_ANY);
	if (!ind_tbl) {
		rte_errno = ENOMEM;
		return NULL;
	}
	ind_tbl->queues_n = queues_n;
	ind_tbl->queues = (uint16_t *)(ind_tbl + 1);
	memcpy(ind_tbl->queues, queues, queues_n * sizeof(*queues));
	ret = mlx5_ind_table_obj_setup(dev, ind_tbl);
	if (ret < 0) {
		mlx5_free(ind_tbl);
		return NULL;
	}
	if (!standalone)
		LIST_INSERT_HEAD(&priv->ind_tbls, ind_tbl, next);
	return ind_tbl;
}
/**
 * Create an indirection table.
 *
 * @param dev
 *   Pointer to Ethernet device.
 * @param queues
 *   Queues entering in the indirection table.
 * @param queues_n
 *   Number of queues in the array.
 * @param standalone
 *   Indirection table for Standalone queue.
 *
 * @return
 *   The Verbs/DevX object initialized, NULL otherwise and rte_errno is set.
 */
Create an indirection table.
@param dev
Pointer to Ethernet device.
@param queues
Queues entering in the indirection table.
@param queues_n
Number of queues in the array.
@param standalone
Indirection table for Standalone queue.

@return
The Verbs/DevX object initialized, NULL otherwise and rte_errno is set.
Create an indirection table . @param dev Pointer to Ethernet device . @param queues Queues entering in the indirection table . @param queues_n Number of queues in the array . @param standalone Indirection table for Standalone queue . @return The Verbs / DevX object initialized NULL otherwise and rte_errno is set .
static struct mlx5_ind_table_obj *
mlx5_ind_table_obj_new(struct rte_eth_dev *dev, const uint16_t *queues,
		       uint32_t queues_n, bool standalone)
{
	struct mlx5_priv *priv = dev->data->dev_private;
	struct mlx5_ind_table_obj *ind_tbl;
	int ret;
	ind_tbl = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*ind_tbl) +
			      queues_n * sizeof(uint16_t), 0, SOCKET_ID_ANY);
	if (!ind_tbl) {
		rte_errno = ENOMEM;
		return NULL;
	}
	ind_tbl->queues_n = queues_n;
	ind_tbl->queues = (uint16_t *)(ind_tbl + 1);
	memcpy(ind_tbl->queues, queues, queues_n * sizeof(*queues));
	ret = mlx5_ind_table_obj_setup(dev, ind_tbl);
	if (ret < 0) {
		mlx5_free(ind_tbl);
		return NULL;
	}
	if (!standalone)
		LIST_INSERT_HEAD(&priv->ind_tbls, ind_tbl, next);
	return ind_tbl;
}
static struct mlx5_ind_table_obj * mlx5_ind_table_obj_new ( struct rte_eth_dev * dev , const uint16_t * queues , uint32_t queues_n , bool standalone ) { struct mlx5_priv * priv = dev -> data -> dev_private ; struct mlx5_ind_table_obj * ind_tbl ; int ret ; ind_tbl = mlx5_malloc ( MLX5_MEM_ZERO , sizeof ( * ind_tbl ) + queues_n * sizeof ( uint16_t ) , 0 , SOCKET_ID_ANY ) ; if ( ! ind_tbl ) { rte_errno = ENOMEM ; return NULL ; } ind_tbl -> queues_n = queues_n ; ind_tbl -> queues = ( uint16_t * ) ( ind_tbl + 1 ) ; memcpy ( ind_tbl -> queues , queues , queues_n * sizeof ( * queues ) ) ; ret = mlx5_ind_table_obj_setup ( dev , ind_tbl ) ; if ( ret < 0 ) { mlx5_free ( ind_tbl ) ; return NULL ; } if ( ! standalone ) LIST_INSERT_HEAD ( & priv -> ind_tbls , ind_tbl , next ) ; return ind_tbl ; }
Create an indirection table.
Create an indirection table .