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 029E3459CC; Wed, 18 Sep 2024 15:47:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0CCA42E6A; Wed, 18 Sep 2024 15:47:02 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2059.outbound.protection.outlook.com [40.107.94.59]) by mails.dpdk.org (Postfix) with ESMTP id A8B484003C for ; Wed, 18 Sep 2024 15:47:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CJjoEOgy3/WLziYjX+O3J9aoAZnEqlk2dj1uAo0d1mIJoGLOdjyZ+dA8VtQfi7dqDjCLe5cyeLvOZlDg5/TI2I7gEfoqQ6h0zIDQcaAgaA1c8h60HcW5mk/RnwPLDq9caq6M4oMx+YMCOoXXr8vAKnkmOo4Y4JadOLZc8mdNJ/SxJ9baWKi8ldTdlYhiN+Haa8lM4zQu87CXFkqWKBpYthMORmjYYeYnG0GPGaL7hmjLoeaY2gTf4Z441UUmgq3zYqZvvj41AvMwae+QPjdsLDRjJpsGtW9X0/FgLZ4kJXgZsurRBfVu97JvDhPkLgBR+0W1iClOhB/+KMaXYtfRhA== 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=AKQqVkRaGOUF4XgeEuPllc5JYe6Sg6RM90MzaGqiMk84auwwp2A8x7lmsomBDcEHSZNhLMEYLiNp31QwnFVpELvRO3s1VZ5xJrpkJDcTavJbYHpDQX3VvI1mPIOI6p3BsDhaAw2UPSCkPbwpuzIdBp7xiepzvXha/GSZIDdXNkISrYoXIIvqCCl4m1hRgfCSeGR2NQSBijsM6CEqBWI8I8OQEFwVAuUFTb2umopxO3G0xdKpJZBN8m6XITx/b/8UiqZTyhiL7pfgahkSvWqwIc/kASohvw5tEs8ycHLcZWc15Ycbkbr1NI88YBxHoKO76NKZ5+lojqd0aU9WJ2c9/w== 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=Oe5tj6B43ohZN1QiavkR2Pr8MNFZHzhxToDEmYbKsjI=; b=q8qBtSZddmRpDujsN/bJ+guLpDOuaVgOqjQaF3/1nRkjYRh1F9Q/ifp8tX4GDIM7KqGXrP66PpN67uivnyVRk0q2N0YAYbF+hmpceG9F7CK5wKCM/ydkgJLPBbs4rajTYyMtGxWNj459VeHAMniLyl82q8KQhjGZxRaHXjnT/x5lPhd0eKQ0EBu/VJipWzOSESoIOMsIEPJrRj7lm4yHW8TDH0Z0j9W1AhUrF0I3QMvMnHW5WgohQMTVVgvV7UjOHBJ8wpdu6X8wlb8HQhtM8JvwNutwY4/4fPbKU/EWeNrgWVS3xul3TnxdNzj5zter5JhgKnO9bxTpzZ8LMwzdXw== Received: from CH0PR08CA0027.namprd08.prod.outlook.com (2603:10b6:610:33::32) by CH3PR12MB8283.namprd12.prod.outlook.com (2603:10b6:610:12a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.17; Wed, 18 Sep 2024 13:46:58 +0000 Received: from DS2PEPF00003447.namprd04.prod.outlook.com (2603:10b6:610:33:cafe::95) by CH0PR08CA0027.outlook.office365.com (2603:10b6:610:33::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 13:46:58 +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 DS2PEPF00003447.mail.protection.outlook.com (10.167.17.74) 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, 18 Sep 2024 13:46:57 +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; Wed, 18 Sep 2024 06:46:46 -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, 18 Sep 2024 06:46:44 -0700 From: Viacheslav Ovsiienko To: CC: , , , Subject: [PATCH v2 1/9] net/mlx5: update flex parser arc types support Date: Wed, 18 Sep 2024 16:46:15 +0300 Message-ID: <20240918134623.8441-2-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240918134623.8441-1-viacheslavo@nvidia.com> References: <20240911160458.524732-1-viacheslavo@nvidia.com> <20240918134623.8441-1-viacheslavo@nvidia.com> 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: DS2PEPF00003447:EE_|CH3PR12MB8283:EE_ X-MS-Office365-Filtering-Correlation-Id: 4805123b-f51f-4c8a-3bcf-08dcd7e85d62 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?rj4Xoyfs0EY4Obf1+NqRdTlyf8DuvA1IX/mzRmKRHE44WIYM7bweWPXRVYu0?= =?us-ascii?Q?YDvdkiesPdLcjX+oVV51bzzWEqj106CxsveVfcCt8U1z6evWhtdv/OBJ3KMw?= =?us-ascii?Q?BdBR+X/Wqj7ug9jxJW9OmNXSoFrEEDLGp52FX/PHO+2I89Vjz+lQvA77YHVW?= =?us-ascii?Q?/Sb7zW8dOaYlyEsdxaASTPhfUegosJrPEd89MzAr5OhZ23OQGyBDeJ6ffx5X?= =?us-ascii?Q?CwJQdduvCulmwlncrVXKZwa3kqPMwG/7fJ32cPO3PQ0fBdy945ldFyhz0kQ2?= =?us-ascii?Q?S6PLAV4zU7bcQuJVBLX0hA6hiKwgus6M7YV6VcMkbvKA1PQ+W4YTPpSAepn/?= =?us-ascii?Q?bhQT78xBGUJ2+q2uiMFlJ2nwEE5+D7rGwewllyUk5LrYNVFoMinrDREKwwGg?= =?us-ascii?Q?ur58VMREitKO0a+R4FPIsOrmxYYD/ni5ZMgG6nINhto2IcsSWrPR8kyME3de?= =?us-ascii?Q?sAgNXphmgD2qbyEKXH+E4Iq6SD+3BvyDpakAaUQ5DfvAou0cpsdi6MYgHBu4?= =?us-ascii?Q?dR1tS3v7rHVG6nHj/kkt2XEKHAILqEW8h/p0TDZkkitDA0K15oTnj3uYWWUm?= =?us-ascii?Q?VngZSQrJW3Q0ssJggm7lcfY9jIRN5T0K6EIyuyzICCMiIPZddVDouw6yd9dl?= =?us-ascii?Q?zd+qRZDrABhawfnqJ6oQVlv5qywfbv7PonZRyoBTE7OUI64DxqsXdOvFlY5E?= =?us-ascii?Q?ngUJnIyfdEvSct4NAIm3HE3zPsFFKoKUApnOGqkSI5DF+sbxT1i3+oBjU2LN?= =?us-ascii?Q?J5vQklZEzWVuyCu5vDcF7JCyenso09CCyABQpAtrxouN17KKK34Zge12mHxT?= =?us-ascii?Q?9z66Gz6udTIwHbRp14IGvOq4o1d25e6aRBE7qZGKcvOQvrfGb3SVPkcIrsQz?= =?us-ascii?Q?avSaddJqVooae2fzcV8OlauWfNUG3O7uUC/6im2Im3204hwUTTYlwpo7um80?= =?us-ascii?Q?19HSSYCpGnmnMwSzT4bwpH8HjRoWRyChVAd73yOkmkF/X5X+w9+XCckn6AuB?= =?us-ascii?Q?h52GOEFUbStvj/YB269+OoUSTKAvUGUBUb4HaMqTSvdLznfLiuVXOkLEt2yp?= =?us-ascii?Q?hN2X/VqQq8txW7Fe3acM3152HfycN1RYydls6fAWTCoCeofl8uOWBLboc8q0?= =?us-ascii?Q?zY2M2mMfqCvBO0yOon8KKkf7MXVktAo8Ns3K6CLjVfRCLXqvc4MQkhHN7yDU?= =?us-ascii?Q?huvsq3bKUjSNwvY7nfjKTeje/RDco579sDb4r8+w/t1N9hnDID+aBrFvoi8+?= =?us-ascii?Q?NU7P47TtL+L1gezIgvGtnS2zPDRYTnPtQTPVv+hHRQbHOqtgjJkJS7x1ODqp?= =?us-ascii?Q?5DkmxjkRc5gf3SBLD0VUXuvlLRea/kBYUqPQzw23uNkMMniwF0ge4fxKdeyr?= =?us-ascii?Q?wnhu+3uFp4KMfFQLsclEv9Kn3Zwh4gdjTgcJdhShOpT9kd9Djc3D0t8YOo7D?= =?us-ascii?Q?rxxen+JCEWhqLqk7g+tL2ijTjE8IZ6dA?= 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)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 13:46:57.7465 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4805123b-f51f-4c8a-3bcf-08dcd7e85d62 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: DS2PEPF00003447.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8283 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