Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2018 15:58:30 +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: r330659 - head/sys/dev/mlx5/mlx5_en
Message-ID:  <201803081558.w28FwUw9017510@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



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