This patch updates the validation function of jump action.
It adds check of conflicting fate actions in flow rule.
It also removes check of action->type which is not needed.
Fixes:
684b9a1b1f5c ("net/mlx5: support jump action")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
* Validate jump action.
*
* @param[in] action
* Validate jump action.
*
* @param[in] action
- * Pointer to the modify action.
+ * Pointer to the jump action.
+ * @param[in] action_flags
+ * Holds the actions detected until now.
* @param[in] group
* The group of the current flow.
* @param[out] error
* @param[in] group
* The group of the current flow.
* @param[out] error
*/
static int
flow_dv_validate_action_jump(const struct rte_flow_action *action,
*/
static int
flow_dv_validate_action_jump(const struct rte_flow_action *action,
uint32_t group,
struct rte_flow_error *error)
{
uint32_t group,
struct rte_flow_error *error)
{
- if (action->type != RTE_FLOW_ACTION_TYPE_JUMP && !action->conf)
+ if (action_flags & (MLX5_FLOW_FATE_ACTIONS |
+ MLX5_FLOW_FATE_ESWITCH_ACTIONS))
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION, NULL,
+ "can't have 2 fate actions in"
+ " same flow");
+ if (!action->conf)
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION_CONF,
NULL, "action configuration not set");
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION_CONF,
NULL, "action configuration not set");
break;
case RTE_FLOW_ACTION_TYPE_JUMP:
ret = flow_dv_validate_action_jump(actions,
break;
case RTE_FLOW_ACTION_TYPE_JUMP:
ret = flow_dv_validate_action_jump(actions,
attr->group, error);
if (ret)
return ret;
attr->group, error);
if (ret)
return ret;