lkml.org 
[lkml]   [2019]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 00/28] Removing struct page from P2PDMA
On Wed, Jun 26, 2019 at 02:45:38PM -0600, Logan Gunthorpe wrote:
> > The bar info would give the exporting struct device and any other info
> > we need to make the iommu mapping.
>
> Well, the IOMMU mapping is the normal thing the mapping driver will
> always do. We'd really just need the submitting driver to, when
> appropriate, inform the mapping driver that this is a pci bus address
> and not to call dma_map_xxx(). Then, for special mappings for the CMB
> like Christoph is talking about, it's simply a matter of doing a range
> compare on the PCI Bus address and converting the bus address to a BAR
> and offset.

Well, range compare on the physical address. We have a few different
options here:

(a) a range is normal RAM, DMA mapping works as usual
(b) a range is another devices BAR, in which case we need to do a
map_resource equivalent (which really just means don't bother with
cache flush on non-coherent architectures) and apply any needed
offset, fixed or iommu based
(c) a range points to a BAR on the acting device. In which case we
don't need to DMA map at all, because no dma is happening but just an
internal transfer. And depending on the device that might also require
a different addressing mode

I guess it might make sense to just have a block layer flag that (b) or
(c) might be contained in a bio. Then we always look up the data
structure, but can still fall back to (a) if nothing was found. That
even allows free mixing and matching of memory types, at least as long
as they are contained to separate bio_vec segments.

\
 
 \ /
  Last update: 2019-06-27 11:10    [W:0.296 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site