[dpdk-dev] x86: fix atomic exchange for 32-bit
Checks
Commit Message
should break out of loop when rte_atomic64_cmpset() retruns non-zero.
Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
lib/librte_eal/common/include/arch/x86/rte_atomic_32.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 5/2/2018 2:58 PM, Konstantin Ananyev wrote:
> should break out of loop when rte_atomic64_cmpset() retruns non-zero.
>
> Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
02/05/2018 18:44, Ferruh Yigit:
> On 5/2/2018 2:58 PM, Konstantin Ananyev wrote:
> > should break out of loop when rte_atomic64_cmpset() retruns non-zero.
> >
> > Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
> >
> > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied, thanks
@@ -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;
}