[dpdk-dev] [PATCH RFC v1 4/6] net/mlx5: add descriptive comment for a barrier
Gavin Hu
gavin.hu at arm.com
Thu Feb 13 13:38:52 CET 2020
The barrier is not required or can be moved down if HW waits for the
doorbell ring to execute the WQE.
This is not the case as HW can start executing the WQE until it gets the
ownership(passed by SW writing the doorbell record).
Add a decriptive comment for this HW specific behavior.
Signed-off-by: Gavin Hu <gavin.hu at arm.com>
Reviewed-by: Phil Yang <phil.yang at arm.com>
---
drivers/net/mlx5/mlx5_rxtx.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index c672af4c4..d32c4e430 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -655,6 +655,11 @@ mlx5_tx_dbrec_cond_wmb(struct mlx5_txq_data *txq, volatile struct mlx5_wqe *wqe,
uint64_t *dst = MLX5_TX_BFREG(txq);
volatile uint64_t *src = ((volatile uint64_t *)wqe);
+ /* The ownership of WQE is passed to HW by updating the doorbell
+ * record. Once WQE ownership has been passed to the HCA, HW can
+ * execute the WQE. The barrier is to ensure the WQE are visible
+ * to HW before HW execute it.
+ */
rte_cio_wmb();
*txq->qp_db = rte_cpu_to_be_32(txq->wqe_ci);
/* Ensure ordering between DB record and BF copy. */
--
2.17.1
More information about the dev
mailing list