longsleep / build-pine64-image

Pine64 Linux build scripts, tools and instructions
MIT License
235 stars 126 forks source link

Gigabit Ethernet retransmited packets uplink/downlink huge discrepancy #22

Closed er0l closed 7 years ago

er0l commented 8 years ago

I am running 3.10.102-0-pine64-longsleep on my Pine64+ 2GB version and I have noticed huge discrepancy between download and upload speeds when testing with iperf.

Pine64 as client:

`iperf -c 192.168.254.1

Client connecting to 192.168.254.1, TCP port 5001

TCP window size: 640 KByte (default)

[ 3] local 192.168.254.2 port 45891 connected with 192.168.254.1 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.1 sec 43.9 MBytes 36.6 Mbits/sec`

Pine64 as server:

`iperf -c 192.168.254.2

Client connecting to 192.168.254.2, TCP port 5001

TCP window size: 16.0 KByte (default)

[ 3] local 192.168.254.1 port 48948 connected with 192.168.254.2 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 844 MBytes 708 Mbits/sec`

Tried changing cables between Cat6 and Cat5e, changed switch ports on the router, tried different power supplies nothing seems to work.

Ethtool shows correct info about eth0:

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: No Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: MII PHYAD: 0 Transceiver: external Auto-negotiation: on Link detected: yes

Allthough I did notice a lot of retransmited packets:

netstat -s |grep retr 18330 segments retransmited 17247 fast retransmits 1 forward retransmits 559 retransmits in slow start 342 SACK retransmits failed

Limiting eth0 to 100Mbit gives also strange results:

Pine64 client:

`iperf -c 192.168.254.1

Client connecting to 192.168.254.1, TCP port 5001

TCP window size: 640 KByte (default)

[ 3] local 192.168.254.2 port 45897 connected with 192.168.254.1 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 76.0 MBytes 63.7 Mbits/sec`

Pine64 server:

`iperf -s 192.168.254.1

iperf: ignoring extra argument -- 192.168.254.1

Server listening on TCP port 5001

TCP window size: 853 KByte (default)

[ 4] local 192.168.254.2 port 5001 connected with 192.168.254.1 port 48949 [ ID] Interval Transfer Bandwidth [ 4] 0.0-10.0 sec 39.2 MBytes 32.9 Mbits/sec `

After this test status of retransmited packets is following:

netstat -s |grep retr 25626 segments retransmited 24497 fast retransmits 2 forward retransmits 563 retransmits in slow start 343 SACK retransmits failed

I have tested also with cross-cable using my laptop's gigabit Ethernet port and the results are similar.

When using my NAS and my laptop, or other PC speed using the same switch is pretty equal in both directions.

er0l commented 8 years ago

After updatin uboot with pine64_update_uboot.sh results got better. Still not excellent but better:

`iperf -c 192.168.254.1 -r

Server listening on TCP port 5001

TCP window size: 85.3 KByte (default)


Client connecting to 192.168.254.1, TCP port 5001

TCP window size: 85.6 KByte (default)

[ 5] local 192.168.254.2 port 55110 connected with 192.168.254.1 port 5001 [ ID] Interval Transfer Bandwidth [ 5] 0.0-10.0 sec 281 MBytes 235 Mbits/sec [ 4] local 192.168.254.2 port 5001 connected with 192.168.254.1 port 52263 [ 4] 0.0-10.0 sec 914 MBytes 765 Mbits/sec `

amc2002 commented 8 years ago

Some of us are having major issues with our Gigabit ethernet on the 2GB boards. The issues are "resolved" when lowering the speed to 100Mb, but since most of us bought these boards for the gigabit, it's not really a resolution. We have tried different switches, cables, etc. with the same results, and the issue seems to be within the PINE itself.

I know this is the place to post bugs, but if devs or OP need more details, this thread might be useful: http://forum.pine64.org/showthread.php?tid=597

Not sure if it's a related issue, but it looks like it.

longsleep commented 8 years ago

Some people claim it is related to the MAC address. Please try setting the MAC address manually - i added some instructions to http://forum.pine64.org/showthread.php?tid=2049

amc2002 commented 8 years ago

Thanks for the link, but I'm one of those lucky folks with only a serial number on the bottom of my PINE.

longsleep commented 7 years ago

Try the gmac Kernel release. See http://forum.pine64.org/showthread.php?tid=293&pid=21791#pid21791 for instructions.