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 B63E6A034F for ; Mon, 30 Aug 2021 08:45:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC189410F6; Mon, 30 Aug 2021 08:45:13 +0200 (CEST) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id DDF1D410F6 for ; Mon, 30 Aug 2021 08:45:12 +0200 (CEST) Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 775A83F226 for ; Mon, 30 Aug 2021 06:45:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1630305912; bh=P1XmzeB+Qw/ISdZ4Pi7mUcR9ikx1Dv4XKL3ulF1ahGY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=gWyYfLGycdS2g56pYfg6OpqFeM7V5bbuuaKqivm2VJEW0/NwiyKUmNGlv/6PAkFhb 77llEhqrPXdUix5HQsTJmbmGaznCQO8fpl/K61sn46gDRkils0mDbfUtupcxd7irE4 YNUJg4Ov87ZENTIZPlNifFxpcA4vU6bcF5pVB13fCXlnKkY/NOK+YGxs4G2+X4MJ/k mxelBmUsI4vH2ebLsQ8CtDvMEiYf4pBg+HYAJZMK5xP8THSwgEtEukJQ0Wm1UAYwYG gGSh21Zal0NX7SPeogLWQlS2MH97dm9N/lH3KtNpRIc/LmIz4Uy60AcZ4HPqodAv9C C7+DaO1H9HZ9w== Received: by mail-qk1-f198.google.com with SMTP id d202-20020a3768d3000000b003d30722c98fso2076809qkc.10 for ; Sun, 29 Aug 2021 23:45:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P1XmzeB+Qw/ISdZ4Pi7mUcR9ikx1Dv4XKL3ulF1ahGY=; b=jPxsswOWdGwXH3GVY1hmQs7yaqqj/TRdVVoZj3Jzo3o2R8SrAzMo9SW5SCk6GFU6Px GNXMKiZHJZgHDYGVgRuVGy4nycgnCfbAPkIuaxiMmQzxnV8vLoxDDPKGDwvYL8iDf9W4 pF6mA1MNcToJRqhk6bTS3GGDS4vT58XFaiYB66quuCbrFyrXI91Rr4LpXVM3lDLLzgrG jQSkP284V5VLzSM8XZHa56EPwKWwDMY3tHUGMdsEPU/SWlcy7L97YvFbRZnu9BwzI70q P+htEIlfoAd/rSiGp3bsYnTYewdhNG4Hj4K7Ln92muJ8lGLp+osxCzP5MYDD3dmrarOT rHzQ== X-Gm-Message-State: AOAM533VftS7axEQ97Zz340plu7aaXsPJN/e/+q/aw2hdSqfY2novI7b 5DXaWjepdh332uMZxx59PBGmkOkWHhEY4hGaddpLB0GznnN47BPeIE1rWdG6o3gb2haoot5C0ya Wt9VpTfpwbacrlBOOKeZJZuZLodACrdQeTUpphQxK X-Received: by 2002:ae9:ed17:: with SMTP id c23mr20939316qkg.462.1630305911307; Sun, 29 Aug 2021 23:45:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjWfFiNEMSBLB+cM+w08j2b8H33yh4YaJOvHEHVqRKPd/zEEQlM8BANhrUjADSLqHx5n+c5cu8Zsamuh/dF6Q= X-Received: by 2002:ae9:ed17:: with SMTP id c23mr20939302qkg.462.1630305911120; Sun, 29 Aug 2021 23:45:11 -0700 (PDT) MIME-Version: 1.0 References: <20210713061602.13064-1-alvinx.zhang@intel.com> In-Reply-To: <20210713061602.13064-1-alvinx.zhang@intel.com> From: Christian Ehrhardt Date: Mon, 30 Aug 2021 08:44:45 +0200 Message-ID: To: Alvin Zhang Cc: Lingli Chen , "Jiang, YuX" , "Power, Ciara" , "Van Haaren, Harry" , Alvin Zhang , dpdk stable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [PATCH v3] telemetry: fix race in telemetry control thread creation 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 Sender: "stable" On Tue, Jul 13, 2021 at 8:16 AM Alvin Zhang wrote: > > From: Alvin Zhang > 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 > --- > > 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