[嵌入式linux]RTL8111/RTL8168网卡内核驱动安装

RTL8111/RTL8168的驱动在内核中没有找到,网上查了一下也可以用RTL8169的驱动

  • 内核路径下执行make menuconfig
->Device Drivers ->Network device support ->Ethernet driver support
[*]   Realtek devices
<M>     Realtek 8169 gigabit ethernet support

重新编译内核驱动,安装内核驱动

启动log:

[   10.615170] r8169 0000:01:00.0: Direct firmware load for rtl_nic/rtl8168h-2.fw failed with error -2
[   10.624283] r8169 0000:01:00.0 eth1: unable to load firmware patch rtl_nic/rtl8168h-2.fw (-2)
OK
[   10.662209] r8169 0000:01:00.0 eth1: link down
[   10.666862] r8169 0000:01:00.0 eth1: link down
[   15.344579] r8169 0000:01:00.0 eth1: link up
#ifconfig
eth1      Link encap:Ethernet  HWaddr E8:4E:06:72:F5:8A
          inet addr:10.10.46.126  Bcast:10.10.47.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:28811 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4245987 (4.0 MiB)  TX bytes:780 (780.0 B)

用iperf3测一下速度,接近300M,带宽还不错。

# iperf3 -c 10.10.47.36
Connecting to host 10.10.47.36, port 5201
[  4] local 10.10.46.126 port 57788 connected to 10.10.47.36 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.03   sec  36.2 MBytes   294 Mbits/sec    0   36.8 KBytes
[  4]   1.03-2.00   sec  33.8 MBytes   293 Mbits/sec    0   39.6 KBytes
[  4]   2.00-3.00   sec  35.0 MBytes   294 Mbits/sec    0   50.9 KBytes
[  4]   3.00-4.03   sec  36.2 MBytes   295 Mbits/sec    0   69.3 KBytes
[  4]   4.03-5.03   sec  35.0 MBytes   295 Mbits/sec    0   87.7 KBytes
[  4]   5.03-6.01   sec  35.0 MBytes   297 Mbits/sec    0    106 KBytes
[  4]   6.01-7.03   sec  36.2 MBytes   298 Mbits/sec    0    148 KBytes
[  4]   7.03-8.02   sec  35.0 MBytes   298 Mbits/sec    0    148 KBytes
[  4]   8.02-9.00   sec  35.0 MBytes   298 Mbits/sec    0    148 KBytes
[  4]   9.00-10.02  sec  36.2 MBytes   298 Mbits/sec    0    148 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.02  sec   354 MBytes   296 Mbits/sec    0             sender
[  4]   0.00-10.02  sec   354 MBytes   296 Mbits/sec                  receiver

iperf Done.

另外注意一点,有些板子PCIe插槽设计的时候没有给3.3VAUX供电,会导致网卡无法工作,遇到这种情况需要将3.3V与3.3VAUX短接。
在这里插入图片描述
3.3VAUX的介绍如下:
PCIe电源有+12V、+3.3Vcc 和+3.3Vaux。其中+12V主要给PCIe设备(如显卡)提供更大的供电能力(PCIe3.0的插槽最大有150w)。
PCIe设备使用两种电源信号供电,分别是Vcc与Vaux,其额定电压为3.3V。其中Vcc为主电源,PCIe设备使用的主要逻辑模块均使用Vcc供电,而一些与电源管理相关的逻辑使用Vaux供电。在PCIe设备中,一些特殊的寄存器通常使用Vaux供电,如Sticky Register,此时即使PCIe设备的Vcc被移除,这些与电源管理相关的逻辑状态和这些特殊寄存器的内容也不会发生改变。
在PCIe总线中,使用Vaux的主要原因是为了降低功耗和缩短系统恢复时间。因为Vaux在多数情况下并不会被移除,因此当PCIe设备的Vcc恢复后,该设备不用重新恢复使用Vaux供电的逻辑,从而设备可以很快地恢复到正常工作状状态

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章