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 82FE941D3B; Wed, 22 Feb 2023 10:37:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74EFE42D86; Wed, 22 Feb 2023 10:37:48 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id DE90542D86 for ; Wed, 22 Feb 2023 10:37:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K0O+lcwGZ2qRIS+CCLzjhV94W9wd25ELzxicpX/7cPxgxTjlEHtI3dCtvlyW94mgm982gWsY4i97Vo/pyalG4pRcuZfZ4/WF52nxD9IEL/4YW9Ay2b8zYgqnZ+wOJt4Cng8BlmEdTrTh6fYEPB/DFFEO7kwPQ0nEXvEBCNiMaFrI7jNEtajXSn/2LihkOvif1ua9KUn5cJRXJ8xrem/wjyJzAMO4rx8NtdedWClCljYGe810IeeuoQOX9Dao0cV2kvpM4L7BBDRScXfG8ku/2mJY29RxcW/brlu3ovVJp4JXSsXFEB4IWJIj0AP7e+X/nmqfiGYbBzfMdxYF0pTCRg== 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=kgIkk/rviUm8PK3PcYwIGxTq4NxTdo5L1gYhFpYXwdV9FgqmjP+hngKtdZdvGrxJM0sMtR1KsBLlrS92VJn/iuSLcyWNSZcAkN415jC1+1qCHCbkj8rZfS5SReTJUl6xrzjf8Lit5TxjW+sR5XAlVC+Avem1vsuU/4o+c1Vb/VJLQntKcteJxJOXa6DQJGsBrYZUk8Nrlg15/9d2pWH54T2i4xhFpb9x4BkWVs24mh/XYl8fj6q1kpzWFeBrevDEhKaM/CCNqzWobbv2QSu6Q15IsaPBdSZYXtt52tFwu+E3JS+Yh77T65zQQmjJrlooWc/8+0aV1Uru2Nc1fveedg== 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=pUuLdGhbVLLEu4/Ctlqj4z8vYJpqvuqjbOE+sM0ljScXWW9AcKurpz4DNqO638QVs7FyiPGmQ+BHvsUV0oA2IH6dS39zKB5bnocV4cWTbhfPJmLr55ACNobcSmhFr3WzFqZvNRKnR8uyN0olrBAUumBTSGoeigRzfiPKabyveSb94jLnO02l5+cOo741NUF7ehT7rOLdtV+zDoaLyfQBgYD+ALb3JW6ZXB3wccgiEeQhf5El1wEM79713epKVwxtXgFnJidM8J3VrGScHC4ft8rc4WWAzLVKmuqeiQ+N5n87UUhmbmHxZvP0MKTLE9tvOIOBXqJ9O9Gx4OuE59iQLA== Received: from MW4PR03CA0144.namprd03.prod.outlook.com (2603:10b6:303:8c::29) by CY5PR12MB6108.namprd12.prod.outlook.com (2603:10b6:930:27::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Wed, 22 Feb 2023 09:37:45 +0000 Received: from CO1NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8c:cafe::79) by MW4PR03CA0144.outlook.office365.com (2603:10b6:303:8c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.19 via Frontend Transport; Wed, 22 Feb 2023 09:37:45 +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 CO1NAM11FT033.mail.protection.outlook.com (10.13.174.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.20 via Frontend Transport; Wed, 22 Feb 2023 09:37:44 +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 01:37:33 -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 01:37:31 -0800 From: Rongwei Liu To: , , , , CC: Subject: [PATCH v2 1/6] net/mlx5: enable hws flex item create Date: Wed, 22 Feb 2023 11:37:10 +0200 Message-ID: <20230222093715.740279-2-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230222093715.740279-1-rongweil@nvidia.com> References: <20230215115251.3924578-7-rongweil@nvidia.com> <20230222093715.740279-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: 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: CO1NAM11FT033:EE_|CY5PR12MB6108:EE_ X-MS-Office365-Filtering-Correlation-Id: fe2372fb-6e0c-4b5e-b535-08db14b873b6 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: lu3h3OdytbaCY5sAz8xs8AXg5f07EHfgyOJ17gvv0iUWUSDLE9qJLhZiNDjPW4xhdDqnN/IRvuKMEUs2dQLgE7Sxuqg7ge4J/z3TGSP0c6LOd7tdw4ibHNd+o2QTnJvIK5DaUAcZmtii0jhgqLqxzLLLLzmoL8oxF9Hq52d2/5QCD6YcqjiK/IpfIIs66B5e0/UQSPUHbS64RVPzxVwagv5fJlbxHq8QJFsfeVIwZ1scT8LUJkpDVjUB0quMqAMBFXtKjdY6S591lWDfHxEmXjzygGi1QHkU2jq9Q1RvOQ6oZ4hCaJRdoJ6Y10LTB4Djar+XamRTVPQCByU0h3fc8QSxygPsZmTdL3Doj78Yjuk0cuy1FXV1gA7EHnjBlyANrntrfGTCyGHkXtQmHiJTYJf7YomiT1PEWia/lP/crDTyTMDjeH4HFCTeugs0REaQqOu9jhQxv+3oNtk7bVF/qq3H81Vc+uu8MpfWK/X9ukVZwKwNhoZVFf2wSpqKwYsmllmFJ0TAFVPiiiKciZPnF8CM8QCsJv6Cn3MomyStDA6FseJ2h7z6m7zClCNOR4XFZXaGhLCC4C7FS0fPZTsk3i8+fzuUEXzmLPoBT+pGwhHHF5sryvS9rUZC1eQ6fNLdUcX9nTQkGoMBz3uQdS4mQtVD2NTMY0SZTZsTsMrna6ZrgKLb8WjNkQ+EDQV/0iWNNgsJpLAfPErTVtw64Vbm98jjHvgzBVGSO0f0Nr9oxTI= 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)(136003)(396003)(451199018)(40470700004)(46966006)(36840700001)(40480700001)(110136005)(2906002)(336012)(426003)(47076005)(2616005)(478600001)(40460700003)(55016003)(8936002)(36756003)(7636003)(316002)(5660300002)(107886003)(41300700001)(7696005)(36860700001)(1076003)(34020700004)(8676002)(4326008)(70206006)(70586007)(6286002)(26005)(186003)(82310400005)(86362001)(356005)(83380400001)(6666004)(16526019)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2023 09:37:44.9386 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe2372fb-6e0c-4b5e-b535-08db14b873b6 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: CO1NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6108 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