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 F2C0D43181; Mon, 16 Oct 2023 20:43:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD99A4068E; Mon, 16 Oct 2023 20:43:16 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id 9B5464067B for ; Mon, 16 Oct 2023 20:43:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JHxCMHWKDFrq6inUb/+asWzBgtSDEAKuL+x3zvkxZ6FJjZ72Z0FKu3wdPzL2n47DpUi3jMC723OddP2CI6k+sp9IVAFzKeAiN8gXRINkQ2vGYtL8VGxLdXCDWdG5X7Ini8TCOuP8laosjm5eH4/3TH7IGucNp3qjgXLTbkzvzGuYYo/miIaULg0c4G9b4WJEYYYSlaYR9ly9MDspT1KOsK8I3ZtJKc7+Jp30wOY2e+hpEsfEHJveC/4/TYW16eX2Ifxm2uNRLnfgkxh6hRf62OEiNhu3ID8PRPH/oBDrMAFqBkHln+HH3b+3PNv23XGpxu6iWcIUKxrxvA6i3aybWg== 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=Y8dAZZ7VrBNBRDL2Nv/49S5IuLC8yk67z2yl489lpaE=; b=bsE4/fa7RMN5uyQUbQuzRzbywQG2TisvEnvI9dtDpXc87C5tY4tvMgJ5GLP7yzUsOuocBH3W/UrOd0bfy4GX9iwpOed7T4sbro3OSnC2dfav4X2BbopOO7fq5uusXrqVwBiATWX9YExura9Ws1APjNMgYSA+fvecWmmi3k1X4UuOn2qutqI2512/yutN7w0M1CotpC35UUQrt2xsDJiStfhmeehi0OVP/3cUsweiw6WQLYZSvdxZ/hd9TKxVUbVsmSBmhp+ZG1bpzvMhGOZfz+08TjXfbbgsuSucoItS1IGI2BZ+WyN425yPa+Uv6EU5Rs+uOe/NZMlNNfeoN4fRtA== 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 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=Y8dAZZ7VrBNBRDL2Nv/49S5IuLC8yk67z2yl489lpaE=; b=B+KA6MGjr3K0G7B+4ZUveSrZE90t4MNTS5d6GnJjgz6ZHy4bIhq53KjVESJ06NmljrykHMKxYbMg0ISgwSh9pAYKUr6kesmfTBZPbdUYDB76DAKbmv3d/6QdwFaBuvW++HEWP/gAT168C9whguW/yV2R/syXVS18k9uGmWDxQuKatSkelZ5MOiaepgwU3d2DPxJDFYtGdCSge8Ia/ZfWpJMzwwU2e6VClljERoHU4ElRvk7HNpDqS8FoxobahYihRDF5cZwUWUWcNDLq3Bq5fbzENAsvfTBMqiy+uNoGICIyE7y4WeKpaz5Fy7k598/RueLq/o7xDeUpmqW0QntRvA== Received: from SJ0PR05CA0041.namprd05.prod.outlook.com (2603:10b6:a03:33f::16) by SA1PR12MB7199.namprd12.prod.outlook.com (2603:10b6:806:2bc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Mon, 16 Oct 2023 18:43:13 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:33f:cafe::54) by SJ0PR05CA0041.outlook.office365.com (2603:10b6:a03:33f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.17 via Frontend Transport; Mon, 16 Oct 2023 18:43: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 MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Mon, 16 Oct 2023 18:43: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.986.41; Mon, 16 Oct 2023 11:42: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.986.41; Mon, 16 Oct 2023 11:42:52 -0700 From: Gregory Etelson To: CC: , =?UTF-8?q?=C2=A0?= , =?UTF-8?q?=C2=A0=20=2E=20=2E=20/patches/upstream-pmd-indirect-actions-list/v2/v2-0000-cover-letter=20=2E=20patch?= , Hamdan Igbaria , Matan Azrad , Viacheslav Ovsiienko , Ori Kam , Suanming Mou Subject: [PATCH v2 02/16] net/mlx5/hws: support creating of dynamic forward table and FTE Date: Mon, 16 Oct 2023 21:42:21 +0300 Message-ID: <20231016184235.200427-2-getelson@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231016184235.200427-1-getelson@nvidia.com> References: <20230927191046.405282-1-getelson@nvidia.com> <20231016184235.200427-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|SA1PR12MB7199:EE_ X-MS-Office365-Filtering-Correlation-Id: bcdcf500-a81f-41fe-4d5b-08dbce77c0ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eMmy7XdmV+C49B1LHCaAQuNYZe5TaVblgDZu7QdoznOHext8YEATmMLBufBIu2NaV3f9AIjsca8AapxQ28Mwn5YIByWiFt5Qd0jmBohwa0FU2yDj8Uiv7eqXYo/EcH221yCAZ+/Ea2MLsVVMVUWU+YvU+oEg/fQ5GXZ7ehJGyM8dPdWTuq8dksDfU0vjKYwOeMmym5Z9NK57u6nI+N/GaKq6nv11VkHX3WSPyUNzlOyc0m5SUuP8b8PhUwYC4VjO9i16pJoCQqhgmNWFA85A5Em/HOaHBs6xsKTf8/dYJreySs9Mh20N8x0waF/vvEnqjOqwmcGOAw/6UoZr7/ONl6kzUKzHzijrmggkyX926Hz8wONiHKx8exFqk/WKsHpaP9ZRzXnfN8AQnjhZ2YqFmmruOf+Sq+BdzJk9PAOuo2mvUctZiUdJ6QakgUsz9Fr7Eihy2Sx9bKmDex9o5nZlhRorR4952+W0tQo6HE8QwxDa5bzI+qhHWSddU0jE6QR7N4Ia1JPWY9g3n7eVNGRVZhHAJvGiqjrRkTaEncIyJOo9a7Z7gKUcqvyA7VCzMMz9MUcTqEVZXvzpAsSx8BOZ4YkW7Lmm8X2wSe7iDM7jGvsDaRV5E4kcV8pG8mKGMAwrpchm3vXWLIh1UK2K+6JGZ5aLkwhkpbqNS/cw0KTQQWR3OUhrb2n+DAPdPYrnvU6wz0/hskbbkpL4lN3WYPFcgWUqQuzcIEmViDZgMnbbJ5YaesSONJvc354zud85TNKE 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:(13230031)(4636009)(376002)(396003)(346002)(39860400002)(136003)(230922051799003)(64100799003)(82310400011)(1800799009)(186009)(451199024)(46966006)(40470700004)(36840700001)(6286002)(16526019)(26005)(426003)(336012)(82740400003)(54906003)(36756003)(40480700001)(55016003)(70586007)(83380400001)(7696005)(316002)(6916009)(70206006)(2616005)(7636003)(107886003)(356005)(1076003)(86362001)(36860700001)(47076005)(40460700003)(478600001)(2906002)(6666004)(5660300002)(8676002)(4326008)(8936002)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 18:43:13.4505 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bcdcf500-a81f-41fe-4d5b-08dbce77c0ea 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: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7199 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 From: Hamdan Igbaria Add the ability to create forward table and FTE. Signed-off-by: Hamdan Igbaria --- drivers/common/mlx5/mlx5_prm.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 13 +++++++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 4192fff55b..df621b19af 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -5048,7 +5048,11 @@ enum mlx5_flow_destination_type { }; enum mlx5_flow_context_action { + MLX5_FLOW_CONTEXT_ACTION_DROP = 1 << 1, MLX5_FLOW_CONTEXT_ACTION_FWD_DEST = 1 << 2, + MLX5_FLOW_CONTEXT_ACTION_REFORMAT = 1 << 4, + MLX5_FLOW_CONTEXT_ACTION_DECRYPT = 1 << 12, + MLX5_FLOW_CONTEXT_ACTION_ENCRYPT = 1 << 13, }; enum mlx5_flow_context_flow_source { diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c index 0ccbaee961..8f407f9bce 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.c +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c @@ -42,6 +42,7 @@ mlx5dr_cmd_flow_table_create(struct ibv_context *ctx, ft_ctx = MLX5_ADDR_OF(create_flow_table_in, in, flow_table_context); MLX5_SET(flow_table_context, ft_ctx, level, ft_attr->level); MLX5_SET(flow_table_context, ft_ctx, rtc_valid, ft_attr->rtc_valid); + MLX5_SET(flow_table_context, ft_ctx, reformat_en, ft_attr->reformat_en); devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!devx_obj->obj) { @@ -182,12 +183,24 @@ mlx5dr_cmd_set_fte(struct ibv_context *ctx, action_flags = fte_attr->action_flags; MLX5_SET(flow_context, in_flow_context, action, action_flags); + if (action_flags & MLX5_FLOW_CONTEXT_ACTION_REFORMAT) + MLX5_SET(flow_context, in_flow_context, + packet_reformat_id, fte_attr->packet_reformat_id); + + if (action_flags & (MLX5_FLOW_CONTEXT_ACTION_DECRYPT | MLX5_FLOW_CONTEXT_ACTION_ENCRYPT)) { + MLX5_SET(flow_context, in_flow_context, + encrypt_decrypt_type, fte_attr->encrypt_decrypt_type); + MLX5_SET(flow_context, in_flow_context, + encrypt_decrypt_obj_id, fte_attr->encrypt_decrypt_obj_id); + } + if (action_flags & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) { /* Only destination_list_size of size 1 is supported */ MLX5_SET(flow_context, in_flow_context, destination_list_size, 1); in_dests = MLX5_ADDR_OF(flow_context, in_flow_context, destination); MLX5_SET(dest_format, in_dests, destination_type, fte_attr->destination_type); MLX5_SET(dest_format, in_dests, destination_id, fte_attr->destination_id); + MLX5_SET(set_fte_in, in, ignore_flow_level, fte_attr->ignore_flow_level); } devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h index f45b6c6b07..bf3a362300 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.h +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h @@ -7,8 +7,12 @@ struct mlx5dr_cmd_set_fte_attr { uint32_t action_flags; + uint8_t encrypt_decrypt_type; + uint32_t encrypt_decrypt_obj_id; + uint32_t packet_reformat_id; uint8_t destination_type; uint32_t destination_id; + uint8_t ignore_flow_level; uint8_t flow_source; }; @@ -16,6 +20,7 @@ struct mlx5dr_cmd_ft_create_attr { uint8_t type; uint8_t level; bool rtc_valid; + uint8_t reformat_en; }; #define ACCESS_KEY_LEN 32 @@ -296,6 +301,20 @@ struct mlx5dr_devx_obj * mlx5dr_cmd_packet_reformat_create(struct ibv_context *ctx, struct mlx5dr_cmd_packet_reformat_create_attr *attr); +struct mlx5dr_devx_obj * +mlx5dr_cmd_set_fte(struct ibv_context *ctx, + uint32_t table_type, + uint32_t table_id, + uint32_t group_id, + struct mlx5dr_cmd_set_fte_attr *fte_attr); + +struct mlx5dr_cmd_forward_tbl * +mlx5dr_cmd_forward_tbl_create(struct ibv_context *ctx, + struct mlx5dr_cmd_ft_create_attr *ft_attr, + struct mlx5dr_cmd_set_fte_attr *fte_attr); + +void mlx5dr_cmd_forward_tbl_destroy(struct mlx5dr_cmd_forward_tbl *tbl); + struct mlx5dr_devx_obj * mlx5dr_cmd_alias_obj_create(struct ibv_context *ctx, struct mlx5dr_cmd_alias_obj_create_attr *alias_attr); -- 2.39.2