[RFC,1/5] eal: reset lcore function pointer and argument
Checks
Commit Message
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.
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
lib/librte_eal/freebsd/eal_thread.c | 2 ++
lib/librte_eal/linux/eal_thread.c | 2 ++
lib/librte_eal/windows/eal_thread.c | 2 ++
3 files changed, 6 insertions(+)
@@ -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;
}
@@ -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
@@ -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