[v2] eal/ppc: fix 64 bit atomic exchange operation

Message ID 20191015211614.123379-1-drc@linux.vnet.ibm.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v2] eal/ppc: fix 64 bit atomic exchange operation |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-compilation success Compile Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

David Christensen Oct. 15, 2019, 9:16 p.m. UTC
  The rte_atomic64_exchange operation for ppc_64 incorrectly linked
back to a 32 bit generic operation (__atomic_exchange_4) rather than
the 64 bit generic operation (__atomic_exchange_8).  As a result,
applications that used rte_eth_link_get_nowait() would only receive
the link speed, they would not receive the link state, link duplex,
or link autoneg properties.

Fixes: ff2863570f ("eal: introduce atomic exchange operation")
Cc: sthemmin@microsoft.com"
Cc: stable@dpdk.org

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
v2:
* Modified the subject line to better describe the change

 lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

David Marchand Oct. 16, 2019, 3:10 p.m. UTC | #1
On Tue, Oct 15, 2019 at 11:16 PM David Christensen
<drc@linux.vnet.ibm.com> wrote:
>
> The rte_atomic64_exchange operation for ppc_64 incorrectly linked
> back to a 32 bit generic operation (__atomic_exchange_4) rather than
> the 64 bit generic operation (__atomic_exchange_8).  As a result,
> applications that used rte_eth_link_get_nowait() would only receive
> the link speed, they would not receive the link state, link duplex,
> or link autoneg properties.
>
> Fixes: ff2863570f ("eal: introduce atomic exchange operation")

Fixes sha1 is usually on 12 digits (from the contributing guide).
Will fix when applying.

> Cc: stable@dpdk.org
>
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>

Reviewed-by: David Marchand <david.marchand@redhat.com>

Thanks.
  
David Marchand Oct. 17, 2019, 5:01 a.m. UTC | #2
On Wed, Oct 16, 2019 at 5:10 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Tue, Oct 15, 2019 at 11:16 PM David Christensen
> <drc@linux.vnet.ibm.com> wrote:
> >
> > The rte_atomic64_exchange operation for ppc_64 incorrectly linked
> > back to a 32 bit generic operation (__atomic_exchange_4) rather than
> > the 64 bit generic operation (__atomic_exchange_8).  As a result,
> > applications that used rte_eth_link_get_nowait() would only receive
> > the link speed, they would not receive the link state, link duplex,
> > or link autoneg properties.
> >
> > Fixes: ff2863570f ("eal: introduce atomic exchange operation")
>
> Fixes sha1 is usually on 12 digits (from the contributing guide).
> Will fix when applying.
>
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
>
> Reviewed-by: David Marchand <david.marchand@redhat.com>


Applied, thanks.


--
David Marchand
  

Patch

diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h b/lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h
index b13a80de4..7e3e13118 100644
--- a/lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h
+++ b/lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h
@@ -401,7 +401,7 @@  static inline void rte_atomic64_clear(rte_atomic64_t *v)
 static inline uint64_t
 rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val)
 {
-	return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
+	return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
 }
 
 #endif