[RFC 1/2] testpmd: make f_quit flag volatile
Stephen Hemminger
stephen at networkplumber.org
Fri Oct 14 19:23:27 CEST 2022
Since f_quit is set in a signal handler it needs
to be marked as volatile. Otherwise, compler is allowed
to optimize away access to it.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
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 5b0f0838dcc8..815dd6dab4e3 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
More information about the dev
mailing list