[RFC,1/2] testpmd: make f_quit flag volatile
Checks
Commit Message
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@networkplumber.org>
---
app/test-pmd/testpmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 10/14/22 20:23, Stephen Hemminger wrote:
> Since f_quit is set in a signal handler it needs
> to be marked as volatile. Otherwise, compler is allowed
compler -> compiler
> to optimize away access to it.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
I need non-RFC version to apply it.
@@ -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. */
/*