Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2018 21:04:47 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r331590 - stable/11/sys/dev/mlx5/mlx5_en
Message-ID:  <201803262104.w2QL4lA3037111@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Mar 26 21:04:47 2018
New Revision: 331590
URL: https://svnweb.freebsd.org/changeset/base/331590

Log:
  MFC r330659:
  Avoid more LFENCE/SFENCe on x86 in mlx5en(4),
  by using the FreeBSD native fences.
  
  Submitted by:	kib@
  Sponsored by:	Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Mon Mar 26 21:03:33 2018	(r331589)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Mon Mar 26 21:04:47 2018	(r331590)
@@ -1256,7 +1256,7 @@ mlx5e_sq_send_nops_locked(struct mlx5e_sq *sq, int can
 		}
 		/* send a single NOP */
 		mlx5e_send_nop(sq, 1);
-		wmb();
+		atomic_thread_fence_rel();
 	}
 done:
 	/* Check if we need to write the doorbell */

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c	Mon Mar 26 21:03:33 2018	(r331589)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c	Mon Mar 26 21:04:47 2018	(r331590)
@@ -429,7 +429,7 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, int budget)
 	mlx5_cqwq_update_db_record(&sq->cq.wq);
 
 	/* Ensure cq space is freed before enabling more cqes */
-	wmb();
+	atomic_thread_fence_rel();
 
 	sq->cc = sqcc;
 

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c	Mon Mar 26 21:03:33 2018	(r331589)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c	Mon Mar 26 21:04:47 2018	(r331590)
@@ -38,7 +38,7 @@ mlx5e_get_cqe(struct mlx5e_cq *cq)
 		return (NULL);
 
 	/* ensure cqe content is read after cqe ownership bit */
-	rmb();
+	atomic_thread_fence_acq();
 
 	return (cqe);
 }



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