UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
859 Views
Registered: ‎03-16-2012

USB Super Speed Ethernet gadget fails for large packets, works when high speed mode

Jump to solution

Hello all

 

I am using Petalinux 2017.4 with the ZCU102 development board. I would like to use the USB3 interface on the ZCU102 as an Ethernet port to transfer data between the ZCU102 and a host PC. In other words, the ZCU102 MPSOC is a USB device (peripheral).

 

I have followed the instructions for 'Ethernet Gadget' in the Xilinx wiki:

http://www.wiki.xilinx.com/Zynq+Ultrascale+MPSOC+Linux+USB+device+driver

 

I am using an USB 3.0 A-Male to Micro-B-Male cable to directly connect from the ZCU102 to a USB 3 port on my Windows host PC.

 

The good news is that the Ethernet link is being detected correctly by the Windows host PC. I can ping the ZCU102 from my host PC and vice versa.

 

However, when I start increasing the size of the ping packet, I see problems. Specifically, as the size of the packets approaches the maximum MTU size of 1500 bytes, I start seeing packets being dropped.

 

I test as follows:

ping -s <size> 10.10.70.2

 

10.10.70.2 is the IP address of the Windows host PC.

 

It is difficult to identify the exact size at which problems start happening but it is somewhere in the region of 1480 bytes.

 

Note that this is only when the USB interface is in super speed mode. When the USB interface is in high speed mode, I no longer see dropped packets! I can run the following command without seeing any dropped packets:

 

ping -s 1492 10.10.70.2

 

This tests for the maximum MTU size of 1500 bytes.

 

As an aside, I first discovered this problem by trying to run iperf3. When the USB interface is in high speed mode, iperf runs perfectly. However, when I have the USB interface in super speed mode, iperf only receives a few packets (or doesn't receive any packets at all). I do know that iperf will try and send packets at the maximum MTU size so this matches the behaviour that I am seeing with ping when I increase the packet size to close to the maximum.

 

I don't think it is a link integrity problem when running in USB super speed mode because:

a) smaller packets (up to ~ 1480 bytes) are handled without any problems

b) when I configure the USB interface as a mass storage device, I am able to reliably transfer large files to the ZCU102 without any problems

 

Questions:

1) Has anyone had any success in using the USB super speed Ethernet gadget at the maximum MTU packet size with the ZCU102?

2) Does anyone know of perhaps an Ethernet gadget patch to fix what looks like a driver problem?

 

I am not sure if this is relevant but my ZCU102 board is populated with ES2 silicon.

 

Many thanks!

 

I have included below the output when I load the Ethernet gadget:

 

 

root@frm125001u1r1:~# mount /dev/mmcblk0p1 /mnt
root@frm125001u1r1:~# cd /mnt
root@frm125001u1r1:/mnt# ./usb_eth_setup.sh
[   41.148090] random: fast init done
[   41.179308] using random self ethernet address
[   41.183692] using random host ethernet address
[   41.190424] usb0: HOST MAC 2a:2f:03:3a:52:9a
[   41.194721] usb0: MAC f2:df:06:d5:93:b5
[   41.200437] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
root@frm125001u1r1:/mnt# [   41.454885] configfs-gadget gadget: super-speed config #1: c1
[   41.460654] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
[   42.561160] NOHZ: local_softirq_pending 08
[   42.569353] NOHZ: local_softirq_pending 08
[   42.574918] NOHZ: local_softirq_pending 08
[   42.664559] NOHZ: local_softirq_pending 08
[   42.808502] NOHZ: local_softirq_pending 08
[   43.000592] NOHZ: local_softirq_pending 08
[   43.069423] NOHZ: local_softirq_pending 08
[   43.568885] NOHZ: local_softirq_pending 08
[   44.568934] NOHZ: local_softirq_pending 08
[   45.569024] NOHZ: local_softirq_pending 08

root@frm125001u1r1:/mnt#

 

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
886 Views
Registered: ‎02-07-2018

Re: USB Super Speed Ethernet gadget fails for large packets, works when high speed mode

Jump to solution

HI Gteatgue,

 

I just followed the steps which mentioned in  the same link which you provided and I verified USB ethernet gadget in superspeed mode but not seen any fail for large packets in superspeed mode. For your reference I added the logs below.

 

 

root@xilinx-zcu102-2017_4:/sys/kernel/config/usb_gadget/g1# dmesg | grep super

[  220.705427] configfs-gadget gadget: super-speed config #1: c1

[  398.672348] configfs-gadget gadget: super-speed config #1: c1

========================

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/fs/configfs# insmod  configfs.ko

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget# insmod libcomposite.ko

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# insmod  u_ether.ko

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# insmod usb_f_rndis.ko

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# ./script.sh

[  217.971142] using random self ethernet address

[  217.975570] using random host ethernet address

[  217.982273] usb0: HOST MAC ea:db:d0:a1:7b:e4

[  217.986550] usb0: MAC a6:aa:5d:49:f7:b6

[  217.992725] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function#

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kerne[  220.705427] configfs-gadget gadget: super-speed config #1: c1

l/drivers/usb/gadget/function# [  220.717398] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready

 

 

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# ping -s 1500 10.10.70.2

PING 10.10.70.2 (10.10.70.2): 1500 data bytes

1508 bytes from 10.10.70.2: seq=0 ttl=128 time=2.490 ms

1508 bytes from 10.10.70.2: seq=1 ttl=128 time=2.337 ms

1508 bytes from 10.10.70.2: seq=2 ttl=128 time=2.274 ms

1508 bytes from 10.10.70.2: seq=3 ttl=128 time=2.227 ms

1508 bytes from 10.10.70.2: seq=4 ttl=128 time=2.134 ms

1508 bytes from 10.10.70.2: seq=5 ttl=128 time=2.044 ms

1508 bytes from 10.10.70.2: seq=6 ttl=128 time=1.954 ms

1508 bytes from 10.10.70.2: seq=7 ttl=128 time=1.865 ms

1508 bytes from 10.10.70.2: seq=8 ttl=128 time=1.821 ms

1508 bytes from 10.10.70.2: seq=9 ttl=128 time=1.725 ms

1508 bytes from 10.10.70.2: seq=10 ttl=128 time=1.633 ms

1508 bytes from 10.10.70.2: seq=11 ttl=128 time=1.587 ms

1508 bytes from 10.10.70.2: seq=12 ttl=128 time=5.494 ms

1508 bytes from 10.10.70.2: seq=13 ttl=128 time=5.452 ms

1508 bytes from 10.10.70.2: seq=14 ttl=128 time=5.362 ms

 

-----------------------------------------------------

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# ping -s 1600 10.10.70.2

PING 10.10.70.2 (10.10.70.2): 1600 data bytes

1608 bytes from 10.10.70.2: seq=0 ttl=128 time=2.430 ms

1608 bytes from 10.10.70.2: seq=1 ttl=128 time=2.345 ms

1608 bytes from 10.10.70.2: seq=2 ttl=128 time=2.247 ms

1608 bytes from 10.10.70.2: seq=3 ttl=128 time=2.154 ms

1608 bytes from 10.10.70.2: seq=4 ttl=128 time=2.108 ms

1608 bytes from 10.10.70.2: seq=5 ttl=128 time=2.018 ms

1608 bytes from 10.10.70.2: seq=6 ttl=128 time=1.926 ms

1608 bytes from 10.10.70.2: seq=7 ttl=128 time=1.879 ms

1608 bytes from 10.10.70.2: seq=8 ttl=128 time=1.793 ms

1608 bytes from 10.10.70.2: seq=9 ttl=128 time=1.259 ms

1608 bytes from 10.10.70.2: seq=10 ttl=128 time=1.663 ms

1608 bytes from 10.10.70.2: seq=11 ttl=128 time=1.543 ms

1608 bytes from 10.10.70.2: seq=12 ttl=128 time=1.466 ms

1608 bytes from 10.10.70.2: seq=13 ttl=128 time=5.374 ms

1608 bytes from 10.10.70.2: seq=14 ttl=128 time=1.327 ms

1608 bytes from 10.10.70.2: seq=15 ttl=128 time=5.286 ms

1608 bytes from 10.10.70.2: seq=16 ttl=128 time=5.241 ms

1608 bytes from 10.10.70.2: seq=17 ttl=128 time=5.199 ms

1608 bytes from 10.10.70.2: seq=18 ttl=128 time=5.110 ms

1608 bytes from 10.10.70.2: seq=19 ttl=128 time=5.066 ms

 

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:22:01

          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:31

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1%4879712/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  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:1

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

usb0      Link encap:Ethernet  HWaddr A6:AA:5D:49:F7:B6

          inet addr:10.10.70.1  Bcast:10.255.255.255  Mask:255.0.0.0

          inet6 addr: fe80::a4aa:5dff:fe49:f7b6%4879712/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:34 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:2617 (2.5 KiB)  TX bytes:114 (114.0 B)

 

  

 

Thanks & regards

Aravind

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
887 Views
Registered: ‎02-07-2018

Re: USB Super Speed Ethernet gadget fails for large packets, works when high speed mode

Jump to solution

HI Gteatgue,

 

I just followed the steps which mentioned in  the same link which you provided and I verified USB ethernet gadget in superspeed mode but not seen any fail for large packets in superspeed mode. For your reference I added the logs below.

 

 

root@xilinx-zcu102-2017_4:/sys/kernel/config/usb_gadget/g1# dmesg | grep super

[  220.705427] configfs-gadget gadget: super-speed config #1: c1

[  398.672348] configfs-gadget gadget: super-speed config #1: c1

========================

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/fs/configfs# insmod  configfs.ko

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget# insmod libcomposite.ko

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# insmod  u_ether.ko

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# insmod usb_f_rndis.ko

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# ./script.sh

[  217.971142] using random self ethernet address

[  217.975570] using random host ethernet address

[  217.982273] usb0: HOST MAC ea:db:d0:a1:7b:e4

[  217.986550] usb0: MAC a6:aa:5d:49:f7:b6

[  217.992725] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function#

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kerne[  220.705427] configfs-gadget gadget: super-speed config #1: c1

l/drivers/usb/gadget/function# [  220.717398] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready

 

 

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# ping -s 1500 10.10.70.2

PING 10.10.70.2 (10.10.70.2): 1500 data bytes

1508 bytes from 10.10.70.2: seq=0 ttl=128 time=2.490 ms

1508 bytes from 10.10.70.2: seq=1 ttl=128 time=2.337 ms

1508 bytes from 10.10.70.2: seq=2 ttl=128 time=2.274 ms

1508 bytes from 10.10.70.2: seq=3 ttl=128 time=2.227 ms

1508 bytes from 10.10.70.2: seq=4 ttl=128 time=2.134 ms

1508 bytes from 10.10.70.2: seq=5 ttl=128 time=2.044 ms

1508 bytes from 10.10.70.2: seq=6 ttl=128 time=1.954 ms

1508 bytes from 10.10.70.2: seq=7 ttl=128 time=1.865 ms

1508 bytes from 10.10.70.2: seq=8 ttl=128 time=1.821 ms

1508 bytes from 10.10.70.2: seq=9 ttl=128 time=1.725 ms

1508 bytes from 10.10.70.2: seq=10 ttl=128 time=1.633 ms

1508 bytes from 10.10.70.2: seq=11 ttl=128 time=1.587 ms

1508 bytes from 10.10.70.2: seq=12 ttl=128 time=5.494 ms

1508 bytes from 10.10.70.2: seq=13 ttl=128 time=5.452 ms

1508 bytes from 10.10.70.2: seq=14 ttl=128 time=5.362 ms

 

-----------------------------------------------------

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# ping -s 1600 10.10.70.2

PING 10.10.70.2 (10.10.70.2): 1600 data bytes

1608 bytes from 10.10.70.2: seq=0 ttl=128 time=2.430 ms

1608 bytes from 10.10.70.2: seq=1 ttl=128 time=2.345 ms

1608 bytes from 10.10.70.2: seq=2 ttl=128 time=2.247 ms

1608 bytes from 10.10.70.2: seq=3 ttl=128 time=2.154 ms

1608 bytes from 10.10.70.2: seq=4 ttl=128 time=2.108 ms

1608 bytes from 10.10.70.2: seq=5 ttl=128 time=2.018 ms

1608 bytes from 10.10.70.2: seq=6 ttl=128 time=1.926 ms

1608 bytes from 10.10.70.2: seq=7 ttl=128 time=1.879 ms

1608 bytes from 10.10.70.2: seq=8 ttl=128 time=1.793 ms

1608 bytes from 10.10.70.2: seq=9 ttl=128 time=1.259 ms

1608 bytes from 10.10.70.2: seq=10 ttl=128 time=1.663 ms

1608 bytes from 10.10.70.2: seq=11 ttl=128 time=1.543 ms

1608 bytes from 10.10.70.2: seq=12 ttl=128 time=1.466 ms

1608 bytes from 10.10.70.2: seq=13 ttl=128 time=5.374 ms

1608 bytes from 10.10.70.2: seq=14 ttl=128 time=1.327 ms

1608 bytes from 10.10.70.2: seq=15 ttl=128 time=5.286 ms

1608 bytes from 10.10.70.2: seq=16 ttl=128 time=5.241 ms

1608 bytes from 10.10.70.2: seq=17 ttl=128 time=5.199 ms

1608 bytes from 10.10.70.2: seq=18 ttl=128 time=5.110 ms

1608 bytes from 10.10.70.2: seq=19 ttl=128 time=5.066 ms

 

root@xilinx-zcu102-2017_4:/lib/modules/4.9.0-xilinx-v2017.4/kernel/drivers/usb/gadget/function# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:22:01

          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:31

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1%4879712/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  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:1

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

usb0      Link encap:Ethernet  HWaddr A6:AA:5D:49:F7:B6

          inet addr:10.10.70.1  Bcast:10.255.255.255  Mask:255.0.0.0

          inet6 addr: fe80::a4aa:5dff:fe49:f7b6%4879712/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:34 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:2617 (2.5 KiB)  TX bytes:114 (114.0 B)

 

  

 

Thanks & regards

Aravind

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

0 Kudos