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 87AE245B5A; Thu, 17 Oct 2024 09:59:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF43F40698; Thu, 17 Oct 2024 09:58:32 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2089.outbound.protection.outlook.com [40.107.93.89]) by mails.dpdk.org (Postfix) with ESMTP id E838F4067E for ; Thu, 17 Oct 2024 09:58:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Jp/0kPMmva1ZfgkndwgbNsIsC6q8jB5LQRoLFyZDJ0zHOcQv9kJ3wjLczP5QkWXadFjObdi/MtSPTCYwcfPARnzp2jWFEFiljpk0FynmysSazhPHSYSxPWW4Zvse108IHSP5bbrQOicWkedTs16EMYEsG51QWGbWjxSWZm8qzMSJuqT4bEXqXTxEdgYhDVs2N9/V5Hg/rgXKwzZVSWSaoDEGjEIQ2a68U6eDi5NTmZ6tqquzP1eBAk/TvWYD1NFSNhuG+p31+M14o/+igifa+E5kdHnoRbcVpNU33sAdadiFBbOmGLrbirUqKZwpUk+lfprmfxVJfAT5MUmYHDnt1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=4kLjP4UFCopu4fMsAQ0Rn+WdO9FPTuVDetJSyp3n7uY=; b=NFro6CG9rAWmHj0P99wzMKBVu33Z5s4uEpBmfFm2DVMXrfaa5VzRJrOFHL0I7HAacgtxKt8LmfmW2VO1SUlWg6fLkxPFzxYis/Se+F5INFOl+UVhppE5GXGRNm17fxdQBy1Watiyjmq8fM9DPiu56rjVinGroMLM7eeAuxDXkn7NYfcfCLVnvTDip8ic2loTV5/sSk3p9X707Bdh8PmIqRQMS3GuCFbliNwu6LN4x4Uv756EhVxxMHpsYx2ZFcYmYVeLxdNp2xhgPcZB3NJeHr+jJd3iWLyMGd0Y3XlJgswlnRvMdeKymeTq4JfnSAOzkbFnZlQaxiayTp8AWsjgZw== 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 (0) 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=4kLjP4UFCopu4fMsAQ0Rn+WdO9FPTuVDetJSyp3n7uY=; b=prVyLgvd8rzCTKYvV2hFNwj3nJu5mVtDVYj0wo9yrc9ufdxNqg2wFG9d1SPZmKmBNAL6Dobu2qZnoVWo+O3v3NZEABNEM4sWE7nqsM8IRkqJ8yo/dh2d6jh7iEfW6qWDiOOxLH4KtPMPGazTlY+NoE9OvKhO+t5GdERdEwHPuzkfKePmSpPCjR0S2s3LRngelV4bgJLYGMJJHuTWd1b4T2TSoK8IpZYaXyCqtgF5xlqhHHsbnBPtHpqPr5X8YF/pkno701m/cKYC5wErh2ygM6h5nf4ebosvHmHB20elkzqJVu4NHe2W7hwDzUgwO1ZCrcoWJOWKKxZQlYfJBf0qBg== Received: from SN6PR01CA0002.prod.exchangelabs.com (2603:10b6:805:b6::15) by IA0PR12MB9045.namprd12.prod.outlook.com (2603:10b6:208:406::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Thu, 17 Oct 2024 07:58:27 +0000 Received: from SA2PEPF000015CD.namprd03.prod.outlook.com (2603:10b6:805:b6:cafe::90) by SN6PR01CA0002.outlook.office365.com (2603:10b6:805:b6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.34 via Frontend Transport; Thu, 17 Oct 2024 07:58:27 +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 SA2PEPF000015CD.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Thu, 17 Oct 2024 07:58:27 +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.1544.4; Thu, 17 Oct 2024 00:58:12 -0700 Received: from nvidia.com (10.126.231.35) 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.1544.4; Thu, 17 Oct 2024 00:58:10 -0700 From: Dariusz Sosnowski To: Viacheslav Ovsiienko , Bing Zhao , Ori Kam , Suanming Mou , Matan Azrad CC: Subject: [PATCH 06/10] net/mlx5: shared init of control flow rules Date: Thu, 17 Oct 2024 09:57:34 +0200 Message-ID: <20241017075738.190064-7-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241017075738.190064-1-dsosnowski@nvidia.com> References: <20241017075738.190064-1-dsosnowski@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] 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: SA2PEPF000015CD:EE_|IA0PR12MB9045:EE_ X-MS-Office365-Filtering-Correlation-Id: 81b681d7-a3fe-4b0a-e2e8-08dcee817bbe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?qhFdHF8p64qcCKRzn72budnrrDTWkws/26N2q4ZuBlG7iFbpCduuM0HhpQ1p?= =?us-ascii?Q?r9vEhqP6fbYPsqTpG/a45C7eiQL+bFGxsHngUMBkIc9DQVFunMP0xo2jq0kk?= =?us-ascii?Q?FeWh008YoXjqEIZ0/2lYD7lGv4TckSi0v8vWJAbNyMms+jPcuYePl65aXsde?= =?us-ascii?Q?88g2N3AfQ4RiHgkxMQxiJ5H9BeNJ7s/TYqwukckot7XAYv+Qvg7C33q6SrcE?= =?us-ascii?Q?s9WxNmHiMdHzDk0pyAH5NmJBjHl/tBrWZ69OEpfHl2h6NXZQYiB7kzyRhRfp?= =?us-ascii?Q?5kzy+OdXeDk1B0VJclQrXmIkdKvtOqLFV/8snzC5Qm+GEy2q5nLayDHqAf1A?= =?us-ascii?Q?g01iK+sHLQgij9xg/yVZ7z4RBAPF9+4QJBQyFcIdaM7mjby/A1Bi+EK2YgwL?= =?us-ascii?Q?lTW/2ueWPKQQECBQTXiuo81jodB0RBoIxOuyVRQKXdgjHZh2XPISpAU4RLlZ?= =?us-ascii?Q?5HImG3duL1KUHr1R5k07B+zTSZBR3r4X/CxbQ15auKBHASw3l/KFuI586w9U?= =?us-ascii?Q?D90tk6W3KMCPI9TVPKXB/fXoB+TsgXXfSrgZkm+BliAu9JpxGOvSZUdO3csS?= =?us-ascii?Q?+DKb2Gr4o1tVntFfFj71usahBoGb6kJAmLbTOZjQJkmFHz78nuu9xB4pY5Uv?= =?us-ascii?Q?FDu4UzeWazvOcmf46BLWzMexc1wNAxftB9hiq74oF+hCgxHBe4rNuRloy29T?= =?us-ascii?Q?7iQoCJqlBiTosbDycD2AWhXrKV9KSie+190q827Gkj3aOTFDtiiLshOQe+lN?= =?us-ascii?Q?HTN4YmepxsDoFaTQUKSpK7V0/eC8Eq6mJ7U96ZKMQPvynoWi4w63n1sWFzlP?= =?us-ascii?Q?C7rDqU3iyd7R0deU9GnNM7iI1TO3GYZ4gwImvq9oeDcPfYV+Ic7JE/PnbGx9?= =?us-ascii?Q?mtqN7gqdESlsrpAqfnvL5N5CA8VmNlED0JTtFGsnGet4MRfKEVFSqlpg1EyS?= =?us-ascii?Q?UuOIcW0Kr6pCtj7C0dmimH6s4olSZUYPQFWzJaCHCvbq1cCrXrgS43ausb0q?= =?us-ascii?Q?ks4N0LdO4T8y3m3hz2sWURVOfn3aB0lj02EbPuY6fCOfGKOavhpDxndl28jq?= =?us-ascii?Q?OAvG4rLPCJ5a4LydvYYehQksKU/XLnrhg4pc336FGxqis+s8lG1K0Wq0PCTs?= =?us-ascii?Q?HkxkU59zmz7ce8o0VkN5eEOaFAe51AmdKV/UOBY7DubswGd4OpqK0Ouzl6Ra?= =?us-ascii?Q?JzQFp4/lXpz0L6kWg+8maFevyEHDfzFAyiunyJtoIejW2brI+JZy9oy7OR2M?= =?us-ascii?Q?dQ7x6togaoPbuiLumrnzN4VK138sZ2hJh6ZatnCgzG4SDhpi2wXKSFPL9OtX?= =?us-ascii?Q?zflF70RdDQyyCeFLkkS8EvSCnW19iVv8SqB7c4QLbiuWAlkbWqrYTlSMct1y?= =?us-ascii?Q?5MbKxD1r2WL70piVAi52L4BH+lTMw2QOlLZYGu0kMUIJ9o0t5Q=3D=3D?= 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:(13230040)(1800799024)(82310400026)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2024 07:58:27.2660 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81b681d7-a3fe-4b0a-e2e8-08dcee817bbe 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: SA2PEPF000015CD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB9045 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 Control flow rules lists and control flow rule lock can be reused between all flow engines, but their initialization was done in flow_hw_configure() implementation. This patch moves it to mlx5_dev_spawn(), which is called for Verbs, DV and HWS flow engines. Signed-off-by: Dariusz Sosnowski --- drivers/net/mlx5/linux/mlx5_os.c | 3 +++ drivers/net/mlx5/mlx5_flow_hw.c | 3 --- drivers/net/mlx5/windows/mlx5_os.c | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 0a8de88759..c8d7fdb8dd 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1701,6 +1701,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, (sh->config.dv_flow_en == 1 && mlx5_flow_discover_ipv6_tc_support(eth_dev))) sh->phdev->config.ipv6_tc_fallback = MLX5_IPV6_TC_FALLBACK; } + rte_spinlock_init(&priv->hw_ctrl_lock); + LIST_INIT(&priv->hw_ctrl_flows); + LIST_INIT(&priv->hw_ext_ctrl_flows); if (priv->sh->config.dv_flow_en == 2) { #ifdef HAVE_MLX5_HWS_SUPPORT if (priv->sh->config.dv_esw_en) { diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 0d8224b8de..9ab66f5929 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -11832,9 +11832,6 @@ __flow_hw_configure(struct rte_eth_dev *dev, if (!priv->dr_ctx) goto err; priv->nb_queue = nb_q_updated; - rte_spinlock_init(&priv->hw_ctrl_lock); - LIST_INIT(&priv->hw_ctrl_flows); - LIST_INIT(&priv->hw_ext_ctrl_flows); ret = flow_hw_action_template_drop_init(dev, error); if (ret) goto err; diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index 0ebd233595..80f1679388 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -600,6 +600,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, } mlx5_flow_counter_mode_config(eth_dev); mlx5_queue_counter_id_prepare(eth_dev); + rte_spinlock_init(&priv->hw_ctrl_lock); + LIST_INIT(&priv->hw_ctrl_flows); + LIST_INIT(&priv->hw_ext_ctrl_flows); return eth_dev; error: if (priv) { -- 2.39.5