svn commit: r330659 - head/sys/dev/mlx5/mlx5_en

Hans Petter Selasky hselasky at FreeBSD.org
Thu Mar 8 15:58:31 UTC 2018


Author: hselasky
Date: Thu Mar  8 15:58:30 2018
New Revision: 330659
URL: https://svnweb.freebsd.org/changeset/base/330659

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

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu Mar  8 15:53:04 2018	(r330658)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu Mar  8 15:58:30 2018	(r330659)
@@ -1361,7 +1361,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: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c	Thu Mar  8 15:53:04 2018	(r330658)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c	Thu Mar  8 15:58:30 2018	(r330659)
@@ -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: head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c	Thu Mar  8 15:53:04 2018	(r330658)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c	Thu Mar  8 15:58:30 2018	(r330659)
@@ -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);
 }


More information about the svn-src-all mailing list