From patchwork Thu Sep 9 23:13:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 508372 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp767594jai; Thu, 9 Sep 2021 16:13:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyssOeFSbGg/zE0M+v9lL0vnQ2HwrUoBSyYZ2hwtP3aFQdTXmuDimp40zSmFBOjeeHPkO6x X-Received: by 2002:adf:ec81:: with SMTP id z1mr6254614wrn.181.1631229222144; Thu, 09 Sep 2021 16:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631229222; cv=none; d=google.com; s=arc-20160816; b=srkJPtELME25Lf2eZfIS9ySZZU/T83q/rjSyQxURftu/6QkA3PDpO8dHcFBMUmYdrS XwnxrPGZyiz0ji/79uXVeWxvU+KfZXmPBFAd0KnssFpWSBa5zVKKQOfXrW+4PHRitHv/ xqYnDeD3PoksEtg/YUrHfl6Cghpq/rZIjNzk+wWVbMh8cmpwSHP0/vzz8WADM2Wkr0GF 65WXpemCbEfU5ohe0vWTcaQZkX5hg+dlR1UjOypy/exrBDBkIbZGTb4TmuWsfoPq952z Z1o6ln7LSoc0DRbgNO2i248ZE7MTntNHeyrvWDIAyGJzh5SBYB3v3s3KrSQ97smeKgwO G9pw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:cc:to:from; bh=I/+22NAQTIWj20kbmyY1/GuQKqGyUglilmzXAX+qdUA=; b=ACVyGGCDN1gQlFZQ7QnNT5PmxHQ54pQ1DJKDTwfPoKFJEkL3twQItTcCZ7/X6fiAiO P8Pb2qc24RN6grFmjxeH9vPrIrEDCdgny5IUONpE1HKj/9vEgCtuJPmK807XSuj/lqaN YLd8fDKjqeoaJEhxzSjMzhdRnig6gLQA6TdoDAz4ZaNBu5bHv6OVIP+5HmD0n1TSpGfB wQCudw6dyLDt4xu8DCpzLzOooKcaB/o9KJ8nMUXQMN2/D05TLMLelZvCloaIXhIISAlB +0hQt/JsKZc07zmu2R5U1wd/PafYtQJQoFiwQlNDaRhI4sgaShINwkgEfwm2FYbrlrH0 Zx6A== 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 a9si3039783wrr.416.2021.09.09.16.13.41; Thu, 09 Sep 2021 16:13:42 -0700 (PDT) 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 DCEE240DF7; Fri, 10 Sep 2021 01:13:41 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 8B3DB40DF7 for ; Fri, 10 Sep 2021 01:13:40 +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 1137A31B; Thu, 9 Sep 2021 16:13:40 -0700 (PDT) Received: from 2p2660v4-1.austin.arm.com (2p2660v4-1.austin.arm.com [10.118.13.211]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0A5CA3F73D; Thu, 9 Sep 2021 16:13:40 -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, Feifei Wang Date: Thu, 9 Sep 2021 18:13:07 -0500 Message-Id: <20210909231312.2572006-2-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210909231312.2572006-1-honnappa.nagarahalli@arm.com> References: <20210224212018.17576-1-honnappa.nagarahalli@arm.com> <20210909231312.2572006-1-honnappa.nagarahalli@arm.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/6] 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 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(+) -- 2.25.1 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