eal: reset lcore task callback and argument
authorHonnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Mon, 25 Oct 2021 04:52:34 +0000 (23:52 -0500)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 25 Oct 2021 16:20:59 +0000 (18:20 +0200)
In the rte_eal_remote_launch function, the lcore function
pointer is checked for NULL. However, the pointer is never
reset to NULL. Reset the lcore function pointer and argument
after the worker has completed executing the lcore function.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
lib/eal/freebsd/eal_thread.c
lib/eal/linux/eal_thread.c
lib/eal/windows/eal_thread.c

index 1dce9b0..bbc3a8e 100644 (file)
@@ -126,6 +126,8 @@ eal_thread_loop(__rte_unused void *arg)
                fct_arg = lcore_config[lcore_id].arg;
                ret = lcore_config[lcore_id].f(fct_arg);
                lcore_config[lcore_id].ret = ret;
+               lcore_config[lcore_id].f = NULL;
+               lcore_config[lcore_id].arg = NULL;
                rte_wmb();
                lcore_config[lcore_id].state = FINISHED;
        }
index 83c2034..8f3c0da 100644 (file)
@@ -126,6 +126,8 @@ eal_thread_loop(__rte_unused void *arg)
                fct_arg = lcore_config[lcore_id].arg;
                ret = lcore_config[lcore_id].f(fct_arg);
                lcore_config[lcore_id].ret = ret;
+               lcore_config[lcore_id].f = NULL;
+               lcore_config[lcore_id].arg = NULL;
                rte_wmb();
 
                /* when a service core returns, it should go directly to WAIT
index 9c3f6d6..df1df5d 100644 (file)
@@ -110,6 +110,8 @@ eal_thread_loop(void *arg __rte_unused)
                fct_arg = lcore_config[lcore_id].arg;
                ret = lcore_config[lcore_id].f(fct_arg);
                lcore_config[lcore_id].ret = ret;
+               lcore_config[lcore_id].f = NULL;
+               lcore_config[lcore_id].arg = NULL;
                rte_wmb();
 
                /* when a service core returns, it should go directly to WAIT