From patchwork Thu Sep 9 23:13:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 508373 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp767655jai; Thu, 9 Sep 2021 16:13:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqOj715Wsjp4hDutz4kVHd3IT1oR/wIGhJgMBtVzEoqKwPWb0NP71CoxwRqOYPhm4BM0+L X-Received: by 2002:a05:600c:230c:: with SMTP id 12mr5421039wmo.41.1631229227370; Thu, 09 Sep 2021 16:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631229227; cv=none; d=google.com; s=arc-20160816; b=LacB6VLBwgeNJ89M+/ZGUFZHLgurO7bAq+NVwIPHpn1wFaxeH7ZMZXJnC9e+Pfz91/ Yh68obExX7VbOmwONM6TC3H0mUYsnYbCn4gOztcYkSHKw/+5y3KeFLAUib4zDTeaDlQL rrJZnKvec02kmQjYq47h20O70iDzaxcXEph57YJs+AEpXquBL9WfuyF6EtRwMb+tGuZh fG1YesSuGjQv/iO7ArhNgRJ6MrmyyldP8qb9Dy/7EkTRgtGDnaX4XAYRGahtzhq7L/3n c6xXKRhxz4gYQhOxQwIvKjHvtfO0dXDXCwEDdFUs4fkXzewRWBptDbFxCV9GK0Geaipe mtWg== 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=7T9TCviEo8Wff6VUamtpdRdbav4xXCCDjLscCizPj14=; b=Yty56lunwOp5ZzfA2L/y53h6hIc9gvC/yG6AiL2kANZStnwivPgPT6xPdYGIAh3K8l H4nrLR5ss8dTn0i6Ul1MteCH+JD5LDhkCwvp8jRKBVkRZRwwJx2jJSJBrB0RAP9Rv52j s4YTqIo6fy2kVi3CrWCXhIeh7r7ETWzk5HfFiEjCo8w1LvRsTi0O3ufPwD/VwFZX5neZ zifOnRHUar8kGUogKpkcs0Vo/UX4rWkpzsy3RLC9uDz7cFVeEuUMfrDUM/Y2UAAHMTzc jXlUEFXD7+dUzpYj/PoTYbhbKlaFN3gmv09E3G1mgKxp3mXLj0u7BTf//q6r/9OxXjWb AVWQ== 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 o13si504374wmc.177.2021.09.09.16.13.47; Thu, 09 Sep 2021 16:13:47 -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 44D4E410FE; Fri, 10 Sep 2021 01:13:44 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id A4997410DA for ; Fri, 10 Sep 2021 01:13:42 +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 1E7651042; Thu, 9 Sep 2021 16:13:42 -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 17E2E3F73D; Thu, 9 Sep 2021 16:13:42 -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:10 -0500 Message-Id: <20210909231312.2572006-5-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 4/6] eal: update rte_eal_wait_lcore definition 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" Since the FINISHED state is removed, the API rte_eal_wait_lcore is updated to always return the status of the last function that ran in the worker core. Signed-off-by: Honnappa Nagarahalli Reviewed-by: Feifei Wang --- lib/eal/common/eal_common_launch.c | 6 ++---- lib/eal/include/rte_launch.h | 12 +++++------- 2 files changed, 7 insertions(+), 11 deletions(-) -- 2.25.1 diff --git a/lib/eal/common/eal_common_launch.c b/lib/eal/common/eal_common_launch.c index 78fd940267..4bc842417a 100644 --- a/lib/eal/common/eal_common_launch.c +++ b/lib/eal/common/eal_common_launch.c @@ -23,10 +23,8 @@ int rte_eal_wait_lcore(unsigned worker_id) { - if (lcore_config[worker_id].state == WAIT) - return 0; - - while (lcore_config[worker_id].state != WAIT) + while (__atomic_load_n(&lcore_config[worker_id].state, + __ATOMIC_ACQUIRE) != WAIT) rte_pause(); rte_rmb(); diff --git a/lib/eal/include/rte_launch.h b/lib/eal/include/rte_launch.h index ed0bb4762a..f2d386e6e2 100644 --- a/lib/eal/include/rte_launch.h +++ b/lib/eal/include/rte_launch.h @@ -119,18 +119,16 @@ enum rte_lcore_state_t rte_eal_get_lcore_state(unsigned int worker_id); * * To be executed on the MAIN lcore only. * - * If the worker lcore identified by the worker_id is in a FINISHED state, - * switch to the WAIT state. If the lcore is in RUNNING state, wait until - * the lcore finishes its job and moves to the FINISHED state. + * If the lcore identified by the worker_id is in RUNNING state, wait until + * the lcore finishes its job and moves to the WAIT state. * * @param worker_id * The identifier of the lcore. * @return - * - 0: If the lcore identified by the worker_id is in a WAIT state. + * - 0: If the remote launch function was never called on the lcore + * identified by the worker_id. * - The value that was returned by the previous remote launch - * function call if the lcore identified by the worker_id was in a - * FINISHED or RUNNING state. In this case, it changes the state - * of the lcore to WAIT. + * function call. */ int rte_eal_wait_lcore(unsigned worker_id);