diff mbox series

[v10,6/6] dma-buf: Document that dma-buf size is fixed

Message ID 1605044477-51833-7-git-send-email-jianxin.xiong@intel.com (mailing list archive)
State Superseded
Delegated to: Jason Gunthorpe
Headers show
Series RDMA: Add dma-buf support | expand

Commit Message

Xiong, Jianxin Nov. 10, 2020, 9:41 p.m. UTC
The fact that the size of dma-buf is invariant over the lifetime of the
buffer is mentioned in the comment of 'dma_buf_ops.mmap', but is not
documented at where the info is defined. Add the missing documentation.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
---
 include/linux/dma-buf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Vetter Nov. 11, 2020, 4:33 p.m. UTC | #1
On Tue, Nov 10, 2020 at 01:41:17PM -0800, Jianxin Xiong wrote:
> The fact that the size of dma-buf is invariant over the lifetime of the
> buffer is mentioned in the comment of 'dma_buf_ops.mmap', but is not
> documented at where the info is defined. Add the missing documentation.
> 
> Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>

Applied to drm-misc-next, thanks for your patch. For the preceeding
dma-buf patch I'll wait for more review/acks before I apply it. Ack from
Jason might also be good, since looks like this dma_virt_ops is only used
in rdma.
-Daniel

> ---
>  include/linux/dma-buf.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
> index 9dcd569..92da98b 100644
> --- a/include/linux/dma-buf.h
> +++ b/include/linux/dma-buf.h
> @@ -272,7 +272,7 @@ struct dma_buf_ops {
>  
>  /**
>   * struct dma_buf - shared buffer object
> - * @size: size of the buffer
> + * @size: size of the buffer; invariant over the lifetime of the buffer.
>   * @file: file pointer used for sharing buffers across, and for refcounting.
>   * @attachments: list of dma_buf_attachment that denotes all devices attached,
>   *               protected by dma_resv lock.
> @@ -404,7 +404,7 @@ struct dma_buf_attachment {
>   * @exp_name:	name of the exporter - useful for debugging.
>   * @owner:	pointer to exporter module - used for refcounting kernel module
>   * @ops:	Attach allocator-defined dma buf ops to the new buffer
> - * @size:	Size of the buffer
> + * @size:	Size of the buffer - invariant over the lifetime of the buffer
>   * @flags:	mode flags for the file
>   * @resv:	reservation-object, NULL to allocate default one
>   * @priv:	Attach private data of allocator to this buffer
> -- 
> 1.8.3.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Jason Gunthorpe Nov. 12, 2020, 1:25 p.m. UTC | #2
On Wed, Nov 11, 2020 at 05:33:23PM +0100, Daniel Vetter wrote:
> On Tue, Nov 10, 2020 at 01:41:17PM -0800, Jianxin Xiong wrote:
> > The fact that the size of dma-buf is invariant over the lifetime of the
> > buffer is mentioned in the comment of 'dma_buf_ops.mmap', but is not
> > documented at where the info is defined. Add the missing documentation.
> > 
> > Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
> 
> Applied to drm-misc-next, thanks for your patch. For the preceeding
> dma-buf patch I'll wait for more review/acks before I apply it. Ack from
> Jason might also be good, since looks like this dma_virt_ops is only used
> in rdma.

We are likely to delete it entirely this cycle, Christoph already has
a patch series to do it:

https://patchwork.kernel.org/project/linux-rdma/list/?series=379277

So, lets just forget about it

Jason
Daniel Vetter Nov. 13, 2020, 8:41 p.m. UTC | #3
On Thu, Nov 12, 2020 at 09:25:14AM -0400, Jason Gunthorpe wrote:
> On Wed, Nov 11, 2020 at 05:33:23PM +0100, Daniel Vetter wrote:
> > On Tue, Nov 10, 2020 at 01:41:17PM -0800, Jianxin Xiong wrote:
> > > The fact that the size of dma-buf is invariant over the lifetime of the
> > > buffer is mentioned in the comment of 'dma_buf_ops.mmap', but is not
> > > documented at where the info is defined. Add the missing documentation.
> > > 
> > > Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
> > 
> > Applied to drm-misc-next, thanks for your patch. For the preceeding
> > dma-buf patch I'll wait for more review/acks before I apply it. Ack from
> > Jason might also be good, since looks like this dma_virt_ops is only used
> > in rdma.
> 
> We are likely to delete it entirely this cycle, Christoph already has
> a patch series to do it:
> 
> https://patchwork.kernel.org/project/linux-rdma/list/?series=379277
> 
> So, lets just forget about it

I can get behind that :-) Also I realized that even when we need it,
probably best if you merge it to avoid a partially broken feature in the
rdma tree. So not my problem anyway ...

Cheers, Daniel
diff mbox series

Patch

diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index 9dcd569..92da98b 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -272,7 +272,7 @@  struct dma_buf_ops {
 
 /**
  * struct dma_buf - shared buffer object
- * @size: size of the buffer
+ * @size: size of the buffer; invariant over the lifetime of the buffer.
  * @file: file pointer used for sharing buffers across, and for refcounting.
  * @attachments: list of dma_buf_attachment that denotes all devices attached,
  *               protected by dma_resv lock.
@@ -404,7 +404,7 @@  struct dma_buf_attachment {
  * @exp_name:	name of the exporter - useful for debugging.
  * @owner:	pointer to exporter module - used for refcounting kernel module
  * @ops:	Attach allocator-defined dma buf ops to the new buffer
- * @size:	Size of the buffer
+ * @size:	Size of the buffer - invariant over the lifetime of the buffer
  * @flags:	mode flags for the file
  * @resv:	reservation-object, NULL to allocate default one
  * @priv:	Attach private data of allocator to this buffer