]> git.baikalelectronics.ru Git - kernel.git/commit
switchdev: Add a blocking notifier chain
authorPetr Machata <petrm@mellanox.com>
Thu, 22 Nov 2018 23:28:25 +0000 (23:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 24 Nov 2018 02:02:23 +0000 (18:02 -0800)
commit1348e0b8ca683fdeab294aa2b4fae6b73c653907
tree668db99bc01b59b8a3da2d19003f0a5843aaa0ae
parent7cbc0d0542579a75d8cd775b5c4b769763f25393
switchdev: Add a blocking notifier chain

In general one can't assume that a switchdev notifier is called in a
non-atomic context, and correspondingly, the switchdev notifier chain is
an atomic one.

However, port object addition and deletion messages are delivered from a
process context. Even the MDB addition messages, whose delivery is
scheduled from atomic context, are queued and the delivery itself takes
place in blocking context. For VLAN messages in particular, keeping the
blocking nature is important for error reporting.

Therefore introduce a blocking notifier chain and related service
functions to distribute the notifications for which a blocking context
can be assumed.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/switchdev.h
net/switchdev/switchdev.c