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 A487941CA5; Wed, 15 Feb 2023 12:53:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F14AB43025; Wed, 15 Feb 2023 12:53:19 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2064.outbound.protection.outlook.com [40.107.223.64]) by mails.dpdk.org (Postfix) with ESMTP id 9C9BC410DD for ; Wed, 15 Feb 2023 12:53:17 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JRQN3zc7ovxHzvKVFl34RD2D1/C21y7KtDQ9gqvBAXV7zBaJKn/SwnF+vIcetZjY28vxOLaj6fcGJMZTwkfi7mmqw9tV6p7wxpAC98bgW6XZ/FWqMfiwQAJEedV4uRADnbVC4wiwM0Zjn6dY0exxe1v3zj+a4WlUPL2W2J9xDwyTZDrQMrMDPyojgdbPjRlfElJ0O+mO8EYZnN42lkGtSvoIRtUxO/eDn/WGFRJjUJ1AlsiVYnfQrCLpsWFyCQf6Jk1/hsJzTSfprRmoST3uUGmJbcVQVmtO3aty1IPeJtvPxbQC7Yud2wRbrQBV25JiHnwr332xSlSAgkPtBftdTA== 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=qZYyy7Q2HnIjwFiL47R+fvXasrb72R7UMTfQy3Zq4Q8=; b=TISw3jp2ZC8zOsE0DMEsERVFoUzXZMRPfznmrA+r31vtb5jHQ+kR1lcqTCExFNnvUUGupZzOAs6zcBotndwqjePfQF4Ca27JnTF26epV01HG4+zrS0DPtWMKcesDSBujvSyoytYj1np85hUi5CM4Uc/i4ChqNIfHvJJdkJ92ba+K3+r2a/3xFKgto1HwDqk3ZpGSEE1x/JCpBCHKS7s0ZAdLVuUFr7K6/e3XpMJ9m8UUM7YK0GRWrvhjhhOs8gXSrddqt4XG549mysA9x1CUPdd7KtMwedhXYtbB2ZP4llWnAfJ7xvCZuvdMD96qjWPvtZuwK0JcXg6MqzzMpXLFwA== 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=qZYyy7Q2HnIjwFiL47R+fvXasrb72R7UMTfQy3Zq4Q8=; b=Ypb0e97BOOGLNdEsUN/vBtCmu7rNSFudWsOiB/62i7+tfpkCYl0YR6t3BHsl8lhwmV+TyjG7dwceksOu1jkBfVmMoL65w6aup5vtKAqEPLVPV1AYS8bP27zbXQMLEN1pi4Rq+6EOdLpoGKt9romt9PNhjNp8vOQ4rNnu4st+4fLZoyyiYLJ4cWATv79NUUL5sf29LDhTp1kUuK2v8gsgveQiYAr6b52x46esC11GNICHsAZP6JssqHpFhOIo/g7dlsMdSs7dcBPTyXVkNaEIRQa1cVTFTvzxVbAOpkPmcMyUqfS7abXFlw/qd5KE6fQElr7JXtr/uMzhPfkTnIRb1g== Received: from BN0PR04CA0166.namprd04.prod.outlook.com (2603:10b6:408:eb::21) by LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24; Wed, 15 Feb 2023 11:53:16 +0000 Received: from BN8NAM11FT083.eop-nam11.prod.protection.outlook.com (2603:10b6:408:eb:cafe::f5) by BN0PR04CA0166.outlook.office365.com (2603:10b6:408:eb::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26 via Frontend Transport; Wed, 15 Feb 2023 11:53:16 +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 BN8NAM11FT083.mail.protection.outlook.com (10.13.177.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.12 via Frontend Transport; Wed, 15 Feb 2023 11:53:15 +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; Wed, 15 Feb 2023 03:53:09 -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, 15 Feb 2023 03:53:07 -0800 From: Rongwei Liu To: , , , , CC: Subject: [PATCH v1 1/6] net/mlx5: enable hws flex item create Date: Wed, 15 Feb 2023 13:52:46 +0200 Message-ID: <20230215115251.3924578-2-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230215115251.3924578-1-rongweil@nvidia.com> References: <20230215115251.3924578-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: BN8NAM11FT083:EE_|LV2PR12MB5990:EE_ X-MS-Office365-Filtering-Correlation-Id: 36de8abb-b6a1-49bb-6c12-08db0f4b3936 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: 30U/Dns2Z/ngF5iNH+fOjddXSVpH+901NCAUyxIyucmSvndOZtihGGolZvc+ITfXwuZ820mqkK0slNspRYtjAMhwWEeCPGIyTuHJCAtW7+153RCNjje2C+oFKH3lE5mRwaS1GD8wOaiccUI63EZmHpSLK704wdv0+ZR1ctr3X60cPHgaO9Pvcj4WdKXTLUTK73O8A1V5Ml+WX3G0SUVepkCqrmDy0NGNjUWkl75+Wb5IguAR1u0OzUMwHmNKQuEKdWC74a1bO8xX6WifFX8t5AiiAU9RkYcHfu5cr7QygUM1GhKnnAHYU4f+QUe3geZ9Dg0vBCRxeFfqhkoTCv5t0AP2y1P08eJDS576KTGxOgt3J03jaaoADnF8JYUdBudIxqwDtdhdP4zennnnZWZpExz8G/Uuv1cd+zBS0itxiRrsAC+zScQnPPbcm8r5W5TdjCg4JGb8N0y4+xd+YiCVHiMVeSyf9+lbxLZwTSXx1h+09TlW6rNd+WJbv6M2dbmOpm5ypZ/p91xkoOYaHckjBvjkRiThPTigxKhefnhpWOiwJiG90dDP3PtNLZj17u7OxegtisEdQ873VAObWZ5NHv3jGTNfJh94WUzIpagbI7QtgrXUIAszFCkw7MmHEZ1SSlx9WuwPwqRVBcKhJ8k/n6uL1XMHGLBwXoS4AYbJTxBPmEnxavAzXMKgozYlKxenx6Tuj/ZHjbhYtJCtC2kwqQ== 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)(39860400002)(346002)(136003)(396003)(376002)(451199018)(36840700001)(40470700004)(46966006)(40480700001)(83380400001)(316002)(110136005)(55016003)(41300700001)(36756003)(40460700003)(5660300002)(478600001)(7636003)(36860700001)(8936002)(107886003)(426003)(7696005)(82310400005)(70206006)(47076005)(70586007)(336012)(356005)(2906002)(2616005)(16526019)(186003)(6286002)(86362001)(82740400003)(1076003)(26005)(4326008)(8676002)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2023 11:53:15.7857 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36de8abb-b6a1-49bb-6c12-08db0f4b3936 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: BN8NAM11FT083.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5990 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 6799b8a89f..b1d5b47900 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -8361,6 +8361,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