ring: use WFE to wait for tail update on aarch64

Instead of polling for tail to be updated, use WFE instruction.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Ruifeng Wang 2021-07-07 13:48:38 +08:00 committed by Thomas Monjalon
parent fa6b488998
commit cac2a49b4a
2 changed files with 3 additions and 4 deletions

View File

@ -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);
}

View File

@ -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;
}