src/dpdk/drivers/net/mlx5/mlx5_rss.c
int
mlx5_rss_reta_index_resize(struct rte_eth_dev *dev, unsigned int reta_size)
{
	struct mlx5_priv *priv = dev->data->dev_private;
	void *mem;
	unsigned int old_size = priv->reta_idx_n;

	if (priv->reta_idx_n == reta_size)
		return 0;

	mem = mlx5_realloc(priv->reta_idx, MLX5_MEM_RTE,
			   reta_size * sizeof((*priv->reta_idx)[0]), 0,
			   SOCKET_ID_ANY);
	if (!mem) {
		rte_errno = ENOMEM;
		return -rte_errno;
	}
	priv->reta_idx = mem;
	priv->reta_idx_n = reta_size;
	if (old_size < reta_size)
		memset(&(*priv->reta_idx)[old_size], 0,
		       (reta_size - old_size) *
		       sizeof((*priv->reta_idx)[0]));
	return 0;
}
/**
 * Allocate/reallocate RETA index table.
 *
 * @param dev
 *   Pointer to Ethernet device.
 * @praram reta_size
 *   The size of the array to allocate.
 *
 * @return
 *   0 on success, a negative errno value otherwise and rte_errno is set.
 */
Allocate/reallocate RETA index table.
@param dev
Pointer to Ethernet device.
@praram reta_size
The size of the array to allocate.

@return
0 on success, a negative errno value otherwise and rte_errno is set.
Allocate / reallocate RETA index table . @param dev Pointer to Ethernet device . @praram reta_size The size of the array to allocate . @return 0 on success a negative errno value otherwise and rte_errno is set .
int
mlx5_rss_reta_index_resize(struct rte_eth_dev *dev, unsigned int reta_size)
{
	struct mlx5_priv *priv = dev->data->dev_private;
	void *mem;
	unsigned int old_size = priv->reta_idx_n;
	if (priv->reta_idx_n == reta_size)
		return 0;
	mem = mlx5_realloc(priv->reta_idx, MLX5_MEM_RTE,
			   reta_size * sizeof((*priv->reta_idx)[0]), 0,
			   SOCKET_ID_ANY);
	if (!mem) {
		rte_errno = ENOMEM;
		return -rte_errno;
	}
	priv->reta_idx = mem;
	priv->reta_idx_n = reta_size;
	if (old_size < reta_size)
		memset(&(*priv->reta_idx)[old_size], 0,
		       (reta_size - old_size) *
		       sizeof((*priv->reta_idx)[0]));
	return 0;
}
int mlx5_rss_reta_index_resize ( struct rte_eth_dev * dev , unsigned int reta_size ) { struct mlx5_priv * priv = dev -> data -> dev_private ; void * mem ; unsigned int old_size = priv -> reta_idx_n ; if ( priv -> reta_idx_n == reta_size ) return 0 ; mem = mlx5_realloc ( priv -> reta_idx , MLX5_MEM_RTE , reta_size * sizeof ( ( * priv -> reta_idx ) [ 0 ] ) , 0 , SOCKET_ID_ANY ) ; if ( ! mem ) { rte_errno = ENOMEM ; return - rte_errno ; } priv -> reta_idx = mem ; priv -> reta_idx_n = reta_size ; if ( old_size < reta_size ) memset ( & ( * priv -> reta_idx ) [ old_size ] , 0 , ( reta_size - old_size ) * sizeof ( ( * priv -> reta_idx ) [ 0 ] ) ) ; return 0 ; }
Allocate/reallocate RETA index table.
Allocate / reallocate RETA index table .