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 C63E341D8D for ; Mon, 27 Feb 2023 08:17:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C002341153; Mon, 27 Feb 2023 08:17:22 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2063.outbound.protection.outlook.com [40.107.93.63]) by mails.dpdk.org (Postfix) with ESMTP id 5827C40ED6 for ; Mon, 27 Feb 2023 08:17:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nKnYAUVD8+Eh0YE7uB5TWB7nA+PRH78eYh2K67lyUvLcFZHokaxTJCu3KUoUpSd/upf47V3PQeTl5AeER4FGCEg2n1fVBEp4oeAQSfd0IEB4p5hJ932fQz0qcHZdhl8OTjvjn8KJCqy14Ydg/hAiHyzYZwn4vRcUizmlZTaNLnCmtAJ0x6tNSklyXSUCbT0oT2qGBPCuaYmUIPinHD9ACXVRvLqKVXJDrz0CMvVIivEuymGDkgTlSZn8NDIkBZH9uhU/GmpdqvHGGfW2yLHKc3t+h/aABhgRzihkipZHJI7ButIu3ERjXj73Cwxw9Aa9Zf6ZSvh0SOu6v8M8p1ECNg== 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=srI9Q89NFZhfiUkyurzoFNp/XFJa195ejGo/gJKP0qI=; b=X2M3uZSNbcfW2+v5CgtGpbc/jC9WC04EX1rURCum0ZFBbi7cXNdqi7zakOrYNnA6myQl5PoK36MVz5lYwgnVhIuCdjC9O849eFZjs90TC7BuLEteUxeeSUD6h7QSb4HOw2MgbXgKXDBosj6hD6OfFHBpL7s7sOmkWM7MjeN8rPXOyf4/+u5VVB6ZLoYNoxwoMii43n237hKbjIH5zeInc8lZdvTdnDMMVTYn3eCYmWCPqa2eGPvIoTaDMHXrM15RCrCpVco4CQyGwftdqL2N7YVO0UkFyuX8+jzpt8OBf4jIsv93VN8CQSu1kg8Rs5ozTrrK60HBLGzcmFJHI0zytg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=huawei.com 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=srI9Q89NFZhfiUkyurzoFNp/XFJa195ejGo/gJKP0qI=; b=MWiPDjbo67NjOTGnxMpn49BlCOvwlS+xTPC6OKl8RODleyztuedMPzUogoWKY0vEJwWXwpD1Q/3Z1zaij2zPgJRXQNEBkcnCK3CnA6fYB25l6DAs0s4Dmv9QcZHGKMYAVHEMGpVqH94x4a/gli2x5MdeXzU8k8MkYndJf+ztxpU7GdclbzMxKzOvZcFtGBYyJxiMNJYpZUAeR6hI6xnV7Cgp0w9U1UchkL4mI1Tb0t8IdK2fvtT67VsEeceTdgp2XH6R0QKrOnBngS5xZ6Gkbhd2ZZ1St/TaGk3Qyr9tbD7Efa6E0PfffNikf6voUzYn5sdZ3wpUjqr1IDYPzkN31Q== Received: from DM6PR06CA0069.namprd06.prod.outlook.com (2603:10b6:5:54::46) by MN2PR12MB4157.namprd12.prod.outlook.com (2603:10b6:208:1db::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Mon, 27 Feb 2023 07:17:19 +0000 Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:5:54:cafe::67) by DM6PR06CA0069.outlook.office365.com (2603:10b6:5:54::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:17:19 +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 DM6NAM11FT041.mail.protection.outlook.com (10.13.172.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.24 via Frontend Transport; Mon, 27 Feb 2023 07:17:18 +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; Sun, 26 Feb 2023 23:17: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.37; Sun, 26 Feb 2023 23:17:07 -0800 From: Xueming Li To: Chengwen Feng CC: Bruce Richardson , dpdk stable Subject: patch 'eal/freebsd: fix lock in alarm callback' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 15:00:58 +0800 Message-ID: <20230227070107.15664-150-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] 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-TrafficTypeDiagnostic: DM6NAM11FT041:EE_|MN2PR12MB4157:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e9cf52d-0df6-42df-17cf-08db1892a961 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zxt+o8yceUgZ6NiM1CaiqQoDoG+lnFUlx015ZE/kpBrjIAuLyu0cSj3uOszmXbWqhmSiiA6sCYvFBSPIOqDH2SkVKdZnYgha27XMXxRYGumfN1gW5mtkZ89IKPMVhAPpQ6NEqSBEPMuQeWA7YyDoRIHdnhrp0n8xZdYDvgBHEGZ+11yM1ScTTwyjLIzJNb3CW60O0wJI2hgeWfzi0XB6HZlFY10bs3pgiiCeXzj91gIxpjDJS7mFtag+V4qvOu9dC2RXcepihoaFNRk9R2bBPYZcCgm2YcFRFSJn5JU2gH7/P39fLHt5rkEiTqyVmGQFnkIcSF4TmZndQtubA3c6+4CRadLac6m17/QtY50kqbGON7wI6p6R88gFJMMBivNQeayShWEDTxeUkW1a2MsHpS6xwjydc2uLtouVEvF2QWZEl0Q+1wIPQpI1GVLu7QW+t384XCQC262azgWbKNNWpQQYmi0oiIP9LPuS2TivXhxclWOOz0SOMWFv0W3xOs9FOAJ0anT4NJgvCa5Qlj0xUejhJhOBA70AqQ72C3Scf3G4/8sBvr/AkUEPXc/UZRHIp+qX6Jwh0ZFetc6IyOOhHyM8hyOjnDUsy2zT5DiePEtvt1bKMgEa8lQmlN6ahNTii0dWcmTcjbfPGuq/YhKrL45rFFrdaa68/8hy3oYOMi7CKnlTfnfDGvVEicF8lJ+P0nvrjzyJjU6Wi6oo4mA03tdHPfnSttHsEjMcZ+cslV2XhVMPRoFJ6OKfdb1RLZPBA00QRzP7mhwqqqsdwet8vuanjoetEoDOyWuOkrHIH81ySVDun+tVrZyDfZhn8pqu 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)(136003)(39860400002)(346002)(376002)(396003)(451199018)(40470700004)(36840700001)(46966006)(41300700001)(8676002)(83380400001)(6916009)(4326008)(70586007)(70206006)(7636003)(36756003)(82740400003)(55016003)(36860700001)(2906002)(86362001)(82310400005)(40480700001)(356005)(5660300002)(8936002)(34020700004)(40460700003)(47076005)(336012)(426003)(2616005)(478600001)(7696005)(966005)(53546011)(316002)(54906003)(6666004)(16526019)(26005)(186003)(6286002)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:17:18.7655 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e9cf52d-0df6-42df-17cf-08db1892a961 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: DM6NAM11FT041.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4157 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 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/01/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=fb395ef1d0e7dcdf5899dbe1a6e71226c09e2fed Thanks. Xueming Li --- >From fb395ef1d0e7dcdf5899dbe1a6e71226c09e2fed Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Mon, 13 Feb 2023 12:44:52 +0000 Subject: [PATCH] eal/freebsd: fix lock in alarm callback Cc: Xueming Li [ upstream commit fc6bdd5248e843ba1300c8d46d43b263b4a69438 ] The spinlock should unlock when clock_gettime() failed. This patch fixes it by invoking clock_gettime() before lock. Fixes: 26021a715067 ("eal/bsd: support alarm API") Signed-off-by: Chengwen Feng Acked-by: Bruce Richardson --- lib/eal/freebsd/eal_alarm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eal/freebsd/eal_alarm.c b/lib/eal/freebsd/eal_alarm.c index 1023c32937..1a3e6c0aad 100644 --- a/lib/eal/freebsd/eal_alarm.c +++ b/lib/eal/freebsd/eal_alarm.c @@ -171,12 +171,12 @@ eal_alarm_callback(void *arg __rte_unused) struct timespec now; struct alarm_entry *ap; - rte_spinlock_lock(&alarm_list_lk); - ap = LIST_FIRST(&alarm_list); - if (clock_gettime(CLOCK_TYPE_ID, &now) < 0) return; + rte_spinlock_lock(&alarm_list_lk); + ap = LIST_FIRST(&alarm_list); + while (ap != NULL && timespec_cmp(&now, &ap->time) >= 0) { ap->executing = 1; ap->executing_id = pthread_self(); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:45.671928700 +0800 +++ 0151-eal-freebsd-fix-lock-in-alarm-callback.patch 2023-02-27 14:08:40.959237000 +0800 @@ -1 +1 @@ -From fc6bdd5248e843ba1300c8d46d43b263b4a69438 Mon Sep 17 00:00:00 2001 +From fb395ef1d0e7dcdf5899dbe1a6e71226c09e2fed Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit fc6bdd5248e843ba1300c8d46d43b263b4a69438 ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org