Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_p2pdma_should_map_bus() and pci_p2pdma_bus_offset()

2021-03-24 Thread Christian König
Am 24.03.21 um 18:21 schrieb Jason Gunthorpe: On Mon, Mar 15, 2021 at 10:27:08AM -0600, Logan Gunthorpe wrote: In this case the WARN_ON is just to guard against misuse of the function. It should never happen unless a developer changes the code in a way that is incorrect. So I think that's the

Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_p2pdma_should_map_bus() and pci_p2pdma_bus_offset()

2021-03-24 Thread Jason Gunthorpe
On Mon, Mar 15, 2021 at 10:27:08AM -0600, Logan Gunthorpe wrote: > In this case the WARN_ON is just to guard against misuse of the > function. It should never happen unless a developer changes the code in > a way that is incorrect. So I think that's the correct use of WARN_ON. > Though I might

Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_p2pdma_should_map_bus() and pci_p2pdma_bus_offset()

2021-03-16 Thread Christoph Hellwig
On Thu, Mar 11, 2021 at 04:31:34PM -0700, Logan Gunthorpe wrote: > Introduce pci_p2pdma_should_map_bus() which is meant to be called by > DMA map functions to determine how to map a given p2pdma page. > > pci_p2pdma_bus_offset() is also added to allow callers to get the bus > offset if they need

Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_p2pdma_should_map_bus() and pci_p2pdma_bus_offset()

2021-03-15 Thread Logan Gunthorpe
On 2021-03-12 7:32 p.m., Ira Weiny wrote: > On Thu, Mar 11, 2021 at 04:31:34PM -0700, Logan Gunthorpe wrote: >> Introduce pci_p2pdma_should_map_bus() which is meant to be called by > ^ > pci_p2pdma_dma_map_type() ??? > > FWIW I find this name

Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_p2pdma_should_map_bus() and pci_p2pdma_bus_offset()

2021-03-15 Thread Logan Gunthorpe
On 2021-03-12 6:38 p.m., Ira Weiny wrote: > On Thu, Mar 11, 2021 at 04:31:34PM -0700, Logan Gunthorpe wrote: >> Introduce pci_p2pdma_should_map_bus() which is meant to be called by >> DMA map functions to determine how to map a given p2pdma page. >> >> pci_p2pdma_bus_offset() is also added to

Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_p2pdma_should_map_bus() and pci_p2pdma_bus_offset()

2021-03-12 Thread Ira Weiny
On Thu, Mar 11, 2021 at 04:31:34PM -0700, Logan Gunthorpe wrote: > Introduce pci_p2pdma_should_map_bus() which is meant to be called by ^ pci_p2pdma_dma_map_type() ??? FWIW I find this name confusing with pci_p2pdma_map_type() and looking at the

Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_p2pdma_should_map_bus() and pci_p2pdma_bus_offset()

2021-03-12 Thread Ira Weiny
On Thu, Mar 11, 2021 at 04:31:34PM -0700, Logan Gunthorpe wrote: > Introduce pci_p2pdma_should_map_bus() which is meant to be called by > DMA map functions to determine how to map a given p2pdma page. > > pci_p2pdma_bus_offset() is also added to allow callers to get the bus > offset if they need

[RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_p2pdma_should_map_bus() and pci_p2pdma_bus_offset()

2021-03-11 Thread Logan Gunthorpe
Introduce pci_p2pdma_should_map_bus() which is meant to be called by DMA map functions to determine how to map a given p2pdma page. pci_p2pdma_bus_offset() is also added to allow callers to get the bus offset if they need to map the bus address. Signed-off-by: Logan Gunthorpe ---