]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_router: Do not assume RTNL is taken when resolving underlay device
authorIdo Schimmel <idosch@mellanox.com>
Thu, 20 Feb 2020 07:07:55 +0000 (09:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Feb 2020 18:04:34 +0000 (10:04 -0800)
commit2c1f577ff8ffa23dda312f11a7be2109e8c203b3
tree3548c4101d0d584937dd6b2455328b89dfa9d2c5
parent7e90823d4a4c4cfbf9dde20ec06f3bdfc7d2429d
mlxsw: spectrum_router: Do not assume RTNL is taken when resolving underlay device

The function that resolves the underlay device of the IPIP tunnel
assumes that RTNL is taken, but this will not be correct when RTNL is
removed from the route insertion path.

Convert the function to use dev_get_by_index_rcu() instead of
__dev_get_by_index() and make sure it is always called from an RCU
read-side critical section.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c