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 99E52A0C52; Wed, 24 Nov 2021 05:32:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 006A940696; Wed, 24 Nov 2021 05:32:57 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2047.outbound.protection.outlook.com [40.107.92.47]) by mails.dpdk.org (Postfix) with ESMTP id 0C7D540040; Wed, 24 Nov 2021 05:32:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ReJ0SBXsLOdQctqepXDKOBWA/6uBIOIQXuaKcFugkWXRBrpOkYTLKE0OkhaWcwN83LtNU9IbxTR0fCJevu2yaBYaYOEua8Zdb35Q50s6VLC6c4sliu2w/ZESzH7v89vg1j3t/J1pK+BJ9cSN/MHc7wGIHKihzAFJ/U3+Q3yGwcLdREpAK89ij0cmlMJwhsvWsEDPVnIYQu3f9HYDaLCh8gjXtq7JZe6nlXRA9sqcXfjTxDPomnDKqlAFDf0jnPq4DqM8ofywoz9Swg7IrofLYTFD+ty0k0NG6/1qvYRRlYVJLkPxxifanQaxjhMtJt3f87cR0VPTuKaeJ6NHVt9KJQ== 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=RvhCK560Y3+/jn2+5lmIGG8btBmw4ycViZ4LSMxjtfM=; b=ZP+0hUZObW20qlTXg89wZIJiugtVG/PnKldNFnYUC6Y90pyarH28TCGpILO4lXd6riNKpawdDY2tr+Jms1RoOSqt3f+eA74wZ63yNZAwnAkLZOS8eRzWrKy2BBMrAi2bixhmk7J+oCQ0S/8rdfzM0q93CbfvTUQvS9p9yNAMoRPz4hDDjWmsKEEU1uuSrkXwYE4+7h2W5NwUxXeOI3ZXypPlJ5o0KeSlqknJDNaDirGN9hAGTC6b/G3xDx3GqWF6GvUObuUz8NBGtrj+Nt2V0hHPzqD9M1JTFrfjCtjnCJ/SwS8SObP5lcxxz4ZvSaAYu1Z/Zp5IRABm7+tXYmic0w== 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=RvhCK560Y3+/jn2+5lmIGG8btBmw4ycViZ4LSMxjtfM=; b=eQq8WPqjD0H0q1nF1AjULIYIm1hfKN2ByI/MbqBMcFLZV6wgNB87w+j1ed3bc1oPoOJK/5d/eX1seyiaVpGf/6dXzMa/R6nhIwKYI9NUZ2/Y8KPwWpxL3b/QDCSyqtmJTHFvTKwleH5afcogCf5Clbu96/TzXlFJ1o767PGi3tAMrTqPsfFOZj3zm4rCrUWqQ8rylbWMuFgpquZOkrBNfmMrO0Hcywmg3fNUnKJ1NQj+VCMzG6aZilMSJnf6noEGUugz15Y4JHtepbTOb2L0tjgsY8128yt51Lqg1nLkYQWqCvVpZRGiU2gJ+MsuBMqwi4yojy9raqv57NR7vspC2A== Received: from DM6PR04CA0023.namprd04.prod.outlook.com (2603:10b6:5:334::28) by DM6PR12MB3403.namprd12.prod.outlook.com (2603:10b6:5:11d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.19; Wed, 24 Nov 2021 04:32:53 +0000 Received: from DM6NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:5:334:cafe::21) by DM6PR04CA0023.outlook.office365.com (2603:10b6:5:334::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21 via Frontend Transport; Wed, 24 Nov 2021 04:32:53 +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 DM6NAM11FT066.mail.protection.outlook.com (10.13.173.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4713.20 via Frontend Transport; Wed, 24 Nov 2021 04:32:53 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 24 Nov 2021 04:32:48 +0000 From: Alexander Kozyrev To: CC: , , , , Subject: [PATCH] net/mlx5: fix GRE item matching Date: Wed, 24 Nov 2021 06:32:34 +0200 Message-ID: <20211124043234.3287245-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e24cff82-24bd-46eb-3eae-08d9af037b22 X-MS-TrafficTypeDiagnostic: DM6PR12MB3403: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DsLXBxLkNVukABep1E4V5ywGoYLl003t+XPWEVxF7iN52Dp052pLTZKlOQ4EVCH4inJ30mkDAsXg4Xh8tUzm2QhT6Jk9jlWkOxnZgSj4gzPXSdUHWUt1afzPewa8SSCAktS77ns3Y9axqgpbuxntgUJRXR3sqHg5m/4toeocVQR+OxDEmf/PF5UeFjFNbIwoYOI2XQmJVCQUjjrnwkppFmTHGxwEvVqWv/TgDEN+oNhFcBmbJKdoXR9Jw5somKeOa1J/x6sm58XjAc/Q64VY1nSB1c3l/rvYn1+vITSguyPnSZwMa+DuFLj6dYYqtxtyrIQq5s+ZsLFwNptgoG0GuUCV+HT7qrboTmpNWa/0EfogdZAU4aBxLIqUBEyw+Rbst8bIzm3iaV1x2gLceB8cJkdAanU+S3shzKHQGCuz8yUcm/Ek1DqFh9qKw3Cz2YZYEHgb1AbgfyAAmtCKw/dQ+LS/lGCKGjyXddoMgOs1S2I10ZlGAELSZzMMeE0Ghr2UvW/pvsmlMl8HZU8OuBGK5FMygkYXJLK1BDseXx5aaawUJFA5O/O24x4nPJ+UZvGpLVnprd/rb1gc6WfgrC2bVG3qOHKx79GSGqHTIJpvy4hpqHS2UrOxi2S+duXnnos7vXfgI1Np/dLBw5eVfyB74FV9P6mzXRmcs986mcCJyAIVV1E5ItTDcl1DTUN4w/5885RlzllS0AfOwyJkT4ynKw== 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)(46966006)(36840700001)(6286002)(450100002)(26005)(316002)(6666004)(1076003)(16526019)(4326008)(8936002)(36756003)(2906002)(82310400004)(55016003)(2616005)(7696005)(6916009)(186003)(508600001)(83380400001)(36860700001)(86362001)(54906003)(70206006)(47076005)(107886003)(336012)(5660300002)(426003)(356005)(7636003)(8676002)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2021 04:32:53.4210 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e24cff82-24bd-46eb-3eae-08d9af037b22 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: DM6NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3403 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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 9d4bd0560c..7bb092ea9f 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -8823,8 +8823,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.18.2