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 4A60543FE0; Thu, 9 May 2024 14:45:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2C76402AD; Thu, 9 May 2024 14:45:27 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 991194029E for ; Thu, 9 May 2024 14:45:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UhOFMnqQNqMnG9j2butuXw9ZIZoO0l+4hT5wenpusJtuHosArx7WuZWadzYZUfqu1ur9rFA5OAWsKHxjIe6uozx+DvBjffleGcqASiUyUvNn05WvQ8fpds1uTXPQ/GOoRTVBNDyY74aYO/wwIXGIqzh2SewTuWBGKUIT0frLQGMAAgkoV3yszXNW0vp+ZFl3sFKjkgLOVHwg9nK5RjF0B1Ck/oVO9ySk48Co+6QXXQgZ4s0U9ipmkzp29EJaDcmziCRTMxz3uJ95RpHoJiucSi4CmcdW4aTB4W93UaH8yOgjXddOAUfZIXiIPMVpeSnpRfsJotv0pqqXoQz8JZ/JiA== 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=MeEjpjVqs3c5tMHfh7jH7ZyX6ViRqtDPqbW+wmGXBw8=; b=mvqGm9MWILQbmNAHbbz5FbcsP4cN0LX4YjSciycNJy/6tiuTU6dh9E1sqJUtwhLtPj0WH6eypoBmMXRuC7p6tZaJo3WsZy0w0F5ja6OCaYgsBLVJAaoJGngJ5h5rUvN5bAET16qIvEAJEMoOQJcKoK6cfyKRD8eyVtzH+RYEoCDhBC4riWfjzEVSYbx0QgLNUekiKk3xkWCjyClq7qT97VMHcKi2JYg40Bq1AnivAfSJGuWFM/3PloEN7Y9r3ivGodSo5+tdmwC9g/eW+PigC19xwt7X/x9g+yK9u/cGSmXileoatHiuFUgeb02+iMuWcH/HSAkTeYtbETbzlQd2eA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net 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=MeEjpjVqs3c5tMHfh7jH7ZyX6ViRqtDPqbW+wmGXBw8=; b=inUaD0nF+YotvbZassNlnMTbednsidwF13UBsFQjn7Mn7Cuk1WS87jbKligwaiyAaFKv621zaBWXhVrFVvZlJ3GTxiFyuzOjQXk4QlVJh53dFY8OjQL3azGabshuuSsH5E0D151zcIVfTRwdfcmBThJ4U3F5Xin2Cx+YCWrbLXpT8qoI2mI65hL0Ue18XSZ/wlrem+4esGe44dWvM5zPjimqAibS0MBNZ3uYWieGnpLQtVsePp8uqPpCnfZ1OI659Vgnk3ySMQrrdr6rmQtEAOXkIrYG3LEQyVyXfyztrxBHuDQtLuuZ9ur5teK1+gGruq8KfNnmLgKRYURtzv9UiA== Received: from CH5PR02CA0015.namprd02.prod.outlook.com (2603:10b6:610:1ed::9) by DS7PR12MB6213.namprd12.prod.outlook.com (2603:10b6:8:97::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.46; Thu, 9 May 2024 12:45:23 +0000 Received: from CH2PEPF0000009E.namprd02.prod.outlook.com (2603:10b6:610:1ed:cafe::3f) by CH5PR02CA0015.outlook.office365.com (2603:10b6:610:1ed::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.48 via Frontend Transport; Thu, 9 May 2024 12:45:23 +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 CH2PEPF0000009E.mail.protection.outlook.com (10.167.244.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.18 via Frontend Transport; Thu, 9 May 2024 12:45:23 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 9 May 2024 05:45:09 -0700 Received: from nvidia.com (10.126.230.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, 9 May 2024 05:45:06 -0700 From: Gavin Li To: , , , , Dariusz Sosnowski , "Suanming Mou" , Itamar Gozlan CC: , , Bing Zhao Subject: [PATCH] net/mlx5: fix HWS support for item NSH Date: Thu, 9 May 2024 15:44:47 +0300 Message-ID: <20240509124448.1524385-1-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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: CH2PEPF0000009E:EE_|DS7PR12MB6213:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f0fb8aa-dd5f-4226-9dc2-08dc7025e4c4 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|376005|36860700004|82310400017; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Xtl9vqlNGjDOPkzCMGSksgF+nI6nqK+rHyM6TbI14qgW9bcG0EJL8m0XS9zD?= =?us-ascii?Q?v0xgS6YHIybalwY1ORZkN1yVsuCF7QpieF8vhFeykDrn42heDipg63drAezT?= =?us-ascii?Q?WIPjprmaEs6+hfowq5aZupIINBYkljIXAt4rhxs7/eQEwWrsjJhhingXVlBJ?= =?us-ascii?Q?7fL3yDXoyoUUaYAnvb033VeeyWoAO4Q8TZceKWOQqXVlAJOGrJXRqoR5EEqz?= =?us-ascii?Q?YXVjCRFnWPTHkbbxUXdipiqHfVuxol2kCmXMIams3NNEKVY1C9yFAURh4Lk7?= =?us-ascii?Q?g8v9mnv4VGx0k8uRTpFsuMMrTCbtzTQQLX1TkyIpSA05NJxR1cHZfwSyKSlZ?= =?us-ascii?Q?K07mqWPhNEgqKb7/8MarMTC4CLM68qMySEkPR6SX++NDLcy7Dp0OlponCLUC?= =?us-ascii?Q?HFuCYFfcSTORCPK3vNQMz1z2LCnEQ1ADEHOnNFNnyBQx53Y+plw62NQdmVp+?= =?us-ascii?Q?YK8kqkNp1gA85EGvzVPdhohp970JOe2fFehI50Vnx8RIGrLIl0b8pDoVD6Dc?= =?us-ascii?Q?e7wn/DsBRLJlSHKZKlXmg2zoll2HuRipv3CFCiXMjDpHCHhpz8H0ejYnmJ0N?= =?us-ascii?Q?dgCfYrlRqyjs3Ie0kCFSM+AeuUkWDJ53jPr/Lgmi0QMHTJ1+j4PPVKp3lxWV?= =?us-ascii?Q?lb3KlLD9lnPdzZyOrnyLsCi4VEGsj11+OMKGJ9Kz8IDOaws78IGUaNZqjtLe?= =?us-ascii?Q?2xHEtJciKoNXiRPl6zDBdwh0wNYn3Ob984ysdGgvn94g4il/eCYZp5t66+w+?= =?us-ascii?Q?f8fEyxcx7QonHwabv399t0lmKj68FtWRQuFpZkqKvmBxTb6q6Sh7Gx+lYLEY?= =?us-ascii?Q?DhPq0Bm6YrDl3qqGlb6cDgz8h/oga8nhniygIZnpl3hA8TPIdWQOdZ6Id30h?= =?us-ascii?Q?qdZNBpzka4Vf9zgEoPufWk1BdbM4ougcLa74J0sIZRjPk9pvSNDOTNMETSE2?= =?us-ascii?Q?dhuuHNV9tGgtg03aaoR/OcUbH7c80MSMczyzdOGdVYh6zDqFGf/CJmj1fUbD?= =?us-ascii?Q?w0MQb/tQbPCspsqESo4HUPAEzlQvPDQR95m3xm3MzBD7C4VxlajfkhttaAqZ?= =?us-ascii?Q?vdJkpI07oiBPbPH0MnEg1PutGZF3ixuDLzogY1uhsLjQE+oMprJaU9yvJeVj?= =?us-ascii?Q?wGexaiDjMbNedWjt6ndq63+ByYRKOdAYf1VrbXhm+BNbLWvRJpsHG95u/lIM?= =?us-ascii?Q?tS4R5UBBmzl6VT9jAkwPe+GI89YGutiAWQskITDde2fR5BC/CGgYAr1tTqc6?= =?us-ascii?Q?xbTf04uDMKK7NM3WhUJXuQtPbNjDHBCltUwf+y+jjGEL0EtZJ/NrpT3jA5JU?= =?us-ascii?Q?BC5/BwQgpE40oJDLNQfoV8Luga8cORnob6IoLthliEwxqFymsAtAO7dDCiSA?= =?us-ascii?Q?8WC5ZR/tJQZ0kTKZS9yNFMXeOVwX?= 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:(13230031)(1800799015)(376005)(36860700004)(82310400017); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2024 12:45:23.2396 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f0fb8aa-dd5f-4226-9dc2-08dc7025e4c4 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: CH2PEPF0000009E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6213 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 Allow item NSH in HWS and set item_flags. Fixes: f6164649a8 ("net/mlx5/hws: support VXLAN-GPE matching") Signed-off-by: Gavin Li Reviewed-by: Bing Zhao --- drivers/net/mlx5/hws/mlx5dr_definer.c | 3 +++ drivers/net/mlx5/mlx5_flow_hw.c | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c index a0f95c6923..867393e282 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.c +++ b/drivers/net/mlx5/hws/mlx5dr_definer.c @@ -3198,6 +3198,9 @@ mlx5dr_definer_conv_items_to_hl(struct mlx5dr_context *ctx, item_flags |= MLX5_FLOW_ITEM_COMPARE; matcher->flags |= MLX5DR_MATCHER_FLAGS_COMPARE; break; + case RTE_FLOW_ITEM_TYPE_NSH: + item_flags |= MLX5_FLOW_ITEM_NSH; + break; case RTE_FLOW_ITEM_TYPE_VOID: break; default: diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 9ebbe664d1..4587d04cb6 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -7475,6 +7475,14 @@ flow_hw_validate_item_compare(const struct rte_flow_item *item, return 0; } +static inline int +mlx5_hw_validate_item_nsh(struct rte_eth_dev *dev, + const struct rte_flow_item *item, + struct rte_flow_error *error) +{ + return mlx5_flow_validate_item_nsh(dev, item, error); +} + static int flow_hw_pattern_validate(struct rte_eth_dev *dev, const struct rte_flow_pattern_template_attr *attr, @@ -7671,6 +7679,11 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev, * template and item spec in flow rule. */ break; + case RTE_FLOW_ITEM_TYPE_NSH: + ret = mlx5_hw_validate_item_nsh(dev, &items[i], error); + if (ret < 0) + return ret; + break; case RTE_FLOW_ITEM_TYPE_END: items_end = true; break; -- 2.34.1