Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-04 Thread Oliver Neukum
On Wed, 2014-07-02 at 17:53 +0200, Stefan Klug wrote: > @@ -1471,6 +1526,57 @@ static int proc_do_submiturb(struct > usb_dev_state > *ps, struct usbdevfs_urb *uurb > } > totlen -= u; > } > +} else if(num_pages) { > +pages = kmalloc(num_pages*sizeo

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-03 Thread Alan Stern
On Thu, 3 Jul 2014, Stefan Klug wrote: > >> Questions/Notes: > >> - I'm quite unhappy with the added member async::is_user_mem. Is there a > >> better place > >> where I could store this information? > > No, async is the right place. Why are you unhappy about it? > A whole byte for this flag

RE: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-03 Thread David Laight
From: Stefan Klug ... > Is there any way to check if the host controller supports arbitrary > alignment? > If I read the xhci spec correctly arbitrary alignment is explicitly > permitted. Not entirely. The xhci spec has a few limits on the alignment of transfer buffer. They seem to be designed to

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-03 Thread Stefan Klug
On 02.07.2014 21:38, Alan Stern wrote: On Wed, 2 Jul 2014, Oliver Neukum wrote: Stefan Klug Software Developer Basler AG An der Strusbek 60-62 22926 Ahrensburg Germany Tel. +49 4102 463 582 Fax +49 4102 463 46 582 stefan.k...@baslerweb.com www.baslerweb.com Vorstand: Dr.-Ing. Dietmar Le

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-03 Thread Stefan Klug
On 02.07.2014 20:24, Alan Stern wrote: Overall this implementation seems quite straightforward. However, it appears that your email client has mangled the whitespace in the patch. The patch contains many style violations; you should run it through checkpatch.pl. It also has one or two mistake

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-03 Thread Stefan Klug
On 02.07.2014 19:55, Greg KH wrote: Very nice. Thanks. Minor non-technical issues here, your patch is corrupted (linewrapped and tabs converted to spaces) and can't be applied at all. Can you fix your email client and try again? Look at Documentation/email_clients.txt for hints on how to do

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-02 Thread Alan Stern
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

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-02 Thread Peter Stuge
Alan Stern wrote: > > > Also, many host controllers cannot handle arbitrary alignment. > > > It would be best to require that the buffer start at a page boundary. > > > > This requires a bit of negotiation with userspace, maybe per-URB but > > I don't follow. What negotiation is needed? All t

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-02 Thread Alan Stern
On Wed, 2 Jul 2014, Oliver Neukum wrote: > On Wed, 2014-07-02 at 17:53 +0200, Stefan Klug wrote: > > > Implementation details: > > The patch only touches drivers/usb/core/devio.c. > > In procy_do_submiturb(), it is checked if zerocopy is allowed. This is > > currently a rough > > check which com

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-02 Thread Alan Stern
On Wed, 2 Jul 2014, Peter Stuge wrote: > Thank you very much for working on this, Stefan. > > Alan Stern wrote: > > Also, many host controllers cannot handle arbitrary alignment. > > It would be best to require that the buffer start at a page boundary. > > This requires a bit of negotiation wi

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-02 Thread Oliver Neukum
On Wed, 2014-07-02 at 17:53 +0200, Stefan Klug wrote: > Implementation details: > The patch only touches drivers/usb/core/devio.c. > In procy_do_submiturb(), it is checked if zerocopy is allowed. This is > currently a rough > check which compares the number of required pages to > ps->dev->bus->s

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-02 Thread Peter Stuge
Thank you very much for working on this, Stefan. Alan Stern wrote: > Also, many host controllers cannot handle arbitrary alignment. > It would be best to require that the buffer start at a page boundary. This requires a bit of negotiation with userspace, maybe per-URB but it seems better to neg

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-02 Thread Alan Stern
On Wed, 2 Jul 2014, Stefan Klug wrote: > Hi everybody, > in short: The attached patch adds zerocopy support to the usbfs driver. > I tested it on x86 and on a globalscale mirabox ARM board. Until now it > works > quite nice and I'd love to get some comments and feedback on the patch. > > Longer

Re: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-02 Thread Greg KH
On Wed, Jul 02, 2014 at 05:53:56PM +0200, Stefan Klug wrote: > Hi everybody, > in short: The attached patch adds zerocopy support to the usbfs driver. > I tested it on x86 and on a globalscale mirabox ARM board. Until now it > works > quite nice and I'd love to get some comments and feedback on the

[PATCH][RFC] USB: zerocopy support for usbfs

2014-07-02 Thread Stefan Klug
Hi everybody, in short: The attached patch adds zerocopy support to the usbfs driver. I tested it on x86 and on a globalscale mirabox ARM board. Until now it works quite nice and I'd love to get some comments and feedback on the patch. Longer version: The usbfs driver does not support direct da