From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 38A84A0C45; Mon, 25 Oct 2021 06:53:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5AD8F410F8; Mon, 25 Oct 2021 06:53:02 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 4EB474111C; Mon, 25 Oct 2021 06:53:00 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C23411FB; Sun, 24 Oct 2021 21:52:59 -0700 (PDT) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.12.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B97D83F73D; Sun, 24 Oct 2021 21:52:59 -0700 (PDT) From: Honnappa Nagarahalli To: dev@dpdk.org, honnappa.nagarahalli@arm.com, konstantin.ananyev@intel.com, david.marchand@redhat.com, feifei.wang2@arm.com Cc: ruifeng.wang@arm.com, nd@arm.com, stable@dpdk.org Date: Sun, 24 Oct 2021 23:52:34 -0500 Message-Id: <20211025045237.19878-2-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211025045237.19878-1-honnappa.nagarahalli@arm.com> References: <20210224212018.17576-1-honnappa.nagarahalli@arm.com> <20211025045237.19878-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH v3 1/4] eal: reset lcore function pointer and argument X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Reviewed-by: Ruifeng Wang Reviewed-by: Feifei Wang --- 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