From: Konstantin Ananyev Date: Wed, 2 May 2018 13:58:26 +0000 (+0100) Subject: eal/x86: fix atomic exchange for 32-bit X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=51c7de38e2b1ee16eb6ce0aa257048a4f4d8275e;p=dpdk.git eal/x86: fix atomic exchange for 32-bit Should break out of loop when rte_atomic64_cmpset() returns non-zero. Fixes: ff2863570fcc ("eal: introduce atomic exchange operation") Signed-off-by: Konstantin Ananyev Reviewed-by: Ferruh Yigit Tested-by: Ferruh Yigit --- diff --git a/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h b/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h index 8d711b6f68..a932f35405 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h +++ b/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h @@ -105,7 +105,7 @@ rte_atomic64_exchange(volatile uint64_t *dest, uint64_t val) do { old = *dest; - } while (rte_atomic64_cmpset(dest, old, val)); + } while (rte_atomic64_cmpset(dest, old, val) == 0); return old; }