Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-11 Thread Ananyev, Konstantin
> > > > > > > >>> In weak memory models, like arm64, reading the > > > > > > > >>> {prod,cons}.tail may get reordered after reading or > > > > > > > >>> writing the ring slots, which corrupts the ring and stale > > > > > > > >>> data is > > observed. > > > > > > > >>> > > > > > > > >>> This issue

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-10 Thread Honnappa Nagarahalli
> > > > > > >>> In weak memory models, like arm64, reading the > > > > > > >>> {prod,cons}.tail may get reordered after reading or > > > > > > >>> writing the ring slots, which corrupts the ring and stale data > > > > > > >>> is > observed. > > > > > > >>> > > > > > > >>> This issue was reported b

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-09 Thread Gavin Hu (Arm Technology China)
> -Original Message- > From: Honnappa Nagarahalli > Sent: Saturday, March 9, 2019 7:48 AM > To: tho...@monjalon.net; Ananyev, Konstantin > ; Gavin Hu (Arm Technology China) > > Cc: Ilya Maximets ; dev@dpdk.org; nd > ; jer...@marvell.com; hemant.agra...@nxp.com; > nipun.gu...@nxp.com; ol

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-08 Thread Honnappa Nagarahalli
> 08/03/2019 16:50, Ananyev, Konstantin: > > 08/03/2019 16:05, Gavin Hu (Arm Technology China): > > > Anyway, on x86, smp_rmb, as a compiler barrier, applies to load/store, not > only load/load. > > > > Yes, that's true, but I think that's happened by coincidence, not > > intentionally. > > > > > T

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-08 Thread Thomas Monjalon
08/03/2019 16:50, Ananyev, Konstantin: > 08/03/2019 16:05, Gavin Hu (Arm Technology China): > > Anyway, on x86, smp_rmb, as a compiler barrier, applies to load/store, not > > only load/load. > > Yes, that's true, but I think that's happened by coincidence, > not intentionally. > > > This is the

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-08 Thread Ananyev, Konstantin
> > > > > >>> In weak memory models, like arm64, reading the {prod,cons}.tail > > > > > >>> may get reordered after reading or writing the ring slots, which > > > > > >>> corrupts the ring and stale data is observed. > > > > > >>> > > > > > >>> This issue was reported by NXP on 8-A72 DPAA2 board.

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-08 Thread Ananyev, Konstantin
> > > > > >>> In weak memory models, like arm64, reading the {prod,cons}.tail > > may > > > > get > > > > > >>> reordered after reading or writing the ring slots, which corrupts > > the > > > > ring > > > > > >>> and stale data is observed. > > > > > >>> > > > > > >>> This issue was reported by N

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-08 Thread Gavin Hu (Arm Technology China)
Hi Konstantin, > -Original Message- > From: Ananyev, Konstantin > Sent: Friday, March 8, 2019 8:13 PM > To: Gavin Hu (Arm Technology China) ; Ilya > Maximets ; dev@dpdk.org > Cc: nd ; tho...@monjalon.net; jer...@marvell.com; > hemant.agra...@nxp.com; nipun.gu...@nxp.com; Honnappa Nagaraha

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-08 Thread Ananyev, Konstantin
> -Original Message- > From: Gavin Hu (Arm Technology China) [mailto:gavin...@arm.com] > Sent: Friday, March 8, 2019 4:23 AM > To: Ilya Maximets ; dev@dpdk.org > Cc: nd ; tho...@monjalon.net; jer...@marvell.com; > hemant.agra...@nxp.com; nipun.gu...@nxp.com; Honnappa > Nagarahalli ; oliv

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-07 Thread Gavin Hu (Arm Technology China)
Hi Konstantin, > -Original Message- > From: Honnappa Nagarahalli > Sent: Friday, March 8, 2019 11:21 AM > To: Ananyev, Konstantin ; Gavin Hu (Arm > Technology China) ; Ilya Maximets > ; dev@dpdk.org > Cc: nd ; tho...@monjalon.net; jer...@marvell.com; > hemant.agra...@nxp.com; nipun.gu...@

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-07 Thread Honnappa Nagarahalli
> > > >> On 07.03.2019 9:45, gavin hu wrote: > > > >>> In weak memory models, like arm64, reading the {prod,cons}.tail > > > >>> may > > get > > > >>> reordered after reading or writing the ring slots, which > > > >>> corrupts the > > ring > > > >>> and stale data is observed. > > > >>> > > > >>> T

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-07 Thread Gavin Hu (Arm Technology China)
> -Original Message- > From: Gavin Hu (Arm Technology China) > Sent: Thursday, March 7, 2019 6:45 PM > To: Ilya Maximets ; dev@dpdk.org > Cc: nd ; tho...@monjalon.net; jer...@marvell.com; > hemant.agra...@nxp.com; nipun.gu...@nxp.com; Honnappa Nagarahalli > ; olivier.m...@6wind.com; > bru

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-07 Thread Honnappa Nagarahalli
> Hi Gavin, > > > > >>> In weak memory models, like arm64, reading the {prod,cons}.tail > > > >>> may get reordered after reading or writing the ring slots, which > > > >>> corrupts the ring and stale data is observed. > > > >>> > > > >>> This issue was reported by NXP on 8-A72 DPAA2 board. The pr

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-07 Thread Ananyev, Konstantin
Hi Gavin, > > >>> In weak memory models, like arm64, reading the {prod,cons}.tail may get > > >>> reordered after reading or writing the ring slots, which corrupts the > > >>> ring > > >>> and stale data is observed. > > >>> > > >>> This issue was reported by NXP on 8-A72 DPAA2 board. The problem

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-07 Thread Gavin Hu (Arm Technology China)
> -Original Message- > From: Ilya Maximets > Sent: Thursday, March 7, 2019 5:48 PM > To: Gavin Hu (Arm Technology China) ; dev@dpdk.org > Cc: nd ; tho...@monjalon.net; jer...@marvell.com; > hemant.agra...@nxp.com; nipun.gu...@nxp.com; Honnappa Nagarahalli > ; olivier.m...@6wind.com > Sub

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-07 Thread Ilya Maximets
On 07.03.2019 12:27, Gavin Hu (Arm Technology China) wrote: > > >> -Original Message- >> From: Ilya Maximets >> Sent: Thursday, March 7, 2019 4:52 PM >> To: Gavin Hu (Arm Technology China) ; >> dev@dpdk.org >> Cc: nd ; tho...@monjalon.net; jer...@marvell.com; >> hemant.agra...@nxp.com; n

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-07 Thread Gavin Hu (Arm Technology China)
> -Original Message- > From: Ilya Maximets > Sent: Thursday, March 7, 2019 4:52 PM > To: Gavin Hu (Arm Technology China) ; > dev@dpdk.org > Cc: nd ; tho...@monjalon.net; jer...@marvell.com; > hemant.agra...@nxp.com; nipun.gu...@nxp.com; Honnappa Nagarahalli > ; olivier.m...@6wind.com > S

Re: [dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-07 Thread Ilya Maximets
On 07.03.2019 9:45, gavin hu wrote: > In weak memory models, like arm64, reading the {prod,cons}.tail may get > reordered after reading or writing the ring slots, which corrupts the ring > and stale data is observed. > > This issue was reported by NXP on 8-A72 DPAA2 board. The problem is most > li

[dpdk-dev] [PATCH v2] ring: enforce reading the tails before ring operations

2019-03-06 Thread gavin hu
In weak memory models, like arm64, reading the {prod,cons}.tail may get reordered after reading or writing the ring slots, which corrupts the ring and stale data is observed. This issue was reported by NXP on 8-A72 DPAA2 board. The problem is most likely caused by missing the acquire semantics whe