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);
 }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to