Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-16 Thread Christoph Hellwig
On Mon, Mar 16, 2020 at 10:41:42AM +0100, Christian König wrote: > Well I would prefer if the drivers can somehow express their requirements > and get IOVA structures already in the form they need. > > Converting the IOVA data from one form to another is sometimes quite costly. > Especially when i

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-16 Thread Christoph Hellwig
On Thu, Mar 12, 2020 at 11:19:28AM -0300, Jason Gunthorpe wrote: > The non-page scatterlist is also a big concern for RDMA as we have > drivers that want the page list, so even if we did as this series > contemplates I'd have still have to split the drivers and create the > notion of a dma-only SGL

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-16 Thread Christoph Hellwig
On Fri, Mar 13, 2020 at 09:17:42AM -0300, Jason Gunthorpe wrote: > On Fri, Mar 13, 2020 at 04:21:39AM -0700, Christoph Hellwig wrote: > > On Thu, Mar 12, 2020 at 11:19:28AM -0300, Jason Gunthorpe wrote: > > > The non-page scatterlist is also a big concern for RDMA as we have > > > drivers that want

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-16 Thread Christian König
Am 16.03.20 um 09:56 schrieb Christoph Hellwig: On Fri, Mar 13, 2020 at 09:17:42AM -0300, Jason Gunthorpe wrote: On Fri, Mar 13, 2020 at 04:21:39AM -0700, Christoph Hellwig wrote: On Thu, Mar 12, 2020 at 11:19:28AM -0300, Jason Gunthorpe wrote: The non-page scatterlist is also a big concern fo

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-13 Thread Christian König
Am 13.03.20 um 12:21 schrieb Christoph Hellwig: On Thu, Mar 12, 2020 at 11:19:28AM -0300, Jason Gunthorpe wrote: The non-page scatterlist is also a big concern for RDMA as we have drivers that want the page list, so even if we did as this series contemplates I'd have still have to split the driv

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-12 Thread Logan Gunthorpe
On 2020-03-12 8:19 a.m., Jason Gunthorpe wrote: > On Thu, Mar 12, 2020 at 03:47:29AM -0700, Christoph Hellwig wrote: >> On Thu, Mar 12, 2020 at 11:31:35AM +0100, Christian König wrote: >>> But how should we then deal with all the existing interfaces which already >>> take a scatterlist/sg_table ?

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-12 Thread Christian König
Am 12.03.20 um 15:19 schrieb Jason Gunthorpe: On Thu, Mar 12, 2020 at 03:47:29AM -0700, Christoph Hellwig wrote: On Thu, Mar 12, 2020 at 11:31:35AM +0100, Christian König wrote: But how should we then deal with all the existing interfaces which already take a scatterlist/sg_table ? The whole D

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-12 Thread Christoph Hellwig
On Thu, Mar 12, 2020 at 11:14:22AM +0100, Christian König wrote: > > > The page pointer is set to NULL and only the DMA address, > > > length and offset values are valid. > > NAK. The only valid way to fill DMA address in scatterlists is > > dma_map_sg / dma_map_sg_attr. > > How can we then map P

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-12 Thread Christoph Hellwig
On Thu, Mar 12, 2020 at 11:31:35AM +0100, Christian König wrote: > But how should we then deal with all the existing interfaces which already > take a scatterlist/sg_table ? > > The whole DMA-buf design and a lot of drivers are build around > scatterlist/sg_table and to me that actually makes quite

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-12 Thread Christoph Hellwig
On Wed, Mar 11, 2020 at 02:51:53PM +0100, Christian König wrote: > This can be used by drivers to setup P2P DMA between device > memory which is not backed by struct pages. > > The drivers of the involved devices are responsible for > setting up and tearing down DMA addresses as necessary > using

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-12 Thread Christian König
Am 11.03.20 um 16:28 schrieb Christoph Hellwig: On Wed, Mar 11, 2020 at 02:51:53PM +0100, Christian König wrote: This can be used by drivers to setup P2P DMA between device memory which is not backed by struct pages. The drivers of the involved devices are responsible for setting up and tearing

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-12 Thread Christian König
Am 12.03.20 um 11:47 schrieb Christoph Hellwig: On Thu, Mar 12, 2020 at 11:31:35AM +0100, Christian König wrote: [SNIP] I mean we could come up with a new structure for this, but to me that just looks like reinventing the wheel. Especially since drivers need to be able to handle both I/O to syst

Re: [Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-12 Thread Christian König
Am 12.03.20 um 11:19 schrieb Christoph Hellwig: On Thu, Mar 12, 2020 at 11:14:22AM +0100, Christian König wrote: The page pointer is set to NULL and only the DMA address, length and offset values are valid. NAK. The only valid way to fill DMA address in scatterlists is dma_map_sg / dma_map_sg_

[Intel-gfx] [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-11 Thread Christian König
This can be used by drivers to setup P2P DMA between device memory which is not backed by struct pages. The drivers of the involved devices are responsible for setting up and tearing down DMA addresses as necessary using dma_map_resource(). The page pointer is set to NULL and only the DMA address