net/failsafe: mitigate data plane atomic operations
authorMatan Azrad <matan@mellanox.com>
Tue, 19 Dec 2017 17:14:28 +0000 (17:14 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
commit1e2670a9002d59c0c0aa1b29a8997bb7177cffe0
treea7f7114bbb3f80aa5a64a0cef57df8ed22f43063
parente6282283090b479953b8c0f951977c82cc368322
net/failsafe: mitigate data plane atomic operations

Fail-safe uses atomic operations to protect sub-device close operation
calling by host thread in removal time while the removed sub-device
burst functions are still in process by application threads.

Using "set" atomic operations is a little bit more efficient than "add"
or "sub" atomic operations because "set" shouldn't read the value and
in fact, it does not need a special atomic mechanism in x86 platforms.

Replace "add 1" and "sub 1" atomic operations by "set 1" and "set 0"
atomic operations.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
drivers/net/failsafe/failsafe_private.h