lkml.org 
[lkml]   [2014]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][RFC] USB: zerocopy support for usbfs
On Wed, 2 Jul 2014, Peter Stuge wrote:

> > The kernel doesn't support scatter-gather for control transfers, only
> > bulk.
>
> That could possibly change, right, and then it would be nice to have
> zerocopy for free there as well?

No. ohci-hcd doesn't support control transfers larger than 4 KB
anyway, and ehci-hcd doesn't support control transfers larger than 16
KB. This is not likely to change. Besides, a control transfer can
never be larger than 64 KB, and throughput isn't an issue for them.

> > > Indeed I think userspace wants to be involved in choosing memory also
> > > with bulk, in order to ensure that zerocopy will always work when
> > > userspace cares about that.
> > >
> > > Is it enough to expose the DMA mask of the host controller?
> >
> > It doesn't need to be exposed, since the mmap(2) call would be handled
> > by the kernel's USB stack (and besides, the user program can't request
> > that the mapped memory be located in any particular physical address
> > region).
>
> Since alignment isn't the only issue I don't think there's a way to
> avoid it. I was just hoping to be able to avoid allocating zerocopy
> buffers with mmap().

How else can you guarantee that a buffer is located in the first 4 GB
of memory? Even on a 32-bit system (if the computer has more than 4 GB
of RAM)?

Alan Stern



\
 
 \ /
  Last update: 2014-07-02 23:21    [W:0.037 / U:4.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site