FSL-UT-USB-043-USB-Performance-Test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[cols=">s,6a",frame="topbot",options="header"]
|====================================================================
|Name | Description

| Summary |
Performance Test

| Automated |
No

| Kernel Config Option |

| Software Dependency |
N/A

| Non-default Hardware Configuration |
N/A

| Test Procedure |
For device mode, using g_ether to test
For host mode, using mass storage to test (hard disk is needed)

1: Test g_ether
1.1 modprobe g_ether qmult=10
connect usb cable between board and pc, and you will see below message
"g_ether gadget: high-speed config #1: CDC Ethernet (ECM)"

1.2
At device side:
ifconfig usb0 10.0.0.2 up
At host side:
sudo ifconfig usb0 10.0.0.1 up

At device side:
ping 10.0.0.1, for ubuntu host, the ip for usb0 will lost
after several seconds, re ifconfig usb0 at host side

After ping can run more than 10 seconds, stop it

1.3 Using iperf to do ether test

At host side:
iperf -s -i 5 &
At device side:
iperf -t 1000000 -c  10.0.0.1 -d -i 5 &

2 mass storage test
2.1 block layer Read
time -p dd if=/dev/sda2 of=/dev/null bs=4096 count=204800
2.2 block layer write
time -p dd if=/dev/zero of=/dev/sda2 bs=4096 count=204800
2.3 filesystem layer
iozone -a -i 1 -i 0 -U /media/sda2 -s 4096m -f  /media/sda2/iozone.test -b /mnt/tmp/iozone_usb_result.xls

| Expected Result |
g_ether: 15MB/s
Block layer read: 21.1MB/s
Block layer write: 17.0MB/s
Filesystem layer (ext3): 19MB/s(R), 7.2MB/s(W)
NOTES: for iozone, it should has file cache during the test.

|====================================================================

<<<
