distributor: fix livelock on flush
authorLiang Ma <liang.j.ma@intel.com>
Thu, 25 Jul 2019 09:03:01 +0000 (10:03 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 29 Jul 2019 21:23:37 +0000 (23:23 +0200)
commit96c343868dd15ebdc74371a9dea2288b30ce13ea
tree84f304ec3c03bc8c33632668f0f32b9a650370e8
parent54ad947eda42042d2bdae69b57d0c7c8e291d9ec
distributor: fix livelock on flush

The Distributor autotest can lock if ran enough times. Worker and
distributor threads get into a livelock situation waiting on each
other.

To repeat:
`while sudo sh -c "echo 'distributor_autotest' |
./build/app/test/dpdk-test"; do :; done`

The root cause is where we are flushing on exit, and do not wait for
all worker packets to be returned before exiting.
Add a delay on flush so that all worker packets are returned before
completing the flush.

Bugzilla ID: 316
Fixes: 775003ad2f96 ("distributor: add new burst-capable library")
Cc: stable@dpdk.org
Reported-by: Michael Santana <msantana@redhat.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Tested-by: Michael Santana <msantana@redhat.com>
lib/librte_distributor/rte_distributor.c