From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 2CBDDA2EEB
	for <public@inbox.dpdk.org>; Sat, 14 Sep 2019 17:01:15 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 9346E1E999;
	Sat, 14 Sep 2019 17:00:32 +0200 (CEST)
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by dpdk.org (Postfix) with ESMTP id 4B03D1E971
 for <dev@dpdk.org>; Sat, 14 Sep 2019 17:00:30 +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 D039D28;
 Sat, 14 Sep 2019 08:00:29 -0700 (PDT)
Received: from net-arm-thunderx2-01.test.ast.arm.com
 (net-arm-thunderx2-01.shanghai.arm.com [10.169.40.40])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9ED9E3F67D;
 Sat, 14 Sep 2019 08:00:27 -0700 (PDT)
From: Gavin Hu <gavin.hu@arm.com>
To: dev@dpdk.org
Cc: nd@arm.com, thomas@monjalon.net, stephen@networkplumber.org,
 hemant.agrawal@nxp.com, jerinj@marvell.com, pbhagavatula@marvell.com,
 Honnappa.Nagarahalli@arm.com, ruifeng.wang@arm.com, phil.yang@arm.com,
 steve.capper@arm.com
Date: Sat, 14 Sep 2019 22:59:55 +0800
Message-Id: <1568473196-34972-7-git-send-email-gavin.hu@arm.com>
X-Mailer: git-send-email 2.7.4
In-Reply-To: <1568473196-34972-1-git-send-email-gavin.hu@arm.com>
References: <1568473196-34972-1-git-send-email-gavin.hu@arm.com>
In-Reply-To: <1561911676-37718-1-git-send-email-gavin.hu@arm.com>
References: <1561911676-37718-1-git-send-email-gavin.hu@arm.com>
Subject: [dpdk-dev] [PATCH v6 6/7] net/thunderx: use new API to save cycles
	on aarch64
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Use the new API to wait in low power state instead of continuous
polling to save CPU cycles and power.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/thunderx/nicvf_rxtx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index 1c42874..16f34c6 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -385,8 +385,7 @@ nicvf_fill_rbdr(struct nicvf_rxq *rxq, int to_fill)
 		ltail++;
 	}
 
-	while (__atomic_load_n(&rbdr->tail, __ATOMIC_RELAXED) != next_tail)
-		rte_pause();
+	rte_wait_until_equal_relaxed_32(&rbdr->tail, next_tail);
 
 	__atomic_store_n(&rbdr->tail, ltail, __ATOMIC_RELEASE);
 	nicvf_addr_write(door, to_fill);
-- 
2.7.4