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

Function mlx5_flow_validate_action_rss

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

* Validate the rss action. * * @param[in] action * Pointer to the queue action. * @param[in] action_flags * Bit-fields that holds the actions detected until now. * @param[in] dev * Pointer to the Ethernet device structure. * @param[in] attr * Attributes of flow that includes this action. * @param[in] item_flags * Items that were detected. * @param[out] error * Pointer to e

Source from the content-addressed store, hash-verified

2352 * 0 on success, a negative errno value otherwise and rte_errno is set.
2353 */
2354int
2355mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
2356 uint64_t action_flags,
2357 struct rte_eth_dev *dev,
2358 const struct rte_flow_attr *attr,
2359 uint64_t item_flags,
2360 struct rte_flow_error *error)
2361{
2362 const struct rte_flow_action_rss *rss = action->conf;
2363 int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
2364 int ret;
2365
2366 if (action_flags & MLX5_FLOW_FATE_ACTIONS)
2367 return rte_flow_error_set(error, EINVAL,
2368 RTE_FLOW_ERROR_TYPE_ACTION, NULL,
2369 "can't have 2 fate actions"
2370 " in same flow");
2371 ret = mlx5_validate_action_rss(dev, action, error);
2372 if (ret)
2373 return ret;
2374 if (attr->egress)
2375 return rte_flow_error_set(error, ENOTSUP,
2376 RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL,
2377 "rss action not supported for "
2378 "egress");
2379 if (rss->level > 1 && !tunnel)
2380 return rte_flow_error_set(error, EINVAL,
2381 RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL,
2382 "inner RSS is not supported for "
2383 "non-tunnel flows");
2384 if ((item_flags & MLX5_FLOW_LAYER_ECPRI) &&
2385 !(item_flags & MLX5_FLOW_LAYER_INNER_L4_UDP)) {
2386 return rte_flow_error_set(error, EINVAL,
2387 RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL,
2388 "RSS on eCPRI is not supported now");
2389 }
2390 if ((item_flags & MLX5_FLOW_LAYER_MPLS) &&
2391 !(item_flags &
2392 (MLX5_FLOW_LAYER_INNER_L2 | MLX5_FLOW_LAYER_INNER_L3)) &&
2393 rss->level > 1)
2394 return rte_flow_error_set(error, EINVAL,
2395 RTE_FLOW_ERROR_TYPE_ITEM, NULL,
2396 "MPLS inner RSS needs to specify inner L2/L3 items after MPLS in pattern");
2397 return 0;
2398}
2399
2400/*
2401 * Validate the default miss action.

Callers 4

flow_dv_validateFunction · 0.85
flow_verbs_validateFunction · 0.85

Calls 2

rte_flow_error_setFunction · 0.85
mlx5_validate_action_rssFunction · 0.85

Tested by

no test coverage detected