net/failsafe: fix Rx clean race
authorMatan Azrad <matan@mellanox.com>
Sun, 22 Oct 2017 05:51:08 +0000 (05:51 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 26 Oct 2017 23:05:55 +0000 (01:05 +0200)
commit295f7ed2dd452aba090080f380c2981b366aa2da
tree3ea4c3576e06c59f656df01222e5f4fb2e807a1d
parent1f148d8eaf3baaf123fd8bf692947fe9437a5ab6
net/failsafe: fix Rx clean race

When removing a device, the fail-safe checks that it is not within its
datapath before cleaning it.

When checking whether an Rx burst should be performed on a device, the
remove flag is not checked. Thus the port could still enter its datapath
and miss a removal round. Furthermore, there is a race between the
thread removing the device and the polling thread.

Check the remove flag before entering a sub-device Rx burst when in safe
mode. This check mitigates the aforementioned race condition.

Fixes: 72a57bfd9a0e ("net/failsafe: add fast burst functions")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
drivers/net/failsafe/failsafe_rxtx.c