From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2941A034E; Tue, 19 Nov 2019 16:32:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3E1B22B8E; Tue, 19 Nov 2019 16:32:40 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 5C594A69 for ; Tue, 19 Nov 2019 16:32:38 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from matan@mellanox.com) with ESMTPS (AES256-SHA encrypted); 19 Nov 2019 17:32:34 +0200 Received: from pegasus07.mtr.labs.mlnx (pegasus07.mtr.labs.mlnx [10.210.16.112]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id xAJFWYJm002400; Tue, 19 Nov 2019 17:32:34 +0200 From: Matan Azrad To: dev@dpdk.org Cc: Viacheslav Ovsiienko , dekelp@mellanox.com, stable@dpdk.org Date: Tue, 19 Nov 2019 15:32:28 +0000 Message-Id: <1574177548-22741-1-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix L3 encapsulation flow validation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In order to configure L3 encapsulation\decapsulation flow to mlx5 devices, 2 actions should be added to the flow actions list: RTE_FLOW_ACTION_TYPE_RAW_DECAP and RTE_FLOW_ACTION_TYPE_RAW_ENCAP. One of the validations for this scenario is to check that modify actions is not done before the L3 decapsulation, because it doesn't make sense to decapsulate a modified data. Wrongly, this check was done for the case of L3 encapsulation what causes a validation failure in modify + L3 encapsulation flow. Ignore this check in case of L3 encapsulation. Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs") Cc: dekelp@mellanox.com Cc: stable@dpdk.org Signed-off-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index c9dbd89..9d883df 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -2185,11 +2185,6 @@ struct field_modify_info modify_tcp[] = { RTE_FLOW_ERROR_TYPE_ACTION, NULL, "can only have a single decap" " action in a flow"); - if (action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS) - return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, NULL, - "can't have decap action after" - " modify action"); /* decap action is valid on egress only if it is followed by encap */ if (attr->egress) { for (; action->type != RTE_FLOW_ACTION_TYPE_END && @@ -2202,6 +2197,11 @@ struct field_modify_info modify_tcp[] = { RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL, "decap action not supported" " for egress"); + } else if (action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS) { + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, NULL, + "can't have decap action after" + " modify action"); } return 0; } -- 1.8.3.1