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 E9182A04D8 for ; Tue, 11 Aug 2020 13:49:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CFABB1B203; Tue, 11 Aug 2020 13:49:05 +0200 (CEST) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by dpdk.org (Postfix) with ESMTP id A79B41B203 for ; Tue, 11 Aug 2020 13:49:04 +0200 (CEST) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 11 Aug 2020 04:47:18 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 11 Aug 2020 04:49:03 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 11 Aug 2020 04:49:03 -0700 Received: from nvidia.com (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 11 Aug 2020 11:49:02 +0000 From: Gregory Etelson To: CC: , , Ori Kam Date: Tue, 11 Aug 2020 14:48:47 +0300 Message-ID: <20200811114847.8987-1-getelson@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1597146438; bh=9Vj+VA4s9Fsy776sY02BwRGboYmIZZIvXYf+FoPxDAM=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy; b=kmR5x027NlWB9Q2LZxlE5u3eIIowX/4AUp/cnfGRjh8LNsVhrMXO/ehEuV08tJbpg DV/MuCFGPO3USBIilnHwKCzHm7oDzGthboPtbT7MJ/CFyOq35ryRLDcrVxVVenTdGY LZOISMAUGTz5N4QtDMLubbZagtgDHIoaRD+96l/qeMoD22kecgEFZxzk0CqP/SnDK+ v19nUOaUJIOprPVhJ/ARI2kOStUptB4pl3+D5lQIE85fTTNLIRCNr6TGY6H5UJNEk6 tvWbWpH5Kvn6TApRVhYJCg1LY9xecnmFQLgSgSlDcqo2uK7Ucvlvu//i88ffiE8c/B JXXNxqDL3pDMw== Subject: [dpdk-stable] [PATCH 19.11] net/mlx5: fix tunnel flow priority 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 750ff30a8fde522477babb0d4fcdc6fb9eb21fde ] PMD flow priority is different from application flow priority. Flow rules with higher match granularity assigned higher PMD priority. Also PMD splits internally RSS flows according to flow RSS layer. Final PMD flow rule priority derived from the last match item network level, after PMD adjusts flow rule, where L4 match gets the highest priority and L2 the lowest. The patch adjusts tunnels flow rule priority calculation for PMDs running verb API. Fixes: 4a78c88e3bae ("net/mlx5: fix Verbs flow tunnel") Signed-off-by: Gregory Etelson Acked-by: Ori Kam --- drivers/net/mlx5/mlx5_flow_verbs.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flo= w_verbs.c index 7ac6a25e43..0c5e56e409 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -1478,6 +1478,7 @@ flow_verbs_translate(struct rte_eth_dev *dev, uint64_t priority =3D attr->priority; uint32_t subpriority =3D 0; struct mlx5_priv *priv =3D dev->data->dev_private; + struct rte_flow *flow =3D dev_flow->flow; =20 if (priority =3D=3D MLX5_FLOW_PRIO_RSVD) priority =3D priv->config.flow_prio - 1; @@ -1596,25 +1597,33 @@ flow_verbs_translate(struct rte_eth_dev *dev, case RTE_FLOW_ITEM_TYPE_VXLAN: flow_verbs_translate_item_vxlan(dev_flow, items, item_flags); - subpriority =3D MLX5_PRIORITY_MAP_L2; + subpriority =3D flow->rss.level >=3D 2 ? + MLX5_PRIORITY_MAP_L2 : + MLX5_PRIORITY_MAP_L4; item_flags |=3D MLX5_FLOW_LAYER_VXLAN; break; case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: flow_verbs_translate_item_vxlan_gpe(dev_flow, items, item_flags); - subpriority =3D MLX5_PRIORITY_MAP_L2; + subpriority =3D flow->rss.level >=3D 2 ? + MLX5_PRIORITY_MAP_L2 : + MLX5_PRIORITY_MAP_L4; item_flags |=3D MLX5_FLOW_LAYER_VXLAN_GPE; break; case RTE_FLOW_ITEM_TYPE_GRE: flow_verbs_translate_item_gre(dev_flow, items, item_flags); - subpriority =3D MLX5_PRIORITY_MAP_L2; + subpriority =3D flow->rss.level >=3D 2 ? + MLX5_PRIORITY_MAP_L2 : + MLX5_PRIORITY_MAP_L4; item_flags |=3D MLX5_FLOW_LAYER_GRE; break; case RTE_FLOW_ITEM_TYPE_MPLS: flow_verbs_translate_item_mpls(dev_flow, items, item_flags); - subpriority =3D MLX5_PRIORITY_MAP_L2; + subpriority =3D flow->rss.level >=3D 2 ? + MLX5_PRIORITY_MAP_L2 : + MLX5_PRIORITY_MAP_L4; item_flags |=3D MLX5_FLOW_LAYER_MPLS; break; default: --=20 2.25.1