* 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. */
| 193 | * 0 on success, a negative errno value otherwise and rte_errno is set. |
| 194 | */ |
| 195 | int |
| 196 | mlx5_dev_rss_reta_update(struct rte_eth_dev *dev, |
| 197 | struct rte_eth_rss_reta_entry64 *reta_conf, |
| 198 | uint16_t reta_size) |
| 199 | { |
| 200 | int ret; |
| 201 | struct mlx5_priv *priv = dev->data->dev_private; |
| 202 | unsigned int idx; |
| 203 | unsigned int i; |
| 204 | unsigned int pos; |
| 205 | |
| 206 | if (!reta_size) { |
| 207 | rte_errno = EINVAL; |
| 208 | return -rte_errno; |
| 209 | } |
| 210 | ret = mlx5_rss_reta_index_resize(dev, reta_size); |
| 211 | if (ret) |
| 212 | return ret; |
| 213 | for (idx = 0, i = 0; (i != reta_size); ++i) { |
| 214 | idx = i / RTE_ETH_RETA_GROUP_SIZE; |
| 215 | pos = i % RTE_ETH_RETA_GROUP_SIZE; |
| 216 | if (((reta_conf[idx].mask >> pos) & 0x1) == 0) |
| 217 | continue; |
| 218 | MLX5_ASSERT(reta_conf[idx].reta[pos] < priv->rxqs_n); |
| 219 | (*priv->reta_idx)[i] = reta_conf[idx].reta[pos]; |
| 220 | } |
| 221 | priv->skip_default_rss_reta = 1; |
| 222 | return mlx5_traffic_restart(dev); |
| 223 | } |
nothing calls this directly
no test coverage detected