From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 84D67A04AB; Thu, 7 Nov 2019 22:36:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 26F9A1BFF6; Thu, 7 Nov 2019 22:35:56 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 3400E1BFF2 for ; Thu, 7 Nov 2019 22:35:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573162552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KOAOZi4lMjuf+IP8ZYJgH8H6nN7b4EPrB/0FRiULjEU=; b=Lw6jXI3d62czkByeDyWOXAnXumWfiUo6YKnduxv6UhBOb+zvOmGuddUVhdcO7/LyrC+KYz HDQoOz6i3vI826Hk3b6QPJwHuVXGcR4eVRvKqdolyFvbUiY+e7YbZlauWpoKO+r+uIwPC6 BO4sqoYifHcvJIWt8hB8wBojVp3FZz0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-375-3YkZY8mlMKK9ZjaUMQKFrA-1; Thu, 07 Nov 2019 16:35:48 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B3A12107ACC3; Thu, 7 Nov 2019 21:35:47 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-222.brq.redhat.com [10.40.204.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 96DE1608B2; Thu, 7 Nov 2019 21:35:45 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: nd@arm.com, konstantin.ananyev@intel.com, Gavin Hu , Jerin Jacob , Maciej Czekaj Date: Thu, 7 Nov 2019 22:35:27 +0100 Message-Id: <1573162528-16230-5-git-send-email-david.marchand@redhat.com> In-Reply-To: <1573162528-16230-1-git-send-email-david.marchand@redhat.com> References: <1561911676-37718-1-git-send-email-gavin.hu@arm.com> <1573162528-16230-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 3YkZY8mlMKK9ZjaUMQKFrA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH v13 4/5] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Gavin Hu 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 Reviewed-by: Ruifeng Wang Acked-by: Jerin Jacob --- drivers/net/thunderx/Makefile | 1 + drivers/net/thunderx/meson.build | 1 + drivers/net/thunderx/nicvf_rxtx.c | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/thunderx/Makefile b/drivers/net/thunderx/Makefile index e6bf497..9e0de10 100644 --- a/drivers/net/thunderx/Makefile +++ b/drivers/net/thunderx/Makefile @@ -10,6 +10,7 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB =3D librte_pmd_thunderx_nicvf.a =20 CFLAGS +=3D $(WERROR_FLAGS) +CFLAGS +=3D -DALLOW_EXPERIMENTAL_API =20 LDLIBS +=3D -lm LDLIBS +=3D -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring diff --git a/drivers/net/thunderx/meson.build b/drivers/net/thunderx/meson.= build index 69819a9..23d9458 100644 --- a/drivers/net/thunderx/meson.build +++ b/drivers/net/thunderx/meson.build @@ -4,6 +4,7 @@ subdir('base') objs =3D [base_objs] =20 +allow_experimental_apis =3D true sources =3D files('nicvf_rxtx.c', =09=09'nicvf_ethdev.c', =09=09'nicvf_svf.c' diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf= _rxtx.c index 1c42874..90a6098 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) =09=09ltail++; =09} =20 -=09while (__atomic_load_n(&rbdr->tail, __ATOMIC_RELAXED) !=3D next_tail) -=09=09rte_pause(); +=09rte_wait_until_equal_32(&rbdr->tail, next_tail, __ATOMIC_RELAXED); =20 =09__atomic_store_n(&rbdr->tail, ltail, __ATOMIC_RELEASE); =09nicvf_addr_write(door, to_fill); --=20 1.8.3.1