Skip to content

Commit

Permalink
net/mlx5: E-Switch, Unload the representors in the correct order
Browse files Browse the repository at this point in the history
This fixes a bug in which changing mode to legacy while handling VXLAN
traffic causes a NULL derefrence.

When switching from switchdev to legacy all the port devices (nic and
reps) are cleaned up. Part of this cleaning process is removing the
neigh entry and the hash table containing them. however, a representor
neigh entry might be linked to the nic hash table and if the 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.

Issue: 1063609
Change-Id: I609697cc684574413ad23d53cae75ea28cef9dc5
Fixes: cb67b83 ("net/mlx5e: Introduce SRIOV VF representors")
Signed-off-by: Shahar Klein <[email protected]>
Reviewed-by: Roi Dayan <[email protected]>
  • Loading branch information
Shahar Klein authored and roidayan committed Aug 24, 2017
1 parent ecc7aa4 commit 54d6c88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ void esw_offloads_cleanup(struct mlx5_eswitch *esw, int nvports)
struct mlx5_eswitch_rep *rep;
int vport;

for (vport = 0; vport < nvports; vport++) {
for (vport = nvports - 1; vport >= 0; vport--) {
rep = &esw->offloads.vport_reps[vport];
if (!rep->valid)
continue;
Expand Down

0 comments on commit 54d6c88

Please sign in to comment.