stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sumit Semwal <sumit.semwal@linaro.org>
To: stable@vger.kernel.org
Cc: Eugenia Emantayev <eugenia@mellanox.com>,
	Tariq Toukan <tariqt@mellanox.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sumit Semwal <sumit.semwal@linaro.org>
Subject: [PATCH for-4.9 3/5] net/mlx4_en: Fix bad WQE issue
Date: Wed, 12 Apr 2017 23:06:33 +0530	[thread overview]
Message-ID: <1492018595-13167-4-git-send-email-sumit.semwal@linaro.org> (raw)
In-Reply-To: <1492018595-13167-1-git-send-email-sumit.semwal@linaro.org>

From: Eugenia Emantayev <eugenia@mellanox.com>

[ Upstream commit 6496bbf0ec481966ef9ffe5b6660d8d1b55c60cc ]

Single send WQE in RX buffer should be stamped with software
ownership in order to prevent the flow of QP in error in FW
once UPDATE_QP is called.

Fixes: 9f519f68cfff ('mlx4_en: Not using Shared Receive Queues')
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 4d3ddc2..5d48458 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -444,8 +444,14 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
 		ring->cqn = priv->rx_cq[ring_ind]->mcq.cqn;
 
 		ring->stride = stride;
-		if (ring->stride <= TXBB_SIZE)
+		if (ring->stride <= TXBB_SIZE) {
+			/* Stamp first unused send wqe */
+			__be32 *ptr = (__be32 *)ring->buf;
+			__be32 stamp = cpu_to_be32(1 << STAMP_SHIFT);
+			*ptr = stamp;
+			/* Move pointer to start of rx section */
 			ring->buf += TXBB_SIZE;
+		}
 
 		ring->log_stride = ffs(ring->stride) - 1;
 		ring->buf_size = ring->size * ring->stride;
-- 
2.7.4

  parent reply	other threads:[~2017-04-12 17:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12 17:36 [PATCH for-4.9 0/5] Stable commits from Ubuntu Xenial 4.4-lts Sumit Semwal
2017-04-12 17:36 ` [PATCH for-4.9 1/5] blk-mq: Avoid memory reclaim when remapping queues Sumit Semwal
2017-04-12 17:36 ` [PATCH for-4.9 2/5] usb: hub: Wait for connection to be reestablished after port reset Sumit Semwal
2017-04-12 17:36 ` Sumit Semwal [this message]
2017-04-12 17:36 ` [PATCH for-4.9 4/5] net/mlx4_core: Fix racy CQ (Completion Queue) free Sumit Semwal
2017-04-12 17:36 ` [PATCH for-4.9 5/5] net/mlx4_core: Fix when to save some qp context flags for dynamic VST to VGT transitions Sumit Semwal
2017-04-14  9:16 ` [PATCH for-4.9 0/5] Stable commits from Ubuntu Xenial 4.4-lts Greg KH

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=1492018595-13167-4-git-send-email-sumit.semwal@linaro.org \
    --to=sumit.semwal@linaro.org \
    --cc=davem@davemloft.net \
    --cc=eugenia@mellanox.com \
    --cc=stable@vger.kernel.org \
    --cc=tariqt@mellanox.com \
    /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;
as well as URLs for NNTP newsgroup(s).