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 9D5EC460EE; Tue, 28 Jan 2025 08:59:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 891E740150; Tue, 28 Jan 2025 08:59:56 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2043.outbound.protection.outlook.com [40.107.96.43]) by mails.dpdk.org (Postfix) with ESMTP id 4C0BC40144; Tue, 28 Jan 2025 08:59:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qLIkmHTtzZH7VeItn2z9opAIa++SvES2KdOHf5QZ65rDrSWMXYeebmnYgRuuP3xgYcgOFSlod5Mok/lY/Q33FBxuvC+e7Kt34Pmc3EfLLjCbPSiwP4cr4lRB1gs5HYVnkhGRUMKMhZ2UU6S31F3erqh8vyojbdXvbYNm9fTcaJv6qWRYp3bjvUPXkknhF+YEu9S7re1BQGRz1y/4oFhpvYVuAIgdZ4/EACWTMLeax0kB80uMxPWVuklB20zed98uU2UO2v6AigBSVWMilj/fSWll83tYg8eJ9VsDHgJSFHOk9ZYufbgxXMjl83Yi/IOOahbSI7pGnc4VfUNEBaSYog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5H57D5F1Zz6/zS3RI8XeyEIpyy+gO9gZ/a88ahK1ivI=; b=UoKZYM0kEknCDvHcanhJo5y9Jtxcy5jOGe8gnRYN+oy71g0ageSkVSwKf80+mjYNio6nGMMA78BY05IZ0ANpWVJuE/hvdvgPV8Un3nsP+HXfVAQ4lUpbxkUyQSJNi3kvzwv2iFGCJ1KF0Exv7s1qtFf/kfOqzo7Y6RfLQzJMs0yH8axTqOHIr2N2DIdvImNelgtS2G7YJOv5I8XFoMTJiI9R7t8PmXCNagxpn2Ez2RPpfFtge8zMHyQCGlqntai+FoQlvIszoNVo67YzQyX4lhJD6HuBMeRCVl5xx1sEpKMhkpddR7Pg0cxhNwvqihDOux0HX67YG3lWW8V6+PNRAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=5H57D5F1Zz6/zS3RI8XeyEIpyy+gO9gZ/a88ahK1ivI=; b=iAMfDL3DyNpmGFmN7jUemrS6ItYo+TxVXC/cMACEbCDABcJ+/XU9k0xQWVjwnUc8j3OcvMn5ySRiZ9OKDukU9J8Y+t38ed+QrspdqkfZ84nMKjY0VqnTjjqyy3HfcxEhyIhd8sJz/0k76TTGcm4EIC4HeNGFwYeTDBsGuAX13CUQbva7t6wJTXTHYc40MouICztA0AysqqSvmz0VUw1eACrAxLWimN34vzBsLKrX2kZ5SQxipcV5yOWBuFy9CgSbjc9YgsdGly9GlzNn2FvmoFR/Hd2kmUUY4vDTD65jUtho7B+Hx5akHcbwn9LH2IIA0crfExbQjBw+RVvygvdzVQ== Received: from BN0PR04CA0179.namprd04.prod.outlook.com (2603:10b6:408:eb::34) by SJ0PR12MB7035.namprd12.prod.outlook.com (2603:10b6:a03:47c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.19; Tue, 28 Jan 2025 07:59:51 +0000 Received: from BL02EPF0001A100.namprd03.prod.outlook.com (2603:10b6:408:eb:cafe::6b) by BN0PR04CA0179.outlook.office365.com (2603:10b6:408:eb::34) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8377.24 via Frontend Transport; Tue, 28 Jan 2025 07:59:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF0001A100.mail.protection.outlook.com (10.167.242.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.14 via Frontend Transport; Tue, 28 Jan 2025 07:59:51 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 27 Jan 2025 23:59:39 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 27 Jan 2025 23:59:38 -0800 Received: from nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Mon, 27 Jan 2025 23:59:35 -0800 From: Maayan Kashani To: CC: , , , Bing Zhao , Dariusz Sosnowski , "Viacheslav Ovsiienko" , Ori Kam , Suanming Mou , Matan Azrad , Gregory Etelson Subject: [PATCH] net/mlx5: fix GRE open matcher does not match packet Date: Tue, 28 Jan 2025 09:59:30 +0200 Message-ID: <20250128075930.175636-1-mkashani@nvidia.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A100:EE_|SJ0PR12MB7035:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e4996de-1b8f-4ab2-5c7d-08dd3f71be61 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ukRJvsVozDDilm7EQqlqvobXgO3r2l1vj17lS0ftnB3wtfFQpK3bt4EITkE9?= =?us-ascii?Q?jaWblWS+oKuoRPHlqNt6Zs8o0HN4iCUwedKiDQyeRgCWJK03/aaN4jUimCkV?= =?us-ascii?Q?8w9+e/l1aZEgICbaS00wTzG1LTrH/LOI8RD7f6WVpkLWXawAD94DkKHotUPr?= =?us-ascii?Q?A75QBOL65vvKdrkxjUsUf7Fj7OIrgn8mioqPIAE/ey54UHENfDYj2My13/AE?= =?us-ascii?Q?NjtOdFyBTmpKN9/Z0iAgYPGi0CXTzGJF5MLa2tSy2JfZcPTpOf0lqjLs7br1?= =?us-ascii?Q?yKW64oVATEoFDcJ0Fntq4q4m7MD7/u/1DOJcO9VJcJWpYVrw1gYCyPDATVPN?= =?us-ascii?Q?BJUNVKEeogFbCXLAacISyvAw97KtlRxHyAAmJZn9oFomkxWMe19Z6RbiYalG?= =?us-ascii?Q?4ercjNsHIe8IQ+Nc2qKNTFrptWvbM36+OcANo+hGRVDyUxCiKGV8Cdn+At72?= =?us-ascii?Q?bEZDh94S550BkpOD7X6xB3wdhn6gcQ9RsFqzJK/pZ/ApXfJTmz2HiTde1rm8?= =?us-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vUJMLKKI4rKTiW5Y?= =?us-ascii?Q?kC43oE/cY+70sgcIb8TRf5/AZJzlAFhA8q8YoHw6TbRFyvOC5Cwhhsl29GNs?= =?us-ascii?Q?/FuMbGb5NfPH7ok=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2025 07:59:51.2197 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e4996de-1b8f-4ab2-5c7d-08dd3f71be61 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A100.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7035 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 The previous GRE fix was meant to handle HWS behavior and changed the behavior for SWS causing degradation. After the previous fix, in case of an empty GRE match, GRE mask was initialized with protocol full mask, Instead of the empty mask with protocol mask equals zero. The Current fix handles the SWS case as before the GRE fix, and HWS according to the latest fix. Also, combined common logic. Fixes: 25ab2cbba31d ("net/mlx5: fix GRE flow item translation for root table") Cc: stable@dpdk.org Signed-off-by: Maayan Kashani Acked-by: Bing Zhao --- drivers/net/mlx5/mlx5_flow_dv.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 41ebe0b61a4..633c41e358b 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -9839,23 +9839,26 @@ flow_dv_translate_item_gre(void *key, const struct rte_flow_item *item, } gre_crks_rsvd0_ver_m, gre_crks_rsvd0_ver_v; uint16_t protocol_m, protocol_v; - if (key_type & MLX5_SET_MATCHER_M) { + /* Common logic to SWS/HWS */ + if (key_type & MLX5_SET_MATCHER_M) MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, 0xff); + else + MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, + IPPROTO_GRE); + /* HWS mask logic only */ + if (key_type & MLX5_SET_MATCHER_HS_M) { if (!gre_m) gre_m = &rte_flow_item_gre_mask; gre_v = gre_m; - } else { - MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, - IPPROTO_GRE); - if (!gre_v) { - gre_v = &empty_gre; - gre_m = &empty_gre; - } else if (!gre_m) { - gre_m = &rte_flow_item_gre_mask; - } - if (key_type == MLX5_SET_MATCHER_HS_V) - gre_m = gre_v; + } else if (!gre_v) { + gre_v = &empty_gre; + gre_m = &empty_gre; + } else if (!gre_m) { + gre_m = &rte_flow_item_gre_mask; } + /* SWS logic only */ + if (key_type & MLX5_SET_MATCHER_SW_M) + gre_v = gre_m; gre_crks_rsvd0_ver_m.value = rte_be_to_cpu_16(gre_m->c_rsvd0_ver); gre_crks_rsvd0_ver_v.value = rte_be_to_cpu_16(gre_v->c_rsvd0_ver); MLX5_SET(fte_match_set_misc, misc_v, gre_c_present, -- 2.21.0