net/failsafe: fix sub-device ownership race
authorMatan Azrad <matan@mellanox.com>
Thu, 10 May 2018 23:58:35 +0000 (01:58 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:31:53 +0000 (22:31 +0100)
commit7fda13d3a508473d21238bf20de39245f584a38c
tree8f6b5c37a594f8135011569d236e3e5c12f90c05
parentbe8cd210379af4f79c225963a5831975e917a6aa
net/failsafe: fix sub-device ownership race

There is time between the sub-device port probing by the sub-device PMD
to the sub-device port ownership taking by a fail-safe port.

In this time, the port is available for the application usage. For
example, the port will be exposed to the applications which use
RTE_ETH_FOREACH_DEV iterator.

Thus, ownership unaware applications may manage the port in this time
what may cause a lot of problematic behaviors in the fail-safe
sub-device initialization.

Register to the ethdev NEW event to take the sub-device port ownership
before it becomes exposed to the application.

Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/failsafe/failsafe.c
drivers/net/failsafe/failsafe_eal.c
drivers/net/failsafe/failsafe_ether.c
drivers/net/failsafe/failsafe_private.h