usb otg slave role g_ether is very slow

Moderators: odroid, mdrjr

usb otg slave role g_ether is very slow

Unread postby hyphop » Tue Jan 03, 2017 7:54 pm

i need use usb ogt slave mode as g_ether / have same powered from laptop via microusb

i start my script from rc.local in boot time

Code: Select all
#!/bin/sh
/usr/sbin/modprobe libcomposite.ko
/usr/sbin/insmod g_ether
sleep 1
/sbin/ifconfig usb0 10.1.1.1 netmask 255.255.255.0


Code: Select all
root@MusicBox:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1E:06:20:09:7C 
          inet addr:10.20.30.2  Bcast:10.20.30.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:40


looks like ok and i have connection from master to host

Code: Select all
root@sager:/home/master# ifconfig usb0           
usb0      Link encap:Ethernet  HWaddr 0a:3f:9f:1c:25:ba 
          inet addr:10.1.1.2  Bcast:10.1.1.255  Mask:255.255.255.0
          inet6 addr: fe80::83f:9fff:fe1c:25ba/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14815 errors:837 dropped:664 overruns:0 frame:837
          TX packets:14968 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3156812 (3.1 MB)  TX bytes:2294516 (2.2 MB)


but connection very slow about 64kbit ((((
Code: Select all
root@sager:/home/master# ping zeru
PING zeru (10.1.1.1) 56(84) bytes of data.
64 bytes from zeru (10.1.1.1): icmp_req=1 ttl=64 time=9.94 ms
64 bytes from zeru (10.1.1.1): icmp_req=2 ttl=64 time=9.61 ms
64 bytes from zeru (10.1.1.1): icmp_req=3 ttl=64 time=7.83 ms


i have kernel
Code: Select all
root@MusicBox:~# uname -a
Linux MusicBox 3.10.103-166 #1 SMP PREEMPT Mon Sep 19 15:03:34 UTC 2016 armv7l GNU/Linux


i try to do on OragePi device with same kernel , and i can say its works fine with same kernel!
but need add some action before usage
Code: Select all
echo -n 0 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role
modprobe g_ether
echo -n 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role


what wrong with my odroid c1+ ?
what i do wrong ? may be i need some additional manipulation in
Code: Select all
/sys/bus/logicmodule/drivers/dwc_otg/lm0/*
or
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/


Tnx for quality answers !!!

some addition info

Code: Select all
root@MusicBox:~# grep "" /sys/bus/logicmodule/drivers/dwc_otg/lm0/*
/sys/bus/logicmodule/drivers/dwc_otg/lm0/busconnected:Bus Connected = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/buspower:Bus Power = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/bussuspend:Bus Suspend = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/devspeed:Device Speed = 0x0
grep: /sys/bus/logicmodule/drivers/dwc_otg/lm0/disconnect_us: Permission denied
/sys/bus/logicmodule/drivers/dwc_otg/lm0/enumspeed:Device Enumeration Speed = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/fr_interval:Frame Interval = 0xb8f
/sys/bus/logicmodule/drivers/dwc_otg/lm0/ggpio:GGPIO = 0x00000000
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gnptxfsiz:GNPTXFSIZ = 0x01000100
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gotgctl:GOTGCTL = 0x001d0000
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gpvndctl:GPVNDCTL = 0x00000000
/sys/bus/logicmodule/drivers/dwc_otg/lm0/grxfsiz:GRXFSIZ = 0x00000100
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gsnpsid:GSNPSID = 0x4f54310a
/sys/bus/logicmodule/drivers/dwc_otg/lm0/guid:GUID = 0x12345678
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gusbcfg:GUSBCFG = 0x40001808
/sys/bus/logicmodule/drivers/dwc_otg/lm0/hcd_frrem:HCD Dump Frame Remaining
/sys/bus/logicmodule/drivers/dwc_otg/lm0/hcddump:HCD Dump
/sys/bus/logicmodule/drivers/dwc_otg/lm0/hnp:HstNegScs = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/hnpcapable:HNPCapable = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/hprt0:HPRT0 = 0x00000000
/sys/bus/logicmodule/drivers/dwc_otg/lm0/hptxfsiz:HPTXFSIZ = 0x00000000
/sys/bus/logicmodule/drivers/dwc_otg/lm0/hsic_connect:HSIC Connect = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/inv_sel_hsic:Invert Select HSIC = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/mode:Mode = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/mode_ch_tim_en:Mode Change Ready Timer Enable = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/peri_iddq:IDDQ = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/peri_otg_disable:IDDQ = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/peri_power:PHY Power = 1
/sys/bus/logicmodule/drivers/dwc_otg/lm0/peri_sleepm:SLEEP MODULE = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/pools:poolinfo - 0.1
/sys/bus/logicmodule/drivers/dwc_otg/lm0/pools:buffer-2048         0    0 2048  0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/pools:buffer-512          0    0  512  0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/pools:buffer-128          0    0  128  0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/pools:buffer-64           0    0   64  0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/rd_reg_test:Time to read GNPTXFSIZ reg 10000000 times: 1440 msecs (144 jiffies)
/sys/bus/logicmodule/drivers/dwc_otg/lm0/regdump:Register Dump
/sys/bus/logicmodule/drivers/dwc_otg/lm0/regoffset:0xffffffff
/sys/bus/logicmodule/drivers/dwc_otg/lm0/regvalue:invalid offset
/sys/bus/logicmodule/drivers/dwc_otg/lm0/remote_wakeup:Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/spramdump:SPRAM Dump
/sys/bus/logicmodule/drivers/dwc_otg/lm0/srp:SesReqScs = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/srpcapable:SRPCapable = 0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/uevent:DRIVER=dwc_otg
/sys/bus/logicmodule/drivers/dwc_otg/lm0/uevent:OF_NAME=usb_a
/sys/bus/logicmodule/drivers/dwc_otg/lm0/uevent:OF_FULLNAME=/usb_con/usb_a
/sys/bus/logicmodule/drivers/dwc_otg/lm0/uevent:OF_COMPATIBLE_N=0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/wr_reg_test:Time to write GNPTXFSIZ reg 10000000 times: 2310 msecs (231 jiffies)


Code: Select all
root@MusicBox:~# grep "" /sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/*
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/addr_assign_type:0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/addr_len:6
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/address:26:07:41:4d:d8:d5
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/broadcast:ff:ff:ff:ff:ff:ff
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/carrier:1
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/dev_id:0x0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/dormant:0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/flags:0x1003
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/ifindex:5
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/iflink:5
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/link_mode:0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/mtu:1500
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/netdev_group:0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/operstate:up
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/tx_queue_len:1000
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/type:1
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/uevent:DEVTYPE=gadget
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/uevent:INTERFACE=usb0
/sys/bus/logicmodule/drivers/dwc_otg/lm0/gadget/net/usb0/uevent:IFINDEX=5
hyphop
 
Posts: 68
Joined: Tue Dec 01, 2015 4:22 pm
languages_spoken: english
ODROIDs: ODROID-C1+ & C2

Re: usb otg slave role g_ether is very slow

Unread postby odroid » Tue Jan 03, 2017 8:07 pm

Try to change the CPU governor to "performance" mode.
User avatar
odroid
Site Admin
 
Posts: 27984
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: usb otg slave role g_ether is very slow

Unread postby hyphop » Tue Jan 03, 2017 8:47 pm

odroid wrote:Try to change the CPU governor to "performance" mode.


i have try all modes without effect (
hyphop
 
Posts: 68
Joined: Tue Dec 01, 2015 4:22 pm
languages_spoken: english
ODROIDs: ODROID-C1+ & C2

Re: usb otg slave role g_ether is very slow

Unread postby odroid » Tue Jan 03, 2017 9:06 pm

Can you try "iperf" test?
User avatar
odroid
Site Admin
 
Posts: 27984
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: usb otg slave role g_ether is very slow

Unread postby hyphop » Sat Jan 07, 2017 5:15 pm

anybody try to use otg_ether on c1+ or not
hyphop
 
Posts: 68
Joined: Tue Dec 01, 2015 4:22 pm
languages_spoken: english
ODROIDs: ODROID-C1+ & C2

Re: usb otg slave role g_ether is very slow

Unread postby nhe » Thu Sep 21, 2017 4:18 pm

I got the same result with both C1 and C1+.

As a comparison, I also tested with RaspberryPi Zero (via g_ether), which is almost two thousand times faster than C1/C1+ on iperf testing.

host PC # iperf -s -i2 ( IP: 10.3.3.1 )
Odroid C1+ (or RPi0) # iperf -c 10.3.3.2

#### test result with Odroid C1+
Code: Select all
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 10.3.3.2 port 5001 connected with 10.3.3.1 port 33476
[  4]  0.0- 2.0 sec  14.1 KBytes  57.9 Kbits/sec
[  4]  2.0- 4.0 sec  12.7 KBytes  52.1 Kbits/sec
[  4]  4.0- 6.0 sec  12.7 KBytes  52.1 Kbits/sec
[  4]  6.0- 8.0 sec  12.7 KBytes  52.1 Kbits/sec
[  4]  8.0-10.0 sec  12.7 KBytes  52.1 Kbits/sec
[  4] 10.0-12.0 sec  14.1 KBytes  57.9 Kbits/sec
[  4] 12.0-14.0 sec  12.7 KBytes  52.1 Kbits/sec
[  4] 14.0-16.0 sec  12.7 KBytes  52.1 Kbits/sec
[  4] 16.0-18.0 sec  12.7 KBytes  52.1 Kbits/sec
[  4] 18.0-20.0 sec  12.7 KBytes  52.1 Kbits/sec
[  4] 20.0-22.0 sec  12.7 KBytes  52.1 Kbits/sec
[  4] 22.0-24.0 sec  12.7 KBytes  52.1 Kbits/sec
[  4] 24.0-26.0 sec  12.7 KBytes  52.1 Kbits/se



#### test result with RaspberryPi Zero
Code: Select all
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 10.3.3.2 port 5001 connected with 10.3.3.1 port 34388
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 2.0 sec  22.0 MBytes  92.2 Mbits/sec
[  4]  2.0- 4.0 sec  22.2 MBytes  93.1 Mbits/sec
[  4]  4.0- 6.0 sec  22.2 MBytes  93.0 Mbits/sec
[  4]  6.0- 8.0 sec  22.1 MBytes  92.8 Mbits/sec
[  4]  8.0-10.0 sec  22.1 MBytes  92.8 Mbits/sec
[  4]  0.0-10.0 sec   111 MBytes  92.7 Mbits/sec


Very slow connection (like human-typing on ssh) works OK, but the data transfer rate is strangely very slow.

Pandaboard seems to have had similar issue (https://e2e.ti.com/support/omap/f/849/t/189866) but not that slow, so maybe different issue?
nhe
 
Posts: 1
Joined: Thu Sep 21, 2017 4:04 pm
languages_spoken: english
ODROIDs: U2, U3, C1, C1+, Xu, XU3, XU4


Return to Hardware and peripherals

Who is online

Users browsing this forum: No registered users and 3 guests