mbox series

[v3,0/2] fix distributor unit test

Message ID 20191015092826.13002-1-ruifeng.wang@arm.com (mailing list archive)
Headers
Series fix distributor unit test |

Message

Ruifeng Wang Oct. 15, 2019, 9:28 a.m. UTC
  Bug 342 reported distributor_autotest execution suspension
on aarch64 platform.
Issue was due to lack of synchronization among threads. Distributor
thread and worker thread may get deadlocked.
Fixed synchronization issue by adding barriers.

Another issue identified was in test case. Non-atomic operation on
stat value could cause value reset not been observed by worker thread
and mess counters. The issue was fixed by using atomic operations.

---
v3:
Added comments for using of C11 acquire/release semantics. (Honnappa)

v2:
Fixed intermittent packet count incorrect failure. (Aaron, David)
Fixed Clang build on 32bit systems.
Additional patch to fix non-atomic operation in unit test.


Ruifeng Wang (2):
  lib/distributor: fix deadlock issue for aarch64
  test/distributor: fix false unit test failure

 app/test/test_distributor.c                  |  6 +-
 lib/librte_distributor/meson.build           |  5 ++
 lib/librte_distributor/rte_distributor.c     | 68 ++++++++++++++------
 lib/librte_distributor/rte_distributor_v20.c | 59 ++++++++++++-----
 4 files changed, 101 insertions(+), 37 deletions(-)
  

Comments

David Marchand Oct. 24, 2019, 7:31 p.m. UTC | #1
On Tue, Oct 15, 2019 at 11:29 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
>
> Bug 342 reported distributor_autotest execution suspension
> on aarch64 platform.
> Issue was due to lack of synchronization among threads. Distributor
> thread and worker thread may get deadlocked.
> Fixed synchronization issue by adding barriers.
>
> Another issue identified was in test case. Non-atomic operation on
> stat value could cause value reset not been observed by worker thread
> and mess counters. The issue was fixed by using atomic operations.
>
> ---
> v3:
> Added comments for using of C11 acquire/release semantics. (Honnappa)
>
> v2:
> Fixed intermittent packet count incorrect failure. (Aaron, David)
> Fixed Clang build on 32bit systems.
> Additional patch to fix non-atomic operation in unit test.

David,

Can you review this series?
Thanks.
  
Hunt, David Oct. 25, 2019, 8:11 a.m. UTC | #2
On 24/10/2019 20:31, David Marchand wrote:
> On Tue, Oct 15, 2019 at 11:29 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
>> Bug 342 reported distributor_autotest execution suspension
>> on aarch64 platform.
>> Issue was due to lack of synchronization among threads. Distributor
>> thread and worker thread may get deadlocked.
>> Fixed synchronization issue by adding barriers.
>>
>> Another issue identified was in test case. Non-atomic operation on
>> stat value could cause value reset not been observed by worker thread
>> and mess counters. The issue was fixed by using atomic operations.
>>
>> ---
>> v3:
>> Added comments for using of C11 acquire/release semantics. (Honnappa)
>>
>> v2:
>> Fixed intermittent packet count incorrect failure. (Aaron, David)
>> Fixed Clang build on 32bit systems.
>> Additional patch to fix non-atomic operation in unit test.
> David,
>
> Can you review this series?
> Thanks.
>

Hi David,

     I had tested this previously, including performance comparisons 
against original version on x86, and saw no performance degradation, so 
I Acked it. I can re-ack on the latest version now.

Thanks,
Dave.
  
David Marchand Oct. 25, 2019, 8:18 a.m. UTC | #3
On Fri, Oct 25, 2019 at 10:11 AM Hunt, David <david.hunt@intel.com> wrote:
>
>
> On 24/10/2019 20:31, David Marchand wrote:
> > On Tue, Oct 15, 2019 at 11:29 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
> >> Bug 342 reported distributor_autotest execution suspension
> >> on aarch64 platform.
> >> Issue was due to lack of synchronization among threads. Distributor
> >> thread and worker thread may get deadlocked.
> >> Fixed synchronization issue by adding barriers.
> >>
> >> Another issue identified was in test case. Non-atomic operation on
> >> stat value could cause value reset not been observed by worker thread
> >> and mess counters. The issue was fixed by using atomic operations.
> >>
> >> ---
> >> v3:
> >> Added comments for using of C11 acquire/release semantics. (Honnappa)

The comments are also something to maintain, so checking the v3 made
sense to me.


> >>
> >> v2:
> >> Fixed intermittent packet count incorrect failure. (Aaron, David)
> >> Fixed Clang build on 32bit systems.
> >> Additional patch to fix non-atomic operation in unit test.
> > David,
> >
> > Can you review this series?
> > Thanks.
> >
>
> Hi David,
>
>      I had tested this previously, including performance comparisons
> against original version on x86, and saw no performance degradation, so
> I Acked it. I can re-ack on the latest version now.

If you think this is fine as is, I will go and apply with your ack.
  
Hunt, David Oct. 25, 2019, 8:20 a.m. UTC | #4
On 25/10/2019 09:18, David Marchand wrote:
> On Fri, Oct 25, 2019 at 10:11 AM Hunt, David <david.hunt@intel.com> wrote:
>>
>> On 24/10/2019 20:31, David Marchand wrote:
>>> On Tue, Oct 15, 2019 at 11:29 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
>>>> Bug 342 reported distributor_autotest execution suspension
>>>> on aarch64 platform.
>>>> Issue was due to lack of synchronization among threads. Distributor
>>>> thread and worker thread may get deadlocked.
>>>> Fixed synchronization issue by adding barriers.
>>>>
>>>> Another issue identified was in test case. Non-atomic operation on
>>>> stat value could cause value reset not been observed by worker thread
>>>> and mess counters. The issue was fixed by using atomic operations.
>>>>
>>>> ---
>>>> v3:
>>>> Added comments for using of C11 acquire/release semantics. (Honnappa)
> The comments are also something to maintain, so checking the v3 made
> sense to me.


   I agree, and the comments look good to me.



>
>>>> v2:
>>>> Fixed intermittent packet count incorrect failure. (Aaron, David)
>>>> Fixed Clang build on 32bit systems.
>>>> Additional patch to fix non-atomic operation in unit test.
>>> David,
>>>
>>> Can you review this series?
>>> Thanks.
>>>
>> Hi David,
>>
>>       I had tested this previously, including performance comparisons
>> against original version on x86, and saw no performance degradation, so
>> I Acked it. I can re-ack on the latest version now.
> If you think this is fine as is, I will go and apply with your ack.


Sure, thanks.


Regards,

Dave.
  
David Marchand Oct. 25, 2019, 8:33 a.m. UTC | #5
On Tue, Oct 15, 2019 at 11:29 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
>
> Bug 342 reported distributor_autotest execution suspension
> on aarch64 platform.
> Issue was due to lack of synchronization among threads. Distributor
> thread and worker thread may get deadlocked.
> Fixed synchronization issue by adding barriers.
>
> Another issue identified was in test case. Non-atomic operation on
> stat value could cause value reset not been observed by worker thread
> and mess counters. The issue was fixed by using atomic operations.

Acked-by: David Hunt <david.hunt@intel.com>

Applied, thanks.



--
David Marchand