From: Dekel Peled Date: Thu, 28 Feb 2019 15:20:30 +0000 (+0200) Subject: net/mlx5: fix sync when handling Tx completions X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fd350d3c9a13b5ebcb41741870c3f09b6920033f;p=dpdk.git net/mlx5: fix sync when handling Tx completions Function mlx5_tx_complete() reads completion entry information from Tx queue. For some processors not having strongly-ordered memory model, there has to be a memory barrier between reading the entry index and the entry fields, in order to guarantee data is valid. Fixes: 54d3fe948dba ("net/mlx5: poll completion queue once per a call") Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Shahaf Shuler --- diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index c0e1adf140..53115dde3d 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -568,6 +568,7 @@ mlx5_tx_complete(struct mlx5_txq_data *txq) } #endif /* NDEBUG */ ++cq_ci; + rte_cio_rmb(); txq->wqe_pi = rte_be_to_cpu_16(cqe->wqe_counter); ctrl = (volatile struct mlx5_wqe_ctrl *) tx_mlx5_wqe(txq, txq->wqe_pi);