From owner-freebsd-usb@FreeBSD.ORG Wed Dec 3 15:00:03 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DEC51065670 for ; Wed, 3 Dec 2008 15:00:03 +0000 (UTC) (envelope-from thierry.herbelot@free.fr) Received: from smtp4-g19.free.fr (smtp4-g19.free.fr [212.27.42.30]) by mx1.freebsd.org (Postfix) with ESMTP id 5734F8FC12 for ; Wed, 3 Dec 2008 15:00:03 +0000 (UTC) (envelope-from thierry.herbelot@free.fr) Received: from smtp4-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp4-g19.free.fr (Postfix) with ESMTP id 0136F3EA145 for ; Wed, 3 Dec 2008 16:00:02 +0100 (CET) Received: from mail.herbelot.nom (bne75-4-82-227-159-103.fbx.proxad.net [82.227.159.103]) by smtp4-g19.free.fr (Postfix) with ESMTP id BF0573EA134 for ; Wed, 3 Dec 2008 16:00:01 +0100 (CET) Received: from tulipe.herbelot.nom (tulipe.herbelot.nom [192.168.2.5]) by mail.herbelot.nom (8.14.1/8.14.1) with ESMTP id mB3ExxZd004420 for ; Wed, 3 Dec 2008 16:00:00 +0100 (CET) From: Thierry Herbelot To: freebsd-usb@freebsd.org Date: Wed, 3 Dec 2008 15:59:54 +0100 User-Agent: KMail/1.9.10 X-Warning: Windows can lose your files X-Op-Sys: Le FriBi de la mort qui tue X-Org: TfH&Co X-MailScanner: Found to be clean MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812031559.54335.thierry.herbelot@free.fr> Subject: Asynchronous bulk transfers in usb2 ? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2008 15:00:03 -0000 Hello, I've been looking at the usb2 code, and from what I've understood, only synchronous transfers are possible : a read (for exemple) is only scheduled when the userland program calls usb_bulk_read(). Furthermore, only fixed size buffers are used : only one buffer of 32 kbyte per transfer. This seems sub-optimal when reading (or writing) from userland blocks bigger than 32 kbytes, as multiple kernel-to-userland switches are necessary, and there is a latency window where no buffer exists to accept data between the arrival of one block and the posting of the next transfer. One way to work around this kind of limitations is to provide in advance a certain number of transfers, arranged in a ring, where the callback function at the end of a transfer schedules the next, without any further userland intervention. Is there any project for adding asynchronous bulk reads and/or writes to the fine usb2 stack ? TfH