Skip to content

Commit d7073e8

Browse files
shayshyikuba-moo
authored andcommitted
net/mlx5: E-switch, Clear legacy flag when moving to switchdev
The cited commit introduced MLX5_PRIV_FLAGS_SWITCH_LEGACY to identify when a transition to legacy mode is requested via devlink. However, the logic failed to clear this flag if the mode was subsequently changed back to MLX5_ESWITCH_OFFLOADS (switchdev). Consequently, if a user toggled from legacy to switchdev, the flag remained set, leaving the driver with wrong state indicating Fix this by explicitly clearing the MLX5_PRIV_FLAGS_SWITCH_LEGACY bit when the requested mode is MLX5_ESWITCH_OFFLOADS. Fixes: 2a4f56f ("net/mlx5e: Keep netdev when leave switchdev for devlink set legacy only") Signed-off-by: Shay Drory <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bd7b9f8 commit d7073e8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4068,6 +4068,8 @@ int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
40684068

40694069
if (mlx5_mode == MLX5_ESWITCH_LEGACY)
40704070
esw->dev->priv.flags |= MLX5_PRIV_FLAGS_SWITCH_LEGACY;
4071+
if (mlx5_mode == MLX5_ESWITCH_OFFLOADS)
4072+
esw->dev->priv.flags &= ~MLX5_PRIV_FLAGS_SWITCH_LEGACY;
40714073
mlx5_eswitch_disable_locked(esw);
40724074
if (mlx5_mode == MLX5_ESWITCH_OFFLOADS) {
40734075
if (mlx5_devlink_trap_get_num_active(esw->dev)) {

0 commit comments

Comments
 (0)