]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: E-Switch, Unload the representors in the correct order
authorShahar Klein <shahark@mellanox.com>
Tue, 1 Aug 2017 12:29:55 +0000 (15:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Sep 2017 06:22:09 +0000 (08:22 +0200)
commit8db40bcf439f3939d16de824adc7a0d781390761
treeb1cadca03083ec617b3a864bd85066c2adec44b9
parentb0034cb5014e7c7d64389c52ee58180101c8ac29
net/mlx5: E-Switch, Unload the representors in the correct order

[ Upstream commit 191220396db840822fc818edf03c49f0c02eb237 ]

When changing from switchdev to legacy mode, all the representor port
devices (uplink nic and reps) are cleaned up. Part of this cleaning
process is removing the neigh entries and the hash table containing them.
However, a representor neigh entry might be linked to the uplink port
hash table and if the uplink nic is cleaned first the cleaning of the
representor will end up in null deref.
Fix that by unloading the representors in the opposite order of load.

Fixes: cb67b832921c ("net/mlx5e: Introduce SRIOV VF representors")
Signed-off-by: Shahar Klein <shahark@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c