Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/mthca: Give reserved MTTs a separate cache line

MTTs are allocated in non-cache-coherent memory, so we must give
reserved MTTs their own cache line, to prevent both device and
CPU from writing into the same cache line at the same time.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Michael S. Tsirkin and committed by
Roland Dreier
1d1f19cf c7d204e8

+4
+4
drivers/infiniband/hw/mthca/mthca_main.c
··· 464 464 goto err_unmap_aux; 465 465 } 466 466 467 + /* CPU writes to non-reserved MTTs, while HCA might DMA to reserved mtts */ 468 + mdev->limits.reserved_mtts = ALIGN(mdev->limits.reserved_mtts * MTHCA_MTT_SEG_SIZE, 469 + dma_get_cache_alignment()) / MTHCA_MTT_SEG_SIZE; 470 + 467 471 mdev->mr_table.mtt_table = mthca_alloc_icm_table(mdev, init_hca->mtt_base, 468 472 MTHCA_MTT_SEG_SIZE, 469 473 mdev->limits.num_mtt_segs,