From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 02F17A0548 for ; Thu, 2 Dec 2021 17:04:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F11944067B; Thu, 2 Dec 2021 17:04:34 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2079.outbound.protection.outlook.com [40.107.102.79]) by mails.dpdk.org (Postfix) with ESMTP id 07AF24067B for ; Thu, 2 Dec 2021 17:04:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gVx5JwypUGGG0fDGPR3dpRigCQ7mKu78FnM6jffVIoR1khmeKAHHd1cSTF9ogUVA0dQPXoOlTMk+NguWXesCrpqeh/EJ7Mw+HHOw0ZdKjAIOADBNIGIUxkv+oilgW7Xc+al21XSIRfd6XUjLHkT8N94B8F1xT5UzlOaBNrxmItI6QfavRS8UB7J2v6DYp2BqcNi8kcDXJ3/XMU7lben5pCmvnD3qEJu3HTT9mRPevc3Trrq051FbWYGoUqarB3JALOJOpdz4I63nkg2rKWa3rYFaM5PaP5ug7Ef6qFYt7PeHd2pY+u19PNWGR8M28FovWUTBUXlpKo19PnV+JsWIIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QY+Be6ZDdb68/cUaNkT7B8jUiL0ZPxt9pnfnodbqssQ=; b=HWVqwls/NwJPjhp3IiGmcqLwUhnapckBsma2cxYReVqcAJb9gAzYUfMrceZU+Y/mEvMi4SeMUIA3duVpWtvMXVhpjwweJZsUp32L3DN6XZ678dgl/c53ZcBFGDvz2tdBfLoPrWzXpshLgY6Kbaui2QN3i7P3q7LPFTw50F+YVPzAc6TT0mRZ+Pm6iKS/Jat8E5GxxDSolguk14FJXTzvhjtyfjbkkQ8vmyFOBXeLWT20rxOZhbnR/sLlScIlRL/iSGguywROJmQiR3y+AOOYGtF+Hn0exFoIh/0Nl0TpA05HHTxL8iW3RO3+4EB6Gs0j3c7KcqQ3TMo/bXsnkwyKFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QY+Be6ZDdb68/cUaNkT7B8jUiL0ZPxt9pnfnodbqssQ=; b=XQHIWSNe2jBgqvdYJde/P6YhQBjkDP6gW48J4C2HgM65R+0GXP+SVJcyPWA5xxXgwTS+qT/cnzPtr7BDHANsdG6qE5tuftuJEUUgNDxWdlYEiOpmf/hU4/RdqHE3RPCAPzmYTyeJIGLF+49JAwORQASYwb+Jk/etXZYteCy0APGy+vckXq0agpQ40sb7W///TCDxG+rtmi+v/E06MfflNkOOL8EUebqXEYbrIBD0tdRMn7CdzxN0WBcRC8RYvQDqXwiItvWtSRLjLSY2mKhq+knPmFbOQiJBgyX2lM9mtdcCtTqc8DKDT6jlYfo2HoaT1a6Uaap5rw+5lHyYNRE+4Q== Received: from BN0PR04CA0122.namprd04.prod.outlook.com (2603:10b6:408:ed::7) by BL0PR12MB4883.namprd12.prod.outlook.com (2603:10b6:208:1c6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Thu, 2 Dec 2021 16:04:31 +0000 Received: from BN8NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ed:cafe::7d) by BN0PR04CA0122.outlook.office365.com (2603:10b6:408:ed::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.14 via Frontend Transport; Thu, 2 Dec 2021 16:04:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT053.mail.protection.outlook.com (10.13.177.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4755.13 via Frontend Transport; Thu, 2 Dec 2021 16:04:30 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 2 Dec 2021 16:04:24 +0000 Received: from nvidia.com (172.20.187.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.9; Thu, 2 Dec 2021 08:04:22 -0800 From: Gregory Etelson To: , CC: Alexander Kozyrev , Viacheslav Ovsiienko , Matan Azrad , Shahaf Shuler Subject: [PATCH 19.11 6/6] net/mlx5: fix GENEVE and VXLAN-GPE flow item matching Date: Thu, 2 Dec 2021 18:04:09 +0200 Message-ID: <20211202160409.26762-1-getelson@nvidia.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b1737b3-4cfa-408f-52f1-08d9b5ad6cd8 X-MS-TrafficTypeDiagnostic: BL0PR12MB4883: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SCnkW6S+WZmgJZKyUQhAcAfsvBnz6w1jM7trOB1ZhX1g1KQ+zuwxwHq15pXuLvmNH+8bbSCdo3SxmiyZtvUzWxvh4g/3AnkZV5OBTkMOlnaLEuoWXmzZQgEVUQRqN51dmUW8NgJFSq5qB/yFy2GkFrullkpOwVj8fzZhmZt9NDaUBhxqE09Zdt6SSugl2VvvZMfCuAh+XQhuyWFzPv0URQudK9LXBTMXLQSRGuQiU8tfe6KBF5pxJpUQtpOk3W+D7p4JDuXA0dvBNbEFTdMYkHO/pjCCouCclzhFe4rcpiJYKyBXv9/uxUy8lSkBIqBW9oxxZUbrPW6HBo5MDLVqB9tZumvb11M+kzyl7sDSCfyhsRPp3sFVP6bvojdPZXlcOQJiGW5f5tWqqMWV8uJuz0dvFKsVnZz8dw6RHYE+j7yShltKGANFboQK+KXV4smHz9XEeWUuPF/0bszXDvY9PUJbR6CthBPiiEROT2wyWluwznSqE+5OuwIj5dbOmdcsminpeVB7zPP/5b1/jgCoVA77K3ZezDmHtQ339NvWuDqk+AhFFFxuSi2F7ceCstky4xqxyUGnn/v1ZEHDPd7u33WZ+xDmaubKEetaETq49DqZDTQUbbyhUU1BL0ZDliGKfurnAjI2QQK4RdyQFI76m7ToPb1ON6Uh6DXc4kbO1lTudVqH/5QLyTWtVopF0/sKxMSx1xH5tRRfmMfztPtv7VOElc3kjG/Yx1uHh8XJkVZnM8fK/lBy3nEa9Ft1rcdKje4KGOICs+HKBe4foDORwA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(40470700001)(7696005)(6286002)(70206006)(70586007)(1076003)(83380400001)(8676002)(107886003)(36756003)(6666004)(86362001)(186003)(7049001)(55016003)(5660300002)(4326008)(47076005)(16526019)(336012)(36860700001)(316002)(110136005)(7636003)(2906002)(26005)(426003)(2616005)(508600001)(356005)(8936002)(40460700001)(54906003)(82310400004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2021 16:04:30.8159 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b1737b3-4cfa-408f-52f1-08d9b5ad6cd8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4883 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 From: Alexander Kozyrev [ upstream commit 94421842de9a821778b95b928945ed8ea382302d ] GENEVE and VXLAN-GPE item matching is done similarly to GRE matching. Users can skip the specification of the protocol type and expect that this type is deducted from the inner header type automatically. But the inner header type may not be specified in order to match all the protocol types. In this case, PMD should not specify the protocol type. Check if we have the inner header type before setting the protocol type. Fixes: 690391dd0e8b ("net/mlx5: fix GENEVE protocol type translation") Fixes: 861fa3796f75 ("net/mlx5: fix VXLAN-GPE next protocol translation") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index cd55deaf56..4766ce155d 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -6119,7 +6119,6 @@ flow_dv_translate_item_vxlan_gpe(void *matcher, void *key, m_protocol = vxlan_m->protocol; v_protocol = vxlan_v->protocol; if (!m_protocol) { - m_protocol = 0xff; /* Force next protocol to ensure next headers parsing. */ if (pattern_flags & MLX5_FLOW_LAYER_INNER_L2) v_protocol = RTE_VXLAN_GPE_TYPE_ETH; @@ -6127,6 +6126,8 @@ flow_dv_translate_item_vxlan_gpe(void *matcher, void *key, v_protocol = RTE_VXLAN_GPE_TYPE_IPV4; else if (pattern_flags & MLX5_FLOW_LAYER_INNER_L3_IPV6) v_protocol = RTE_VXLAN_GPE_TYPE_IPV6; + if (v_protocol) + m_protocol = 0xFF; } MLX5_SET(fte_match_set_misc3, misc_m, outer_vxlan_gpe_next_protocol, m_protocol); @@ -6197,8 +6198,9 @@ flow_dv_translate_item_geneve(void *matcher, void *key, protocol_v = rte_be_to_cpu_16(geneve_v->protocol); if (!protocol_m) { /* Force next protocol to prevent matchers duplication */ - protocol_m = 0xFFFF; protocol_v = mlx5_translate_tunnel_etypes(pattern_flags); + if (protocol_v) + protocol_m = 0xFFFF; } MLX5_SET(fte_match_set_misc, misc_m, geneve_protocol_type, protocol_m); MLX5_SET(fte_match_set_misc, misc_v, geneve_protocol_type, -- 2.34.0