From owner-freebsd-usb@FreeBSD.ORG Thu Jan 20 06:54:16 2011 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 271B41065673 for ; Thu, 20 Jan 2011 06:54:16 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 86C578FC1B for ; Thu, 20 Jan 2011 06:54:15 +0000 (UTC) Received: from ur.gsoft.com.au (Ur.gsoft.com.au [203.31.81.44]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p0K6bW7e054280 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 20 Jan 2011 17:07:32 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Thu, 20 Jan 2011 17:07:32 +1030 To: freebsd-usb@freebsd.org Message-Id: <9CF6C32F-E230-446B-94FC-C57F0F02B0E4@gsoft.com.au> Mime-Version: 1.0 (Apple Message framework v1082) X-Mailer: Apple Mail (2.1082) X-Spam-Score: -2.51 () ALL_TRUSTED,BAYES_00,T_RP_MATCHES_RCVD X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Subject: libusb performance on 8.1 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: Thu, 20 Jan 2011 06:54:16 -0000 [re-sent from the correct address] Hi, I am building a USB interface to a radar data acquisition chassis based = on the Cypress CY7C68013A. While doing some speed testing I find that FreeBSD does ~4Mb/sec, but = Linux does 17Mb/sec & OS X does 8-10Mb/sec. It is using libusb-1.0 with the async API in a threaded app. I spawn a = thread which sites in the following loop: while (!child_exit) { tout.tv_sec =3D 0; tout.tv_usec =3D 100000; libusb_handle_events_timeout(ctx, &tout); } ugsio_cancelusb(); The parent thread is the rest of the program which and handles reading = data out of the completed transfers and forwarding them to the data = processing children and re-submitting them to the USB stack. I keep 8 transactions of 512 bytes each in flight. The device itself = holds up to 4 packets in a FIFO until the PC is ready. Increasing the = number of transactions in flight has no effect on performance. Does anyone have a suggestion as to how I can look at improving = performance? Deploying Linux is not really an option :) The Linux PC is.. Linux fpgawork 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 23:42:43 UTC = 2011 x86_64 GNU/Linux The CPU is a Core 2 E6400 @ 2.13GHz on a Gigabyte 965P-DS3 rev 1 = (http://www.gigabyte.com/products/product-page.aspx?pid=3D2314#ov) which = has an ICH8 chipset. The FreeBSD PC is.. FreeBSD aumond8.gsoft.com.au 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul = 19 02:55:53 UTC 2010 = root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 The CPU is a Core 2 E7500 @ 2.93GHz on a Supermicro C2SBA+ = (http://www.supermicro.com/products/motherboard/Core/G33/C2SBA_.cfm) = which has an ICH9 chipset. Any patches welcome! Thanks. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C