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 E3EAC44060; Wed, 12 Jun 2024 18:26:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD9F6427A9; Wed, 12 Jun 2024 18:25:25 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2086.outbound.protection.outlook.com [40.107.244.86]) by mails.dpdk.org (Postfix) with ESMTP id E20A74278A for ; Wed, 12 Jun 2024 18:25:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hKktF2MIikqNPofRy6qIgDNxoKamRU0JDWc/fynQlGqcYIa8885JDEoof+UOUS5aqsAA9Sn8Wx6QFClhajeqRyO8V40hq9W9fktmXxogfPT49lKEjvlG3XOgmEVCYRl3wI6DiTkr0LsEMJAvdOvFG0IhAs81q0iwaI0WTMj+U4jL+FpZm0/WXvURLmM68lOTktfX+VM4j8UkfaWSR2BEXbp1FwVE/vNYsVDiiCnIm/ZxkL1JZKSvsRpRbj0Ve4/Aq6bLrb+LBywfd3vdyQRMZltxRfaOalzpPXT1LHFTcizE681oKEU6kiBtnY7truUnR/bIE1VwnfTgXa9zPQuHKw== 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=POrrNFZtb6QSfUK1xwqsRERldBECmOUNc2iUH5oheP8=; b=B27FQd8fUMezeLYMWSWBSWBc/CP/px7zuatIaNyqnLU9Hblea49eL2z34/5qjjQuu2DmTqWSDouClTI08k8Rcnjsb192PGDBZgIAUvvGmDqTY07cGMVHno7Aat4tVaT0LuR78TpiEiC4aC67L1nXb2dwAOVSo8i2bIewTBEPglvi7y3cdi3OBCjO/zynMeoo9Pk04tMMybfV689QjzJX6zJMa9v7FRcQVsJDBhdsCJ2Pg3yFDDpO1HB5e5iHbhSDE0MnNZ5jLyK5bElxGjhQ5MFuwkMNp3aNAdwDMf1QTOcSiHUJLFqtaVBb8+6/ZZtkFB3xBzzf89QBfAy9thRFxQ== 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=POrrNFZtb6QSfUK1xwqsRERldBECmOUNc2iUH5oheP8=; b=SUe11yWADZsv4HwpJbjl06yMxUcwWhGHmX6WeWNzlcG92uueNNsOJqKAmfZGfSN5bED5pDqzTGzCkkAWnYmXRQ6KxYwX7v84K3WzR+g6Xm6U/lO1F0PYKVkhp/Wk4hiXxxL/n0gVIzBtYQpPwGm3vk9AwjXfMprxoXeOzEjj9wMvJWTUO13ql/w4DhLsHn14TVrcPF/36vjnZX9eG9ETCVwDK9cnxNubRvPKHPwRhlFftv6PVAwAJuUYXwyO4xIb6CuPI8KFsXsQXqUu0RMKbQYpzU1UmGE9vZyqtAY0js3VqfBx8lgFxPiJiV+VmN4RNooAJKqgNK+hXLv1YZmfUw== Received: from BN0PR03CA0019.namprd03.prod.outlook.com (2603:10b6:408:e6::24) by DS0PR12MB7582.namprd12.prod.outlook.com (2603:10b6:8:13c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.21; Wed, 12 Jun 2024 16:25:19 +0000 Received: from BN2PEPF000044A8.namprd04.prod.outlook.com (2603:10b6:408:e6:cafe::af) by BN0PR03CA0019.outlook.office365.com (2603:10b6:408:e6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.24 via Frontend Transport; Wed, 12 Jun 2024 16:25:19 +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 BN2PEPF000044A8.mail.protection.outlook.com (10.167.243.102) 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, 12 Jun 2024 16:25:18 +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, 12 Jun 2024 09:25:01 -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, 12 Jun 2024 09:24:59 -0700 From: Dariusz Sosnowski To: Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad CC: Subject: [PATCH v2 6/8] net/mlx5: store modify field action Date: Wed, 12 Jun 2024 18:24:24 +0200 Message-ID: <20240612162426.978117-7-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240612162426.978117-1-dsosnowski@nvidia.com> References: <20240605183419.489323-1-dsosnowski@nvidia.com> <20240612162426.978117-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: BN2PEPF000044A8:EE_|DS0PR12MB7582:EE_ X-MS-Office365-Filtering-Correlation-Id: 5925d4f6-f58f-4965-c1a4-08dc8afc400b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230034|36860700007|376008|1800799018|82310400020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Cx0TtPyJ3yTMKvkZuHlrADNE5doL1GdegulsbnPgG7F/46U/fjcIibRsPQRi?= =?us-ascii?Q?TPTB6PGsmB7ClGjDMiCc6lsy+ASAM4GQMJQXr1fIExN7/M0K7GIGYC6Q1PEu?= =?us-ascii?Q?Qp8pO+zTedJwxnr7Y2H1jfsXHcfK+GoyfiMx9dnQmUyaSNOOMlYUX2EnB1I2?= =?us-ascii?Q?7ptuEo1qzj2vmnWDEkFHkLzBGFzL3EIDsgbw9s96+EQjI+nuYweH7pR/VV2g?= =?us-ascii?Q?PdIrpHqNsW6JMJYC5dUl/+B/2idhKwXe2F2kGiRt0uy9lpbMV+shJSk76G3A?= =?us-ascii?Q?ZolVuUpenizOV/rBgRIHAYiNfjOU7FQi4P0SfKxZfBRIR4f5+8GLx80TNvJp?= =?us-ascii?Q?G6tVPg6HgrZQsrXqbwC6G1gau+cjY4AXf1DdbbhOkrznmzOv6ZwKxLsApy72?= =?us-ascii?Q?UFmwFF70wkh7zuOnEhM6SM/5MWl6nuQX6CAR7WyuAhK4FfxSykVdaqEze6rc?= =?us-ascii?Q?RAAnO1G7xLm9gPBZ8OjK5mmxwFZOkxuncIe1XjowLA229qTJHFL8IrN680A+?= =?us-ascii?Q?rQbekIa9tQyr1fPy9AKqPyfhOrMCNbQr+aIP546MLxgN0yFSDO0S2lz1rusm?= =?us-ascii?Q?0fb89cZ4WtZJLS//7VpkIZPySIwyju5mTUmYujh213x4WfnA6u2vwo8K+K1p?= =?us-ascii?Q?bem1W/ta9UfdlluQxsaOG7IQnXurzC+U6xvfxn3bgHjV1ZJnGTFSaHWZFB9F?= =?us-ascii?Q?ir1wDAj0B5y+wTePi9+kr6OyN0OB9ZMuN3v3aMx+dp1DgZRopw59UIldn4sJ?= =?us-ascii?Q?dgpucIcN9QZgiXGIciIhn37+JONnyy3ToVgs1cwSvnD7FH2m969mAJxS2wBg?= =?us-ascii?Q?+Vja2LiFh0W1GNeFWf98UkQM8SqnULc9SwhnRx4wDY+mdstl70iIDEE9pQe0?= =?us-ascii?Q?U1xp45sR2VmscFj2O82Ia07hWwMCQalx7fV10owIkz904T9U2uTRKqciG657?= =?us-ascii?Q?kHAOiCC1I7wOX0jsR6pJlgHpIGLPdZGVcbx97V5K0034+D1LHC+cZbvTMdAV?= =?us-ascii?Q?GQPl4XzHrkbsS9WuWhOutxvby38lQ2E5RTM8p1N74l3LN9jPG3vELyhtYigf?= =?us-ascii?Q?RhaH1u5RgFpgek6jz8cPaeJ0ztU82x3TuSU/dDmEotGBU00GGXKkhvJoOTRc?= =?us-ascii?Q?ckY0utYMmT+MaS7qHaFuYHHHdzwMMW20GI2VUILd5ZLzZD5bawlYanR8jEm9?= =?us-ascii?Q?RXNUXgGTDcVpkMISgpyNRIA4bjouCDP6xF7EM2nJVyQpmAnIQD1p8bvendw8?= =?us-ascii?Q?L/Tw5Tl/Cdc6TH4Dc9YcvSjv6ChPn/bU67OIEQPPROx97LTl+l5xQOauNsYx?= =?us-ascii?Q?oUZuHlXrGPsDHLtkDzLrTt/9foU+IA9iMHb+0Cy0L/6une/VNsTKhFCxPP5W?= =?us-ascii?Q?Whx8O9ZOJjoDINxBvQ5DWdOxMrtBnEoiprxu00XRYw5MnYp6Aw=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:(13230034)(36860700007)(376008)(1800799018)(82310400020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 16:25:18.8484 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5925d4f6-f58f-4965-c1a4-08dc8afc400b 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: BN2PEPF000044A8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7582 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 21a885517a..19d6105be8 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; @@ -1601,7 +1603,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