MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_validate_action_rss

Function mlx5_validate_action_rss

dpdk/drivers/net/mlx5/mlx5_flow.c:2249–2333  ·  view source on GitHub ↗

* Validate the rss action. * * @param[in] dev * Pointer to the Ethernet device structure. * @param[in] action * Pointer to the queue action. * @param[out] error * Pointer to error structure. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

2247 * 0 on success, a negative errno value otherwise and rte_errno is set.
2248 */
2249int
2250mlx5_validate_action_rss(struct rte_eth_dev *dev,
2251 const struct rte_flow_action *action,
2252 struct rte_flow_error *error)
2253{
2254 struct mlx5_priv *priv = dev->data->dev_private;
2255 const struct rte_flow_action_rss *rss = action->conf;
2256 int ret;
2257 const char *message;
2258 uint32_t queue_idx;
2259
2260 if (rss->func == RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) {
2261 DRV_LOG(WARNING, "port %u symmetric RSS supported with SORT",
2262 dev->data->port_id);
2263 } else if (rss->func != RTE_ETH_HASH_FUNCTION_DEFAULT &&
2264 rss->func != RTE_ETH_HASH_FUNCTION_TOEPLITZ)
2265 return rte_flow_error_set(error, ENOTSUP,
2266 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
2267 &rss->func,
2268 "RSS hash function not supported");
2269#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
2270 if (rss->level > 2)
2271#else
2272 if (rss->level > 1)
2273#endif
2274 return rte_flow_error_set(error, ENOTSUP,
2275 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
2276 &rss->level,
2277 "tunnel RSS is not supported");
2278 /* allow RSS key_len 0 in case of NULL (default) RSS key. */
2279 if (rss->key_len == 0 && rss->key != NULL)
2280 return rte_flow_error_set(error, ENOTSUP,
2281 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
2282 &rss->key_len,
2283 "RSS hash key length 0");
2284 if (rss->key_len > 0 && rss->key_len < MLX5_RSS_HASH_KEY_LEN)
2285 return rte_flow_error_set(error, ENOTSUP,
2286 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
2287 &rss->key_len,
2288 "RSS hash key too small");
2289 if (rss->key_len > MLX5_RSS_HASH_KEY_LEN)
2290 return rte_flow_error_set(error, ENOTSUP,
2291 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
2292 &rss->key_len,
2293 "RSS hash key too large");
2294 if (rss->queue_num > priv->sh->dev_cap.ind_table_max_size)
2295 return rte_flow_error_set(error, ENOTSUP,
2296 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
2297 &rss->queue_num,
2298 "number of queues too large");
2299 if (rss->types & MLX5_RSS_HF_MASK)
2300 return rte_flow_error_set(error, ENOTSUP,
2301 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
2302 &rss->types,
2303 "some RSS protocols are not"
2304 " supported");
2305 if ((rss->types & (RTE_ETH_RSS_L3_SRC_ONLY | RTE_ETH_RSS_L3_DST_ONLY)) &&
2306 !(rss->types & RTE_ETH_RSS_IP))

Callers 3

flow_dv_action_validateFunction · 0.85

Calls 2

rte_flow_error_setFunction · 0.85
mlx5_validate_rss_queuesFunction · 0.85

Tested by

no test coverage detected