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 29054A0543 for ; Tue, 21 Jun 2022 10:03:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A0E840151; Tue, 21 Jun 2022 10:03:32 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2072.outbound.protection.outlook.com [40.107.237.72]) by mails.dpdk.org (Postfix) with ESMTP id 2EC5440151 for ; Tue, 21 Jun 2022 10:03:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TPKKkjMrP87Ghr0rYVvEvDXOZXC0ys2fIUQckxNmlq9cmKCRGUUGYC+YQjal6/UmEjkpkVhn7Cy1xEEuKiEBEXo4sVFqy+pfqNFP3MB3+J6EbFs+71V2zpQ4DXg8RzduWEZhdP/1W3VXZkI/0XR8X0bs/Az/s6t/TeNI9sBahIyuznN0PutkzFW68uq+VoPkXmQkPuyNm0HO8ZZxi42CkddFepBRVTZwd6ylSxITrCIN/OOrXgKfg/NATzqS+4WzPJx/0oXD1s8vWfWHOq3qixbJ8IDeSrdX3G28Hm4bN2/3kx1bzjnqhtsEILosAl9ozVtKHtVkzngSrieMWTSijA== 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=UYQNu9dK14kf8IZpwBVh+RQERbxeoetKHQPwx4wTNTE=; b=aRYv7J77c3NoNIVnDuEohxALfuhAWaSqA3pdbq79RITXowhMSOdAgdfQkju3fSqwXc4fA1nqaT6+RLa/8qQcjXO/UWmi1upW1jsFOF64uObRt2j4e6qsuvtGWvhtLxnbqPLX1eot8naSmvuqnFmigwYNsNGD1BUKdsMRKkrOS88lxG+Rv2tOc3/9lzezkOKIbr7pHACgDj1TUyfDeumETa04QKC2bq2j00VyRWUxqXS5xwwgvS4cUBXhS4WJIq0eI93+6xIofRmL39E4lRABcnkZT/Ln6sV7G0fhXUumRMp+OMnGLWywwwnLX325j8GbTKbhc9z9UDaya5kaxy9paA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) 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=UYQNu9dK14kf8IZpwBVh+RQERbxeoetKHQPwx4wTNTE=; b=fyYwPS9Y/z/XTcsF1Qw/JZ+ZsroZzrxV9ddxLgIfPDuV4Slcb2/7MHtAnpuglg2R2CqouGHBYDdH9oD3whL/x78KvVW8GCKzkhDLrEmAB1j0R5sStpKLeG9UeP7Hpcpgm4s9W/cZrKnU1rYESedCH6/0C6yadc+iUz8fS2I745igefWpoD+oQlW/vHCHqGNnVzINocbItVgYyJFb2ZIuTE+mjcH7NI9rkaeE4RWu48HY3gw6dJrLdbSh3VTqlgeyrjXYjumj7k8bwG8JETGPfD0tKndV37M6D8qFQF7OG7hy7qjim3FlYgoc0VaZYvZQKefWN+y9HMoihHFf0mfjZw== Received: from DM5PR2201CA0005.namprd22.prod.outlook.com (2603:10b6:4:14::15) by BYAPR12MB2981.namprd12.prod.outlook.com (2603:10b6:a03:de::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.18; Tue, 21 Jun 2022 08:03:28 +0000 Received: from DM6NAM11FT044.eop-nam11.prod.protection.outlook.com (2603:10b6:4:14:cafe::c1) by DM5PR2201CA0005.outlook.office365.com (2603:10b6:4:14::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.22 via Frontend Transport; Tue, 21 Jun 2022 08:03:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT044.mail.protection.outlook.com (10.13.173.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:03:28 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:03:22 +0000 Received: from nvidia.com (10.126.230.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.986.22; Tue, 21 Jun 2022 01:03:20 -0700 From: Xueming Li To: Tyler Retzlaff CC: Dmitry Kozlyuk , dpdk stable Subject: patch 'eal/windows: fix data race when creating threads' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:01:09 +0300 Message-ID: <20220621080301.2315720-4-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aa0cf01d-6b66-47db-6f92-08da535c867e X-MS-TrafficTypeDiagnostic: BYAPR12MB2981:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N+d6K6d5G/uT3DcpwVRz+bH4UbDhHH0RE6ebdjYF48hKgMDIibRLATW7DuHJwlpYYOB5vSY0RupD/9/1rej3OaUJsBeaIm8FNq442mtYk2D7Snok9PGEy7ctj0AqnnyeX86LFiRH1eZiqELb2Rdu9jrjf+UylCYJGs9BOxB+h/UTMbdmorP1ZY2wJ7ALFtVjGzyip0zuPDL0F8Y/WAlNMmiRxBN87EV1e+/rzeIkpV+AVyjSCrLyTbk+V0YdYf2o/1B62rmJZuJgsNZhh3j2OaT41TLBfDZfQLFCqp92pbrIEwrCt6zcSAcRmkdmzjncfw64QUBOMf1WACJ6o9Mf+gKumAdgiWgk7xj093NwwXIPwJqEUiawpKAQ7P40s8x8KHbIpoxGhMd+ZlK1giw83tLk26SzaiPY/kX32IRFb8+Ar3Ftypa6qqpltI48TXM6JxLa2btlTWo74Ek1aUY7mZEusuCk4mO/ycFnGtoSyxwFZMgwUerIXQ2tqVCb0M8u+yte2qLvQkNdwjZRLzg9vgxTYJb6o1NGZNYsrO55v1kZWK4G7XDm4yMYfTin6Yv7i3VIpsreOJyvsh2zl2+7uGClbDnT0uuBr3Du78tAex3JCxc/5PK3CTYsLYn7hVXS7R11wKjJGE5BSKi1yijZ1CrbLVF8sSrFTu9GtsMNEPaHETQkuW3H7UTwBRmYGboEZuZajaJvEqeyGQelQcALKy4CF+GHtqXbfKyp1TmQBA1dMaP8Orzqzu0kbkG/0wqtODxHGNWLaUJsjoO2M5hRh6O9Mb8BaKFjKpkGOq97Y6hcj2i2/wCrozeIn9v1Ek1kAOkYvmWieQXgLrnWNNuN9PMuQzDsVMFzN+QzjClrWB0= X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(376002)(346002)(396003)(136003)(46966006)(40470700004)(36840700001)(6666004)(2616005)(966005)(4326008)(478600001)(70206006)(6916009)(8676002)(186003)(16526019)(1076003)(36756003)(47076005)(41300700001)(83380400001)(54906003)(70586007)(8936002)(426003)(82310400005)(336012)(316002)(6286002)(40460700003)(356005)(82740400003)(5660300002)(40480700001)(55016003)(26005)(7696005)(53546011)(86362001)(2906002)(81166007)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:03:28.3782 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa0cf01d-6b66-47db-6f92-08da535c867e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT044.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2981 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/23/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/5888f84ccdd65e87ec47082aac86a5a699efe9eb Thanks. Xueming Li --- >From 5888f84ccdd65e87ec47082aac86a5a699efe9eb Mon Sep 17 00:00:00 2001 From: Tyler Retzlaff Date: Wed, 9 Mar 2022 23:35:08 -0800 Subject: [PATCH] eal/windows: fix data race when creating threads Cc: Xueming Li [ upstream commit e4e983b975df700474309605b6adb5f2c6d83e2f ] eal_thread_loop() uses lcore_config[i].thread_id, which is stored upon the return from CreateThread(). Per documentation, eal_thread_loop() can start before CreateThread() returns and the ID is stored. Create lcore worker threads suspended and then subsequently resume to allow &lcore_config[i].thread_id be stored before eal_thread_loop execution. Fixes: 53ffd9f080fc ("eal/windows: add minimum viable code") Signed-off-by: Tyler Retzlaff Acked-by: Dmitry Kozlyuk --- lib/librte_eal/windows/eal_thread.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c index df1df5d02c..b40498c0d6 100644 --- a/lib/librte_eal/windows/eal_thread.c +++ b/lib/librte_eal/windows/eal_thread.c @@ -132,13 +132,18 @@ eal_thread_create(pthread_t *thread) th = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)(ULONG_PTR)eal_thread_loop, - NULL, 0, (LPDWORD)thread); + NULL, CREATE_SUSPENDED, (LPDWORD)thread); if (!th) return -1; SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); SetThreadPriority(th, THREAD_PRIORITY_NORMAL); + if (ResumeThread(th) == (DWORD)-1) { + (void)CloseHandle(th); + return -1; + } + return 0; } -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:49.448484905 +0800 +++ 0003-eal-windows-fix-data-race-when-creating-threads.patch 2022-06-21 15:37:48.954450956 +0800 @@ -1 +1 @@ -From e4e983b975df700474309605b6adb5f2c6d83e2f Mon Sep 17 00:00:00 2001 +From 5888f84ccdd65e87ec47082aac86a5a699efe9eb Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit e4e983b975df700474309605b6adb5f2c6d83e2f ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ - lib/eal/windows/eal_thread.c | 7 ++++++- + lib/librte_eal/windows/eal_thread.c | 7 ++++++- @@ -24,5 +26,5 @@ -diff --git a/lib/eal/windows/eal_thread.c b/lib/eal/windows/eal_thread.c -index 54fa93fa62..ff84cb42af 100644 ---- a/lib/eal/windows/eal_thread.c -+++ b/lib/eal/windows/eal_thread.c -@@ -150,13 +150,18 @@ eal_thread_create(pthread_t *thread) +diff --git a/lib/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c +index df1df5d02c..b40498c0d6 100644 +--- a/lib/librte_eal/windows/eal_thread.c ++++ b/lib/librte_eal/windows/eal_thread.c +@@ -132,13 +132,18 @@ eal_thread_create(pthread_t *thread)