mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
net/mlx5: Use dma_wmb() for completion queue doorbell updates
dma_*() barriers are specifically for ordering writes to DMA coherent memory that is accessible to both the CPU and DMA capable devices. The dma_wmb() barrier is lighter than wmb() on some architectures because it only ensures ordering for DMA writes, not for all writes including MMIO accesses. In the MLX5 driver, completion queue (CQ) doorbell records are allocated as DMA coherent memory via mlx5_dma_zalloc_coherent_node(). The CQ update pattern is: 1. Update CQ space (device reads via DMA) 2. Update doorbell record (device reads via DMA) 3. Memory barrier 4. Enable more CQEs Since only DMA coherent memory accesses are involved (no MMIO accesses follow), we can safely use dma_wmb() instead of wmb(). This change improves performance slightly on architectures where dma_wmb() is lighter than wmb(). Signed-off-by: Li RongQing <lirongqing@baidu.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260902023429.1717-1-lirongqing@baidu.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
1d1ac57cc9
commit
31f961de2f
6 changed files with 6 additions and 6 deletions
Loading…
Add table
Add a link
Reference in a new issue