Skip to content

Commit 54d6c88

Browse files
Shahar Kleinroidayan
authored andcommitted
net/mlx5: E-Switch, Unload the representors in the correct order
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]>
1 parent ecc7aa4 commit 54d6c88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ void esw_offloads_cleanup(struct mlx5_eswitch *esw, int nvports)
817817
struct mlx5_eswitch_rep *rep;
818818
int vport;
819819

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

0 commit comments

Comments
 (0)