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 C13D343E83 for ; Tue, 16 Apr 2024 17:32:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5BD7E40A6F; Tue, 16 Apr 2024 17:31:56 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2066.outbound.protection.outlook.com [40.107.94.66]) by mails.dpdk.org (Postfix) with ESMTP id 5034140695; Tue, 16 Apr 2024 17:31:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ilergGZyRrZfK8UQkpCH18yVxt1cx3fZFA/xH3PuZGTskbGi0FREvJ6vo2JsFeVfEV9bKZLLS7wxBtyxp9GRnZLBOVj79FDyocv6npKs22kziXRcfWxER9v4DW327ouyVdxdP9dabu0Q5yKjqsX8Jf6Azlv0riAd0T53Rhxb5jKcd8ntZiep64uZw+0HmoDO45Ts4/LzaL66MLw2MtartgNBLkx1HR+nihDW8k20zTvno6FIC1WMeSxCiEGkYcAITXnSLYU3MvoxyXmU8gvYg8e/wsbqkQs6mTRbFN17IBWCTFjkSTQnOjdMBcPSCMXzwDlyrNyx0J5W0snw0Lueag== 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=7hjI7w1ZJgCmhB3d3/x0G4czsU2iHBHmxYw1Q41cyYU=; b=NEFpiciTemXyKfzCdoHdkyXu1G5xrM0UpU66CmRcqCZ6akXmYbKJugnKRBLRtUAzIvMf90QgIDyLU5hu1m7MAjtgz4t5B7zZCxQhTyeyDEc9TUbjSKgq3wVlRchfbTjPPvlULx0FxmmTBs1APt1QpbRyY6iII4r/m2jM5+SrtqbEoTFWLDuB/8XPJj+HSfY4CHIiE7yE+VRNEIIqvpGSLIk1EQZHUzTkEtnco3rqLJgX6IS6oZZUL2wyO6BqPt+KY6nM0Q5UQRIImJcWdrAu8GiEU/pWjpzSmAkvKIGJ/sBozOjtFrvS9xmQ7iiwR6oLauuoDVH6HlahkATG+jpwIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=7hjI7w1ZJgCmhB3d3/x0G4czsU2iHBHmxYw1Q41cyYU=; b=jl1t+gT14i0Z0R4RwwHeMI6FJd1HRO2fDdjbdG2PfzFRI1MB948O+rewj4tmTgYi2Zt0RhunpKhBBC7+JEQABgzFiJ8WdsOoSGdP3Yvu061URkLyD9r6mC1cMEECH2qKP33eewuhJr6LDqAANXRAGCNudVKqn/pchXBj+YqtaQNpgN6VY6CLl1YKFFvfeWhfcO5Ayf3emz/J5g6wjwRmLiIDv+HjB0pcM1s31jB69YaMFzgeUZ+wQ/PKxKVbiaZxYbjKCxvPFZ9t2XNeHVPyVMCA/sEAp1H2uE0xxVKYH/IwJmoMcs4NkgN8h8i5G8GutwxGEUFFqYlJAjriU23VZQ== Received: from SJ0PR05CA0210.namprd05.prod.outlook.com (2603:10b6:a03:330::35) by SA1PR12MB8164.namprd12.prod.outlook.com (2603:10b6:806:338::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Tue, 16 Apr 2024 15:31:39 +0000 Received: from SJ5PEPF000001CD.namprd05.prod.outlook.com (2603:10b6:a03:330:cafe::25) by SJ0PR05CA0210.outlook.office365.com (2603:10b6:a03:330::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.20 via Frontend Transport; Tue, 16 Apr 2024 15:31:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ5PEPF000001CD.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Tue, 16 Apr 2024 15:31:39 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 16 Apr 2024 08:31:09 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Tue, 16 Apr 2024 08:31:09 -0700 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12 via Frontend Transport; Tue, 16 Apr 2024 08:31:06 -0700 From: Michael Baum To: CC: Matan Azrad , Dariusz Sosnowski , Raslan Darawsheh , Viacheslav Ovsiienko , Ori Kam , Suanming Mou , , Subject: [PATCH 2/4] net/mlx5/hws: fix GENEVE option class partial mask Date: Tue, 16 Apr 2024 18:30:52 +0300 Message-ID: <20240416153054.3216706-3-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240416153054.3216706-1-michaelba@nvidia.com> References: <20240416153054.3216706-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CD:EE_|SA1PR12MB8164:EE_ X-MS-Office365-Filtering-Correlation-Id: 507f3dbc-83ed-4455-79f5-08dc5e2a4f4a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: loOG4c2Eb40kpZKvmUWq7nQmH/zglB73RfIwU847zvBIbfLQ8Xi0puD1N1TGWOvHraXPKgXAu6WAry3PAUh9kpS5S+ZWyEIuqxxIj19sknOmLdkuCAOyNR2UXpO+YVxk3Wm0R6sL+MsOvZK3qGHZquuEeLShyqTjIi9Od6NBD/Eu6O/9lbPep+lg0DAKKIbsIVo4GgOCV1Jk4OpiH/JQ2lE0DDlS/RQeT6cR4C20N6X39zN3lxwtLCxlNdjpK31ogPJmO57ymmHVjp59a+IW5bg7/992KoRdrJhYDesB6WWxj+5xmwT2gCxO+l6KqS6uSOdgIrcCBvFvB2L52S6jSwXN5hbefMPhE6ghv0+e+h5Fu3CP8jnzoRAFqyXBZxJQnQTyaZjyfPdeA0NgzPELrFEWEcwMbAb63IING5sytoXx55VbP5jcHDbAnDjxZ+kyEuGqrxL3NcYFyZrIn6eTgltP5CBEa+tZ2pcKxnGkHQwERVgUD/JqgRLiXwmXPM50CXdnI3Q3OBXI9B+StDmTPdXEAbuCk9XoUHk8SFCM5lFceOPAUS0MlbLblgveQ0dCYmij4g7a0dp1Ui4Cixx5FGmRIlHbcdtrAgFpE6FLwhHAfkkCR0UZTS4aVvNok//rsw/goJm/7REXZvnxlz2GsYLq+gjb1AyyGNg5koY9GSXYDfoV9ceF48AcvZwgWsZn01Y9K39KfQOLpEYM/xYx/pSvU3An/brRjNBaD3EyzZLPmxphH9KcNgIkVrUMREM4 X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(1800799015)(82310400014)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Apr 2024 15:31:39.0436 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 507f3dbc-83ed-4455-79f5-08dc5e2a4f4a 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001CD.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8164 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 When GENEVE option parser is configured, the class field has 3 optional modes: 1. ignored - ignore this field. 2. fixed - this field is part of option identifier along with type field. In this mode, the exact value is provided in "spec" field during pattern template creation and mask must be 0xffff. 3. matchable - class field isn't part of the identifier and only mask is provided in pattern template creation. The mask can be any value like all other fields. In current implementation, when class mask isn't 0, pattern template creation is failed for mask != 0xffff regardless to class mode. This patch fixes this validation to be only when class mode is fixed. Fixes: 8f8dad4289e0 ("net/mlx5/hws: support GENEVE options matching") Cc: valex@nvidia.com Cc: stable@dpdk.org Signed-off-by: Michael Baum Reviewed-by: Alex Vesker --- drivers/net/mlx5/hws/mlx5dr_definer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c index 35a2ed2048..f1f544deab 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.c +++ b/drivers/net/mlx5/hws/mlx5dr_definer.c @@ -2500,11 +2500,6 @@ mlx5dr_definer_conv_item_geneve_opt(struct mlx5dr_definer_conv_data *cd, goto out_not_supp; } - if (m->option_class && m->option_class != RTE_BE16(UINT16_MAX)) { - DR_LOG(ERR, "Geneve option class has invalid mask"); - goto out_not_supp; - } - ret = mlx5_get_geneve_hl_data(cd->ctx, v->option_type, v->option_class, @@ -2517,6 +2512,11 @@ mlx5dr_definer_conv_item_geneve_opt(struct mlx5dr_definer_conv_data *cd, goto out_not_supp; } + if (ok_bit_on_class && m->option_class != RTE_BE16(UINT16_MAX)) { + DR_LOG(ERR, "Geneve option class has invalid mask"); + goto out_not_supp; + } + if (!ok_bit_on_class && m->option_class) { /* DW0 is used, we will match type, class */ if (!num_of_dws || hl_dws[0].dw_mask != UINT32_MAX) { -- 2.25.1