diff options
| author | Li RongQing <lirongqing@baidu.com> | 2026-09-02 10:34:29 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-09-05 13:01:36 -0700 |
| commit | 31f961de2f90fbf52eb2d4e15b3eeaa09f9b4fc2 (patch) | |
| tree | 8649cee5ea463e31a87b93caa1a69d56c7c162d1 /scripts | |
| parent | 1d1ac57cc9af54948fee2f7c71e7f6600b151cb4 (diff) | |
| download | linux-next-31f961de2f90fbf52eb2d4e15b3eeaa09f9b4fc2.tar.gz linux-next-31f961de2f90fbf52eb2d4e15b3eeaa09f9b4fc2.zip | |
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>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
