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

2020-03-17 Thread Jason Gunthorpe
On Mon, Mar 16, 2020 at 02:52:13AM -0700, Christoph Hellwig wrote: > 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

Re: [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: [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-15 Thread Jason Gunthorpe
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 the page list, so even if we did as this series > > contemplates I'd hav

Re: [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: [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

2020-03-13 Thread Jason Gunthorpe
On Thu, Mar 12, 2020 at 04:39:02PM +0100, Christian König wrote: > > > The structure for holding dma addresses doesn't really exist > > > in a generic form, but would be an array of these structures: > > > > > > struct dma_sg { > > > dma_addr_t addr; > > > u32 len; > > > }; >

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

2020-03-13 Thread 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 DMA-buf design and a lot of driver

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

2020-03-13 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: [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: [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: [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_

Re: [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

[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