From 87e1134f86dff1a61357b89c8a3a2202ec02bc71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?N=C3=A9lio=20Laranjeiro?= Date: Fri, 20 Jan 2017 16:27:28 +0100 Subject: [PATCH] net/mlx5: fix flow API mark combined with drop Fixes: ea3bc3b1df94 ("net/mlx5: support mark flow action") Cc: stable@dpdk.org Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5_flow.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index d7ed686846..7b97a610ee 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -480,7 +480,7 @@ priv_flow_validate(struct priv *priv, goto exit_action_not_supported; } } - if (action.mark && !flow->ibv_attr) + if (action.mark && !flow->ibv_attr && !action.drop) flow->offset += sizeof(struct ibv_exp_flow_spec_action_tag); if (!action.queue && !action.drop) { rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_HANDLE, @@ -1042,6 +1042,7 @@ priv_flow_create(struct priv *priv, actions->conf)->index; } else if (actions->type == RTE_FLOW_ACTION_TYPE_DROP) { action.drop = 1; + action.mark = 0; } else if (actions->type == RTE_FLOW_ACTION_TYPE_MARK) { const struct rte_flow_action_mark *mark = (const struct rte_flow_action_mark *) @@ -1049,7 +1050,7 @@ priv_flow_create(struct priv *priv, if (mark) action.mark_id = mark->id; - action.mark = 1; + action.mark = !action.drop; } else { rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, -- 2.20.1