DPDK patches and discussions
 help / color / mirror / Atom feed
From: Feifei Wang <feifei.wang2@arm.com>
Cc: dev@dpdk.org, nd@arm.com, Feifei Wang <feifei.wang2@arm.com>,
	Ruifeng Wang <ruifeng.wang@arm.com>
Subject: [dpdk-dev] [PATCH v1 1/2] eal/common: use wait until equal API for tight loop
Date: Wed, 25 Aug 2021 16:01:26 +0800	[thread overview]
Message-ID: <20210825080127.495645-2-feifei.wang2@arm.com> (raw)
In-Reply-To: <20210825080127.495645-1-feifei.wang2@arm.com>

Instead of polling for mcfg->magic to be updated, use wait_until_equal
API.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 lib/eal/common/eal_common_mcfg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/eal/common/eal_common_mcfg.c b/lib/eal/common/eal_common_mcfg.c
index c77ba97a9f..cf4a279905 100644
--- a/lib/eal/common/eal_common_mcfg.c
+++ b/lib/eal/common/eal_common_mcfg.c
@@ -30,8 +30,7 @@ eal_mcfg_wait_complete(void)
 	struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
 
 	/* wait until shared mem_config finish initialising */
-	while (mcfg->magic != RTE_MAGIC)
-		rte_pause();
+	rte_wait_until_equal_32(&mcfg->magic, RTE_MAGIC, __ATOMIC_RELAXED);
 }
 
 int
-- 
2.25.1


  reply	other threads:[~2021-08-25  8:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  8:01 [dpdk-dev] [PATCH v1 0/2] replace tight loop with wait until equal api Feifei Wang
2021-08-25  8:01 ` Feifei Wang [this message]
2021-08-25  8:01 ` [dpdk-dev] [PATCH v1 2/2] mcslock: use wait until equal API for tight loop Feifei Wang
2021-10-19 11:10   ` David Marchand
2021-10-20  2:46     ` [dpdk-dev] 回复: " Feifei Wang
2021-10-20  2:54       ` Feifei Wang
2021-10-15 10:07 ` [dpdk-dev] 回复: [PATCH v1 0/2] replace tight loop with wait until equal api Feifei Wang
2021-10-20  3:03 ` [dpdk-dev] [PATCH v2 " Feifei Wang
2021-10-20  3:03   ` [dpdk-dev] [PATCH v2 1/2] eal/common: use wait until equal API for tight loop Feifei Wang
2021-10-20  3:03   ` [dpdk-dev] [PATCH v2 2/2] mcslock: " Feifei Wang
2021-10-20  6:20   ` [dpdk-dev] [PATCH v2 0/2] replace tight loop with wait until equal api David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210825080127.495645-2-feifei.wang2@arm.com \
    --to=feifei.wang2@arm.com \
    --cc=dev@dpdk.org \
    --cc=nd@arm.com \
    --cc=ruifeng.wang@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).