Netdev List
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Alaa Hleihel <alaa@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [RESEND net 2/3] net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ
Date: Mon, 17 Sep 2018 20:49:27 -0700	[thread overview]
Message-ID: <20180918034928.28651-3-saeedm@mellanox.com> (raw)
In-Reply-To: <20180918034928.28651-1-saeedm@mellanox.com>

From: Alaa Hleihel <alaa@mellanox.com>

When modifying hairpin SQ, instead of checking if the next state equals
to MLX5_SQC_STATE_RDY, we compare it against the MLX5_RQC_STATE_RDY enum
value.

The code worked since both of MLX5_RQC_STATE_RDY and MLX5_SQC_STATE_RDY
have the same value today.

This patch fixes this issue.

Fixes: 18e568c390c6 ("net/mlx5: Hairpin pair core object setup")
Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/transobj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/transobj.c b/drivers/net/ethernet/mellanox/mlx5/core/transobj.c
index dae1c5c5d27c..d2f76070ea7c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/transobj.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/transobj.c
@@ -509,7 +509,7 @@ static int mlx5_hairpin_modify_sq(struct mlx5_core_dev *peer_mdev, u32 sqn,
 
 	sqc = MLX5_ADDR_OF(modify_sq_in, in, ctx);
 
-	if (next_state == MLX5_RQC_STATE_RDY) {
+	if (next_state == MLX5_SQC_STATE_RDY) {
 		MLX5_SET(sqc, sqc, hairpin_peer_rq, peer_rq);
 		MLX5_SET(sqc, sqc, hairpin_peer_vhca, peer_vhca);
 	}
-- 
2.17.1

  parent reply	other threads:[~2018-09-18  9:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18  3:49 [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 Saeed Mahameed
2018-09-18  3:49 ` [RESEND net 1/3] net/mlx5: Fix read from coherent memory Saeed Mahameed
2018-09-18  3:49 ` Saeed Mahameed [this message]
2018-09-18  3:49 ` [RESEND net 3/3] net/mlx5e: TLS, Read capabilities only when it is safe Saeed Mahameed
2018-09-19  3:00 ` [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 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=20180918034928.28651-3-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=alaa@mellanox.com \
    --cc=davem@davemloft.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox