]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net/mlx5e: DCBNL fix min inline header size for dscp
authorHuy Nguyen <huyn@mellanox.com>
Thu, 21 Dec 2017 21:15:24 +0000 (15:15 -0600)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 26 Apr 2018 19:43:18 +0000 (12:43 -0700)
When the trust state is set to dscp and the netdev is down, the inline
header size is not updated. When netdev is up, the inline header size
stays at L2 instead of IP.

Fix this issue by updating the private parameter when the netdev is in
down so that when netdev is up, it picks up the right header size.

Fixes: fbcb127e89ba ("net/mlx5e: Support DSCP trust state ...")
Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c

index 3d46ef48d5b82ef0d1f85e93a0ac0694080173b4..c641d5656b2de3c8028b435057cf39b202cd5b6b 100644 (file)
@@ -1007,12 +1007,14 @@ static void mlx5e_trust_update_sq_inline_mode(struct mlx5e_priv *priv)
 
        mutex_lock(&priv->state_lock);
 
-       if (!test_bit(MLX5E_STATE_OPENED, &priv->state))
-               goto out;
-
        new_channels.params = priv->channels.params;
        mlx5e_trust_update_tx_min_inline_mode(priv, &new_channels.params);
 
+       if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
+               priv->channels.params = new_channels.params;
+               goto out;
+       }
+
        /* Skip if tx_min_inline is the same */
        if (new_channels.params.tx_min_inline_mode ==
            priv->channels.params.tx_min_inline_mode)