Re: [PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 1:29 p.m., Jason Gunthorpe wrote: > On Thu, Jul 25, 2019 at 01:17:02PM -0600, Logan Gunthorpe wrote: >> >> >> On 2019-07-25 12:58 p.m., Jason Gunthorpe wrote: >>> On Mon, Jul 22, 2019 at 05:08:56PM -0600, Logan Gunthorpe wrote: Any requests that traverse the host bridge will

Re: [PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-25 Thread Jason Gunthorpe
On Thu, Jul 25, 2019 at 01:17:02PM -0600, Logan Gunthorpe wrote: > > > On 2019-07-25 12:58 p.m., Jason Gunthorpe wrote: > > On Mon, Jul 22, 2019 at 05:08:56PM -0600, Logan Gunthorpe wrote: > >> Any requests that traverse the host bridge will need to be mapped into > >> the IOMMU, so call

Re: [PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 12:58 p.m., Jason Gunthorpe wrote: > On Mon, Jul 22, 2019 at 05:08:56PM -0600, Logan Gunthorpe wrote: >> Any requests that traverse the host bridge will need to be mapped into >> the IOMMU, so call dma_map_sg() inside pci_p2pdma_map_sg() when >> appropriate. >> >> Similarly, call

Re: [PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-25 Thread Jason Gunthorpe
On Mon, Jul 22, 2019 at 05:08:56PM -0600, Logan Gunthorpe wrote: > Any requests that traverse the host bridge will need to be mapped into > the IOMMU, so call dma_map_sg() inside pci_p2pdma_map_sg() when > appropriate. > > Similarly, call dma_unmap_sg() inside pci_p2pdma_unmap_sg(). > >

Re: [PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 10:34 a.m., Jason Gunthorpe wrote: > On Thu, Jul 25, 2019 at 10:00:25AM -0600, Logan Gunthorpe wrote: >> >> >> On 2019-07-25 12:10 a.m., Christoph Hellwig wrote: >>> On Wed, Jul 24, 2019 at 09:58:59AM -0600, Logan Gunthorpe wrote: On 2019-07-24 12:32 a.m., Christoph

Re: [PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-25 Thread Jason Gunthorpe
On Thu, Jul 25, 2019 at 10:00:25AM -0600, Logan Gunthorpe wrote: > > > On 2019-07-25 12:10 a.m., Christoph Hellwig wrote: > > On Wed, Jul 24, 2019 at 09:58:59AM -0600, Logan Gunthorpe wrote: > >> > >> > >> On 2019-07-24 12:32 a.m., Christoph Hellwig wrote: > struct dev_pagemap

Re: [PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 12:10 a.m., Christoph Hellwig wrote: > On Wed, Jul 24, 2019 at 09:58:59AM -0600, Logan Gunthorpe wrote: >> >> >> On 2019-07-24 12:32 a.m., Christoph Hellwig wrote: struct dev_pagemap *pgmap = sg_page(sg)->pgmap; + struct pci_dev *client; + int dist; +

Re: [PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-25 Thread Christoph Hellwig
On Wed, Jul 24, 2019 at 09:58:59AM -0600, Logan Gunthorpe wrote: > > > On 2019-07-24 12:32 a.m., Christoph Hellwig wrote: > >>struct dev_pagemap *pgmap = sg_page(sg)->pgmap; > >> + struct pci_dev *client; > >> + int dist; > >> + > >> + client = find_parent_pci_dev(dev); > >> + if

Re: [PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-24 Thread Logan Gunthorpe
On 2019-07-24 12:32 a.m., Christoph Hellwig wrote: >> struct dev_pagemap *pgmap = sg_page(sg)->pgmap; >> +struct pci_dev *client; >> +int dist; >> + >> +client = find_parent_pci_dev(dev); >> +if (WARN_ON_ONCE(!client)) >> +return 0; >> >> +dist =

Re: [PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-24 Thread Christoph Hellwig
> struct dev_pagemap *pgmap = sg_page(sg)->pgmap; > + struct pci_dev *client; > + int dist; > + > + client = find_parent_pci_dev(dev); > + if (WARN_ON_ONCE(!client)) > + return 0; > > + dist = upstream_bridge_distance(pgmap->pci_p2pdma_provider, > +

[PATCH 11/14] PCI/P2PDMA: dma_map P2PDMA map requests that traverse the host bridge

2019-07-22 Thread Logan Gunthorpe
Any requests that traverse the host bridge will need to be mapped into the IOMMU, so call dma_map_sg() inside pci_p2pdma_map_sg() when appropriate. Similarly, call dma_unmap_sg() inside pci_p2pdma_unmap_sg(). Signed-off-by: Logan Gunthorpe --- drivers/pci/p2pdma.c | 31