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 E777741D4F for ; Thu, 23 Feb 2023 10:40:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2D4643150; Thu, 23 Feb 2023 10:40:36 +0100 (CET) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mails.dpdk.org (Postfix) with ESMTP id B973F431C8 for ; Thu, 23 Feb 2023 10:40:35 +0100 (CET) Received: by mail-wm1-f47.google.com with SMTP id p26so8215262wmc.4 for ; Thu, 23 Feb 2023 01:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1ITZFDZhTDEwOjIddBCrJZgNy1gpygyqBC/gewKSZNU=; b=PE0cz1K926uf0yGEZtMF+S9InfB+uK6QLWj/HWnRCYZWJFmH5B4LMUv9IPGXE9a660 5WUPd2EimbTqWsVYGtv6C+nZ//X4D5Tw0KbLVEkG0eI1/UqrfZJO704zFXKk7yT95r6T qvrWpjFiCFBWEtyzLYpe+ZV241X3cj0SyMYSGDk/Rs0fqDEJlfOlbgNwqy6sdETd7C2B inqERMHVL/5de/DUbsUcPBaXeVoQ+qfDGMrAtvTswUA7Zk0gw4nvEUcrFS/gcoyGJ6qf VpTQ5L5hlVnuz5QGigZxbqpK6Mp7SHYZrfyUxtBQxyh+yHPmYdqWiE2a5SSatOTJQ9S9 oEAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1ITZFDZhTDEwOjIddBCrJZgNy1gpygyqBC/gewKSZNU=; b=wil6tGmYYulO8k+ykCghDUBrxJ96WM+DLL/pwAs7Sp4lx5hC3GWE7yAIm0GBll78AL Gb/ix52cLa5iOMzHZcGGFqdXytDTcZyrwu6b8loEcXCyE8F2Cpd0LlB5aZ9d7/+pup/X sfl2/Zw3ksP3686QhtR3s09OAuEbBnpQFYXcCRL1SJZ5t42eVOqlNJ9V5arM3/+BQzx6 PS6WOAhmK/Yn5TV5SB0c8ttbyp3R1ykjstuLEuK2Bk9Z2bWwVmW2XeJoVoooFkNw7i9Y j2aTe8SneuTAKsXt2ZzeM92rEyWH/sRMxOlNhckz9KG77ugUMbl2bPkg/XJEdyZDLAx2 QO0w== X-Gm-Message-State: AO0yUKUH3qnrCWJokVfeC8BVb0oewTKQIvwcytitU0oJZrQ6Tj3WI6ls MWMqGfZEBno9mefw73vwIXQ= X-Google-Smtp-Source: AK7set9krXxkRRg2yLcIQoOLD47qnO/jEqQRSnt+t8p16CduVq4K5rjxZ8MhiREvTqFREePDpVojNQ== X-Received: by 2002:a05:600c:1716:b0:3dc:5302:ad9 with SMTP id c22-20020a05600c171600b003dc53020ad9mr2876904wmn.27.1677145235425; Thu, 23 Feb 2023 01:40:35 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id m17-20020a05600c3b1100b003e896d953a8sm6356208wms.17.2023.02.23.01.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 01:40:34 -0800 (PST) From: luca.boccassi@gmail.com To: Chengwen Feng Cc: Bruce Richardson , dpdk stable Subject: patch 'eal/freebsd: fix lock in alarm callback' has been queued to stable release 20.11.8 Date: Thu, 23 Feb 2023 09:37:09 +0000 Message-Id: <20230223093715.3926893-65-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230223093715.3926893-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/25/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/45ff268fbc9d20911bde534876f99c826b2ac562 Thanks. Luca Boccassi --- >From 45ff268fbc9d20911bde534876f99c826b2ac562 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 [ 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/librte_eal/freebsd/eal_alarm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/freebsd/eal_alarm.c b/lib/librte_eal/freebsd/eal_alarm.c index c38b2e04f8..3677bdfe40 100644 --- a/lib/librte_eal/freebsd/eal_alarm.c +++ b/lib/librte_eal/freebsd/eal_alarm.c @@ -148,12 +148,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.39.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-23 09:36:30.887116157 +0000 +++ 0065-eal-freebsd-fix-lock-in-alarm-callback.patch 2023-02-23 09:36:28.350172224 +0000 @@ -1 +1 @@ -From fc6bdd5248e843ba1300c8d46d43b263b4a69438 Mon Sep 17 00:00:00 2001 +From 45ff268fbc9d20911bde534876f99c826b2ac562 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit fc6bdd5248e843ba1300c8d46d43b263b4a69438 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -15 +16 @@ - lib/eal/freebsd/eal_alarm.c | 6 +++--- + lib/librte_eal/freebsd/eal_alarm.c | 6 +++--- @@ -18,5 +19,5 @@ -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) +diff --git a/lib/librte_eal/freebsd/eal_alarm.c b/lib/librte_eal/freebsd/eal_alarm.c +index c38b2e04f8..3677bdfe40 100644 +--- a/lib/librte_eal/freebsd/eal_alarm.c ++++ b/lib/librte_eal/freebsd/eal_alarm.c +@@ -148,12 +148,12 @@ eal_alarm_callback(void *arg __rte_unused)