Skip to content

Commit

Permalink
eal: reset lcore task callback and argument
Browse files Browse the repository at this point in the history
[ upstream commit 33969e9 ]

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: af75078 ("first public release")

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>
  • Loading branch information
nagarahalli authored and cpaelzer committed Nov 30, 2021
1 parent 545b8e9 commit 7cc6083
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/librte_eal/freebsd/eal/eal_thread.c
Expand Up @@ -152,6 +152,8 @@ eal_thread_loop(__attribute__((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;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/librte_eal/linux/eal/eal_thread.c
Expand Up @@ -152,6 +152,8 @@ eal_thread_loop(__attribute__((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
Expand Down
2 changes: 2 additions & 0 deletions lib/librte_eal/windows/eal/eal_thread.c
Expand Up @@ -124,6 +124,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
Expand Down

0 comments on commit 7cc6083

Please sign in to comment.