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 5C21B454E5; Wed, 26 Jun 2024 20:16:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 382A940678; Wed, 26 Jun 2024 20:15:32 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2051.outbound.protection.outlook.com [40.107.93.51]) by mails.dpdk.org (Postfix) with ESMTP id 74B934065B for ; Wed, 26 Jun 2024 20:15:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CbPMsyxdhdpLQ2kduE9QT3jobMwB2KMaQbZrB/oLB561dl9zTE/RqVposKdrR9voceDF+vSwex5YYDW6nMlAIeSUczqBv3MujxcPUi7M3T97tLGIcX1iqxus4B7uXwIgHzuXIeA3BOtd+iK4IN2G9URmELRbl74ZHtxh7rMF2sVXFwt2BxfIgEhwaZd5mVfHy2zlQcZ3vbyIswf3DcrNXUnQ0ikfXLcy7ttJh9eErOqUG/A9BjL+A+bjZTID26y8nr8f3ZusyGeCKavYhP/tCXQa4U1UVOFzdd0KGnPjCJUvMtpINQHKPX/dJ3NPl4ZwLwnks99bOePiVO/Qk85DpQ== 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=x5E77PT74jTVocdfgvPIetpBw1tusuhpZ6U59q8VUUM=; b=NR8tytiCrkNpp+Q1k1nd9jLGYsu+RoeZMsJEfer/lXbpssU8k26PKwcCN1kRoESfD77MEML8Lp4q3Q9fLU5RoX6nj2tHFelY0RHTcpHE6BbMkIczksIb+G+RXTZ+m2kyu/eYq9TrS//VRa8z588jQpdsSnbcygxsVpE/d1OifyrmT1bAjByrZP0SBltjN1QFPG+uIcrPmpw7Zmd8P2ZgebsLe2tWk77/u8aBK7mIkokDFytvCW77ez4wXhEE15S47vxCVyszEstecDTYEdZoEmo+/OEechTN1ZC0wnPmoGQ4h/EdUUhNKRvn2xUwWHYRC8ozgx+MZTHVF+20tO1yng== 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=x5E77PT74jTVocdfgvPIetpBw1tusuhpZ6U59q8VUUM=; b=H6hIG9kln8jN7/u5/9xVgu9KLuxSWoccQSH4nAH/IGZJaMq0qrzS8tZhk12uWPhYHoOckzd2rzq41HHUwmP8bl+sTu8OUG2ahGl7XEI5CBNWdTneCCmh355E8+WllKjt65ZIeg2I7E7InRvYwhNGi2FznNnudqqKP7qNe6Ff2l7WwP+2Tv/QCdLAi6zFJIHWsrVwPqo+XSpBMh1M4ZWA/xK3xQX4dBMAtMlFjljjrBN635jA8rWNqQT7N9o9ZdG5oNXECVKc+f55Pxx5e3Fs2Nx39x7DE2UEv1XQoeUY2kM4czGpDXoFrCLxyh4WqJ/jyqfeK4SPEIYNA+YzAY3PLA== Received: from SA1P222CA0178.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c4::26) by SN7PR12MB7954.namprd12.prod.outlook.com (2603:10b6:806:344::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.26; Wed, 26 Jun 2024 18:15:13 +0000 Received: from SA2PEPF00003F62.namprd04.prod.outlook.com (2603:10b6:806:3c4:cafe::98) by SA1P222CA0178.outlook.office365.com (2603:10b6:806:3c4::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.38 via Frontend Transport; Wed, 26 Jun 2024 18:15:13 +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 SA2PEPF00003F62.mail.protection.outlook.com (10.167.248.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Wed, 26 Jun 2024 18:15:13 +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, 26 Jun 2024 11:14:59 -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, 26 Jun 2024 11:14:57 -0700 From: Dariusz Sosnowski To: Viacheslav Ovsiienko , Bing Zhao , Ori Kam , Suanming Mou , Matan Azrad CC: Subject: [PATCH v3 6/8] net/mlx5: store modify field action Date: Wed, 26 Jun 2024 20:14:26 +0200 Message-ID: <20240626181428.1678402-7-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240626181428.1678402-1-dsosnowski@nvidia.com> References: <20240612162426.978117-1-dsosnowski@nvidia.com> <20240626181428.1678402-1-dsosnowski@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: SA2PEPF00003F62:EE_|SN7PR12MB7954:EE_ X-MS-Office365-Filtering-Correlation-Id: 43977988-68d1-4954-387b-08dc960bec8e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230038|1800799022|82310400024|376012|36860700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?vkjfYcU0d+YifoYeotsDy3Q9oKChqUlK5Q82HOPz394J3NCzqOTC2cNA0Xuk?= =?us-ascii?Q?rXNLRYVljtBHOQ6JTdfXaPeAz78LJp44G9soiWgUEZtDhPqRmWIK24ssAope?= =?us-ascii?Q?JMy/S/PNr0CfEwGSaHtBaHAXQQ3md9XrY9R8a2Svpc4T3EelJQVZ0ok2ymls?= =?us-ascii?Q?4ES0X4Y0ej4B1FhHiBy33o7GgrC/29ufwGC4W5gGpsp00d8AijG9NwDvg65X?= =?us-ascii?Q?d/IzPZtShn0pyatd4CACqnoiKpy1HIW+pX+bIXFP5/bBBPTVHEqcy6ynCudQ?= =?us-ascii?Q?vgzNdNcTJ8HDiIYA7DAdz81FhwdA0mZcJjpujSwLTyYfMeR8JlrN08VhzEi8?= =?us-ascii?Q?XPdyobsQmBBKdWGrRYph7cgyIoAgeh2iKl3lrzQx3dWp2TNu+GFA5o9wMKTl?= =?us-ascii?Q?TDFO91WHIp533ZfcXcYiJ5eW/tpGzD/Fa7daLqBbsE8oWkPGUE6teuwmqKYv?= =?us-ascii?Q?mBilS36aK4PXfR097JXnbclTHDVR2qCHJCy8YrcNj66f+rmYuHkAY/nw+IaJ?= =?us-ascii?Q?izkS86NPMiBFxNG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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:(13230038)(1800799022)(82310400024)(376012)(36860700011); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2024 18:15:13.5911 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43977988-68d1-4954-387b-08dc960bec8e 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: SA2PEPF00003F62.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7954 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 When template table is created, list of unmasked actions is recorded for future flow rule insertions. This patch expands entries for RTE_FLOW_ACTION_TYPE_MODIFY_FIELD actions in this list with a copy of the action from the template. This will be used in follow up commits which add flow rule operation validation. Specifically, to validate that RTE_FLOW_ACTION_TYPE_MODIFY_FIELD action passed by the user is correctly configured. Signed-off-by: Dariusz Sosnowski Acked-by: Ori Kam --- drivers/net/mlx5/mlx5_flow.h | 2 ++ drivers/net/mlx5/mlx5_flow_hw.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 33847e2272..6974d4e075 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -1472,6 +1472,8 @@ struct mlx5_action_construct_data { * PRM actions. */ uint32_t mask[MLX5_ACT_MAX_MOD_FIELDS]; + /* Copy of action passed to the action template. */ + struct rte_flow_action_modify_field action; } modify_header; struct { bool symmetric_hash_function; /* Symmetric RSS hash */ diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index f337f76450..bc084af87e 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -1112,6 +1112,7 @@ __flow_hw_act_data_hdr_modify_append(struct mlx5_priv *priv, enum rte_flow_action_type type, uint16_t action_src, uint16_t action_dst, + const struct rte_flow_action_modify_field *mf, uint16_t mhdr_cmds_off, uint16_t mhdr_cmds_end, bool shared, @@ -1124,6 +1125,7 @@ __flow_hw_act_data_hdr_modify_append(struct mlx5_priv *priv, act_data = __flow_hw_act_data_alloc(priv, type, action_src, action_dst); if (!act_data) return -1; + act_data->modify_header.action = *mf; act_data->modify_header.mhdr_cmds_off = mhdr_cmds_off; act_data->modify_header.mhdr_cmds_end = mhdr_cmds_end; act_data->modify_header.shared = shared; @@ -1605,7 +1607,7 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev, if (shared) return 0; ret = __flow_hw_act_data_hdr_modify_append(priv, acts, RTE_FLOW_ACTION_TYPE_MODIFY_FIELD, - src_pos, mhdr->pos, + src_pos, mhdr->pos, conf, cmds_start, cmds_end, shared, field, dcopy, mask); if (ret) -- 2.39.2