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 4B44F41D50; Thu, 23 Feb 2023 13:49:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13B2A431EF; Thu, 23 Feb 2023 13:49:33 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2059.outbound.protection.outlook.com [40.107.92.59]) by mails.dpdk.org (Postfix) with ESMTP id 306B7431F0 for ; Thu, 23 Feb 2023 13:49:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L9GfvpWuL+inpEV3pnAn4i+91Hwa1Y4hkf9MWaV33IwM8lBPUpRe3VVlQgK+rfINHHQYDrEHDYgvIKCkVblqts6+1UuWI6XDNjQlyEb36gcCXL9fvO0wgojjD6wdPiOxcGaCqMltrklqVJXtFT0sDMc9rSZ2psam++71q2TC4m/jMXj76baytluroovU+zFkT3USYbQVXVg38URe0qX0F+m7qug/vMKfPMvCEslH80WsnzQMjUBoaDa4SLIcLCDc9+i3GQhkp83sjvlcGG5ckfmaepBpJDKM388oWh+Lwuyv5gMsRMcW66JaH96iHMq20gB8awe6svv9GSavIWRTsw== 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=m8PqDCGuhs960uh1EDg7CknUFrtoYD27L7uqTyT4Qu8W/gzHqF3BPTTWcnePYy6WuXiH2qj7FLTixdQjaIMadH/WrrnO11MwgwYHuAgoD59uPIgZLa2y89/1V3zBzPLJdIAWv7HUMOHvRKvNuteepxdJrDw8UkFIYchuaH1xgWoTp6wZ+RftlQRU8DqBIHQaXu2I6BkPgP+b/zCGCNV2DoV1KplpwZ2BWYiRnDlgFrRU4Lqu1G6cYNHse3SVc0OAU8yC+/h8N8Ulkk15UjFyikU8iS6SYK0tlpbpNB60AvwoXII0Rk51pCET48IPrp94uXgBKXjAScJTwE+pv5butQ== 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=ECxFdvCgzxQX24lhCF7UDFkm4dgCmr1ju8ozNonsKClfSkZBD7xwrr2e8m7cnl15q0/aylqdKkjP3McWrS3uK2jxRfDI1VnzhpQX+J16iy7B63uD3Zj0tMR/gTGOfDVwSzTGEQb22N3orFA3VLNBS0oElPXnKIZjHryq/C8vlxCHvnJY0XUsgrhn7lhBs8ellKkjgP5UunaPgj6D0Gad0vS++68UV6VaJJLIhlV4dM4cmNaPVoPBZlAWLxiwakDPCv++OLXwBeP5vZ/FKQjGtrG2Z2XjlGJbVSMd7z0eEFNz7YWI4ffSnqXAprdht1xotiuokFFMYTvnkSlTFZtv2A== Received: from BN0PR04CA0064.namprd04.prod.outlook.com (2603:10b6:408:ea::9) by SA1PR12MB6993.namprd12.prod.outlook.com (2603:10b6:806:24c::22) 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 12:49:30 +0000 Received: from BN8NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ea:cafe::6b) by BN0PR04CA0064.outlook.office365.com (2603:10b6:408:ea::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21 via Frontend Transport; Thu, 23 Feb 2023 12:49:30 +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 BN8NAM11FT003.mail.protection.outlook.com (10.13.177.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21 via Frontend Transport; Thu, 23 Feb 2023 12:49:30 +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; Thu, 23 Feb 2023 04:49:14 -0800 Received: from nvidia.com (10.126.231.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; Thu, 23 Feb 2023 04:49:12 -0800 From: Rongwei Liu To: , , , , CC: Subject: [PATCH v4 1/6] net/mlx5: enable hws flex item create Date: Thu, 23 Feb 2023 14:48:53 +0200 Message-ID: <20230223124858.1042097-2-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230223124858.1042097-1-rongweil@nvidia.com> References: <34229594.ATrlOLLGV9@thomas> <20230223124858.1042097-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] 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: BN8NAM11FT003:EE_|SA1PR12MB6993:EE_ X-MS-Office365-Filtering-Correlation-Id: e675b540-e4cd-4e3a-c739-08db159c67c6 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: tLN5BPor/XtHWv5KmQfZlpguLQzxLvESPtThZfyaSqUFKlicmnk3qnHQr4KyiIxRKFOdZc53OHO+4CHyXYCTJc99fqKAmPf4PBBH+9rbXht+Y6koDK3OJYPOwpuWAXm4RUpkW+1BAcfZjWgoaA+2fqJnNCuhEv0VTt/iQjftQ4QNr5OegoFG0qhlNNL0wBdCOjI4C3SqDY5X0GIKmyiKTWIyldgKiKJkveCPyYvWtZicstuk1cUHX5fPK22GfdRJ6r1xQ5114OwZOJwqvIxeQbyVgjlbegVC427VRcEJsCAQmh988AW5tFhk0qex3uW6+mEOzqLnUGyHcgy8lis7hd1f2aNgWWCXw2LTbdo2Az3DpPVlWfmmWBcKbhwyKWkmn2jbwk+XqrLMbrkIPAgyEMLCstR6uZaEMAUjcv/Xazt3ZkdF3J/R5bkc7ujF6c4c00+yA1MChj4EovWC31wyfzc/NACkJE3D71cHUU0b53luQAwC2uyUr4tmoENuWKmYuqlu4r3fp6ZqaDSNcYf2dFLjzntZnK+HWa0+4pM1VhJrN9pxOY+ffSl5gBdFaLOq7clh4XN9n+6IRY8OxRaAUY8SHwZ5myf/x/XvzbA2zGXPTOAeIGOjiY1uF815+ZyVxxQ2RXxlVuSbRuXZB4X0TTK+KKNKYJnrhKt9LzWdrptNDFKFKrzDm65eIF1DsJcyS0gHw/moyUz4VmLas4uxb9c5cYN3EvDou1/oWw1d9mg= 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)(39860400002)(346002)(376002)(396003)(136003)(451199018)(40470700004)(36840700001)(46966006)(6286002)(186003)(26005)(16526019)(70586007)(8676002)(4326008)(8936002)(55016003)(40480700001)(70206006)(83380400001)(5660300002)(2616005)(1076003)(107886003)(6666004)(36756003)(7696005)(426003)(316002)(336012)(40460700003)(478600001)(47076005)(356005)(110136005)(41300700001)(82740400003)(7636003)(86362001)(82310400005)(2906002)(36860700001)(34020700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2023 12:49:30.1031 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e675b540-e4cd-4e3a-c739-08db159c67c6 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: BN8NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6993 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