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 C4CF8424B9; Mon, 30 Jan 2023 05:53:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20E5C427E9; Mon, 30 Jan 2023 05:53:51 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2045.outbound.protection.outlook.com [40.107.96.45]) by mails.dpdk.org (Postfix) with ESMTP id E32F740A8A for ; Mon, 30 Jan 2023 05:53:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mQeIBnorMt7tz0qo78QOzFvbuXlWp7oFGA8fNlZHDh8Qh+NUg4X8caNqsRFMWkCZNTLEBdiEOyA19AlQoob3XNNzVZB0ojEYceUtjkI4xBwOxJIQE9xMMzbbWcsNAN2bUyy04kz3SrXSVt/zwiQuiaoOSmeoCo1AOAmVQphSyFSkmL71ZJshYiL7dWPdiwao+JUxvjf+OzCqgvUDSq9W3NtgyghdiLcgAPak0y7Wmh005dCrMoadrPyl/AybPcMsX3aOXSvQirgeIl3nAWq8g2vP4J1qoqw2EKm3P8j1sjka7Q9QL/DuV8kYUuXiI4zizJ3ksbYkUd5FHwUM9gAKfw== 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=Gk7r+gEKVCCbzwjnVI2QsLO1euk/OqG34tBF3LiEt5ub7Yo8sXiLGYfE28lg26TJyh1mdg3Mn1iotzxS4tv1Vj+wmqkX8FsN5XjBgltgWmUVJKDdeEGH9MJag3oBa+K64KGRcfzI6osWUr+ldkWDCFaofkQxVYq38fj5Ua5Sjue8yQb9l4OqmvmXWQmTTRjGi3hlv+Cxe9EGdB3+hOFiZB0KhGmvXujYY/e/5Olb89d+kWuM00/XA+Xm0NvN1gsjsswQBoYGYDPHpQPF9ULuTyel/921qksxSxrxLwWD1MKbiNzWVvKNKX/cH8Z4WhzY8QDOVB2lzAdrdCwEbA2BMw== 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=dXOgvKFmV+OFakAEGVHjaMzbzmWdhuv/vlFMjWto6Y+/Q67HOBrh25L+lS2YeylywqyrAPxZ9KLT2PHfDkm437I5dJWNFY+uAuwHm1Om81S7OKMhr6jgo4M+yU8owNCRtJ6QuCNu0OeTZQnmaCCQPXfevwlzCJX3FJaxCkdWRQCX2gKgK3GjnB9tnbaKKSjwbbGU030OA+zHDXhTPC8xQOray+zuA5jXrtWaY8eL9GoTAlsCWAHBRlvYaWZDA+iGqNyxr2fnJjTEFm/UksBM5mVUFXOP4mKYYqn28XqGYFp/T8SoQboTXJN7/pMGWl9WgVAlJAR6t16+pfk5IIoMjA== Received: from MW4PR04CA0109.namprd04.prod.outlook.com (2603:10b6:303:83::24) by IA1PR12MB7733.namprd12.prod.outlook.com (2603:10b6:208:423::17) 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 04:53:45 +0000 Received: from CO1NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::e5) by MW4PR04CA0109.outlook.office365.com (2603:10b6:303:83::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 04:53:44 +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 CO1NAM11FT028.mail.protection.outlook.com (10.13.175.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22 via Frontend Transport; Mon, 30 Jan 2023 04:53: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; Sun, 29 Jan 2023 20:53:31 -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; Sun, 29 Jan 2023 20:53:29 -0800 From: Rongwei Liu To: , , , CC: , Subject: [PATCH v3 03/11] net/mlx5: enable hws flex item create Date: Mon, 30 Jan 2023 06:52:54 +0200 Message-ID: <20230130045302.1560006-4-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230130045302.1560006-1-rongweil@nvidia.com> References: <3ba49f25-52d0-fe07-02e6-22a71e0fbe13@oktetlabs.ru> <20230130045302.1560006-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: CO1NAM11FT028:EE_|IA1PR12MB7733:EE_ X-MS-Office365-Filtering-Correlation-Id: dea881d9-e377-4f4c-76c7-08db027df723 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: VtXUmlpC3+th2x8ET2/WX/xBjTccdXg+UcTsYkRHd7XFrdXHZRVozdsl6WDOb95tGFra7QxXDx6rr0yRXMyOb9mfCyDRZiNh2mbRftC4ObiK+Vy5BpWjsZMVUmFVzvV60UAGP6owXYKXqVt4wW0iCT0Ojxt6l3Sb0/gZWwQbOObfHEyvRwEZdPMzZQAiyREysJbCN9Oib+o3y2yvk/xRprnxBANT2K5lAXXaY/P0E+Z4LMAQfceeg0htGKzY6/5f8R0divJYy0KQd5uwBKwp4v9tyEsSRpbTXgZcWvou2OEl8xrrzxs4+IWR8w4vyBpH4c8EOLz3AU5X5DIdLToRAaS6RbcztCREVpkMMQ14absPd9rV0bmNv+sQYL4sF6syi9utw2gWopGxCZj89nqmbFeUQiEFQxMILplTE9S9MS6DaN/NP4dK/wE0aEzfk9cYrg2Y8Wz/Wll4DIa+9s6r1or7z1v+D0EgTNb0PP0E1h0E36sjbcHJSv9yn83hnGTKjYhO1zJlyp0udVustQEOAFqbGPqKSqLNVtbh2OJawU/QRopM/Ab7hB4ds+V7mIgmWJ682UVobwt5DqOgKc2AtEAZJAomnl0rcYVGqPebLCn1MHCECAM2RtZ0RlS2m/5w0zzJeNkZ9c2cGknDxNXQKRJCskkz8ZDmPiotMPvJlCSkjcMbgu9VwSKD29WFgLaNQHcLUA8CNUHy4hzhm+3vqA== 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)(136003)(346002)(376002)(396003)(451199018)(40470700004)(36840700001)(46966006)(82310400005)(2906002)(5660300002)(86362001)(47076005)(336012)(6286002)(426003)(83380400001)(8936002)(40460700003)(41300700001)(356005)(36756003)(478600001)(1076003)(26005)(6666004)(7696005)(186003)(107886003)(55016003)(82740400003)(2616005)(36860700001)(7636003)(70586007)(70206006)(4326008)(8676002)(40480700001)(54906003)(16526019)(110136005)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 04:53:44.1958 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dea881d9-e377-4f4c-76c7-08db027df723 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: CO1NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7733 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