由于设备树设置导致的问题

由于我们以下核心板使用的开发板是百兆的网口插座,因此在设备树中限制网络为百兆。

machine 名称配置根设备树文件修正后的设备树文件 16.1.0 版本
phyboard-mira-imx6-4
i.MX6 Solo, 256MB RAM, NAND
imx6dl-phytec-mira-rdk-nand.dtb
phyboard-mira-imx6-6
i.MX6 Solo, 1GiB RAM, 1GiB NAND
imx6dl-phytec-mira-rdk-nand.dtb
phyboard-mira-imx6-7
i.MX6 DualLite, 1GiB RAM, 4GB eMMC
imx6dl-phytec-mira-rdk-emmc.dtb

在以上的dts文件中都有以下代码:

&ethphy {
        max-speed = <100>;
};

去掉这部分后重新编译来修复。

由于网口flowcontrol导致的问题

imx6在用iperf测试时,实际速度会是在400Mbit/s,如果此时在网络协商时,协商结果(位于dmesg,注意flow control的结果)为:

[ ] fec 2188000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx

iperf测试结果:

[  5] local 192.168.3.11 port 5001 connected with 192.168.3.10 port 49892
[  5]  0.0-10.0 sec   528 MBytes   443 Mbits/sec


则工作正常,如果协商结果(注意flow control是off)为:

[ ] fec 2188000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off

则由于SOC内部总线的速度限制,会导致buffer overrun,如下:

root@phyboard-mira-imx6-3:~# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 192.168.3.11 port 5001 connected with 192.168.3.10 port 53423
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.8 sec 5.13 MBytes 3.97 Mbits/sec

ifconfig

eth0      Link encap:Ethernet  HWaddr 50:2D:F4:0C:CB:91
          inet addr:192.168.3.11  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::522d:f4ff:fe0c:cb91/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:774836 errors:524 dropped:0 overruns:524 frame:524 <--- 这里有错
          TX packets:79830 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1168487250 (1.0 GiB)  TX bytes:4456324 (4.2 MiB)

另外,windows可以在网卡的驱动配置中修改flow control的配置,如下图



更多信息请参考以下几个链接:

https://boundarydevices.com/i-mx6-ethernet/

镜像PDF: i-mx6-ethernet.pdf

http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/140114.html

镜像PDF: [PATCH 1_1 net-next] net_ fec_ enable pause frame to improve rx prefomance for 1G network.pdf


  • No labels