]> git.droids-corp.org - dpdk.git/commitdiff
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 1dce9b04f24ad7601292e5b1c2f955a0bcf79b5b..bbc3a8e985730846b5bdd77044f08365e2621ad2 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 83c2034b93d5c9722e99bd8151d504fa8d941ab7..8f3c0dafd612a0c729f8a60349e8fdc77ea3006a 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 9c3f6d69fd18f5138e13383abc5dda2ff8cf8d46..df1df5d02cb00b810491cf738102ac2ceb1720c7 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