eal: fix link status issue on ppc_64
PATCH 1/1 eal: fix link status issue on ppc_64
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, only the link speed was passed to the application, not the link state, link duplex, on link autoneg properties.
--- lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h +1 -1
@@ -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
Signature · 1 line
2.18.1
Hello David,
Quoted 6 lines · David Christensen
The
rte_atomic64_exchangeoperation forppc_64incorrectly linked back to a 32 bit generic operation (__atomic_exchange_4) rather than the 64 bit generic operation (__atomic_exchange_8). As a result, only the link speed was passed to the application, not the link state, link duplex, on link autoneg properties.
Good catch.
The first impact is the link status, but you can imagine applications calling this, so I would prefer a title like "eal/ppc: fix 64bits exchange operation".
WDYT ?
rte_atomic64_exchange has no unit test.
This kind of problem could (should?) have been caught in unit tests. Maybe something to add later.
Quoted 26 lines
Fixes ff2863570f ("eal: introduce atomic exchange operation")Signed-off-by David Christensen <[email protected]>--- lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h +1
-2@@ -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 --2.18.1
Signature · 1 line
David Marchand
Quoted 7 lines
Quoted 6 lines
The
rte_atomic64_exchangeoperation forppc_64incorrectly linked back to a 32 bit generic operation (__atomic_exchange_4) rather than the 64 bit generic operation (__atomic_exchange_8). As a result, only the link speed was passed to the application, not the link state, link duplex, on link autoneg properties.
Quoted 5 lines
Good catch.
The first impact is the link status, but you can imagine applications calling this, so I would prefer a title like "eal/ppc: fix 64bits exchange operation".
WDYT ?
Sure, I can do that as a v2.
Quoted 5 lines
rte_atomic64_exchangehas no unit test.
This kind of problem could (should?) have been caught in unit tests. Maybe something to add later.
I was surprised too. I'll look at adding a change to the rte_atomic.c test application.
Dave
PATCH v2 1/1 eal/ppc: fix 64 bit atomic exchange operation
In reply to David ChristensenThe 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.
---
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(-)
lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h +1 -1
@@ -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
Signature · 1 line
2.18.1
Re: [dpdk-dev] [dpdk-stable] [PATCH v2] eal/ppc: fix 64 bit atomic exchange operation
Quoted 9 lines · David Christensen
The
rte_atomic64_exchangeoperation forppc_64incorrectly 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 usedrte_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.
Quoted 3 lines
Signed-off-by David Christensen <[email protected]>
Thanks.
Signature · 1 line
David Marchand
David Marchand
AppliedRe: [dpdk-dev] [dpdk-stable] [PATCH v2] eal/ppc: fix 64 bit atomic exchange operation
Quoted 13 lines · David Marchand
Quoted 9 lines · David Christensen
The
rte_atomic64_exchangeoperation forppc_64incorrectly 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 usedrte_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")
Quoted 8 lines
Fixes sha1 is usually on 12 digits (from the contributing guide). Will fix when applying.
Quoted 3 lines
Signed-off-by David Christensen <[email protected]>Reviewed-by David Marchand <[email protected]>
Applied, thanks.
--
David Marchand