From 5e481225de1dc4ae16a2310bf1db50380182d7b5 Mon Sep 17 00:00:00 2001 From: Jan Hák Date: Tue, 26 Nov 2024 12:56:51 +0100 Subject: kxdpgun: fix usage of new atomic in code (variables stats_trigger and stats_switch) --- src/utils/kxdpgun/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/kxdpgun/main.c b/src/utils/kxdpgun/main.c index 3c036034a..8698adbcd 100644 --- a/src/utils/kxdpgun/main.c +++ b/src/utils/kxdpgun/main.c @@ -58,8 +58,8 @@ volatile int xdp_trigger = KXDPGUN_WAIT; -volatile knot_atomic_uint64_t stats_trigger = 0; -volatile knot_atomic_bool stats_switch = STATS_SUM; +knot_atomic_uint64_t stats_trigger; +knot_atomic_bool stats_switch; unsigned global_cpu_aff_start = 0; unsigned global_cpu_aff_step = 1; @@ -1349,6 +1349,8 @@ static bool get_opts(int argc, char *argv[], xdp_gun_ctx_t *ctx) int main(int argc, char *argv[]) { int ecode = EXIT_FAILURE; + ATOMIC_INIT(stats_trigger, 0); + ATOMIC_INIT(stats_switch, STATS_SUM); xdp_gun_ctx_t ctx = ctx_defaults, *thread_ctxs = NULL; ctx.msgid = time(NULL) % UINT16_MAX; @@ -1425,6 +1427,8 @@ int main(int argc, char *argv[]) ecode = EXIT_SUCCESS; err: + ATOMIC_DEINIT(stats_trigger); + ATOMIC_DEINIT(stats_switch); free(ctx.rss_conf); free(thread_ctxs); free(threads); -- cgit v1.2.3