Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Mar 2015 17:19:11 +0900
From:      "Daisuke Aoyama" <aoyama@peach.ne.jp>
To:        "Hans Petter Selasky" <hps@selasky.org>, <freebsd-arm@freebsd.org>
Subject:   Re: Ready for NAS4Free on ODROID-C1
Message-ID:  <3429DC2CFDA24B9585F82FA9A8EF7D28@ad.peach.ne.jp>
In-Reply-To: <54F9BBA8.8080002@selasky.org>
References:  <1DA948EA255F4963ACBC0EBE7D046401@ad.peach.ne.jp> <34D37D2811D246BEB11080D19F03FECE@ad.peach.ne.jp> <579F7C2BEACC4FF684780E575AC9C474@ad.peach.ne.jp> <54F9BBA8.8080002@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

>> Changes:
>> Add USB fast writing patch (3x faster but may break some condition on RPi)
>Do you have a link for this patch?

New version is released, and the source diff is also uploaded.
Please use the link below.

I drop out v1.1 patch. It does not work under some condition.
Now, I'm making v1.2 patch and testing it. However, I will plan to make v1.3 for reading.
This is not final version. I tested only bulk transfer on ODROID-C1 and tested HOST mode only
(mainly using USB HDD or USB flashdrive)

The source diff against to HEAD r279589:
http://www.peach.ne.jp/archives/oc1/patch/dwc_otg-20150321.patch

Current score is around Raw Read 14.5MB/s (1.3x faster), UFS Write 26.0MB/s (4.0x faster).
Writing is 74% of amd64 kernel score since the unit is around 35MB/s on amd64.

NAS4Free SMB performance is R:16.43MB/s, W:23.96MB/s at 4GB x 9 = total 36GB transfer

The HDD is Toshiba MK5065GSX (2.5inch/5400rpm/8MB cache).

Example of dd:
I changed dd size from 16MiB to 32MiB because writing is fast enough.

# mount /dev/da0p1 /mnt
# dd if=/dev/zero of=/mnt/test.dat bs=1m count=32
32+0 records in
32+0 records out
33554432 bytes transferred in 1.287799 secs (26055644 bytes/sec)
# umount /mnt
# mount /dev/da0p1 /mnt
# dd if=/mnt/test.dat of=/dev/null bs=1m
32+0 records in
32+0 records out
33554432 bytes transferred in 2.255524 secs (14876557 bytes/sec)

Example main OUT transaction:

Before:
Polling/Wait SOF if need/CH alloc/set pktcnt=1/write FIFO/XXX/ACK/CH free/SOF if need/CH
alloc/set pktcnt=1/write FIFO/XXX/ACK/ ... /XXX/ACK/CH free/END
(XXX means useless polling loop triggered by other transfer,always polling all intr_q,
 CH free need 2 x SOF = 250us, usually NAK/NYET is hidden in this delay)

After patched:
NPTX empty intr/CH alloc/set pktcnt=N/write FIFO/ACK intr/write FIFO/ACK intr/ ...
/ACK+XFERCOMPL intr/CH free(restart other xfer)/END
(run interrupt delivered channel only, CH free need only CHHLTD intr or RXFLVL intr)

Changes on v1.2 USB driver:
get rid of polling functiuon (still use one time scan)
get rid of waiting SOF
use INT_RXFLVL for receiving IN packet
use INT_CHHLTD for host channel disable (always issue)
use TX FIFO size as multiple of 512
restart/allocate HC by PTX/NPTX FIFO empty intr(half or complete empty)
clear HC registers at alloc/free
don't free host channel until transfer is completed or aborted. (BULK RX/TX only at this time)
add bulk transfer that support multiple packets
add interrupt driven HC handling
add NYET/PING/ACK/NAK support
verify NPTXQSPCAVAIL and NPTXFSPCAVAIL before writing FIFO
some bugfixs and improvements

Known problems:
It seems short(small) packet is slow.
Performance on RPi is slow.
Debug message can't use under RPi (Probably, CPU is too slow?)
if_smsc does not work as expected on RPi.
I don't know reason but I see 280K intr/sec in systat.
Probably, it's a result of many NAKs for 20480 BULK transfer.
----------------------------------------------------------------------
my USB device list on ODROID-C1:
(umass,ukbd,uplcom,axe)
# usbconfig list
ugen0.1: <OTG Root HUB DWCOTG> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <USB2.0 Hub vendor 0x05e3> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA)
ugen0.3: <USB 2.0 Hub vendor 0x1a40> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
(100mA)
ugen0.4: <USB to Serial-ATA bridge Sunplus Innovation Technology.> at usbus0, cfg=0 md=HOST
spd=HIGH (480Mbps) pwr=ON (2mA)
ugen0.5: <product 0x7720 vendor 0x0b95> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
(250mA)
ugen0.6: <USB-Serial Controller Prolific Technology Inc.> at usbus0, cfg=0 md=HOST spd=FULL
(12Mbps) pwr=ON (100mA)
ugen0.7: <USB Carder vendor 0x13fe> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (200mA)
ugen0.8: <Dell QuietKey Keyboard Dell> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (70mA)
----------------------------------------------------------------------

Regards,
-- 
Daisuke Aoyama
 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3429DC2CFDA24B9585F82FA9A8EF7D28>