Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757339AbaGBSth (ORCPT ); Wed, 2 Jul 2014 14:49:37 -0400 Received: from foo.stuge.se ([212.116.89.98]:45377 "EHLO foo.stuge.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754104AbaGBStg (ORCPT ); Wed, 2 Jul 2014 14:49:36 -0400 Message-ID: <20140702184933.7464.qmail@stuge.se> Date: Wed, 2 Jul 2014 20:49:33 +0200 From: Peter Stuge To: Alan Stern Cc: Stefan Klug , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][RFC] USB: zerocopy support for usbfs Mail-Followup-To: Alan Stern , Stefan Klug , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <53B42B14.7010303@baslerweb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 negotiate per-claim or even per-open. What about large control transfers? > Using a global module parameter to control the use of zerocopy (for > anything other than debugging or testing) is a bad idea. I agree. > If you think people will have a reason for avoiding zerocopy then > you should make it possible to decide for each URB, by adding a new > flag to struct usbdevfs_urb. People might want to use zerocopy always, but have buffers in userspace which make that impossible with the given hardware. It's important that the kernel gives userspace enough information about the constraints, if userspace wants zerocopy. > People will want to use zerocopy with isochronous transfers as well as > bulk. Implementing that isn't going to be quite so easy; it will be > necessary for the user to set up a memory mapping. In fact, once > that's done the same mechanism could be used for bulk transfers too. 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? //Peter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/