From owner-freebsd-questions@freebsd.org Fri Sep 11 12:09:21 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F3799CC35C for ; Fri, 11 Sep 2015 12:09:21 +0000 (UTC) (envelope-from wam@hiwaay.net) Received: from fly.hiwaay.net (fly.hiwaay.net [216.180.54.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EDDF1AB3 for ; Fri, 11 Sep 2015 12:09:20 +0000 (UTC) (envelope-from wam@hiwaay.net) Received: from kabini1.local (dynamic-216-186-222-143.knology.net [216.186.222.143] (may be forged)) (authenticated bits=0) by fly.hiwaay.net (8.13.8/8.13.8/fly) with ESMTP id t8BC9DGK010763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 11 Sep 2015 07:09:14 -0500 Subject: Re: USB physical ports To: freebsd-questions@freebsd.org References: <55F1A507.70402@gmail.com> <2091716.bhpPQfPjgk@amd.asgard.uk> <55F216CB.6040606@gmail.com> <2029052.xQsMmxkVaC@desk8.phess.net> <55F2C335.3030304@gmail.com> From: "William A. Mahaffey III" Message-ID: <55F2C469.4030101@hiwaay.net> Date: Fri, 11 Sep 2015 07:14:43 -0453.75 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55F2C335.3030304@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2015 12:09:21 -0000 On 09/11/15 07:10, Ernie Luzar wrote: > Patrick Hess wrote: >> Ernie Luzar wrote: >>> How can I confirm 480Mbps transfer rate. >> >> Run "dmesg -a" after plugging in the device. A USB 2.0 flash drive >> should be reported with a 40 MB/s transfer rate: >> >> da1: Removable Direct Access SCSI-4 device >> da1: 40.000MB/s transfers >> >> You can verify this by reading from the drive, e.g. by using dd(1): >> >> # dd if=/dev/da1 of=/dev/zero bs=1M count=1024 >> 1024+0 records in >> 1024+0 records out >> 1073741824 bytes transferred in 52.099073 secs (20609615 bytes/sec) >> >> That's ~20 MB/s, definitely more than USB 1.x could have delivered. >> > > Yes that is true, BUT it's a very long way from 480Mbps. Following are > some test results. > > Before plugging in flash drive > /root/bin >usbconfig > ugen3.1: at usbus3, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=SAVE (0mA) > ugen2.1: at usbus2, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=SAVE (0mA) > ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=SAVE (0mA) > ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=SAVE (0mA) > > After plugging in flash drive > /root/bin >usbconfig > ugen3.1: at usbus3, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=SAVE (0mA) > ugen2.1: at usbus2, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=SAVE (0mA) > ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=SAVE (0mA) > ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=SAVE (0mA) > ugen3.2: at usbus3, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=ON (200mA) > > Get this result no matter which physical port I plug into. > > Get these console messages when plugging in flash drive > > umass0: on > usbus3 > umass0: SCSI over Bulk-Only; quirks = 0x8100 > umass0:2:0:-1: Attached to scbus2 > da0 at umass-sim0 bus 0 scbus2 target 0 lun 0 > da0: Removable Direct Access SPC-4 SCSI > device > da0: Serial Number 4C530001020404102235 > da0: 40.000MB/s transfers > da0: 14907MB (30529536 512 byte sectors: 255H 63S/T 1900C) > da0: quirks=0x2 > > Why is it saying 40.000MB/s transfers? Is this some max value that > Freebsd is limited to? > > > /root/bin >dd if=/dev/da0 of=/dev/null bs=1M count=10 > 10+0 records in > 10+0 records out > 10485760 bytes transferred in 0.607835 secs (17250996 bytes/sec) > > /root/bin >dd if=/dev/da0 of=/dev/null bs=1M count=100 > 100+0 records in > 100+0 records out > 104857600 bytes transferred in 5.683069 secs (18450876 bytes/sec) > > /root/bin >dd if=/dev/da0 of=/dev/null bs=1M count=200 > 200+0 records in > 200+0 records out > 209715200 bytes transferred in 11.233349 secs (18668983 bytes/sec) > > /root/bin >dd if=/dev/da0 of=/dev/null bs=1M count=400 > 400+0 records in > 400+0 records out > 419430400 bytes transferred in 22.415176 secs (18711894 bytes/sec) > > > If 20Mbps is the max rate Freebsd can do, then 18.7Mbps is a good rate. > > But the real question is why is Freebsd USB rates capped at 20Mbps > when the hardware says it's capable of 480Mbps? I think you are confusing bits & bytes. 480 Mbps = 60 MBps, lower case 'b' is bits, upper case 'B' is bytes, 8b / B (8b per B). -- William A. Mahaffey III ---------------------------------------------------------------------- "The M1 Garand is without doubt the finest implement of war ever devised by man." -- Gen. George S. Patton Jr.