summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDekel Peled <dekelp@mellanox.com>2019-08-15 12:26:51 +0300
committerFerruh Yigit <ferruh.yigit@intel.com>2019-09-06 17:15:14 +0200
commitb41c48b7ad6b81825001f70a7ee9b7e5bab01e76 (patch)
tree4ef88866c78dc9d0deb6b79389168be239d15a00
parente6ed9dfdf848a3c7995dc6fa8f56f8c7fbb85161 (diff)
downloaddpdk-next-eventdev-b41c48b7ad6b81825001f70a7ee9b7e5bab01e76.zip
dpdk-next-eventdev-b41c48b7ad6b81825001f70a7ee9b7e5bab01e76.tar.gz
dpdk-next-eventdev-b41c48b7ad6b81825001f70a7ee9b7e5bab01e76.tar.xz
net/mlx5: fix jump action validation
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>
-rw-r--r--drivers/net/mlx5/mlx5_flow_dv.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 41500bc..a645217 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1957,7 +1957,9 @@ flow_dv_validate_action_modify_ttl(const uint64_t action_flags,
* 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
@@ -1968,10 +1970,17 @@ flow_dv_validate_action_modify_ttl(const uint64_t action_flags,
*/
static int
flow_dv_validate_action_jump(const struct rte_flow_action *action,
+ uint64_t action_flags,
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");
@@ -3226,6 +3235,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
break;
case RTE_FLOW_ACTION_TYPE_JUMP:
ret = flow_dv_validate_action_jump(actions,
+ action_flags,
attr->group, error);
if (ret)
return ret;