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 3FADAA04AB; Thu, 7 Nov 2019 22:36:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5EB8D1BFFC; Thu, 7 Nov 2019 22:35:59 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 398151BFBA for ; Thu, 7 Nov 2019 22:35:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573162556; 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=D95qJCr/G32cXrBouwFbG4N5qt/9jq+el241nA/D474=; b=ATuT+TYFHApdVQS+W46OHsuMrOPtuCxeriTW8P/MEBC7+kpwgcT7mR4NVo5ozDZvpIr3e8 HRL/lvSj06TlVedr3z3tT97n4n3vVJvVFMnys6CPV5x3SE2BCaGQ2s5T/dO5e4/xQbanNi WYyVQH09rlJjZSuOHegFick4brNc6Ak= 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-61-QrqafbPBPyC91kiuzNtuWA-1; Thu, 07 Nov 2019 16:35:52 -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 1D14C477; Thu, 7 Nov 2019 21:35:51 +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 9B685608B3; Thu, 7 Nov 2019 21:35:48 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: nd@arm.com, konstantin.ananyev@intel.com, Gavin Hu , Liang Ma , Peter Mccarthy Date: Thu, 7 Nov 2019 22:35:28 +0100 Message-Id: <1573162528-16230-6-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: QrqafbPBPyC91kiuzNtuWA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH v13 5/5] event/opdl: 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 Reviewed-by: Jerin Jacob --- drivers/event/opdl/Makefile | 1 + drivers/event/opdl/meson.build | 1 + drivers/event/opdl/opdl_ring.c | 5 ++--- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/event/opdl/Makefile b/drivers/event/opdl/Makefile index bf50a60..72ef07d 100644 --- a/drivers/event/opdl/Makefile +++ b/drivers/event/opdl/Makefile @@ -9,6 +9,7 @@ LIB =3D librte_pmd_opdl_event.a # build flags CFLAGS +=3D -O3 CFLAGS +=3D $(WERROR_FLAGS) +CFLAGS +=3D -DALLOW_EXPERIMENTAL_API # for older GCC versions, allow us to initialize an event using # designated initializers. ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) diff --git a/drivers/event/opdl/meson.build b/drivers/event/opdl/meson.buil= d index 1fe034e..e67b164 100644 --- a/drivers/event/opdl/meson.build +++ b/drivers/event/opdl/meson.build @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Luca Boccassi =20 +allow_experimental_apis =3D true sources =3D files( =09'opdl_evdev.c', =09'opdl_evdev_init.c', diff --git a/drivers/event/opdl/opdl_ring.c b/drivers/event/opdl/opdl_ring.= c index 06fb5b3..c8d19fe 100644 --- a/drivers/event/opdl/opdl_ring.c +++ b/drivers/event/opdl/opdl_ring.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 #include "opdl_ring.h" #include "opdl_log.h" @@ -474,9 +475,7 @@ opdl_ring_input_multithread(struct opdl_ring *t, const = void *entries, =09/* If another thread started inputting before this one, but hasn't =09 * finished, we need to wait for it to complete to update the tail. =09 */ -=09while (unlikely(__atomic_load_n(&s->shared.tail, __ATOMIC_ACQUIRE) !=3D -=09=09=09old_head)) -=09=09rte_pause(); +=09rte_wait_until_equal_32(&s->shared.tail, old_head, __ATOMIC_ACQUIRE); =20 =09__atomic_store_n(&s->shared.tail, old_head + num_entries, =09=09=09__ATOMIC_RELEASE); --=20 1.8.3.1