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供電的邏輯,從而設備可以很快地恢復到正常工作狀狀態