[v8,00/17] fix distributor synchronization issues
mbox series

Message ID 20201017030701.16134-1-l.wojciechow@partner.samsung.com
Headers show
Series
  • fix distributor synchronization issues
Related show

Message

Lukasz Wojciechowski Oct. 17, 2020, 3:06 a.m. UTC
During review and verification of the patch created by Sarosh Arif:
"test_distributor: prevent memory leakages from the pool" I found out
that running distributor unit tests multiple times in a row causes fails.
So I investigated all the issues I found.

There are few synchronization issues that might cause deadlocks
or corrupted data. They are fixed with this set of patches for both tests
and librte_distributor library.

---
v8:
* simplify memory model to relaxed and remove extra variable in patch 1
* rearrange order of patches: "synchronize lcores statistics"
    and "fix freeing mbufs" to avoid changing same code twice
* reword "packages" -> "packets" in "collect return mbufs" commit message
* add patch 17 fixing quitting of workers in distributor tests

v7:
* add patch 16 ensuring that tests will try sending packets until workers
    are started and requested for packets

v6:
* fix comments indentation
* fix stats atomic operations memory mode from ACQUIRE/RELEASE
    to RELAXED

v5:
* implement missing functionality in burst mode - worker shutdown
* fix shutdown test to always shutdown busy worker
* use atomic stores instead of barrier in tests clear_packet_count()
* reorder patches
* new patch 7: fix call to return_pkt in single mode
* new patch 11: replacing delays with spinlock on atomics in tests
* new patch 12: fix scalar matching algorithm
* new patch 13: new test with marking and checking every packet
* new patch 14: flush also in flight packets
* new patch 15: fix clearing returns buffer
* minor fixes in other patches

v4:
* adjust commit name prefixes app/test -> test/distributor:
* reorder patches
* use NULL oldpkt in rte_distributor_get_pkt() calls in tests

v3:
* add missing acked and tested by statements from v1

v2:
* assign NULL to freed mbufs in distributor test
* fix handshake check on legacy single distributor
     rte_distributor_return_pkt_single()
* add patch 7 passing NULL to legacy API calls if no bufs are returned
* add patch 8 fixing API documentation
 

Lukasz Wojciechowski (17):
  distributor: fix missing handshake synchronization
  distributor: fix handshake deadlock
  distributor: do not use oldpkt when not needed
  distributor: handle worker shutdown in burst mode
  test/distributor: fix shutdown of busy worker
  distributor: fix return pkt calls in single mode
  test/distributor: fix freeing mbufs
  test/distributor: synchronize lcores statistics
  test/distributor: collect return mbufs
  distributor: align API documentation with code
  test/distributor: replace delays with spin locks
  distributor: fix scalar matching
  test/distributor: add test with packets marking
  distributor: fix flushing in flight packets
  distributor: fix clearing returns buffer
  test/distributor: ensure all packets are delivered
  test/distributor: fix quitting workers

 app/test/test_distributor.c                   | 353 ++++++++++++++----
 lib/librte_distributor/distributor_private.h  |   3 +
 lib/librte_distributor/rte_distributor.c      | 217 ++++++++---
 lib/librte_distributor/rte_distributor.h      |  23 +-
 .../rte_distributor_single.c                  |   4 +
 5 files changed, 473 insertions(+), 127 deletions(-)

Comments

David Marchand Oct. 19, 2020, 8:32 a.m. UTC | #1
On Sat, Oct 17, 2020 at 5:07 AM Lukasz Wojciechowski
<l.wojciechow@partner.samsung.com> wrote:
>
> During review and verification of the patch created by Sarosh Arif:
> "test_distributor: prevent memory leakages from the pool" I found out
> that running distributor unit tests multiple times in a row causes fails.
> So I investigated all the issues I found.
>
> There are few synchronization issues that might cause deadlocks
> or corrupted data. They are fixed with this set of patches for both tests
> and librte_distributor library.
>

Series applied, thanks Lukasz!