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)
commitf24fbf4de5d4241a7c5f3fa6fc7fcd60835a6b40
tree3548c4101d0d584937dd6b2455328b89dfa9d2c5
parent23d154c0d071468aadbebb57a0d73e93bd1aff0e
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