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 CBE2242403; Thu, 19 Jan 2023 05:59:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36AD642D86; Thu, 19 Jan 2023 05:59:04 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2050.outbound.protection.outlook.com [40.107.101.50]) by mails.dpdk.org (Postfix) with ESMTP id 0E4414068E for ; Thu, 19 Jan 2023 05:59:01 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cx+1WreVGOTnxEZUtKAAzB0nENnbs+T+4ZiKiRqLCtDQ/yREBH9bxN0sfv5oOCuxBqNvN+hpbG1Eth+eUsmRVMiyTSLH9HX0G5VQhBxv+zK9Jra1rCBSbi3aYhwxO0vak9rbPiL6RUyFNK6MQapBpqo510vRtf79Ca2mHIWzHO8JTzsH1fQ8YOrYQdMoEQmLQfU0YkzT83HCSJbtRFMz2lSGh5cazdmtFwho7kM4OZxdPvw7xSAi2hWPwRAxkYfjnAXdxWSAtKUbXsvvZdArZWndY+UyOJEN31k6fZ43Fu7rYMKw/j+BvVL27jqwR7nQveV87FbgxCnNbyfubbHOfA== 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=5qqsKyS/2hLZfKsRr7JVQcehnXoyywT3HpAa64EQ6ek=; b=Wiif+oGtacbpxMIP0tm7h6XVVEeKGDScCGptX76gWey2xtPFBTQxdBaia//Hau/mGfwSKWtUM8E4PAbTZ8qKENw43PaD2HAFBkx34TLfWQY10hqyta+pxedoF5NXfIDZ5j/C09y7HLl/pgDkxYLy/lsnxsqoGmfhy8/Rc+a98/UlyEBsfyRc5wXbY47GBMmN+jBr5+OAIcZIkHR90LAiV/vd1KcbRnhJu3YZfyDttaPyOT7SyspZDszGNqx/LIsOYWLe6N8sdx7NSarm5glfMm+XAdR57lCs4baW6YTSob1EzoH6x/iZRzhoUugU3su2rVLQSHMoVOPEguqrkshc0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net 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=5qqsKyS/2hLZfKsRr7JVQcehnXoyywT3HpAa64EQ6ek=; b=pVmVOjBZ3AE8c5lCJF2C9yS+HLfPj0igubi0f4O5n45aKBF0gnJJLa5cyTKlB7fWAAzymcMWu3icfcBj4pp01qOxCaXTGfdU7QaxW5mkEzRuB3ItuNSNeUb7ohHFQ5mjBU9UZJz2EWRxJ5V7tAy72eFjYB5aUAwJjMWL5JD8bJZufxHjjWe6PlIBcIHU+FC9AFv+ILoUgcNAwype/7t927yQK3ICDxrhPq6tlGpz6Md0/lWuxFdq5jDGOZitsic0kGhnSx2dGr1ZvgrAUAlSSG+2RQCKxpFL8IU9bkLTvA26RJfsl7V/Es+2pIsrnAQPfGwmBXYoGJzd68dBB7RCdw== Received: from MW4PR03CA0010.namprd03.prod.outlook.com (2603:10b6:303:8f::15) by DM4PR12MB5231.namprd12.prod.outlook.com (2603:10b6:5:39b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 19 Jan 2023 04:58:59 +0000 Received: from CO1NAM11FT091.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8f:cafe::1a) by MW4PR03CA0010.outlook.office365.com (2603:10b6:303:8f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend Transport; Thu, 19 Jan 2023 04:58:59 +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 CO1NAM11FT091.mail.protection.outlook.com (10.13.175.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Thu, 19 Jan 2023 04:58:58 +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, 18 Jan 2023 20:58:47 -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; Wed, 18 Jan 2023 20:58:45 -0800 From: Rongwei Liu To: , , , CC: , Subject: [PATCH v2 03/11] net/mlx5: enable hws flex item create Date: Thu, 19 Jan 2023 06:58:16 +0200 Message-ID: <20230119045824.665663-4-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230119045824.665663-1-rongweil@nvidia.com> References: <20221221084000.3680015-2-rongweil@nvidia.com> <20230119045824.665663-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: CO1NAM11FT091:EE_|DM4PR12MB5231:EE_ X-MS-Office365-Filtering-Correlation-Id: 5df254cb-9f15-4fad-028e-08daf9d9e02d 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: jrS9pJ6fWOOWR9A+fKRbeXAhy9iyi3YM4wYtYZ7QobmAHV1LqasNqpO1hEbISDmOQDZyMfCj6CgRNjQ73cU2mvHBquLJShGk2PNzOPtlJNu5XHCwzsmDFFV+k9o6iyr6JGrECuBqpRBJRYN8qQUFY3WuQYV37mOrUtolbkFYlbumZjIRDzs1eFMINUY++AjjBBzM/wQomfddG/Bw/I40qhEkNLbtlg5uV9aDaQ1Ibb4sVk6JDGYeqCLrCaTqhkbnH8vTmr5wVvy9/GUy9M4ChBMzYbv2X4s4EmtEQ4f0U5LAnWqHqPP7dykK+L0B2TDVkOO+FgP7RSMEzxzPMBPu7/tmRccjiH87f5LcF5STMg+3/A7pyPvDsotckPzHm6AkmSvRaedHMFcv5ydKxD/tQtBAyUSD7jLeDdKYQk2kybQyAZxhG4rmLFmNemNKKIrYKOhI+MsVeAnrFxAyWAC0PcR4tQZVn1FhAEBxxKM9zLsgT8HyyCkn2mgl1SARxh9VsKsQyrW8gEDK2ykcP9izr2nKaDmQ8OHG2pUMoCIHmvJ1Y8K3aUrSBE/9MjZwBO+6abtQRMW6Ut4ITCVn8GOBp/jvWeEPVRKNIicHj+EsG8xMkQ0IMMwRbSr8GvwhIdA01XqIE2FDY0ZLCXyf1OgfYSld4CRg29BK/hyc6MrkovjSFic1WJ0XdO8cxyusBYyns7sCYGYvVPImIltAi4tiLw== 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:(13230022)(4636009)(396003)(136003)(39860400002)(376002)(346002)(451199015)(36840700001)(40470700004)(46966006)(7696005)(40460700003)(478600001)(336012)(54906003)(110136005)(36756003)(316002)(7636003)(36860700001)(83380400001)(82740400003)(82310400005)(107886003)(55016003)(26005)(40480700001)(426003)(356005)(1076003)(16526019)(2906002)(47076005)(6666004)(186003)(41300700001)(5660300002)(86362001)(2616005)(70586007)(70206006)(8676002)(4326008)(6286002)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 04:58:58.9049 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5df254cb-9f15-4fad-028e-08daf9d9e02d 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: CO1NAM11FT091.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5231 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 20c71ff7f0..44953451d5 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -8336,6 +8336,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