patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v3 1/4] eal: reset lcore function pointer and argument
       [not found] ` <20211025045237.19878-1-honnappa.nagarahalli@arm.com>
@ 2021-10-25  4:52   ` Honnappa Nagarahalli
  0 siblings, 0 replies; only message in thread
From: Honnappa Nagarahalli @ 2021-10-25  4:52 UTC (permalink / raw)
  To: dev, honnappa.nagarahalli, konstantin.ananyev, david.marchand,
	feifei.wang2
  Cc: ruifeng.wang, nd, stable

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.wang@arm.com>
---
 lib/eal/freebsd/eal_thread.c | 2 ++
 lib/eal/linux/eal_thread.c   | 2 ++
 lib/eal/windows/eal_thread.c | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/lib/eal/freebsd/eal_thread.c b/lib/eal/freebsd/eal_thread.c
index 1dce9b04f2..bbc3a8e985 100644
--- a/lib/eal/freebsd/eal_thread.c
+++ b/lib/eal/freebsd/eal_thread.c
@@ -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;
 	}
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index 83c2034b93..8f3c0dafd6 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -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
diff --git a/lib/eal/windows/eal_thread.c b/lib/eal/windows/eal_thread.c
index 9c3f6d69fd..df1df5d02c 100644
--- a/lib/eal/windows/eal_thread.c
+++ b/lib/eal/windows/eal_thread.c
@@ -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
-- 
2.17.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-25  4:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210224212018.17576-1-honnappa.nagarahalli@arm.com>
     [not found] ` <20211025045237.19878-1-honnappa.nagarahalli@arm.com>
2021-10-25  4:52   ` [dpdk-stable] [PATCH v3 1/4] eal: reset lcore function pointer and argument Honnappa Nagarahalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).