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 EFB4741B81; Mon, 30 Jan 2023 14:20:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7033A40EE1; Mon, 30 Jan 2023 14:20:39 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2077.outbound.protection.outlook.com [40.107.102.77]) by mails.dpdk.org (Postfix) with ESMTP id 14FD7410F6 for ; Mon, 30 Jan 2023 14:20:38 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hFzhJJftCmmkAQDapqLsFMTXnNx07CVYBuzNgnKRuQG8Hxr9e831MbVso61Ti3FQMya8xxLYPKFI2oF2Zuv9qJDfowkAON64iY59LuIz2RYE+G+IY0lzca40pDsRt368IVTRtrJaFeflMKQn4GExi7WBDLeS1R4IdNLEQOGLTMmfIbQsk4a+hmLog5RS3pohkjAQlfNeHkKcd3SYrCsUtLtfp0HC6DzbIaGLXxnIb1mYTiSyjog10Ito0nDMH0AmKE1sjLXC9H9ij4lMQ7NU4yZ3xeMcXIH5tLfPWxQ7VIPXgwmvPuEY2niWmJyn9nGMIpt7vgZxICEM9UmOeQ4V2Q== 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=Cf0/pCmYyiTnONp/zIv2CZ3f5xKUDz9NUDJI6WBXw9Y=; b=k0LDtNTwQLSSvEYj4flvvqFW0CAIZB3XB0k4UPPTb2/QfIDhtbMIZQsnBoHKUDTIxZlHnl61FicBndV5dewQoSf9KYTCY8wBRk1poFqHX7461tdUuVUZ0QWZ+UeTP2IeB4/wBjkBhtbWZFS/LEWQkYF+O5UHeJnKMB4w58pXq7WZSsykrccI9X/cz4mIzlbMdfERpQwG2M6JtWAN7W6GBBP1YT9F7O/gKvEzqYhyM2PfEf8UH7GH/WDydd8gW7ese91iuHh1iSzySozJht+FJpPWxPqQMALFpQOx8LO7W+X7/QyjueC6Goz0yyLl1J8HAodt6uSP3q/jLLi4sAXv+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=Cf0/pCmYyiTnONp/zIv2CZ3f5xKUDz9NUDJI6WBXw9Y=; b=Vrki4P1uAAnvg49HVclCHnzmhAO3jr+Mz+072suVBH7l5BPVVt04e/pWPc2t95uMSOOJ5teRy0u2OngXzUqxdiIDjmWYc0/PWUp7TUNs8Czl5mpJgb5s1l3LEtxd3YXj3fDbfaC1kI6mTv7dPWe7/VgGASVcW6RcSAEkPcgXH+MgpwKpPcfO+OpMCDTm7sPo7Cmrq5A3IJ55x17L7q8pQSZHzw94Y+9Eeq+5PZf7b9xB5a8COmIO9nNwMcdeN/BSG19zKl8WiUluYQEwTBZVKC2HZvQQyD4M8yxyHTco1nq6zMRVDOme+hwF7L+C2gX91/eso6dcZqbLczMCs76Y/A== Received: from BN8PR04CA0050.namprd04.prod.outlook.com (2603:10b6:408:d4::24) by DM4PR12MB5841.namprd12.prod.outlook.com (2603:10b6:8:64::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Mon, 30 Jan 2023 13:20:36 +0000 Received: from BN8NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:408:d4:cafe::24) by BN8PR04CA0050.outlook.office365.com (2603:10b6:408:d4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 13:20:36 +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 BN8NAM11FT031.mail.protection.outlook.com (10.13.177.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 13:20:35 +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.36; Mon, 30 Jan 2023 05:20:23 -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; Mon, 30 Jan 2023 05:20:21 -0800 From: Rongwei Liu To: , , , CC: , Subject: [PATCH v3 03/11] net/mlx5: enable hws flex item create Date: Mon, 30 Jan 2023 15:19:52 +0200 Message-ID: <20230130132000.1715473-4-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230130132000.1715473-1-rongweil@nvidia.com> References: <3ba49f25-52d0-fe07-02e6-22a71e0fbe13@oktetlabs.ru> <20230130132000.1715473-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: 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: BN8NAM11FT031:EE_|DM4PR12MB5841:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d4d0b13-31da-4f8e-80da-08db02c4c5f8 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: oVaUYofK8dXr663M3DFA/iJZt5xQNOTlI2g7H12WiVfXy5Lm0RYdULdfh1aeiIefRNZJ0bvP9/SO11LgGJ7Hm/yJM3lTCAr+1UdjCpqMe+2R/RBVWVMX5ICiN9NqSMzT7ttvtTnZ+YnGJTl1gj+XjOq/4YspEordSXpoK9W4ohkiYJlyc3Zb/rG7y6OLN326YNFOj0qTrRp/sF7L9QS0rvgiGh2ka9GeRNP5PoFvzRnodspkA6dZZL5tV1cH26nQye+ziUyTVzBFO3mxX3QtwWoVAXQ6JiwVxDGq/jBEVmHfLzVE7ZK8k+ejcGbTsH4uscz0xajNB8yHBDy0ADQaG3QtLOfQdv/n1i2cv0erxEN81JI7COCd38l0YZXRv3CQu0bwLtKSu1TwmeR09lBGOXavxnWTGP6O1TC/+UN6SYNQnAKotjjsXYB0ES54C0fkNSQahqPe4hW6whJJWuwLL2LOnUMOfa36U6O5j5g7xMdz/0nefbp+GowyJKh/ZvrWZVDxJ4a4Xj7AdmAWtt6aHV762V+5/7R+psl2DVoKOoQ726fLOa7TlJUK6DxVtBEgFYAssA5u+9zGrMleM1oQ4ob7Zd8qe3dahgo5fl5MaBzKtN8Yr1LutZskg7oIcBPQ11J1lK+IRlmmOw9BW57SRuUXesAUXq+Th1xN8OkIeZv81aTHkVozj3YJ/dMP09jtSUJBQj922hzA4SDLjc8doQ== 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:(13230025)(4636009)(136003)(39860400002)(396003)(376002)(346002)(451199018)(36840700001)(40470700004)(46966006)(7636003)(2906002)(82740400003)(316002)(5660300002)(16526019)(186003)(6286002)(356005)(26005)(1076003)(36756003)(110136005)(40460700003)(54906003)(2616005)(6666004)(107886003)(82310400005)(55016003)(40480700001)(47076005)(7696005)(426003)(83380400001)(336012)(86362001)(478600001)(4326008)(8676002)(70206006)(70586007)(8936002)(36860700001)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 13:20:35.9425 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8d4d0b13-31da-4f8e-80da-08db02c4c5f8 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: BN8NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5841 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 952247d3cf..9406360a10 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -8340,6 +8340,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