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 5A306A04B5 for ; Sun, 13 Dec 2020 19:33:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 19EF64C7B; Sun, 13 Dec 2020 19:33:40 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 806DB4C7B for ; Sun, 13 Dec 2020 19:33:37 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from matan@nvidia.com) with SMTP; 13 Dec 2020 20:33:36 +0200 Received: from nvidia.com (pegasus25.mtr.labs.mlnx [10.210.16.10]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0BDIXagG022323; Sun, 13 Dec 2020 20:33:36 +0200 From: Matan Azrad To: stable@dpdk.org, Viacheslav Ovsiienko Cc: Kevin Traynor Date: Sun, 13 Dec 2020 18:33:32 +0000 Message-Id: <1607884412-242890-1-git-send-email-matan@nvidia.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [PATCH] net/mlx5: fix tunnel flow prioriity X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" [ upstream commit 050bfe033c2dcaff1f6cfb3110aa90bf80071513 ] The PMD manages internally the priority of the flows in addition to the user configured priority. So, 2 flows with the same user priority may get different priority. The method: As much as the flow is more specific it gets higher priority (higher means first to be matched). In addition, When the user creates a RSS flow the PMD splits the flows according to the flow RSS layers as the HW requests for RSS TIR. The internal priority for each flow is decided by the flow last layer. L2, L3 and L4 (L2 low and L4 high). The tunnel layer was wrongly decided to be L4 all the time, even when the flow is configured with inner-RSS. Hence, the first RSS split which takes the tunnel layer priority all the time will be matched before the more specific splits. Change the priority of tunnel layer to be L2 when inner-RSS is configured. Fixes: d4a405186b73 ("net/mlx5: support tunnel RSS level") Signed-off-by: Matan Azrad Acked-by: Ori Kam --- drivers/net/mlx5/mlx5_flow_dv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 3363f90..67327c2 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -2232,26 +2232,36 @@ case RTE_FLOW_ITEM_TYPE_GRE: flow_dv_translate_item_gre(match_mask, match_value, items, tunnel); + matcher.priority = flow->rss.level >= 2 ? + MLX5_PRIORITY_MAP_L2 : MLX5_PRIORITY_MAP_L4; last_item = MLX5_FLOW_LAYER_GRE; break; case RTE_FLOW_ITEM_TYPE_NVGRE: flow_dv_translate_item_nvgre(match_mask, match_value, items, tunnel); + matcher.priority = flow->rss.level >= 2 ? + MLX5_PRIORITY_MAP_L2 : MLX5_PRIORITY_MAP_L4; last_item = MLX5_FLOW_LAYER_GRE; break; case RTE_FLOW_ITEM_TYPE_VXLAN: flow_dv_translate_item_vxlan(match_mask, match_value, items, tunnel); + matcher.priority = flow->rss.level >= 2 ? + MLX5_PRIORITY_MAP_L2 : MLX5_PRIORITY_MAP_L4; last_item = MLX5_FLOW_LAYER_VXLAN; break; case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: flow_dv_translate_item_vxlan(match_mask, match_value, items, tunnel); + matcher.priority = flow->rss.level >= 2 ? + MLX5_PRIORITY_MAP_L2 : MLX5_PRIORITY_MAP_L4; last_item = MLX5_FLOW_LAYER_VXLAN_GPE; break; case RTE_FLOW_ITEM_TYPE_MPLS: flow_dv_translate_item_mpls(match_mask, match_value, items, last_item, tunnel); + matcher.priority = flow->rss.level >= 2 ? + MLX5_PRIORITY_MAP_L2 : MLX5_PRIORITY_MAP_L4; last_item = MLX5_FLOW_LAYER_MPLS; break; case RTE_FLOW_ITEM_TYPE_META: -- 1.8.3.1