* Validate queue numbers for device RSS. * * @param[in] dev * Configured device. * @param[in] queues * Array of queue numbers. * @param[in] queues_n * Size of the @p queues array. * @param[out] error * On error, filled with a textual error description. * @param[out] queue_idx * On error, filled with an offending queue index in @p queues array. * * @return * 0 on success,
| 2190 | * 0 on success, a negative errno code on error. |
| 2191 | */ |
| 2192 | static int |
| 2193 | mlx5_validate_rss_queues(struct rte_eth_dev *dev, |
| 2194 | const uint16_t *queues, uint32_t queues_n, |
| 2195 | const char **error, uint32_t *queue_idx) |
| 2196 | { |
| 2197 | const struct mlx5_priv *priv = dev->data->dev_private; |
| 2198 | bool is_hairpin = false; |
| 2199 | bool is_ext_rss = false; |
| 2200 | uint32_t i; |
| 2201 | |
| 2202 | for (i = 0; i != queues_n; ++i) { |
| 2203 | struct mlx5_rxq_ctrl *rxq_ctrl; |
| 2204 | |
| 2205 | if (mlx5_is_external_rxq(dev, queues[0])) { |
| 2206 | is_ext_rss = true; |
| 2207 | continue; |
| 2208 | } |
| 2209 | if (is_ext_rss) { |
| 2210 | *error = "Combining external and regular RSS queues is not supported"; |
| 2211 | *queue_idx = i; |
| 2212 | return -ENOTSUP; |
| 2213 | } |
| 2214 | if (queues[i] >= priv->rxqs_n) { |
| 2215 | *error = "queue index out of range"; |
| 2216 | *queue_idx = i; |
| 2217 | return -EINVAL; |
| 2218 | } |
| 2219 | rxq_ctrl = mlx5_rxq_ctrl_get(dev, queues[i]); |
| 2220 | if (rxq_ctrl == NULL) { |
| 2221 | *error = "queue is not configured"; |
| 2222 | *queue_idx = i; |
| 2223 | return -EINVAL; |
| 2224 | } |
| 2225 | if (i == 0 && rxq_ctrl->is_hairpin) |
| 2226 | is_hairpin = true; |
| 2227 | if (is_hairpin != rxq_ctrl->is_hairpin) { |
| 2228 | *error = "combining hairpin and regular RSS queues is not supported"; |
| 2229 | *queue_idx = i; |
| 2230 | return -ENOTSUP; |
| 2231 | } |
| 2232 | } |
| 2233 | return 0; |
| 2234 | } |
| 2235 | |
| 2236 | /* |
| 2237 | * Validate the rss action. |
no test coverage detected