From: fengchengwen <fengchengwen@huawei.com>
To: <thomas@monjalon.net>, <ferruh.yigit@amd.com>,
<andrew.rybchenko@oktetlabs.ru>
Cc: <dev@dpdk.org>, "Richardson, Bruce" <bruce.richardson@intel.com>,
"Burakov, Anatoly" <anatoly.burakov@intel.com>
Subject: Re: [PATCH] eal/bsd: fix spinlock not unlock in alarm callback
Date: Thu, 16 Feb 2023 09:28:17 +0800 [thread overview]
Message-ID: <506fd32a-1d88-63fd-9fcb-c96a5b1b10b9@huawei.com> (raw)
In-Reply-To: <20230213124452.46536-1-fengchengwen@huawei.com>
add cc maintainer
On 2023/2/13 20:44, Chengwen Feng wrote:
> 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")
> Cc: stable@dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---
> 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();
>
next prev parent reply other threads:[~2023-02-16 1:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-13 12:44 Chengwen Feng
2023-02-16 1:28 ` fengchengwen [this message]
2023-02-16 9:22 ` Bruce Richardson
2023-02-19 22:27 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=506fd32a-1d88-63fd-9fcb-c96a5b1b10b9@huawei.com \
--to=fengchengwen@huawei.com \
--cc=anatoly.burakov@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).