From patchwork Mon Nov 4 12:43:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyu Min X-Patchwork-Id: 62372 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3CD55A0352; Mon, 4 Nov 2019 13:43:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D625374C; Mon, 4 Nov 2019 13:43:44 +0100 (CET) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 4F8323576 for ; Mon, 4 Nov 2019 13:43:43 +0100 (CET) From: Xiaoyu Min To: Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Cc: dev@dpdk.org, motih@mellanox.com Date: Mon, 4 Nov 2019 14:43:39 +0200 Message-Id: X-Mailer: git-send-email 2.21.0 In-Reply-To: <9e5de2107190123908378aff9a191c84aaf6581c.1572443907.git.jackmin@mellanox.com> References: <9e5de2107190123908378aff9a191c84aaf6581c.1572443907.git.jackmin@mellanox.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2] net/mlx5: port id action must be after VLAN actions 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" Rdma-core needs the dst_vport (port_id) action be after push/pop VLAN and modify hdr actions otherwise it will reject to create rule. This pach validates the port_id is after push/pop VLAN and set VLAN VID/PCP otherwise PMD spits out errors. Fixes: 5f163d520cff ("net/mlx5: support modify VLAN ID on existing VLAN header") Cc: motih@mellanox.com Signed-off-by: Xiaoyu Min Acked-by: Matan Azrad --- v2: * rebased drivers/net/mlx5/mlx5_flow_dv.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 4be059ded5..b49175e5a4 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1000,6 +1000,11 @@ flow_dv_validate_action_pop_vlan(struct rte_eth_dev *dev, NULL, "cannot pop vlan without a " "match on (outer) vlan in the flow"); + if (action_flags & MLX5_FLOW_ACTION_PORT_ID) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "wrong action order, port_id should " + "be after pop VLAN action"); return 0; } @@ -1103,6 +1108,11 @@ flow_dv_validate_action_push_vlan(uint64_t action_flags, "push VLAN needs to match on VLAN in order to " "get VLAN VID information because there is " "no followed set VLAN VID action"); + if (action_flags & MLX5_FLOW_ACTION_PORT_ID) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "wrong action order, port_id should " + "be after push VLAN"); (void)attr; return 0; } @@ -1144,6 +1154,11 @@ flow_dv_validate_action_set_vlan_pcp(uint64_t action_flags, RTE_FLOW_ERROR_TYPE_ACTION, action, "Multiple VLAN PCP modification are " "not supported"); + if (action_flags & MLX5_FLOW_ACTION_PORT_ID) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "wrong action order, port_id should " + "be after set VLAN PCP"); return 0; } @@ -1202,6 +1217,11 @@ flow_dv_validate_action_set_vlan_vid(uint64_t item_flags, RTE_FLOW_ERROR_TYPE_ACTION, action, "match on VLAN is required in order " "to set VLAN VID"); + if (action_flags & MLX5_FLOW_ACTION_PORT_ID) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "wrong action order, port_id should " + "be after set VLAN VID"); return 0; }