Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jul 2017 19:26:50 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320876 - head/sys/dev/mlx4/mlx4_en
Message-ID:  <201707101926.v6AJQoEW050827@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Jul 10 19:26:50 2017
New Revision: 320876
URL: https://svnweb.freebsd.org/changeset/base/320876

Log:
  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.
  
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c

Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c
==============================================================================
--- head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c	Mon Jul 10 17:53:12 2017	(r320875)
+++ head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c	Mon Jul 10 19:26:50 2017	(r320876)
@@ -394,8 +394,14 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *pri
                 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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707101926.v6AJQoEW050827>