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 A513B41F45; Wed, 12 Jun 2024 18:25:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B95B240151; Wed, 12 Jun 2024 18:25:18 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2048.outbound.protection.outlook.com [40.107.243.48]) by mails.dpdk.org (Postfix) with ESMTP id 69486410E8 for ; Wed, 12 Jun 2024 18:25:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jHisdZSwUsgAd/yRjuxOcvjGRZf4V+7CIhSwr0iK8elkvZUfRvtQpYNq+YY0CtyczgsoUkrvOB2JuoA1ONqw+Jr7wRdNSbKWoEGMQ22xTuVpSEQn2T3lp3tN7pxSxDlI3r1d0HK/jWV2JVj0By0US4kz9Aysv+SZcfa4rQu7vv6TwLLYQAbEarA548ZAgf9d4TLrKI/Mc62B9TfhV7p2wpNiuRiKyWveAQKjmJrBSU7UC6xuEAS1x4Kg5F3/BNGK/KOcdROUX4lra4Cf1RNhK8D3c7kuwAuDRn5u1JR9q4nx/K0iGbqA4+vsxvOA/s1xn2iaBBTzG6VhTOClLThPNA== 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=PoD2O5krRI14rc7xrRrpuEnlVe+n+IlbwrQvQ/tyhec=; b=O8b0MwFvid4R8z6HErT1Is0GQQd4BRBul0PCpB9vhdGdrumGoUl3LMJGD1i5w1QlRs49mWXTXXGEqmonLyPbse9JUHi3lFbISn2F1cXIlwq1Rq/JzMfgErBvtCE1F3b9dVn3gwcHubQ0DE7vAjx/MVld+RoVUT4xkvJXQ28sze+8XRcFYE4wYx5LfafFQjgWgENSvKYTnXp1J9aQvVcsT5gCqlfLWwefiAZwK9l7UKMcPacEOlYU0HVhJAJ4M9hDL8FSlxgGGoNI8lTZILagdcqoUZPPMfviTnMYMAEqGlTJ+JD3Vn5Jt3ihr37T6S5555OVXOID/aNXK4cQEOAAgw== 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=PoD2O5krRI14rc7xrRrpuEnlVe+n+IlbwrQvQ/tyhec=; b=QgeAy1OWZnYW61GImJ7JK4MRvqV+lUd7Z+Zx0EpoNGmwuwyPVEcWpNql+Bd3uCufAwYi4H22t1qoacBk1YBetI8RMTmqq9ItR2Bd5Y1yQXsO1o71qsz9oDZJH7KtOpE5ohdLhKmNKg+15g/uMJYDQA6HrklMQv//N2D63Wd0i63pRM5Sb1gE/63dwdFtigmepOWFxdHMGCfnNTCbXoudRyTsGAebhnijVcn9pQIYSb/7+tnl3K+O6giWF0h99aUYAMUEJLJZRARVxV5J81Np2Ry+JxHaDnmFhg9ke8VEgxPtV1LjDVlpfhGByCObaH5BdAw183cyby1IoXRSU0nHUg== Received: from BY5PR20CA0034.namprd20.prod.outlook.com (2603:10b6:a03:1f4::47) by SA1PR12MB7271.namprd12.prod.outlook.com (2603:10b6:806:2b8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20; Wed, 12 Jun 2024 16:25:13 +0000 Received: from SJ5PEPF000001D7.namprd05.prod.outlook.com (2603:10b6:a03:1f4:cafe::e7) by BY5PR20CA0034.outlook.office365.com (2603:10b6:a03:1f4::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.21 via Frontend Transport; Wed, 12 Jun 2024 16:25: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 SJ5PEPF000001D7.mail.protection.outlook.com (10.167.242.59) 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: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, 12 Jun 2024 09:24: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, 12 Jun 2024 09:24:57 -0700 From: Dariusz Sosnowski To: Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad CC: Subject: [PATCH v2 5/8] net/mlx5: store expected type on indirect action Date: Wed, 12 Jun 2024 18:24:23 +0200 Message-ID: <20240612162426.978117-6-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: SJ5PEPF000001D7:EE_|SA1PR12MB7271:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d4cc57e-21e0-4638-e024-08dc8afc3c7e 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?lXkpFpiRiYHd98xcJkL/lxixi890lda7Lz7mPP6t29wHOkC3fffk0roQSvvK?= =?us-ascii?Q?qq40X3jLJxEkLjSleQTMimjAhUuBF09aDNUD7i2RqdlLN0zcs9X7q5+tVK7C?= =?us-ascii?Q?xbm63GYKyXeWU/1V+5VIbmNvGE/gbbmLap+mSTCmNqiYWlywyatSaZcf4kYk?= =?us-ascii?Q?12916EnxE8kHmKrfClJN94XfuJ3SY92Kd5iemlAcZwCz7spVS3MnWgebtJdG?= =?us-ascii?Q?ABRxOiP9QzlD/2eEZ0NUJXihjuICk8sKC/LVzyemaD2PIDuMOBR3RgocL3xO?= =?us-ascii?Q?q36+Ec+HZWcnnpiBf7zXB7QgCdZk8m/Y90aEqVHrNksFHU/om1q8FZu5CwK4?= =?us-ascii?Q?W7FGhGyLTZKSFJ6xOW4e6VXqth5Eu5L/JG2gdBa1jAilSE2KHWjjLpJxWVlJ?= =?us-ascii?Q?IaLIh+hA+mWQETL25DtSf3JGgo4zLsqudyvqSoEsHZbvcGJOGuXF4wQfdJXV?= =?us-ascii?Q?3aNGbejbFY+AyKE1AT/aP+WF01/+/Nglnt+AzQrfKxceaQOnCz0/ox5ERU4O?= =?us-ascii?Q?smt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03Aew=3D=3D?= X-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:(13230034)(36860700007)(376008)(1800799018)(82310400020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 16:25:13.0794 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3d4cc57e-21e0-4638-e024-08dc8afc3c7e 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: SJ5PEPF000001D7.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7271 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_INDIRECT actions in this list with information about expected indirect action type. This will be used in follow up commits which add flow rule operation validation. Specifically, this will be used to verify if indirect action provided by the user references an action of a correct type. Signed-off-by: Dariusz Sosnowski Acked-by: Ori Kam --- drivers/net/mlx5/mlx5_flow.h | 4 ++++ drivers/net/mlx5/mlx5_flow_hw.c | 22 ++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 8e99e76e5d..33847e2272 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -1442,6 +1442,10 @@ struct mlx5_action_construct_data { uint16_t action_dst; /* mlx5dr_rule_action dst offset. */ indirect_list_callback_t indirect_list_cb; union { + struct { + /* Expected type of indirection action. */ + enum rte_flow_action_type expected_type; + } indirect; struct { /* encap data len. */ uint16_t len; diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index ddc9cf24d6..21a885517a 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -997,6 +997,24 @@ __flow_hw_act_data_general_append(struct mlx5_priv *priv, return 0; } +static __rte_always_inline int +__flow_hw_act_data_indirect_append(struct mlx5_priv *priv, + struct mlx5_hw_actions *acts, + enum rte_flow_action_type type, + enum rte_flow_action_type mask_type, + uint16_t action_src, + uint16_t action_dst) +{ + struct mlx5_action_construct_data *act_data; + + act_data = __flow_hw_act_data_alloc(priv, type, action_src, action_dst); + if (!act_data) + return -1; + act_data->indirect.expected_type = mask_type; + LIST_INSERT_HEAD(&acts->act_list, act_data, next); + return 0; +} + static __rte_always_inline int flow_hw_act_data_indirect_list_append(struct mlx5_priv *priv, struct mlx5_hw_actions *acts, @@ -2482,9 +2500,9 @@ __flow_hw_translate_actions_template(struct rte_eth_dev *dev, if (flow_hw_shared_action_translate (dev, actions, acts, src_pos, dr_pos)) goto err; - } else if (__flow_hw_act_data_general_append + } else if (__flow_hw_act_data_indirect_append (priv, acts, RTE_FLOW_ACTION_TYPE_INDIRECT, - src_pos, dr_pos)){ + masks->type, src_pos, dr_pos)){ goto err; } break; -- 2.39.2