Skip to content

Commit 5a2ba25

Browse files
Maxim MikityanskiySaeed Mahameed
authored andcommitted
net/mlx5e: Update max_opened_tc also when channels are closed
max_opened_tc is used for stats, so that potentially non-zero stats won't disappear when num_tc decreases. However, mlx5e_setup_tc_mqprio fails to update it in the flow where channels are closed. This commit fixes it. The new value of priv->channels.params.num_tc is always checked on exit. In case of errors it will just be the old value, and in case of success it will be the updated value. Fixes: 05909ba ("net/mlx5e: Avoid reset netdev stats on configuration changes") Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent a5bfe6b commit 5a2ba25

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,12 +3627,10 @@ static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv,
36273627

36283628
err = mlx5e_safe_switch_channels(priv, &new_channels,
36293629
mlx5e_num_channels_changed_ctx, NULL);
3630-
if (err)
3631-
goto out;
36323630

3633-
priv->max_opened_tc = max_t(u8, priv->max_opened_tc,
3634-
new_channels.params.num_tc);
36353631
out:
3632+
priv->max_opened_tc = max_t(u8, priv->max_opened_tc,
3633+
priv->channels.params.num_tc);
36363634
mutex_unlock(&priv->state_lock);
36373635
return err;
36383636
}

0 commit comments

Comments
 (0)