]> git.baikalelectronics.ru Git - kernel.git/commit
NTB: ntb_transport: Ensure the destination buffer is mapped for TX DMA
authorLogan Gunthorpe <logang@deltatee.com>
Sat, 19 Jan 2019 00:10:01 +0000 (17:10 -0700)
committerJon Mason <jdmason@kudzu.us>
Mon, 11 Feb 2019 14:26:30 +0000 (09:26 -0500)
commit84cdfae5f47a640a9c55b178e5903ef564ab2c64
tree1899a86e550686291f178fca9ebccafbc70d99c5
parent670b99bb5f3075ba1461cfc4f0d50dd2331e27a8
NTB: ntb_transport: Ensure the destination buffer is mapped for TX DMA

Presently, when ntb_transport is used with DMA and the IOMMU turned on,
it fails with errors from the IOMMU such as:

  DMAR: DRHD: handling fault status reg 202
  DMAR: [DMA Write] Request device [00:04.0] fault addr
381fc0340000 [fault reason 05] PTE Write access is not set

This is because ntb_transport does not map the BAR space with the IOMMU.

To fix this, we map the entire MW region for each QP after we assign
the DMA channel. This prevents needing an extra DMA map in the fast
path.

Link: https://lore.kernel.org/linux-pci/499934e7-3734-1aee-37dd-b42a5d2a2608@intel.com/
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/ntb_transport.c