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 6B03EA034F for ; Mon, 6 Dec 2021 11:39:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C95D40040; Mon, 6 Dec 2021 11:39:31 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (unknown [40.107.92.79]) by mails.dpdk.org (Postfix) with ESMTP id 9286C40040 for ; Mon, 6 Dec 2021 11:39:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kPSbFOS/WAvRUB/ngGc/oYY4snVzWIJF08dStddr7ZYjxPm7j1oBih/lpu/z78n9Ux7N9aODLSIDQBmUNv6iL2z/5HepW6dn2mLvyzeGnQb0I1UfNuwet+bqI87cxe1TfqMgz0Kh1pFlDrFEJJNWA5aTyNF92R207AGgKOOfCBJbXhwGBvOCkt4/Giv/jpxiAu+nCMBug/AbRGrGQIdq9o4TI5vzslWKSYgUX8VhqKP8S4VxWJ/2LjpGS5s098PBlXGY8AnwZVMgADPNJ+JH6+u42csPmaS3nJPq2Nj+2+LqRvjHS8pCkkb55d4+e547vneI5/5f+7eJBSjV28A4Rg== 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=ormnvLXxkp36t0vCTd95ow+Nj6p6J6AipGErsyiGcTQ=; b=DxUCx14s2oE1AWDqEJxhnPHylWl/hkXHlNsCEUd08nKgTuz7iwcFrywrPE2PvcWg/KnF/tCXa2FKkgQZPvBz+YiBeHVaO28fGBAbETyvLgi2X8l9yZzkzhCd284NeJ5dYqaBMXv1T1lEvlrvk5vlBki8c1XttWXoVYyEIuhQcanfpaaYTJyX7HJM4Nq0AWuq+PiTAR7uw8xWPAL1yyZWb1b20f5ujRGpFbwDjfP+D9Od5gUU0qsFPsDGZWM0x93moJsHOxh0wgl+kySxgyDqE23K/95l/5XZMtvduKpDxH/TYHqrW05IZDxfjvZ7LocBZ3MX7nDdPcuNUj6t2V0E4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=canonical.com 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=ormnvLXxkp36t0vCTd95ow+Nj6p6J6AipGErsyiGcTQ=; b=ckZx69s1HUvFs+r4r3ouyNe2KtegVzazaCEJa/cBodAfB7wG8IG6Ddfq/HaDoXyLW5xkwmwmn56B3cBC8R/qCp1phTjhRYETkh4ZoSuWj20Rwt39ovWEUBUwGkw1UVEmICi0FabUqFOKuF9l/wk+xXpjFKVgH4Sk66oG90DnVxPgGScB6QPLUnnESK96MVLJhCc2hGk2NUmBkafd+rouSCVTHBW2gP5ItDQvT0x38knUTuf8s2aOlgZQPp1HA7AOnra2SZ2Y8eiWNsLhGyRakFvf9nCmI5ECu9c439VjUxHHDiWYAllbk84xaMB3M2hQ3KTUdobnjKSJ+txbSxxXLA== Received: from BN8PR15CA0056.namprd15.prod.outlook.com (2603:10b6:408:80::33) by BY5PR12MB4132.namprd12.prod.outlook.com (2603:10b6:a03:209::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.16; Mon, 6 Dec 2021 10:39:25 +0000 Received: from BN8NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:408:80:cafe::ce) by BN8PR15CA0056.outlook.office365.com (2603:10b6:408:80::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.20 via Frontend Transport; Mon, 6 Dec 2021 10:39:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) 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.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by BN8NAM11FT031.mail.protection.outlook.com (10.13.177.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4755.13 via Frontend Transport; Mon, 6 Dec 2021 10:39:24 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 6 Dec 2021 10:39:22 +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; Mon, 6 Dec 2021 02:39:19 -0800 From: Gregory Etelson To: CC: , , , , , Christian Ehrhardt , Alexander Kozyrev Subject: [PATCH 19.11 v2 2/2] net/mlx5: fix GRE flow item matching Date: Mon, 6 Dec 2021 12:39:07 +0200 Message-ID: <20211206103907.29893-1-getelson@nvidia.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211202160314.26638-1-getelson@nvidia.com> References: <20211202160314.26638-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9678edd3-08ef-4360-0040-08d9b8a4abf9 X-MS-TrafficTypeDiagnostic: BY5PR12MB4132:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AnRuEOlcZSPQ3RCrWfsbOpDg31rjrSCRbixAKrmHl+zQ1BCVXMvIVe+cuNzVWcP0O/k+OFA8sjn3C6m/ZtsTmEgrnhmM79J7UO2yxyH7im/iiJLjJFmv33mC0tynsOzNTcVRMNyCqjAgR/8Hg4HjM6WfjUWe5OSnZwBd3Abj2CmXazZqn2fKSUu1vxsuyBvwkpgTZKvXZlXHW7sqmtox53pnoKC7OqR9KeyAYLRDr9nKpoe+2zlRTfPxdNEtQMT0o2ACyIM5XGKNJqjS7c5VSbmwzYmfPBuXkNlQwItaOx5Fxr9LmcLC++oHxH0zH2Gz1eH0S5p9JOkuTUAP4NkKYquj2WWRkvfYxgZqF7+fT7M7KTw9GqgjthCTJmWQkhxfhDFX26VxT6mkEQVAUikXorL8dbuLoeGBs1D9bggpmfaT5pWpQBCHfQ8LYDxLBmqCNpV2nwAumE8Jg28as/o/dYKle/L01IShMxgQjgEqWAL13C/UO/b4t5jTdcyyZjnO2X38qsiSSxvLseg5bgQ4l9nM6g2AKA1BcwPNb2UwWnD2R4GU4y2Afdx5+EAtaGmYmy62ZoexVQDcYJhjxTgESUyTj+vr1oXzuWyR/aqDLTXJSIMrdygAOwPsfraMBw4Ml8oDBfOo+LLkRGCJ5AZ+t7fi5U4yW64GQM4G3uqlmAnn5lh1b3MK7iiFdIbMT/aAX9QCKcLR60PuXGEqyTjmt96csAyRGuQpjj0jbIA0I03hQMsHgi//YRYmViPwjr3sZNTrPzRTKN0RYuYJXQnmNA== X-Forefront-Antispam-Report: CIP:216.228.112.36; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid05.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(40470700001)(54906003)(6666004)(5660300002)(2616005)(2906002)(1076003)(4326008)(40460700001)(83380400001)(186003)(70586007)(16526019)(36756003)(6862004)(86362001)(356005)(7696005)(70206006)(26005)(107886003)(508600001)(82310400004)(316002)(7049001)(336012)(55016003)(8676002)(8936002)(6286002)(36860700001)(426003)(7636003)(37006003)(6200100001)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2021 10:39:24.7130 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9678edd3-08ef-4360-0040-08d9b8a4abf9 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.36]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4132 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 9e61533df27fc4d76080da20a7e8f9c9e7e1b90f ] GRE protocol type is implicitly set in the matching translation in case an application doesn't specify any type explicitly in a flow rule. It is extracted from the inner header type, but this type may be absent. In this case, GRE item matching is broken. Check if we have the inner header type before setting it to allow matching on all GRE packets. Fixes: be26e81bfc1c ("net/mlx5: fix GRE protocol type translation") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index a65a670045..2c7d5c7c02 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -5936,8 +5936,9 @@ flow_dv_translate_item_gre(void *matcher, void *key, protocol_v = rte_be_to_cpu_16(gre_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, gre_protocol, protocol_m); MLX5_SET(fte_match_set_misc, misc_v, gre_protocol, -- 2.34.0