All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Huy Nguyen <huyn@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net 2/7] net/mlx5e: DCBNL fix min inline header size for dscp
Date: Thu, 26 Apr 2018 12:58:37 -0700	[thread overview]
Message-ID: <20180426195842.29665-3-saeedm@mellanox.com> (raw)
In-Reply-To: <20180426195842.29665-1-saeedm@mellanox.com>

From: Huy Nguyen <huyn@mellanox.com>

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 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
index 3d46ef48d5b8..c641d5656b2d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
@@ -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)
-- 
2.14.3

  parent reply	other threads:[~2018-04-26 19:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 19:58 [pull request][net 0/7] Mellanox, mlx5 fixes 2018-04-26 Saeed Mahameed
2018-04-26 19:58 ` [net 1/7] net/mlx5e: Allow offloading ipv4 header re-write for icmp Saeed Mahameed
2018-04-26 19:58 ` Saeed Mahameed [this message]
2018-04-26 19:58 ` [net 3/7] net/mlx5: Fix mlx5_get_vector_affinity function Saeed Mahameed
2018-04-26 19:58 ` [net 4/7] net/mlx5e: TX, Use correct counter in dma_map error flow Saeed Mahameed
2018-04-26 19:58 ` [net 5/7] net/mlx5: Avoid cleaning flow steering table twice during " Saeed Mahameed
2018-04-26 19:58 ` [net 6/7] net/mlx5e: Fix traffic between VF and representor Saeed Mahameed
2018-04-26 19:58 ` [net 7/7] net/mlx5: Properly deal with flow counters when deleting rules Saeed Mahameed
2018-04-27 18:32 ` [pull request][net 0/7] Mellanox, mlx5 fixes 2018-04-26 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180426195842.29665-3-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=huyn@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.