src/dpdk/drivers/net/mlx5/mlx5_rss.c
int
mlx5_dev_rss_reta_update(struct rte_eth_dev *dev,
			 struct rte_eth_rss_reta_entry64 *reta_conf,
			 uint16_t reta_size)
{
	int ret;
	struct mlx5_priv *priv = dev->data->dev_private;
	unsigned int idx;
	unsigned int i;
	unsigned int pos;

	if (!reta_size) {
		rte_errno = EINVAL;
		return -rte_errno;
	}
	ret = mlx5_rss_reta_index_resize(dev, reta_size);
	if (ret)
		return ret;
	for (idx = 0, i = 0; (i != reta_size); ++i) {
		idx = i / RTE_RETA_GROUP_SIZE;
		pos = i % RTE_RETA_GROUP_SIZE;
		if (((reta_conf[idx].mask >> i) & 0x1) == 0)
			continue;
		MLX5_ASSERT(reta_conf[idx].reta[pos] < priv->rxqs_n);
		(*priv->reta_idx)[i] = reta_conf[idx].reta[pos];
	}

	priv->skip_default_rss_reta = 1;

	if (dev->data->dev_started) {
		mlx5_dev_stop(dev);
		return mlx5_dev_start(dev);
	}
	return 0;
}
/**
 * DPDK callback to update the RETA indirection table.
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 * @param reta_conf
 *   Pointer to RETA configuration structure array.
 * @param reta_size
 *   Size of the RETA table.
 *
 * @return
 *   0 on success, a negative errno value otherwise and rte_errno is set.
 */
DPDK callback to update the RETA indirection table.
@param dev
Pointer to Ethernet device structure.
@param reta_conf
Pointer to RETA configuration structure array.
@param reta_size
Size of the RETA table.

@return
0 on success, a negative errno value otherwise and rte_errno is set.
DPDK callback to update the RETA indirection table . @param dev Pointer to Ethernet device structure . @param reta_conf Pointer to RETA configuration structure array . @param reta_size Size of the RETA table . @return 0 on success a negative errno value otherwise and rte_errno is set .
int
mlx5_dev_rss_reta_update(struct rte_eth_dev *dev,
			 struct rte_eth_rss_reta_entry64 *reta_conf,
			 uint16_t reta_size)
{
	int ret;
	struct mlx5_priv *priv = dev->data->dev_private;
	unsigned int idx;
	unsigned int i;
	unsigned int pos;
	if (!reta_size) {
		rte_errno = EINVAL;
		return -rte_errno;
	}
	ret = mlx5_rss_reta_index_resize(dev, reta_size);
	if (ret)
		return ret;
	for (idx = 0, i = 0; (i != reta_size); ++i) {
		idx = i / RTE_RETA_GROUP_SIZE;
		pos = i % RTE_RETA_GROUP_SIZE;
		if (((reta_conf[idx].mask >> i) & 0x1) == 0)
			continue;
		MLX5_ASSERT(reta_conf[idx].reta[pos] < priv->rxqs_n);
		(*priv->reta_idx)[i] = reta_conf[idx].reta[pos];
	}
	priv->skip_default_rss_reta = 1;
	if (dev->data->dev_started) {
		mlx5_dev_stop(dev);
		return mlx5_dev_start(dev);
	}
	return 0;
}
int mlx5_dev_rss_reta_update ( struct rte_eth_dev * dev , struct rte_eth_rss_reta_entry64 * reta_conf , uint16_t reta_size ) { int ret ; struct mlx5_priv * priv = dev -> data -> dev_private ; unsigned int idx ; unsigned int i ; unsigned int pos ; if ( ! reta_size ) { rte_errno = EINVAL ; return - rte_errno ; } ret = mlx5_rss_reta_index_resize ( dev , reta_size ) ; if ( ret ) return ret ; for ( idx = 0 , i = 0 ; ( i != reta_size ) ; ++ i ) { idx = i / RTE_RETA_GROUP_SIZE ; pos = i % RTE_RETA_GROUP_SIZE ; if ( ( ( reta_conf [ idx ] . mask >> i ) & 0x1 ) == 0 ) continue ; MLX5_ASSERT ( reta_conf [ idx ] . reta [ pos ] < priv -> rxqs_n ) ; ( * priv -> reta_idx ) [ i ] = reta_conf [ idx ] . reta [ pos ] ; } priv -> skip_default_rss_reta = 1 ; if ( dev -> data -> dev_started ) { mlx5_dev_stop ( dev ) ; return mlx5_dev_start ( dev ) ; } return 0 ; }
DPDK callback to update the RETA indirection table.
DPDK callback to update the RETA indirection table .