From patchwork Wed Feb 24 21:20:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 386876 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp697728jap; Wed, 24 Feb 2021 13:20:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfywlCL02vgFSqX46eY9M7d7iKMI5XeDTQPPw4EUbUmXCUPB6WZK4B1n2CQHFCl3DBYmfw X-Received: by 2002:aa7:dc17:: with SMTP id b23mr36054412edu.139.1614201642404; Wed, 24 Feb 2021 13:20:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614201642; cv=none; d=google.com; s=arc-20160816; b=eDS95QOnjoUMJpFk8gIuZpXUBuj71/elJJKdTTPYFstT7w9YlRLnUZkmnjL6qAtQV0 4bck81SO0VKVFOg9dDCJCce4HnP0Km2Eb1Xri+8OHN45X2w9jV9mGP+LeFMzpUQAy9GT xi510qfSWHiGtNwaVJ7AXTU03WPUyRj26hEzg8raNjlpgch+EJ8Uj+VOcOwBRSlJmdtr oxulxS3IvHslsmISLz3oK1zlGPi8xDcSlWHAbFrQolzCTTXO4ULwXrilThUq1ZEZ6zAF pGWUlbWM8FzqWTCQFZMb/yBvna7EuMcr/g6bcvioKrdOPJt6CNE6pbuEDP0jbZzC7BAe MyTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=YgTgusxH26PPbSznZDfZrOqbbacVtfyxG94DGHfcDcs=; b=NtBSHRhkW8r2SpQ68/4Dt8Ewdg0S4c1Em/UyTaYduVQjqYQaOpZnVNQGr0n81Yc1KC +Hgb+40N/MNB3voIMgXy3+P05LAMNhrWe9ks+ygClEUzkAB7Hf7rUpp+J440c60yQIum 1oZhedGsp0S6GVokaEkittcH6N89GPE6nZS7GkIkmbO1yOK+dUPPFDjgqBk5mB/6SYGh 0/Ubb5TadbztADy993bNCicZxzuq6Y1WcMaisT1fvmKp2JjmuzBVBGC0cD5gGQpJFxwL KXcI0FzkmnHpWaRfeRWh9Z095lzUSvH/dPnZKAfSirBTxpwsJLpJn7ALCm/OUJtBFEpu 3cfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id lz19si2201414ejb.88.2021.02.24.13.20.42; Wed, 24 Feb 2021 13:20:42 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0675C16074F; Wed, 24 Feb 2021 22:20:42 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 315D640040 for ; Wed, 24 Feb 2021 22:20:40 +0100 (CET) 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 877C9ED1; Wed, 24 Feb 2021 13:20:39 -0800 (PST) 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 7BB8B3F73D; Wed, 24 Feb 2021 13:20:39 -0800 (PST) From: Honnappa Nagarahalli To: Bruce Richardson , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com, feifei.wang@arm.com, nd@arm.com Date: Wed, 24 Feb 2021 15:20:14 -0600 Message-Id: <20210224212018.17576-2-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210224212018.17576-1-honnappa.nagarahalli@arm.com> References: <20210224212018.17576-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [RFC 1/5] 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. Signed-off-by: Honnappa Nagarahalli Reviewed-by: Ruifeng Wang --- 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(+) -- 2.17.1 diff --git a/lib/librte_eal/freebsd/eal_thread.c b/lib/librte_eal/freebsd/eal_thread.c index 1dce9b04f..bbc3a8e98 100644 --- a/lib/librte_eal/freebsd/eal_thread.c +++ b/lib/librte_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/librte_eal/linux/eal_thread.c b/lib/librte_eal/linux/eal_thread.c index 83c2034b9..8f3c0dafd 100644 --- a/lib/librte_eal/linux/eal_thread.c +++ b/lib/librte_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/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c index 908e726d1..b69672fe0 100644 --- a/lib/librte_eal/windows/eal_thread.c +++ b/lib/librte_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