summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2017-07-13 15:54:26 +0000
committerhselasky <hselasky@FreeBSD.org>2017-07-13 15:54:26 +0000
commit7099733c5a6b6ef52c2367fd744959d8be36a260 (patch)
treed5f1f96347ad1bcd201875805c848cd3843ae7c5
parent6a14c848154f9b1a6511cd1d248d9c8e8ed12172 (diff)
downloadFreeBSD-src-7099733c5a6b6ef52c2367fd744959d8be36a260.zip
FreeBSD-src-7099733c5a6b6ef52c2367fd744959d8be36a260.tar.gz
MF11 r320947; MFC r320876:
Make sure the mlx4en RX DMA ring gets stamped with software ownership in order to prevent the flow of QP to error in the firmware once UPDATE_QP is called. Approved by: re (marius) Sponsored by: Mellanox Technologies
-rw-r--r--sys/ofed/drivers/net/mlx4/en_rx.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/ofed/drivers/net/mlx4/en_rx.c b/sys/ofed/drivers/net/mlx4/en_rx.c
index 2711b22..5e9ec86 100644
--- a/sys/ofed/drivers/net/mlx4/en_rx.c
+++ b/sys/ofed/drivers/net/mlx4/en_rx.c
@@ -394,8 +394,14 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
ring->rx_mb_size = priv->rx_mb_size;
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;
OpenPOWER on IntegriCloud