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 69D0145C20 for ; Thu, 31 Oct 2024 13:45:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F44B40264; Thu, 31 Oct 2024 13:45:11 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2062.outbound.protection.outlook.com [40.107.94.62]) by mails.dpdk.org (Postfix) with ESMTP id 4BB5440264 for ; Thu, 31 Oct 2024 13:45:10 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZjXGYmYLsMHKCi9BuJP5v1A+6zEgM5qttScrwZPHc18EoLYk3Vl6J0/Yx/8wWTNqO6w38nbQPrhYQR7ZNtMVL2NNbBeEcH5+8v2yp86L/WKaJpJ8xED9pJl96f7eZPUfapDp5lQ+syvnHDJBmBNwlsUR8Bdmj59gqpjBgXM5ER895KSQ/yLgjHXoiocR87T1AFvMLXyKFShlQoDQWAUfBWInyoW8G1iV6EHSlmo0LuegjJUqJrISLP0FxoOW1rd+ygxwaBvD1+tEe225r9qXqrEvUfdEKGkxSDjxrQ9eW9mkm5p7cI2LU/tOPfJ7Ja4rtAYP8i36LJRdeJL5XYLuEg== 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=n14p01ffSum0Zrechc8f1zwQG+PPeGQTsp6JA7Fklb8=; b=M88XP/95iW1GPYSRmgA1/YyBL5rlIalWnyXSXhNvdiJzAMlxo8mLMe59DB6MjbiQHR1CHQUDUw+pzbNyQnB5Tc4lQVE/zts6SPixDJKjfuHvsjBMPLeD9R3r7XliuWj6ddRstMJGTn2Z1daspAnfA8nVzaUKu6S3CL6du3lhYBtmL8q2CYxwL+00oUi1JMkcg7PB7KbYQWTkdDDLyNuj36uHnKw1lSaqr2u6O2Vk00h5l9KLETa1Yl4z+vxr4e7SvZ9+CL6UXEmpR8W+3JLHkXXHo6nTPktdYHd8//EyCT0Gj6CsJi8zDIczdM0evPQUj0Ye1nUuhe46CJT46i148g== 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=n14p01ffSum0Zrechc8f1zwQG+PPeGQTsp6JA7Fklb8=; b=M9NXXTvsIeil/bVO4OHzU8Ef92o1xZurr0HhZ9yn2iflYVD5f3WRjbb99wzWHuZSbq7kBGQAeBvgtqJqOY5Nn7fH5z+jn8K2M8c/jNiQFp2yqOeEx+mSP6Z2njg1JDS+BeOqLT2Zh/NXA9EOnY2rRt/Gk1PmdNwsgMXAmwpYJVFhgghWXOwsqLfg6dHciEz980jPpJH9n4uCrKMWN1HJDgKweA0VeRyyjpX3e5ZUm+KEAXx72u/d8p6UJj02DKWBBguMLmuKIbWqVWlhJSJdODcO4QY61Dot+qbXX1KHBh4gka4PfY7TiqRTc+la3+tMYphs2F2unZAl4jBdu5Z8pw== Received: from BY5PR17CA0022.namprd17.prod.outlook.com (2603:10b6:a03:1b8::35) by CH3PR12MB9097.namprd12.prod.outlook.com (2603:10b6:610:1a6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Thu, 31 Oct 2024 12:45:07 +0000 Received: from SJ5PEPF0000020A.namprd05.prod.outlook.com (2603:10b6:a03:1b8:cafe::b3) by BY5PR17CA0022.outlook.office365.com (2603:10b6:a03:1b8::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.31 via Frontend Transport; Thu, 31 Oct 2024 12:45:07 +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 SJ5PEPF0000020A.mail.protection.outlook.com (10.167.244.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.16 via Frontend Transport; Thu, 31 Oct 2024 12:45:06 +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, 31 Oct 2024 05:44:51 -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, 31 Oct 2024 05:44:50 -0700 From: Viacheslav Ovsiienko To: CC: , Dariusz Sosnowski Subject: [PATCH 22.11 1/3] net/mlx5: update flex parser arc types support Date: Thu, 31 Oct 2024 14:44:32 +0200 Message-ID: <20241031124434.1751097-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF0000020A:EE_|CH3PR12MB9097:EE_ X-MS-Office365-Filtering-Correlation-Id: 14b5bb9d-8601-4efb-7986-08dcf9a9d933 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?5mCeMRIFSs6ibQ9NCqO+Vn9aSUkFRYj4loShV5OXc+2vOcM5CO32N4VStepi?= =?us-ascii?Q?HFFLbLoIfJSzB3OKi+M7HBQ/4Uh00gGJMn31eo8TRjmptIl6I+1T3LAgbt7v?= =?us-ascii?Q?lY9lt9ulRraykFCO+ctEpuy59SRrVqZLfXCbXBQMU4OBgcuvdbksU8rnLkXo?= =?us-ascii?Q?TFdCEXIVqrdUjNIOdkysGc7hmXY8HFNf4b4ePMNOTi2MxM/320Ce7/CvN+vU?= =?us-ascii?Q?8tauJjadTNcr8+7QcmRETQPqNM5UUcdvt5J97vcsAcyUat7JsbwiMmPwfnOX?= =?us-ascii?Q?uOKohvh1qdpfzW/E8UQKS/guYQ2NBmeJxpOoSoUF7NIYIiMkJSTpDOdG/KPX?= =?us-ascii?Q?GWBKpw+zAiyhfrqIiWkVTtvvx+RFnoo5r1dgZFs1QShMZjVUW9qHw+byC/MS?= =?us-ascii?Q?9W9h6VebyqliPtAEJCmYrCcNbwW0MP0JMzZMx0dt1mEuH+F40JpSBL6RS2/L?= =?us-ascii?Q?ZtMh1mgY8RPCUDcpo/vCfP6UmHFdiO1Bx2oihhiTIHljQFS2sYzicjgx7ye0?= =?us-ascii?Q?0aU3cOMyjRD0PWIASErvzi/65og7CN9Fp1WSa/yQaY9XxbU1kx0PtWAZLtu4?= =?us-ascii?Q?6/zp3v+epXXJMUD3zttdLRh9HM/QGlgVxJjceMRMeYrQEc40WrZIe+dQtVe0?= =?us-ascii?Q?2c3apixYP6sx0WYqlWNbDwKjzceZt+HvYJ6bCL7P1A9UBepGHccr+mGIlXUY?= =?us-ascii?Q?TqBuen4C3XPNpewccaKiai7alW1d/Jr/1U7OhoxrLViZjaIg4V+IQm9eM+mD?= =?us-ascii?Q?0rM5h+YzT9y/v+Y37HNh7aFbaXC4SJ5Jzrj67mawpEYC7LClYEoU1bYBfGcM?= =?us-ascii?Q?yn37bBxjjhnMqht789Jr33x2C3/EkPYf9mI1LekncFfPCeBF5qSTKHtEkLzI?= =?us-ascii?Q?GKPqF1KwXoO0F1rP/27Bx+aULQ1vQjulxZx16urqq8bYTRgqntrvg5BB5LZD?= =?us-ascii?Q?e1wltsexuCPw5AsVyNQT0QkuHkTvpXWULnGiOM8Wscpycy9IQQcBgg5KpmX1?= =?us-ascii?Q?be3Nx4c8Ju3BXw+Ca+avwaqn3PJ6c6P1gOGywSh/wJEaTEB7Sm+OyFms7KBq?= =?us-ascii?Q?ZgObeFvslYe6mAGvhWxvKLs1XmLwzARST/+sJfXlCuHDvPnf95UlU/ulYUQP?= =?us-ascii?Q?5Sjsw2ksa6vtbN7WlOWSqaSFinrWiqWqDJt9x27jCoGZpBCrgpE5sWg4Sta0?= =?us-ascii?Q?g3WXWpah/S1vUyxcOe1a1kPeS/oO/1qan+g8+BPlT4PGGD5Zc1WImSi6h7vu?= =?us-ascii?Q?+bZLD9DsENnOj/Wp9BLRR7IhcrRzpF4+JJeHWOMtDHttd+A7IPLC4xOtgz2g?= =?us-ascii?Q?LKPwlFQT3Du01t0XOEH55FqvOCMLZqQ4P10FwETvF/E4B934enpzeKci8YiI?= =?us-ascii?Q?bcb0VfttxsFnDoO5TcPyGAnIfQJX5NtNvoG2DW7ynDLl58kKjQ=3D=3D?= 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)(36860700013)(82310400026)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 12:45:06.7336 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14b5bb9d-8601-4efb-7986-08dcf9a9d933 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: SJ5PEPF0000020A.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9097 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 [ upstream commit 6dfb83f13f7a6d259e4ecd3d53d40b9ed87e2fe1 ] Add support for input IPv4 and for ESP output flex parser arcs. Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_flex.c | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_flex.c b/drivers/net/mlx5/mlx5_flow_flex.c index fb08910ddb..b63441b199 100644 --- a/drivers/net/mlx5/mlx5_flow_flex.c +++ b/drivers/net/mlx5/mlx5_flow_flex.c @@ -1006,6 +1006,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; } @@ -1043,6 +1045,38 @@ 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) +{ + const struct rte_flow_item_ipv6 *spec = item->spec; + const struct rte_flow_item_ipv6 *mask = item->mask; + struct rte_flow_item_ipv6 ip = { .hdr.proto = 0xff }; + + if (memcmp(mask, &ip, sizeof(struct rte_flow_item_ipv6))) { + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, + "invalid ipv6 item mask, full mask is desired"); + } + return spec->hdr.proto; +} + static int mlx5_flex_translate_arc_in(struct mlx5_hca_flex_attr *attr, const struct rte_flow_item_flex_conf *conf, @@ -1089,6 +1123,12 @@ 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; default: MLX5_ASSERT(false); return rte_flow_error_set -- 2.34.1