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 0208B45962; Wed, 11 Sep 2024 18:05:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C969942F3F; Wed, 11 Sep 2024 18:05:44 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2088.outbound.protection.outlook.com [40.107.223.88]) by mails.dpdk.org (Postfix) with ESMTP id 8E1314029E for ; Wed, 11 Sep 2024 18:05:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wTZkGCvib2mIYqRgyMa4l/t0kk5SbXJprdOC323RC/CTzvntAmdODI3TGrrjtFapeg/pWeux20Rux9B66gLeii91iFwQT6pNYJLlDtsPMhswUfFoij3yieL7TvEuJGxDVW1YizbqWQzzxpTe6bQxMPJM/OLZUaqhJ5Bcc3Kr1LDlieuEFuRu9RmJSFxiNVLxgEOpEfBR82TWdVK/KbYn11XWbf/TtR9dqMaqd6mHCKL1w6yy+SIVL7pIufFE++Yq+TowqdpExpPca/8pg/aia3eHP7L+c2D1Z4pJfyLpmHzjy6T4z1SPa0Ca+cSGmFwI8InqsM8C1yxoCP9u52SlSg== 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=Oe5tj6B43ohZN1QiavkR2Pr8MNFZHzhxToDEmYbKsjI=; b=IN0qiEgQ4CXW3mOOCgIY5diVIG5V+5wmGMyGwMxFE1Q7UIUrPxJxcbbnrn8bHx0aSnb1Zt8XgE2If2MBwuVVyXZdPSxc26UEFCKKeQt9srt3wci2927rsj04pDIoamBDZmpcD8L+GZgh9JafigZ/cTD1P99KPkwknvId15g+4gQ3pqW+T6n3+Xqg0aJjc0hs7wiXdyyPIZlNVQ4f4/V7gTN3OgvmN/kezbP/i84YY1xfA5cwyqlkP+wWHUc2QgnJoUBESvSmQQKkDaoyNftVmWrMIWhR9CSuuQtrnWpkHJRjVrcDFuQqjhlaDNKTQSovwOSRObEls87Gak7lA/7E/A== 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=Oe5tj6B43ohZN1QiavkR2Pr8MNFZHzhxToDEmYbKsjI=; b=ZIYS5HukNYlAS8X7gI3SCJ03btCy5kTsimPd1a1gcXucUnhFJahiip3u6H5sWYZpyxRSKK3w25yJgYLAoAk92KAn3l/aKFVNN1xNRenfzzm1xUaBTdZwJuTsSo3hJFz8ceJZdjl/bZ/9zMO+A0r3Gxd3Udbypaxp1//DfuurZL69A+A85czARrO6koDPN54HzcfJ/PCMozLfoLT/omrDStyqr5jE5WLcpC/Q42/AotXKO3h8MS7gN/1h2Rwrw1Z2ZvmIKKeGpRaOEpTI+BBruUdIzCVy3njHNkuIHldeNfbZeAcOEtiaN876Yy7G+4f5iKK/tghPUt5gWhRUX/e+VQ== Received: from CH0P220CA0011.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::13) by DS7PR12MB5837.namprd12.prod.outlook.com (2603:10b6:8:78::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.18; Wed, 11 Sep 2024 16:05:39 +0000 Received: from CH2PEPF00000147.namprd02.prod.outlook.com (2603:10b6:610:ef:cafe::5a) by CH0P220CA0011.outlook.office365.com (2603:10b6:610:ef::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.25 via Frontend Transport; Wed, 11 Sep 2024 16:05: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 CH2PEPF00000147.mail.protection.outlook.com (10.167.244.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Wed, 11 Sep 2024 16:05: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.1544.4; Wed, 11 Sep 2024 09:05:22 -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; Wed, 11 Sep 2024 09:05:20 -0700 From: Viacheslav Ovsiienko To: CC: , , , Subject: [PATCH 1/9] net/mlx5: update flex parser arc types support Date: Wed, 11 Sep 2024 19:04:50 +0300 Message-ID: <20240911160458.524732-1-viacheslavo@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: CH2PEPF00000147:EE_|DS7PR12MB5837:EE_ X-MS-Office365-Filtering-Correlation-Id: 75ebd027-c7f2-4d4a-8e39-08dcd27b945f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?89FMAaUGIDKGPW9uvbGEBBTsGgyfPvE3ZAUMLvmOOigBCfVp/rzwV05rzHz6?= =?us-ascii?Q?rZL4VehrG9AawK/oHITYkGCImZ2VNbOz48W9KPtxAg/7YFHoEqPfsyPbXwwf?= =?us-ascii?Q?sLOIxgO4S35sG+hCvY7OJdvldPHWRsJjV53WfaqdNt49LhlXA7Hm+EeGv6th?= =?us-ascii?Q?Majzmedkkl8KCNF9DzZb9m8UvZNJqvK51e/5SlimKl8FSMh9fqlRkMdHDTKQ?= =?us-ascii?Q?/FYKcXwysLMuq1C5eB0z2Q0p1Pm9eI2H+5XPbNXFsQ405L/SHOWbsgxy+Z8x?= =?us-ascii?Q?IzEztEcG5eOYF3VYiOebNVZcMMCUIVQ2D2lVW4VNSCbldeEuxP6jjRByG/9w?= =?us-ascii?Q?lWg2umYRPe1OgOdhBIwnVm1UGSh4rwBV1+GHph29kmYaAKK1WTdFNMHfSHyK?= =?us-ascii?Q?1v621D8pdxUhixgRn57O7Ov6J51IlkJQK8/vzXN9rKHWOXy/3u60HxWkHaqG?= =?us-ascii?Q?h1B1thQf4Szx9P1pUA79O5fNIi5r5TNfatqagYmBZgjhrJskdDSu1rfr88Kb?= =?us-ascii?Q?NdNsTOEbWnbk1h/z/CKX+EVwxpscuOccKzS7PceFyDK2JBvZwIdazRNfRQdo?= =?us-ascii?Q?x/b1OfsR1VgBfn6fxLT0uPGFtuNG73DSr3+f/KVq/6AfI6lvuwxaaGrdOT41?= =?us-ascii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NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2024 16:05:39.0149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75ebd027-c7f2-4d4a-8e39-08dcd27b945f 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: CH2PEPF00000147.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5837 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 Add support for input IPv4 and for ESP output flex parser arcs. Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_flex.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_flex.c b/drivers/net/mlx5/mlx5_flow_flex.c index 8a02247406..5b104d583c 100644 --- a/drivers/net/mlx5/mlx5_flow_flex.c +++ b/drivers/net/mlx5/mlx5_flow_flex.c @@ -1111,6 +1111,8 @@ mlx5_flex_arc_type(enum rte_flow_item_type type, int in) return MLX5_GRAPH_ARC_NODE_GENEVE; case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: return MLX5_GRAPH_ARC_NODE_VXLAN_GPE; + case RTE_FLOW_ITEM_TYPE_ESP: + return MLX5_GRAPH_ARC_NODE_IPSEC_ESP; default: return -EINVAL; } @@ -1148,6 +1150,22 @@ mlx5_flex_arc_in_udp(const struct rte_flow_item *item, return rte_be_to_cpu_16(spec->hdr.dst_port); } +static int +mlx5_flex_arc_in_ipv4(const struct rte_flow_item *item, + struct rte_flow_error *error) +{ + const struct rte_flow_item_ipv4 *spec = item->spec; + const struct rte_flow_item_ipv4 *mask = item->mask; + struct rte_flow_item_ipv4 ip = { .hdr.next_proto_id = 0xff }; + + if (memcmp(mask, &ip, sizeof(struct rte_flow_item_ipv4))) { + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, + "invalid ipv4 item mask, full mask is desired"); + } + return spec->hdr.next_proto_id; +} + static int mlx5_flex_arc_in_ipv6(const struct rte_flow_item *item, struct rte_flow_error *error) @@ -1210,6 +1228,9 @@ mlx5_flex_translate_arc_in(struct mlx5_hca_flex_attr *attr, case RTE_FLOW_ITEM_TYPE_UDP: ret = mlx5_flex_arc_in_udp(rte_item, error); break; + case RTE_FLOW_ITEM_TYPE_IPV4: + ret = mlx5_flex_arc_in_ipv4(rte_item, error); + break; case RTE_FLOW_ITEM_TYPE_IPV6: ret = mlx5_flex_arc_in_ipv6(rte_item, error); break; -- 2.34.1