patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: Alvin Zhang <alvinx.zhang@intel.com>
Cc: Lingli Chen <LingliX.Chen@intel.com>,
	"Jiang, YuX" <YuX.Jiang@intel.com>,
	 "Power, Ciara" <ciara.power@intel.com>,
	"Van Haaren, Harry" <harry.van.haaren@intel.com>,
	 Alvin Zhang <alvinzhx@intel.com>, dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH v3] telemetry: fix race in telemetry control thread creation
Date: Mon, 30 Aug 2021 08:44:45 +0200	[thread overview]
Message-ID: <CAATJJ0J2g73K_wpRhR60QoLgND9j+d8jFHXQ58C78j_sq4VyzA@mail.gmail.com> (raw)
In-Reply-To: <20210713061602.13064-1-alvinx.zhang@intel.com>

On Tue, Jul 13, 2021 at 8:16 AM Alvin Zhang <alvinx.zhang@intel.com> wrote:
>
> From: Alvin Zhang <alvinzhx@intel.com>
>

This was missing the 19.11 tag and was thereby missed.
It came back via the -rc1 tests of 19.11.10 as it listed the bug again.
Applied now.

> Before the caller returns from function "rte_ctrl_thread_create",
> the newly created thread may have ran, and because the thread
> control flag was not set before, the new thread may exit soon.
> This is not what the developer expected.
>
> This patch puts the setting thread control flag to the place that
> before creating new thread.
>
> Reported-at: https://bugs.dpdk.org/show_bug.cgi?id=731
> Fixes: 8877ac688b52 ("telemetry: introduce infrastructure")
> Cc: stable@dpdk.org
>
> Signed-off-by: Alvin Zhang <alvinzhx@intel.com>
> ---
>
> v2, v3: update commit log
> ---
>  lib/librte_telemetry/rte_telemetry.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_telemetry/rte_telemetry.c b/lib/librte_telemetry/rte_telemetry.c
> index eb20cc6..98d5f91 100644
> --- a/lib/librte_telemetry/rte_telemetry.c
> +++ b/lib/librte_telemetry/rte_telemetry.c
> @@ -1005,10 +1005,10 @@ struct json_data {
>         }
>         TAILQ_INIT(&static_telemetry->client_list_head);
>
> +       static_telemetry->thread_status = 1;
>         ret = rte_ctrl_thread_create(&static_telemetry->thread_id,
>                 telemetry_ctrl_thread, &attr, rte_telemetry_run_thread_func,
>                 (void *)static_telemetry);
> -       static_telemetry->thread_status = 1;
>
>         if (ret < 0) {
>                 ret = rte_telemetry_cleanup();
> --
> 1.8.3.1
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

      reply	other threads:[~2021-08-30  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  6:16 Alvin Zhang
2021-08-30  6:44 ` Christian Ehrhardt [this message]

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=CAATJJ0J2g73K_wpRhR60QoLgND9j+d8jFHXQ58C78j_sq4VyzA@mail.gmail.com \
    --to=christian.ehrhardt@canonical.com \
    --cc=LingliX.Chen@intel.com \
    --cc=YuX.Jiang@intel.com \
    --cc=alvinx.zhang@intel.com \
    --cc=alvinzhx@intel.com \
    --cc=ciara.power@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=stable@dpdk.org \
    /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).