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 05E33A0093; Tue, 8 Nov 2022 19:07:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A155C400D7; Tue, 8 Nov 2022 19:07:51 +0100 (CET) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id 7D512400D4 for ; Tue, 8 Nov 2022 19:07:49 +0100 (CET) Received: by mail-pf1-f172.google.com with SMTP id q9so14498251pfg.5 for ; Tue, 08 Nov 2022 10:07:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.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=5pOsV5PX8NwW1HrF/CWjpJY0OYnOmagZOBEMwNRDXAU=; b=pzWBQe93cHeGoZP969tDM2xADzvFanhnar9984Pu60iQWlKTaP4fNencou7s++0fCs SoQzTdlAL4L5ZZzcX24wJoXVn69bVNH76KdwPhgKwhG3jzIGtZFtrEr+O3jS1LS8YCMw 9mJWHrnmoA35Z+94HOLOWZEBon9worpViBOWCwrr5EdEaPEn1czAlHD73suKyeNqBLoS 9SCdPf0vUr6i5g2d2y+YYJ7RF5VRjTfcsRHdJmWq8PWDxCO5Siz4WgPozlumXEOumd0u B/mTcF0cBYcdY/0tjDwZsZz6Sz6rL16eTuaED8fIsQM2uwOdbPJVIwIwb76PG00CXPXb ehWQ== 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=5pOsV5PX8NwW1HrF/CWjpJY0OYnOmagZOBEMwNRDXAU=; b=j9JcT2JlQuiJ23+s3b+lcZsbpmscW8940EWjU0w8K8dokW4ejxDkJC/PgFJeTWnm8I LEr8uFN3/zk0g3sTiE8t8EIaY1+bvSlpCbXP4XJ403NpoP5BBSosL0kZ9BXNK9aearLX SV6jBQard4l6Htnu9p5I6NX5WyVTkHzKrjZk18WSu3Lp6ah74K4SX1kgAgcLWoUSI/2A x+1YWXLrk+kb/bkrNBtXZCILdfgFjBX+CaaIuzXeTA58M9M4Ce3J2TrDlBL18UC0aZzc 7UM0E/WXHalFNQA88M9UAyYMSntnYmt8ESt7DpK2RvmhKJ+ly15TYLJACgDCsGQFaCxe f7rQ== X-Gm-Message-State: ACrzQf0nVnwAzawXc5tR99dICYWhAXzP7GCsclx3Ybb6HWHx2QWUvnw3 0oV7JNlxwXepZpjvo8emkIe1hk/EfwwvuA== X-Google-Smtp-Source: AMsMyM7T4FTUvfUqtwK8ijKEB1109qukYUrYRQqEjvgAF2skikqTkLywiFtc117kCJJ3zhobV6BdwA== X-Received: by 2002:a05:6a00:4504:b0:56b:3ed4:1fac with SMTP id cw4-20020a056a00450400b0056b3ed41facmr57110230pfb.73.1667930868066; Tue, 08 Nov 2022 10:07:48 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id b30-20020a62a11e000000b0056dde9895e2sm6668504pff.30.2022.11.08.10.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 10:07:46 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: phil.yang@arm.com, Stephen Hemminger Subject: [PATCH v2] testpmd: make f_quit flag volatile Date: Tue, 8 Nov 2022 10:07:43 -0800 Message-Id: <20221108180743.20390-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221014172328.185219-1-stephen@networkplumber.org> References: <20221014172328.185219-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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