Ethernet problem A20-OLinuXino-Lime2 Rev.K

Started by valt, October 26, 2024, 06:57:19 PM

Previous topic - Next topic

valt

Hello everyone,

I've owned an Olimex A20 Lime2 Rev.K for a few months and a problem related to the ethernet remains unresolved despite my numerous searches on the Internet and various forums. My box is connected directly via an ethernet cable to my ISP's box. Trying to use this famous ethernet cable from my personal PC, a speed test gives me a downstream speed of around ~900 Mbps. However, when I connect this cable to my olimex, the speed suddenly becomes very low, trying an iperf on a public server with a speed of 100 Gbit/s I get about 30 Mbps:
root@olimex:~# iperf3 -c ping.online.net
Connecting to host ping.online.net, port 5201
[  5] local xx.xx.xx.xx port 58542 connected to 51.158.1.21 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  3.44 MBytes  28.8 Mbits/sec    0    244 KBytes      
[  5]   1.00-2.02   sec  4.25 MBytes  35.1 Mbits/sec    0    430 KBytes      
[  5]   2.02-3.00   sec  4.07 MBytes  34.6 Mbits/sec    0    619 KBytes      
[  5]   3.00-4.00   sec  3.70 MBytes  31.0 Mbits/sec    6    410 KBytes      
[  5]   4.00-5.00   sec  2.96 MBytes  24.8 Mbits/sec    1    258 KBytes      
[  5]   5.00-6.00   sec  2.22 MBytes  18.6 Mbits/sec    0    279 KBytes      
[  5]   6.00-7.00   sec  2.96 MBytes  24.8 Mbits/sec    0    288 KBytes      
[  5]   7.00-8.00   sec  2.22 MBytes  18.6 Mbits/sec    0    290 KBytes      
[  5]   8.00-9.00   sec  3.02 MBytes  25.3 Mbits/sec    0    290 KBytes      
[  5]   9.00-10.00  sec  1.48 MBytes  12.4 Mbits/sec    0    290 KBytes      
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  30.3 MBytes  25.4 Mbits/sec    7             sender
[  5]   0.00-10.31  sec  28.6 MBytes  23.3 Mbits/sec                  receiver

iperf Done.

However, if I look at my network card, I'm supposed to be able to receive at least 1000 Mbp/s :
root@olimex:~# ethtool eth0
Settings for eth0:
    Supported ports: [ TP     MII ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Half 1000baseT/Full
    Supported pause frame use: Symmetric
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Half 1000baseT/Full
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes:  1000baseT/Full
    Link partner advertised pause frame use: Symmetric
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 1000Mb/s
    Duplex: Full
    Auto-negotiation: on
    master-slave cfg: preferred slave
    master-slave status: slave
    Port: Twisted Pair
    PHYAD: 1
    Transceiver: external
    MDI-X: Unknown
    Supports Wake-on: d
    Wake-on: d
        Current message level: 0x0000003f (63)
                               drv probe link timer ifdown ifup
    Link detected: yes

Do you know of a similar problem with anyone else? Do you have any advice on how to fix it?

PS: if my message isn't very clear, please excuse me for my broken English.

Thank you in advance and have a nice day

LubOlimex

Each board gets a network throughput test after manufacturing, each board is required to have at least 300Mbit/s throughput.

Are you testing with Olimage Linux? If not, please test with Olimage and report back. Refer to this document:

https://github.com/OLIMEX/OLINUXINO/blob/master/DOCUMENTS/OLIMAGE/Olimage-guide.pdf

Technical support and documentation manager at Olimex

valt

#2
Hello,
Sorry for my late reply. I'm not on Olimage linux. I have the community version of Armbian for file 2. However, my card is currently running my personal services. Isn't there anything else than reinstalling the Olimex image? By any chance, can I remove my current external disk (which contains my current services) to run the Olimage Linux image via USB while I test the throughput? Or will I lose all my data?

LubOlimex

#3
Then it is quite likely problem with the Ethernet settings. You might try changing a value in the CPU registers and see if that improves the behavior (it is alright if it doesn't since the value gets reloaded upon reboot):

memtool mw 0x01c20164 0x00000426

Important: this value will reset to default if you reboot. So after issuing the command test the Ethernet throughput and ping right away before rebooting or powering down the board. If you reboot you need to issue the command again.

If your image has no memtool, try:

apt install memtool

or find it here

https://github.com/pengutronix/memtool

>  By any chance, can I remove my current external disk (which contains my current services) to run the Olimage Linux image via USB while I test the throughput? Or will I lose all my data?

I don't know how to boot from USB on these A20 boards. We boot from card and after that we can prepare booting from eMMC (with the help of SPI flash) or SATA disk.

You can prepare another SD card with Olimage and just run that, SD card has highest boot priority so your data on eMMC or SATA will be unaffacted as long as you don't wipe or install the card to them of course. The Olimage SD card boot will have precedence over other boot mediums.

Refer to Olimage guide:

https://github.com/OLIMEX/OLINUXINO/blob/master/DOCUMENTS/OLIMAGE/Olimage-guide.pdf

- Download the archive with the latest Olimage Linux image from the proper location for your board.

- Extract the archive, if you can't extract the 7-zip archive, download 7-zip software for your OS.

- Prepare a card with the image from the archive. I recommend using free version of BalenaEtcher since it is pretty simple to use, it can be downloaded from here:

https://etcher.balena.io/#download-etcher

- Insert the ready SD card in the board, attach debug medium (preferably USB-serial cable) and start the debug medium, finally attach 5V DC jack to the board to power it.

- Login to the board with root and olimex

- Test the Ethernet

- If there are issues still try the CPU register command from the beginning of this post and test the Ethernet again.



Technical support and documentation manager at Olimex

valt

#4
Hello,

I'm coming back to you following my instructions. Using memtool, I changed the values on my current configuration (an armbian image) from 48 Mbps to 61Mbps. I've run an olimex image on my lime 2 and run the tests again, this time I get this for the iperf command-line tests:

olimex@a20-olinuxino:~$ iperf3 -c ping.online.net
Connecting to host ping.online.net, port 5201
[  5] local xx.xx.xx.xx port 47938 connected to 51.158.1.21 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.01   sec  69.3 MBytes   576 Mbits/sec    1    515 KBytes       
[  5]   1.01-2.01   sec  65.0 MBytes   545 Mbits/sec    0    580 KBytes       
[  5]   2.01-3.01   sec  61.2 MBytes   514 Mbits/sec    1    448 KBytes       
[  5]   3.01-4.01   sec  53.8 MBytes   452 Mbits/sec    1    339 KBytes       
[  5]   4.01-5.02   sec  48.8 MBytes   405 Mbits/sec    0    368 KBytes       
[  5]   5.02-6.01   sec  52.5 MBytes   442 Mbits/sec    1    324 KBytes       
[  5]   6.01-7.00   sec  52.5 MBytes   445 Mbits/sec    0    352 KBytes       
[  5]   7.00-8.01   sec  50.0 MBytes   419 Mbits/sec    1    329 KBytes       
[  5]   8.01-9.01   sec  43.0 MBytes   360 Mbits/sec    0    345 KBytes       
[  5]   9.01-10.00  sec  48.8 MBytes   412 Mbits/sec    1    327 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   545 MBytes   457 Mbits/sec    6             sender
[  5]   0.00-10.04  sec   545 MBytes   455 Mbits/sec                  receiver
 
iperf Done.

However, when I run a direct GUI test on fast.com, for example, I get a throughput of 20Mbps. I don't know how to explain this difference, but overall, with iperf and an olimage image, the throughput seems to correspond to what it receives on ethernet.

LubOlimex

So it is the software configuration in Armbian image. It is probably not configured properly for the Ethernet chip we currently use. Unfortunately, we no longer support Armbian and I have no idea what exactly have to be changed. Maybe compare our u-boot and kernel configurations with the ones of Armbian and find what needs to be changed. Notice that each hardware revision of the board has own config in our images (the information is stored on the EEPROM and the image loads configuration based on what it reads from the EEPROM). You can find all info about Olimage (and links to resources and all) in the Olimage guide (that I linked previously too):

https://github.com/OLIMEX/OLINUXINO/blob/master/DOCUMENTS/OLIMAGE/Olimage-guide.pdf

I don't know about fast.com - maybe this is some internet provider fault or network equipment misconfiguration when it comes to the outside network. I would no trust testing external web-sites. Maybe re-try with different web-sites.
Technical support and documentation manager at Olimex