Re: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-11-10 Thread Jason Gunthorpe
On Tue, Nov 10, 2020 at 03:14:45PM +0100, Daniel Vetter wrote: > On Fri, Nov 06, 2020 at 12:39:53PM -0400, Jason Gunthorpe wrote: > > On Fri, Nov 06, 2020 at 04:34:07PM +, Xiong, Jianxin wrote: > > > > > > The user could specify a length that is beyond the dma buf, can > > > > the dma buf leng

RE: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-11-10 Thread Xiong, Jianxin
iel ; > Christian Koenig > Subject: Re: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user > memory region > > On Tue, Nov 10, 2020 at 10:27:57AM -0400, Jason Gunthorpe wrote: > > On Tue, Nov 10, 2020 at 03:14:45PM +0100, Daniel Vetter wrote: > > > On Fri, N

Re: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-11-10 Thread Daniel Vetter
On Tue, Nov 10, 2020 at 10:27:57AM -0400, Jason Gunthorpe wrote: > On Tue, Nov 10, 2020 at 03:14:45PM +0100, Daniel Vetter wrote: > > On Fri, Nov 06, 2020 at 12:39:53PM -0400, Jason Gunthorpe wrote: > > > On Fri, Nov 06, 2020 at 04:34:07PM +, Xiong, Jianxin wrote: > > > > > > > > The user coul

Re: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-11-10 Thread Daniel Vetter
On Fri, Nov 06, 2020 at 12:39:53PM -0400, Jason Gunthorpe wrote: > On Fri, Nov 06, 2020 at 04:34:07PM +, Xiong, Jianxin wrote: > > > > The user could specify a length that is beyond the dma buf, can > > > the dma buf length be checked during get? > > > > In order to check the length, the buff

Re: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-11-08 Thread Jason Gunthorpe
On Fri, Nov 06, 2020 at 04:34:07PM +, Xiong, Jianxin wrote: > > The user could specify a length that is beyond the dma buf, can > > the dma buf length be checked during get? > > In order to check the length, the buffer needs to be mapped. That can be done. Do DMA bufs even have definitate im

RE: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-11-06 Thread Xiong, Jianxin
Daniel > > Subject: Re: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user > memory region > > On Fri, Nov 06, 2020 at 04:34:07PM +, Xiong, Jianxin wrote: > > > > The user could specify a length that is beyond the dma buf, can the > > > dma buf length

RE: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-11-06 Thread Xiong, Jianxin
Daniel > > Subject: Re: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user > memory region > > On Thu, Nov 05, 2020 at 02:48:05PM -0800, Jianxin Xiong wrote: > > + /* modify the sgl in-place to match umem address and length */ > > + > > + start = ALIG

Re: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-11-06 Thread Jason Gunthorpe
On Thu, Nov 05, 2020 at 02:48:05PM -0800, Jianxin Xiong wrote: > + /* modify the sgl in-place to match umem address and length */ > + > + start = ALIGN_DOWN(umem_dmabuf->umem.address, PAGE_SIZE); > + end = ALIGN(umem_dmabuf->umem.address + umem_dmabuf->umem.length, > + P

[PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-11-05 Thread Jianxin Xiong
Dma-buf is a standard cross-driver buffer sharing mechanism that can be used to support peer-to-peer access from RDMA devices. Device memory exported via dma-buf is associated with a file descriptor. This is passed to the user space as a property associated with the buffer allocation. When the buf