Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[sfrench/cifs-2.6.git] / drivers / net / ethernet / mellanox / mlx5 / core / en_dcbnl.c
index 6435517c0beeb45e177cd9b9521801696da9370e..2449731b7d79a715c3d07a923bb4719cf299bd25 100644 (file)
@@ -1191,6 +1191,16 @@ static int mlx5e_trust_initialize(struct mlx5e_priv *priv)
                return err;
        WRITE_ONCE(priv->dcbx_dp.trust_state, trust_state);
 
+       if (priv->dcbx_dp.trust_state == MLX5_QPTS_TRUST_PCP && priv->dcbx.dscp_app_cnt) {
+               /*
+                * Align the driver state with the register state.
+                * Temporary state change is required to enable the app list reset.
+                */
+               priv->dcbx_dp.trust_state = MLX5_QPTS_TRUST_DSCP;
+               mlx5e_dcbnl_delete_app(priv);
+               priv->dcbx_dp.trust_state = MLX5_QPTS_TRUST_PCP;
+       }
+
        mlx5e_params_calc_trust_tx_min_inline_mode(priv->mdev, &priv->channels.params,
                                                   priv->dcbx_dp.trust_state);