On Sun, Apr 25, 2021 at 11:27 AM Ruifeng Wang <[email protected]> wrote: > > Instead of polling for tail to be updated, use wfe instruction. > > Signed-off-by: Gavin Hu <[email protected]> > Signed-off-by: Ruifeng Wang <[email protected]> > Reviewed-by: Steve Capper <[email protected]> > Reviewed-by: Ola Liljedahl <[email protected]> > Reviewed-by: Honnappa Nagarahalli <[email protected]> > Acked-by: Konstantin Ananyev <[email protected]>
Acked-by: Jerin Jacob <[email protected]> > --- > 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 [email protected] > + * 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 >

