From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DF9F8A0548; Mon, 26 Apr 2021 07:38:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B5FC410D8; Mon, 26 Apr 2021 07:38:20 +0200 (CEST) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by mails.dpdk.org (Postfix) with ESMTP id 017B040A4B for ; Mon, 26 Apr 2021 07:38:18 +0200 (CEST) Received: by mail-io1-f53.google.com with SMTP id v123so3704390ioe.10 for ; Sun, 25 Apr 2021 22:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=urPBITTc5ER/5rgC5zgjDcRBTb+A2TjjZVkVCLBaEyg=; b=dMk1JewlJD1HEq62pFy4goXqEcQAFLup1deMgHm2wQQHIa8VXCcLQxd8rNkmxitiXH LOtNm5xKadnmBtzOMe5IPI5oDMjpwiPzzVEheLe1VxA4k7HTJQXpd+Nv9Y+xpLcn6W7L qoQ0EVXliAbeT8IooZIZ7MjYRCiTuqzJE9/EshdBBz2FDVrbOfre1EO7NropD+JD/80x CKoy269zesoJ9DSmEmSC1me/Rx8LwEhLIGjwNrF9Gqgdbg/+GZOmC1UJkddHm5kugPg/ wVwwqndynrL9pxwEm0mx8lBPucmt1k2Ndg0kGLvqnePr/TIUj8F7WtRXWRN8N5dQ1Mfy 672w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=urPBITTc5ER/5rgC5zgjDcRBTb+A2TjjZVkVCLBaEyg=; b=h90806zJTBR9IDAQw+P6D2aJNAGjCCKzYYBvKnmH3zSKXWTPSwMktNDBNtCCGH8MF5 odO1ojy3wZtdi7SNkVKfTOL8ksz+O3w7SFDH5lV7fX3a5a98yLKNGFPVEyV8YbjZ/QBA bu/DGS2yjySmXyvSIcUuMRPzVXSbG7+t7MtM4EmeCvvKUZZw03nUmlXub1vARgoWg9nr zvmGPXtlhwxCwB9HwwFPjBh69b62+L//0zS4d/Z3UmnGLEfGV3+EXJT6Xoq09AEl7r/B t4r4a3LfBrWFYF6l/avmTHm3+mUGY8XmA6jlu0NCZNOYc6egy/9jkNIbBBi+2w88VqFI ta3A== X-Gm-Message-State: AOAM530f9255PVupW0BAIMgCD/yS9Zc9qP0fy2zOUmy99KMxMerNtjiV +EbjV30h5mvWhnoImaWeR21YI9+pAA138qsvXqM= X-Google-Smtp-Source: ABdhPJyYnSU+gO8kwJt/9fky5isptkYF76U2nxo/BwSV5BHO6B+XUbM+V5FjZy8Gr1gmnXQ7NLp25HdSudufTOOtHEs= X-Received: by 2002:a02:7f13:: with SMTP id r19mr14509575jac.113.1619415498208; Sun, 25 Apr 2021 22:38:18 -0700 (PDT) MIME-Version: 1.0 References: <20200424070741.16619-1-gavin.hu@arm.com> <20210425055653.1509261-1-ruifeng.wang@arm.com> <20210425055653.1509261-3-ruifeng.wang@arm.com> In-Reply-To: <20210425055653.1509261-3-ruifeng.wang@arm.com> From: Jerin Jacob Date: Mon, 26 Apr 2021 11:08:02 +0530 Message-ID: To: Ruifeng Wang Cc: Honnappa Nagarahalli , Konstantin Ananyev , dpdk-dev , David Marchand , Thomas Monjalon , Jerin Jacob , nd , Gavin Hu , Steve Capper , Ola Liljedahl Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3 2/2] ring: use wfe to wait for ring tail update on aarch64 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" On Sun, Apr 25, 2021 at 11:27 AM Ruifeng Wang wrote: > > Instead of polling for tail to be updated, use wfe instruction. > > Signed-off-by: Gavin Hu > Signed-off-by: Ruifeng Wang > Reviewed-by: Steve Capper > Reviewed-by: Ola Liljedahl > Reviewed-by: Honnappa Nagarahalli > Acked-by: Konstantin Ananyev Acked-by: Jerin Jacob > --- > lib/ring/rte_ring_c11_pvt.h | 4 ++-- > lib/ring/rte_ring_generic_pvt.h | 3 +-- > 2 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/lib/ring/rte_ring_c11_pvt.h b/lib/ring/rte_ring_c11_pvt.h > index 759192f4c4..37e0b2afd6 100644 > --- a/lib/ring/rte_ring_c11_pvt.h > +++ b/lib/ring/rte_ring_c11_pvt.h > @@ -2,6 +2,7 @@ > * > * Copyright (c) 2017,2018 HXT-semitech Corporation. > * Copyright (c) 2007-2009 Kip Macy kmacy@freebsd.org > + * Copyright (c) 2021 Arm Limited > * All rights reserved. > * Derived from FreeBSD's bufring.h > * Used as BSD-3 Licensed with permission from Kip Macy. > @@ -21,8 +22,7 @@ __rte_ring_update_tail(struct rte_ring_headtail *ht, uint32_t old_val, > * we need to wait for them to complete > */ > if (!single) > - while (unlikely(ht->tail != old_val)) > - rte_pause(); > + rte_wait_until_equal_32(&ht->tail, old_val, __ATOMIC_RELAXED); > > __atomic_store_n(&ht->tail, new_val, __ATOMIC_RELEASE); > } > diff --git a/lib/ring/rte_ring_generic_pvt.h b/lib/ring/rte_ring_generic_pvt.h > index 532deb5e7a..c95ad7e12c 100644 > --- a/lib/ring/rte_ring_generic_pvt.h > +++ b/lib/ring/rte_ring_generic_pvt.h > @@ -23,8 +23,7 @@ __rte_ring_update_tail(struct rte_ring_headtail *ht, uint32_t old_val, > * we need to wait for them to complete > */ > if (!single) > - while (unlikely(ht->tail != old_val)) > - rte_pause(); > + rte_wait_until_equal_32(&ht->tail, old_val, __ATOMIC_RELAXED); > > ht->tail = new_val; > } > -- > 2.25.1 >