All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: fix atomic exchange for 32-bit
@ 2018-05-02 13:58 Konstantin Ananyev
  2018-05-02 16:44 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Ananyev @ 2018-05-02 13:58 UTC (permalink / raw)
  To: dev, dev; +Cc: Konstantin Ananyev

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(-)

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 8d711b6f6..a932f3540 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;
 }
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: fix atomic exchange for 32-bit
  2018-05-02 13:58 [PATCH] x86: fix atomic exchange for 32-bit Konstantin Ananyev
@ 2018-05-02 16:44 ` Ferruh Yigit
  2018-05-02 17:23   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-05-02 16:44 UTC (permalink / raw)
  To: Konstantin Ananyev, dev

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: fix atomic exchange for 32-bit
  2018-05-02 16:44 ` Ferruh Yigit
@ 2018-05-02 17:23   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-05-02 17:23 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Ferruh Yigit

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-02 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02 13:58 [PATCH] x86: fix atomic exchange for 32-bit Konstantin Ananyev
2018-05-02 16:44 ` Ferruh Yigit
2018-05-02 17:23   ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.