* [dpdk-dev] [PATCH] eal: fix link status issue on ppc_64
@ 2019-10-14 23:07 David Christensen
2019-10-15 7:33 ` David Marchand
2019-10-15 21:16 ` [dpdk-dev] [PATCH v2] eal/ppc: fix 64 bit atomic exchange operation David Christensen
0 siblings, 2 replies; 6+ messages in thread
From: David Christensen @ 2019-10-14 23:07 UTC (permalink / raw)
To: dev; +Cc: sthemmin, stable, David Christensen
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.
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>
---
lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
--
2.18.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix link status issue on ppc_64
2019-10-14 23:07 [dpdk-dev] [PATCH] eal: fix link status issue on ppc_64 David Christensen
@ 2019-10-15 7:33 ` David Marchand
2019-10-15 20:50 ` David Christensen
2019-10-15 21:16 ` [dpdk-dev] [PATCH v2] eal/ppc: fix 64 bit atomic exchange operation David Christensen
1 sibling, 1 reply; 6+ messages in thread
From: David Marchand @ 2019-10-15 7:33 UTC (permalink / raw)
To: David Christensen; +Cc: dev, Stephen Hemminger, dpdk stable, Aaron Conole
Hello David,
On Tue, Oct 15, 2019 at 1:08 AM 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,
> 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.
>
> 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>
> ---
> lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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
> --
> 2.18.1
>
--
David Marchand
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix link status issue on ppc_64
2019-10-15 7:33 ` David Marchand
@ 2019-10-15 20:50 ` David Christensen
0 siblings, 0 replies; 6+ messages in thread
From: David Christensen @ 2019-10-15 20:50 UTC (permalink / raw)
To: David Marchand; +Cc: dev, Stephen Hemminger, dpdk stable, Aaron Conole
>> 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.
>
> 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.
>
> rte_atomic64_exchange has 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v2] eal/ppc: fix 64 bit atomic exchange operation
2019-10-14 23:07 [dpdk-dev] [PATCH] eal: fix link status issue on ppc_64 David Christensen
2019-10-15 7:33 ` David Marchand
@ 2019-10-15 21:16 ` David Christensen
2019-10-16 15:10 ` [dpdk-dev] [dpdk-stable] " David Marchand
1 sibling, 1 reply; 6+ messages in thread
From: David Christensen @ 2019-10-15 21:16 UTC (permalink / raw)
To: dev; +Cc: sthemmin, stable, David Christensen
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(-)
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
--
2.18.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] eal/ppc: fix 64 bit atomic exchange operation
2019-10-15 21:16 ` [dpdk-dev] [PATCH v2] eal/ppc: fix 64 bit atomic exchange operation David Christensen
@ 2019-10-16 15:10 ` David Marchand
2019-10-17 5:01 ` David Marchand
0 siblings, 1 reply; 6+ messages in thread
From: David Marchand @ 2019-10-16 15:10 UTC (permalink / raw)
To: David Christensen; +Cc: dev, Stephen Hemminger, dpdk stable
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] eal/ppc: fix 64 bit atomic exchange operation
2019-10-16 15:10 ` [dpdk-dev] [dpdk-stable] " David Marchand
@ 2019-10-17 5:01 ` David Marchand
0 siblings, 0 replies; 6+ messages in thread
From: David Marchand @ 2019-10-17 5:01 UTC (permalink / raw)
To: David Christensen; +Cc: dev, Stephen Hemminger, dpdk stable
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-10-17 5:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14 23:07 [dpdk-dev] [PATCH] eal: fix link status issue on ppc_64 David Christensen
2019-10-15 7:33 ` David Marchand
2019-10-15 20:50 ` David Christensen
2019-10-15 21:16 ` [dpdk-dev] [PATCH v2] eal/ppc: fix 64 bit atomic exchange operation David Christensen
2019-10-16 15:10 ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-10-17 5:01 ` David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).