]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_router: Take router lock in router notifier handler
authorPetr Machata <petrm@nvidia.com>
Sun, 8 May 2022 08:08:21 +0000 (11:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 May 2022 10:46:20 +0000 (11:46 +0100)
commit91940d7bfb65e684bee7cdfbc414da73c109d6b0
tree640b2269ddf165d774d16b5d5d87bf6a73439f98
parent25064be66c3d7a778d1fbb2f6ff3165ebae739d5
mlxsw: spectrum_router: Take router lock in router notifier handler

For notifications that the router needs to handle, router lock is taken.
Further, at least to determine whether an event is related to a tunnel
underlay, router lock also needs to be taken. Due to this, the router lock
is always taken for each unhandled event, and also for some handled events,
even if they are not related to underlay. Thus each event implies at least
one router lock, sometimes two.

Instead of deferring the locking to the leaf handlers, take the lock in the
router notifier handler always. This simplifies thinking about the locking
state, and in some cases saves one lock cycle.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c