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 89E0DA00C4; Wed, 9 Nov 2022 11:37:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72D5940143; Wed, 9 Nov 2022 11:37:12 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id CAF72400EF for ; Wed, 9 Nov 2022 11:37:11 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 4457A66; Wed, 9 Nov 2022 13:37:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 4457A66 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1667990231; bh=GlkmadD86mg5kRkXcSI/7wK1OqPYelaut603bQ1diHU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=T/iYQo3imuyEc8VquO401fixPVw+pQMULU6ZKle1tS44BLznpEAQO1DcFFZ4qI8Qj rwbqUXfpi53gjgcadvVhmLzAPiu2za2TnD7S1gBrJ1R9p0ZqgAf4l8s6s5NHLsA7gK YG6vNrGKViyufPhZ0kcV9PvxNhMPfkSNKXFcj/6k= Message-ID: <9b38ffd5-456f-c0c6-95c3-9adfad7b03c1@oktetlabs.ru> Date: Wed, 9 Nov 2022 13:37:10 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v2] testpmd: make f_quit flag volatile Content-Language: en-US To: Ruifeng Wang , Stephen Hemminger , "dev@dpdk.org" Cc: Phil Yang , nd References: <20221014172328.185219-1-stephen@networkplumber.org> <20221108180743.20390-1-stephen@networkplumber.org> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 11/9/22 13:11, Ruifeng Wang wrote: >> -----Original Message----- >> From: Stephen Hemminger >> Sent: Wednesday, November 9, 2022 2:08 AM >> To: dev@dpdk.org >> Cc: Phil Yang ; Stephen Hemminger >> Subject: [PATCH v2] testpmd: make f_quit flag volatile >> >> Since f_quit is set in a signal handler it needs to be marked volatile. Otherwise, >> compiler is allowed to optimize the loop because it can assume the value never changes. >> The flag can also be made local to the file it is used in. >> >> Fixes: d9a191a00e81 ("app/testpmd: fix quitting in container") >> Signed-off-by: Stephen Hemminger >> --- >> v2 - not RFC and add fixes line >> >> app/test-pmd/testpmd.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index >> aa7ea29f15ba..cf5942d0c422 100644 >> --- a/app/test-pmd/testpmd.c >> +++ b/app/test-pmd/testpmd.c >> @@ -231,7 +231,7 @@ unsigned int xstats_display_num; /**< Size of extended statistics to >> show */ >> * In container, it cannot terminate the process which running with 'stats-period' >> * option. Set flag to exit stats period loop after received SIGINT/SIGTERM. >> */ >> -uint8_t f_quit; >> +static volatile uint8_t f_quit; >> uint8_t cl_quit; /* Quit testpmd from cmdline. */ >> >> /* >> -- >> 2.35.1 > Thanks for the change. > Reviewed-by: Ruifeng Wang > Applied to dpdk-next-net/main, thanks.