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 B317044165; Wed, 5 Jun 2024 20:36:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A84D410FB; Wed, 5 Jun 2024 20:35:55 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2056.outbound.protection.outlook.com [40.107.92.56]) by mails.dpdk.org (Postfix) with ESMTP id A7A6F4113D for ; Wed, 5 Jun 2024 20:35:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cQBoHNWVVJmEVt0cKPgnRR3ryivhUDOHXRx3wfxn/Wz6+NwZz1wtyclWgAtTSq4Z1RqkQYXnN7I/Vbm2yzf0i/VfxBWOT+JzIX+XCl8JR18SAiqKowpHhzDUVvtgbyoowFXsOA2bfSE/cBF+FP3wozf/6eXlHMaDFxvhGoHg9NzgUJpoxcLRk/9Oda0TPBtbFcf9dsDMwnXt1lLo63UTKJzqj6C76naSiyoJ1aPOXmpDFNjOokKsPuOGYIFhilSdwYUIYmtV16JLDZe33zz6qPBA7L2KrF6Ne27mmb57oNaZgKzHBPWza4ObGeGNjPp1HQCCD2wzUL3U3DrlRdZs2g== 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=kEq1Z0vQ/h60TfOLWvoCPseu/knwWhsAm+a8CVHQm4g=; b=OLQiYQDUWa4OQzpPDnyfX0cUWIqK8zhqOSPm1sqWoC9G4MkCn82KrTkvcNO3nAUshvI5BIuIMwCsY9J2SOw00KNBE0tcQ5WzddXuJvE38fVhEXQfWEUCrManx/7+X8nNZ5JANPB4paN4mHDc0AQ3akpCGf3MlM9jlrKmNYMHJo4L9cAtBzrlPbgic4XVQREQ1eVtqj++cv0hwdcBpxf/Q0buitp/r2g2Au5ameKSENRaZOVdH3Acld/G1NR4N2ADGqjl618YP7DMMUUTD0brv4UxUb21afffD1OGqUz7PHsjwdBy1nO90G9VGDEd6F+EaM7UM3c6p2RSlrORSulU0w== 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=kEq1Z0vQ/h60TfOLWvoCPseu/knwWhsAm+a8CVHQm4g=; b=hj39j5agFNf9XobOIpUaxd23bKp7AiCPzm/DP/Gkre8NqHZYbPWG4/rRKDrcB67QrB6zCKd77ojjzr9rbP/Xie+nHlxU7mOQAXn2n7oFE2y3M5gUq26dP/zk8UH7wKn1eqQGzQyot/9vFI89Dt9PiPYZ3XlRLlOI+NFjNDvZzKZdo1dZQW9bM/dYm9e+Xpg8P+QRwuWz5YU05OGRoS6C5jC9LG4dmD0cIqMBFa2PMAMr/2r2XXzZnGTrC6em+Hw3nTNADMu4BGEpsdLYW1qF+T3ta9spY/9od2SJO5Bjd1GH0qXVBDvMQk3mrxPIOXIrcts8ynW/IfnGtHsl8npbHQ== Received: from MN2PR15CA0066.namprd15.prod.outlook.com (2603:10b6:208:237::35) by CH3PR12MB8533.namprd12.prod.outlook.com (2603:10b6:610:159::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Wed, 5 Jun 2024 18:35:48 +0000 Received: from BL02EPF00021F6C.namprd02.prod.outlook.com (2603:10b6:208:237:cafe::8d) by MN2PR15CA0066.outlook.office365.com (2603:10b6:208:237::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31 via Frontend Transport; Wed, 5 Jun 2024 18:35:47 +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 BL02EPF00021F6C.mail.protection.outlook.com (10.167.249.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Wed, 5 Jun 2024 18:35:44 +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, 5 Jun 2024 11:34:55 -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, 5 Jun 2024 11:34:53 -0700 From: Dariusz Sosnowski To: Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad CC: Subject: [PATCH 6/9] net/mlx5: store expected type on indirect action Date: Wed, 5 Jun 2024 20:34:16 +0200 Message-ID: <20240605183419.489323-7-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240605183419.489323-1-dsosnowski@nvidia.com> References: <20240605183419.489323-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: 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: BL02EPF00021F6C:EE_|CH3PR12MB8533:EE_ X-MS-Office365-Filtering-Correlation-Id: 25e9884d-1712-43ed-06da-08dc858e4fb3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|376005|1800799015|82310400017; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?BjkChJkLvnB8Atg130P6vc/fRNLpaNdL1s88IdABJ4V+BuaVKrIjg2OMoScM?= =?us-ascii?Q?SeIDvxwJ2vMvl4+DW6xZWlrDsUwZLRnwwlESeBCx+hTFvq/K7tlRzn4NY6FK?= =?us-ascii?Q?XEPATr+K4S3vMpqM/gQRxylYL4DxDE4kFwDJTM60oZDMNwPyQlqcvoqC2r3s?= =?us-ascii?Q?f9ppf4cjHvOZ+V+oG/9QToBVOTRKE2B73Ix0Ua0xxr4O2iIusDqOsybFr7bc?= =?us-ascii?Q?5gv6NtIvQ4kpK4nXZ8kUBBb4ypXu4T99osEB1wZTlElPka5tmpp/iJFvsGvd?= =?us-ascii?Q?fjBn1ziwwxPNHfDTuA25u5pPSdpcslNb6mgnByO0OFY54fZd4Zv6DhTAE16+?= =?us-ascii?Q?z63FpE06jX84EeMVUoFfKO+nIPgq/eJzQhY7MK8hjHAHBfoCS56D299S8XxZ?= =?us-ascii?Q?bfkRUO5Wic9ZfRrzoIJr4IQT6xmKbKegMcQGMEach3yVLMW6ioYuhQvXub8G?= =?us-ascii?Q?UC/j2IKvIW4Cd27Q0DpkKwT1MoNMCG50JnTY6Y6APPSePfkRdnyjmHhOKSKr?= =?us-ascii?Q?rUbSj8KLQ0FLsn7Un7jlQVN3YQwx8n+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:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(376005)(1800799015)(82310400017); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2024 18:35:44.2188 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25e9884d-1712-43ed-06da-08dc858e4fb3 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: BL02EPF00021F6C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8533 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 a40e8385b3..cd6fed4723 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -1409,6 +1409,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 52ad419c95..5e9d43ab22 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -768,6 +768,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, @@ -2215,9 +2233,9 @@ __flow_hw_actions_translate(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