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 809CC45EED; Thu, 19 Dec 2024 17:06:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1C58402B2; Thu, 19 Dec 2024 17:06:39 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by mails.dpdk.org (Postfix) with ESMTP id D4D4E4025F; Thu, 19 Dec 2024 17:06:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HcLG7omhfALsRWyB+/vYirumBO0S1/R5LQp4nXUoVj1BkOiKWJN2fx00Xhag6SaiK+wKokBXUD5G2UNua4t83teILNp7MPWTGs0QfGdGKZCz1RPWfcBa6qJtg3C1UZHGud9gm2/Pc48UMGiKVTQdOZP/gfml912TXBWrUAeUw+Y2Cod8LxPH0ATR5XZDe1BpZ0Z1pRjBmTd3lkAzPIaHMMhC0ol7zVPTBCvLECy13ccnifmxXFhHlZoKs1TENoftoCruwRn6skQuLb7Kqz+b1HhFuqU/V2pMrwNTYREuzGYGhwJGKEK19NCPCgFsiUxwExVBy0VzZqQwOE98JeawLg== 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=2Fs+fTPbk5sBVC5QcPpSA6ArqkWQwv2SXxSkTNskN2w=; b=YI6GikAEj1s2cKPKPcg35W9ihUwqJCV8ftJC3QgyBv8xU0AwSvD7ysyePHOrA58XVOTrII84dQBLMyywcRHJmnDK/ZcWlLU1v9lo3pyTcgwTRf/Q2ZRIkCFQzH+8afpWPVaJWplzcSX5SmQ1JjBV5wQaRIj3MpW1ZYozITOwBv3lhIBUjYfsGRTT6hlT0dIlz4dVVvTXAvWEjH+y+qR9bbp2j2xXBleUGlJL3S3AhrDCSfNQeOQSj2aoFY17cWP8YBX1lirXmf08sv2y+INPNZljuUaYgZBi86CKHi51oZ+1kmq6Jmub3Y+BRkSkqYcHfOOkJEPxZVqnvzxXlOGkvA== 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=2Fs+fTPbk5sBVC5QcPpSA6ArqkWQwv2SXxSkTNskN2w=; b=WQ1rpngzerGMGivAhh1CLRLXoArfjIUpTzHAC6i7bOwBXkD+qokku+rj504xys8yAChQeLhE1TluAiUSZ0hSxgEK5IXIr7dYoHcH01PpNf8lOo34RFYruxnPmlbn7Sfvqt8Ebw2AQ0mBRm7I9jY0IwdTV5hjIFIravQHJQRZtiAndA3lquXRja8NY9Fbo+tJ5Ulh/SQQk1t3+9X6eBDp+CYYA44dJF4zRsyjDfhuWKkhxuD064VbX3hTDWqHqyaMkEW1O9PCEj31QN6Sn2ywDipn+b0SAFYSmvY+IKVMEYDnZ6aUQdr41goLQVU1JPnAmjHizXLojLaJCZnX13KQ+A== Received: from BN9P222CA0005.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::10) by BY5PR12MB4211.namprd12.prod.outlook.com (2603:10b6:a03:20f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.15; Thu, 19 Dec 2024 16:06:33 +0000 Received: from BN3PEPF0000B06F.namprd21.prod.outlook.com (2603:10b6:408:10c:cafe::90) by BN9P222CA0005.outlook.office365.com (2603:10b6:408:10c::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.25 via Frontend Transport; Thu, 19 Dec 2024 16:06:32 +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 BN3PEPF0000B06F.mail.protection.outlook.com (10.167.243.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.6 via Frontend Transport; Thu, 19 Dec 2024 16:06:32 +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.1544.4; Thu, 19 Dec 2024 08:06:14 -0800 Received: from pegasus01.mtr.labs.mlnx (10.126.231.35) 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.1544.4; Thu, 19 Dec 2024 08:06:12 -0800 From: Alexander Kozyrev To: CC: , , , , , , Subject: [PATCH v2] net/mlx5/hws: fix fragmented ptype match Date: Thu, 19 Dec 2024 18:05:49 +0200 Message-ID: <20241219160553.897489-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241219160158.897255-1-akozyrev@nvidia.com> References: <20241219160158.897255-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06F:EE_|BY5PR12MB4211:EE_ X-MS-Office365-Filtering-Correlation-Id: 20ee7e37-21e1-46cd-bf47-08dd20471ada X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?CtQUktdGKUjX1IMbsLchFFF5k1oRVFQsmfPx72a39YLkayxpScUWFb7eGu0i?= =?us-ascii?Q?Xfihi3eBXsmptfoSIg5ECMaeTJNFxKL1PU2UozFIIxyW0rTkVF3sDZIzjD7p?= =?us-ascii?Q?bEmPUQ0+780QUz+NIu/S1roswzOL8nTnGYKR813EslS0ESTquBzOFw+vxdEi?= =?us-ascii?Q?uUcYbyfeqvEmSr9T2okPdpkFpMCvnd5//KwnZZedXBJ0tHtTUn7DS2pwaUDY?= =?us-ascii?Q?FUSg0Fv0BxJ/j+8kWh4PTPROj7ltwHm+5ffiovuk2l/QWu2clWptI6GYUKA7?= =?us-ascii?Q?MB3V5FHQOvwMREnyoYL69jBn/mKsbbF7zIyzAQjwhYHTkni8GIuFsKp4NrJE?= =?us-ascii?Q?WESRQSehokzav4hXil94Y0WqyMlVNyKECYVX3lxUWoQmI2hMwUrch1mvGeAJ?= =?us-ascii?Q?ax7q2mT+RuowYsT0cSAdKN0oOOxeDzkaKHkLQDTvBnEWDFo70GBY4I7CQGAN?= =?us-ascii?Q?m2QMAT6TCu51Og/hsdPgmuXVv/bQVgy9szcDIbJtV6G4UnvaT7RN653ghzyI?= =?us-ascii?Q?6Bfe4kzCAUMIuKyEA8Gz1j9qsY1Du3+fPcc3Eh4XCMEsWSHwD90czwJbcYLF?= =?us-ascii?Q?f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D9njiEklRvD3sosLTTQ31iBkt2xiLqwEEaZ9dQ=3D=3D?= 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:(13230040)(82310400026)(376014)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2024 16:06:32.0538 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20ee7e37-21e1-46cd-bf47-08dd20471ada 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: BN3PEPF0000B06F.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4211 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 Fragmented PTYPE matching requires setting the mask to the exact RTE_PTYPE_L4_FRAG value to avoid conflicts with other L4 types. Adding L2 or L3 types to the same mask should be allowed, but there is a check for the exact value for setting the definer. This prevents the fragmented packets from matching in case of L2/L3 mask is provided as well. Mask out L2/L3 types when setting L4_FRAG. Fixes: 761439a20f net/mlx5/hws: support fragmented packet type matching Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev --- drivers/net/mlx5/hws/mlx5dr_definer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c index e6d3dbfa46..837e0c47bd 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.c +++ b/drivers/net/mlx5/hws/mlx5dr_definer.c @@ -2205,7 +2205,7 @@ mlx5dr_definer_conv_item_ptype(struct mlx5dr_definer_conv_data *cd, * Cannot be combined with Layer 4 Types (TCP/UDP). * The exact value must be specified in the mask. */ - if (m->packet_type == RTE_PTYPE_L4_FRAG) { + if ((m->packet_type & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_FRAG) { fc = &cd->fc[DR_CALC_FNAME(PTYPE_FRAG, false)]; fc->item_idx = item_idx; fc->tag_set = &mlx5dr_definer_ptype_frag_set; @@ -2227,7 +2227,7 @@ mlx5dr_definer_conv_item_ptype(struct mlx5dr_definer_conv_data *cd, } if (m->packet_type & RTE_PTYPE_INNER_L4_MASK) { - if (m->packet_type == RTE_PTYPE_INNER_L4_FRAG) { + if ((m->packet_type & RTE_PTYPE_INNER_L4_MASK) == RTE_PTYPE_INNER_L4_FRAG) { fc = &cd->fc[DR_CALC_FNAME(PTYPE_FRAG, true)]; fc->item_idx = item_idx; fc->tag_set = &mlx5dr_definer_ptype_frag_set; -- 2.43.5