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 D4053A0548 for ; Thu, 2 Dec 2021 17:04:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA9484067B; Thu, 2 Dec 2021 17:04:22 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2076.outbound.protection.outlook.com [40.107.244.76]) by mails.dpdk.org (Postfix) with ESMTP id 712AC4067B for ; Thu, 2 Dec 2021 17:04:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=byLPMrUC2uNWCXQ+DZSu9cP1C/gXm3/tUDhAyM1gKIOwQPz7WmnEjdELdfntcnrYyuATTE+YfcNWpaVBpsXaRJvo8e5HPJvgU1mxemgu54/DKJB/KSCuZbT1pi78RGWQ2hG74wpMOV9oRNovEW+fcscgZhB78y3t6O+vzDHlOMQ/RvkpukDCI4X3C9PDYlQFKlrvF3eZVyrAo29y5F7inW0lXO93sGDz0yvLjQgcAQoovWvEGpPTL/XSFd4OQzLF/Q2vTj6wVQr4FDjsMud+QIHZqpweSPxgTcr/4tSe2EDSwzmimbRw3ErrH1fyR8oXqTV9ahM0Vw5MnAWJSXqCkQ== 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=mjoTDQj/bi1RX/tPkpFwNugY5zR7fRzmgm88dbNjdJg=; b=JjdGXTctgGgYA11za5T58GSoGhZuUHtIy0ttZ/mcK8+f6JvUg1g3uCM3WNFD3hWVqCJNBB000OYtK8urHMKAuszeGRy6fGq6G3HgaBFOYNFCVuikiWogcA1pSO6Z7D43OO6gCT6R7QJFpivx4ShzhtwV5UCnUu14GY82p4LWqcM750tOUJ4ET0Vu6otZg9bV/KIqbaprz72Wuh/cZ0hXVUFdPIrrGR2InMYqpnKmqGICnLUeuasJRRy7DnfkXtr8YFCbsYiuz2BqGrJealD/iOVQjg9TAD1Y3Q9bv/dLTCj9pG77TeF/5iQxrNKyTnP76oTw4xV59A9+gp5w57O50w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) 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=mjoTDQj/bi1RX/tPkpFwNugY5zR7fRzmgm88dbNjdJg=; b=rTgvIa67G5BTFtzB/YGYvnfZn/RCseMWt3pPfGoyw4o8qahZTo62MMelf38i9Eni4L0a4g5pe2O9l41uzwv6lCh7x481ta65nyc3cCaNVUALAlYuOlMi7bpnR0MBaP0fZaHJDm+tX4P8DaRttqbrnrL0x/2V8o09hkruNzu/tUfgGSmJJ7WZakPUlXrXM53ZfwO2rqs4oPbXHvtoQPwmH5V564+nxyV+i1vOKoMZ0kyn0cy1zAq/5E6WdTPKSkZGw1b7rgEVXOAXZrvqlnaSx0kKu5R+XG09vMZdNrHNwiMihiKjIbC8kEkr4/M6qOiFoaq/YsU7aeotMK3tM+NsxQ== Received: from BN1PR14CA0002.namprd14.prod.outlook.com (2603:10b6:408:e3::7) by SJ0PR12MB5580.namprd12.prod.outlook.com (2603:10b6:a03:422::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Thu, 2 Dec 2021 16:04:19 +0000 Received: from BN8NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e3:cafe::cc) by BN1PR14CA0002.outlook.office365.com (2603:10b6:408:e3::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23 via Frontend Transport; Thu, 2 Dec 2021 16:04:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by BN8NAM11FT017.mail.protection.outlook.com (10.13.177.93) 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:18 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 2 Dec 2021 08:03:58 -0800 Received: from nvidia.com (172.20.187.5) 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:03:56 -0800 From: Gregory Etelson To: , CC: Alexander Kozyrev , Viacheslav Ovsiienko , Matan Azrad , Shahaf Shuler Subject: [PATCH 19.11 5/6] net/mlx5: fix GRE flow item matching Date: Thu, 2 Dec 2021 18:03:42 +0200 Message-ID: <20211202160342.26701-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.5] 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: 2847c92b-fe0b-44b5-973c-08d9b5ad658f X-MS-TrafficTypeDiagnostic: SJ0PR12MB5580: 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: Q0584nYCeQUtPf0w/GgTmBhZ7xD6jDdWp3c9k20JcQLFpg2xmaib0c2mfocD98FLd9Ipz2K3KYc7VwmZwrGf+Tky8KQUp/b8yFQ0TgdejNVWDG8Tz7l7SbDTxoW/j3zMjCfVN8yXtQBRiY7q7ZjH0bjFV5NVF0QteEQDaIbuV4H6cwj1ClYxJE9swjyty/PEfOGZVq97LcowE8oxNc9uLyUoeUDNkgCX3f6QMq0m5J2F7ft4oC99dNpSlY4Eoi6uf+F7A1gYJ4gny1y4deJ+8JnwMGzdbn9uuTkwsmpxkFE+2C/QPDJWdOcsaJla955w7t1SRsfZ9uXxdZM16z/rR/yUZmcoaxUCF3GPf+R4C7jBOeOmAUwDJ48YumQzLH0YH6QXDVyAyK7d/I7YpgcLHEgHPe7Ntr1ZcBRzsd+h6gIhXAZ0a6TyppJqICglxm4I95NvEdf0f+axnxDcCVe7HIw7e5Y+cKBAbh4EXLcn/5wa15hio1N9Ysxojn92PrlBGMQeN8rjcehg/x9lPNa74SUQneeq3rRMJFxbhE8r67as3WvjU84W+XqMI4FCfPcaqdOFA63kQ6hCxFloezeWnZEqDYxkOzGVHz8to+NaPl5iqyQVP5rDPQnX6OoJdWVgM9Wk8/LFTMcrJR6c5tjl8V1V+2Imq9lv7KcTxZOHPoeLds8L9OSAvj5mpNys1J3+dvqRiZVIupTvLWe+HZNq7dHDN4xzdDL0kGQPQebh17vRuwKUEunDVgiN8LzcEPWjsH8uwFjpi1Qq1A9HCPteug== X-Forefront-Antispam-Report: CIP:216.228.112.32; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid01.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(40470700001)(36860700001)(36756003)(16526019)(2906002)(186003)(54906003)(110136005)(508600001)(5660300002)(7636003)(26005)(2616005)(316002)(86362001)(356005)(7696005)(4326008)(1076003)(83380400001)(336012)(40460700001)(107886003)(426003)(8936002)(47076005)(8676002)(7049001)(55016003)(6286002)(70586007)(6666004)(82310400004)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2021 16:04:18.5796 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2847c92b-fe0b-44b5-973c-08d9b5ad658f 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.32]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5580 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 edbdba3e23..cd55deaf56 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