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 9ED2641D49; Thu, 23 Feb 2023 08:07:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EA1F4303B; Thu, 23 Feb 2023 08:07:06 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2047.outbound.protection.outlook.com [40.107.223.47]) by mails.dpdk.org (Postfix) with ESMTP id 0A2A04021F for ; Thu, 23 Feb 2023 08:07:05 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LJzzEI3fhcGhxUfwk9LHjAV57Xz0rmaRCcJlnatpmJcJ/DET6ZfDmg+TcsxMaCAXycAJ08jDLX2WsQ3cqeVceBbJ880r766uPItHCwz+wrUFaJ9HRePVAQa0IFkUgdvIMqNoeN/HdkSJwI15hpDbOCx705geVH8eukOp2td+vVxBDeU+HyNl/30A/qrKeho3M1mqMCtgbUkr0fSx81CzSYVXZKc1A9p7o40v/8JtKaLmjAplIdOqDVHbX5JpJSGg4PcseoccQmo0ryzGbMFzV7RIcdHzWH8Nfxv8KEe/CvF9NDVtgRjQxKFsdIrzfUOXASCR2lLZAoQ7Vs+PWDxN9A== 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=NkMIb8+I0/9K5DCQyjCjiDhYovm5r1KvsWyraP74MCo=; b=Qgv0SB4924EgH6FBxUjhepyARcKGt5svwMOhjH+97lXtY6aQWOdbFhMi93psxm0zM+TXzZFyX9QmQ8g4/R0EbCBd2fLRjEEwECA/NNMIsw556+sNygoeKcg/+Ec51rpd+HdX4hRKWDyvUEBVWpYPjZnIfONRMN6uJ2QpHRY+d6QAxyse6nRcBqfGGZc4tDcyQDlhm5GAG65HLSNWcXxCVmExrIt0nUbws/ZfEDYfFxjNFAQiDo7BYoDW+rYGrMBVbSb357cFKDZThVeoqaz1J6GPMdr1P6EnrhLEpSJhAbjax0zjNm93acD5tPyxMJ4lHBbpluqgBVVVCeWpdtOKCw== 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 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=NkMIb8+I0/9K5DCQyjCjiDhYovm5r1KvsWyraP74MCo=; b=dJdIjQ/XT4DeVJmlZoFMPBGP49ToPXn3pvk6b85maUdssxQnLkkUoVGDBlrPbDqf4tMcxJtlNIbhLMH3uTbPsc8XAK6rmZ67ixhlMylstz20nzZuvokigS7lPxSwQa5MFFLhtdMlmxAVm8cMsrWjxO0Xuts4mHr0BtQC7UuNwSUo7037+++i107Ox/VfH5V2mAowZawiUX8h03F/8MRGe3a2Wkty7Z/i71F8e33sgCVXaCmO/8v6PfR8/9Qt3gj9ZuDV5VfzjTMWyM6ycV7kexzhXaIL0P6ezPFOFlhLrUczjw+Nu9byeHRHTBFdIlKC8TCt1MhngeWfOLfWZdFkeA== Received: from DS7PR06CA0038.namprd06.prod.outlook.com (2603:10b6:8:54::19) by MN2PR12MB4221.namprd12.prod.outlook.com (2603:10b6:208:1d2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.19; Thu, 23 Feb 2023 07:07:03 +0000 Received: from CY4PEPF0000C976.namprd02.prod.outlook.com (2603:10b6:8:54:cafe::94) by DS7PR06CA0038.outlook.office365.com (2603:10b6:8:54::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21 via Frontend Transport; Thu, 23 Feb 2023 07:07:03 +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 CY4PEPF0000C976.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.14 via Frontend Transport; Thu, 23 Feb 2023 07:07:03 +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.986.36; Wed, 22 Feb 2023 23:06:50 -0800 Received: from nvidia.com (10.126.230.37) 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.36; Wed, 22 Feb 2023 23:06:48 -0800 From: Rongwei Liu To: , , , , CC: Subject: [PATCH v3 1/7] net/mlx5: enable hws flex item create Date: Thu, 23 Feb 2023 09:06:27 +0200 Message-ID: <20230223070633.946328-2-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230223070633.946328-1-rongweil@nvidia.com> References: <20230215115251.3924578-7-rongweil@nvidia.com> <20230223070633.946328-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] 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: CY4PEPF0000C976:EE_|MN2PR12MB4221:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b430919-8af1-46b1-6dc0-08db156c90b7 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cIlqfphWf8GbRCef1f9VzZP37wIA3lb0wH+210EA1vkJBVa/Fs/FjDH1hCmTPzs8DupaIXlj9SqJPlZ4u4aKatRo76DkzVGJUHDBUql15yl5awiI7Q+kk7L5A3q0ZJMfeAZID92UTYChZ3k0If7rdl7fhNRwReZKZC8noaTdgs4jzo7imdzSoGs0zQaf3zZpyzreH2R/5nWVwDJpaOagZlaMEgs4za1bxmJPNn+MP1jOHQ3jmvIJc3Jx3aOJy7ccMeTZ7Fcij2g+H6sNuSWOM57LW2U74U7/qnyZr0bl4O/2yJsvpiACd6gElKimVesHXov03mSo3N+2xRSFlz9ibO8YBi0tCOZWtSH2ZcOEOf/ED22oWCbvkwnM8uM8UetZzvJfV4tSy25BF9kEMTzd0oW6CROQwcboPSiWWm6aL2dExvwmseZs17oJnVyc/FuhhjIu7QlPdJ0o/mVucTbiJQ7BykuXZ5D7EzCdqVExrs91Mr3UBPeC2BxXuZ70wvE/IwT5DPFZMWt+HBKOlrRdYEMuEbwRnx+PvCiWW5ZjhNY0nNjkJ7XwScgTzpyI0PBBEnrfb4VFiQ48qa3GjSqc7koBNfM2F8qKqT1MIejeVLOJJm4tJ9OOoq9YVwRb0BE60iCsKMPtcDy4WgF8wjleDo6mJ80yl6X8uABj6eId38RoKzoZab3Os9WuFrLQ7zhjOloTP9x7mMGK7cUftl63rw== 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:(13230025)(4636009)(136003)(346002)(376002)(39860400002)(396003)(451199018)(40470700004)(36840700001)(46966006)(36756003)(82310400005)(47076005)(83380400001)(110136005)(426003)(336012)(316002)(6666004)(107886003)(7696005)(70586007)(478600001)(5660300002)(41300700001)(2616005)(1076003)(6286002)(26005)(16526019)(186003)(40460700003)(356005)(40480700001)(2906002)(86362001)(8936002)(4326008)(82740400003)(36860700001)(55016003)(70206006)(8676002)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2023 07:07:03.0242 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b430919-8af1-46b1-6dc0-08db156c90b7 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: CY4PEPF0000C976.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4221 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 Enable flex item create and destroy with dv_flow_en=2 Signed-off-by: Rongwei Liu Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/linux/mlx5_os.c | 27 +++++++++++++++------------ drivers/net/mlx5/mlx5_flow_hw.c | 2 ++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index a71474c90a..f5b3edea99 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -474,10 +474,20 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv) err = mlx5_alloc_table_hash_list(priv); if (err) goto error; - if (priv->sh->config.dv_flow_en == 2) - return 0; /* The resources below are only valid with DV support. */ #ifdef HAVE_IBV_FLOW_DV_SUPPORT + /* Init shared flex parsers list, no need lcore_share */ + snprintf(s, sizeof(s), "%s_flex_parsers_list", sh->ibdev_name); + sh->flex_parsers_dv = mlx5_list_create(s, sh, false, + mlx5_flex_parser_create_cb, + mlx5_flex_parser_match_cb, + mlx5_flex_parser_remove_cb, + mlx5_flex_parser_clone_cb, + mlx5_flex_parser_clone_free_cb); + if (!sh->flex_parsers_dv) + goto error; + if (priv->sh->config.dv_flow_en == 2) + return 0; /* Init port id action list. */ snprintf(s, sizeof(s), "%s_port_id_action_list", sh->ibdev_name); sh->port_id_action_list = mlx5_list_create(s, sh, true, @@ -518,16 +528,9 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv) flow_dv_dest_array_clone_free_cb); if (!sh->dest_array_list) goto error; - /* Init shared flex parsers list, no need lcore_share */ - snprintf(s, sizeof(s), "%s_flex_parsers_list", sh->ibdev_name); - sh->flex_parsers_dv = mlx5_list_create(s, sh, false, - mlx5_flex_parser_create_cb, - mlx5_flex_parser_match_cb, - mlx5_flex_parser_remove_cb, - mlx5_flex_parser_clone_cb, - mlx5_flex_parser_clone_free_cb); - if (!sh->flex_parsers_dv) - goto error; +#else + if (priv->sh->config.dv_flow_en == 2) + return 0; #endif #ifdef HAVE_MLX5DV_DR void *domain; diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 7457187b19..9e1912ec69 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -8436,6 +8436,8 @@ const struct mlx5_flow_driver_ops mlx5_flow_hw_drv_ops = { .query = flow_hw_query, .get_aged_flows = flow_hw_get_aged_flows, .get_q_aged_flows = flow_hw_get_q_aged_flows, + .item_create = flow_dv_item_create, + .item_release = flow_dv_item_release, }; /** -- 2.27.0