Ubuntu 18.04 上的 RTL8152

Ubuntu 18.04 上的 RTL8152

我刚刚开始设置多千兆网络。我找到了一些不错的 USB 转 2.5GBASE-T 适配器。

现在,虽然它们确实可以开箱即用,但它们似乎正在使用 cdc-ncm 作为驱动程序,而这无法充分利用 NIC 的功能(限制为 1500MTU 并且性能受阻)

通过安装现已过时的 Realtek 驱动程序,可以解决此问题。问题是,我需要在连接设备之前使用 modprobe -r 踢出 cdc-mbim 和 cdc-ncm,否则模块会发生冲突,cdc-ncm 将获胜。但是,我不想只将这两个模块列入黑名单,因为我还安装了使用这些模块的 LTE 调制解调器。

我的两个问题:

  1. 我怎样才能防止 cdc-ncm 接管该设备,而不是直接把它撕掉?
  2. 如何修补驱动程序以便与最新的内核版本兼容?

系统信息:

  • uname -r:5.3.8-050308-通用
  • Realtek 驱动程序:r8152_2.12.0
  • 连接cdc-ncm后的dmesg输出:
[  556.959398] usb 3-3.2: New USB device found, idVendor=0bda, idProduct=8156, bcdDevice=30.00
[  556.959400] usb 3-3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[  556.959401] usb 3-3.2: Product: USB 10/100/1G/2.5G LAN
[  556.959402] usb 3-3.2: Manufacturer: Realtek
[  556.959403] usb 3-3.2: SerialNumber: 000000001
[  556.984103] cdc_ncm 3-3.2:2.0: MAC-Address: a0:ce:c8:cb:7c:ca
[  556.984105] cdc_ncm 3-3.2:2.0: setting rx_max = 16384
[  556.984172] cdc_ncm 3-3.2:2.0: setting tx_max = 16384
[  556.984445] cdc_ncm 3-3.2:2.0 usb0: register 'cdc_ncm' at usb-0000:00:14.0-3.2, CDC NCM, a0:ce:c8:cb:7c:ca
[  557.009821] usbcore: registered new interface driver r8152
[  557.012312] cdc_ncm 3-3.2:2.0 enxa0cec8cb7cca: renamed from usb0
[  557.062459] usb 2-3.1.1: new high-speed USB device number 8 using xhci_hcd
[  557.062510] cdc_ncm 3-3.2:2.0 enxa0cec8cb7cca: network connection: disconnected
[  557.094515] cdc_ncm 3-3.2:2.0 enxa0cec8cb7cca: network connection: disconnected
[  557.126508] cdc_ncm 3-3.2:2.0 enxa0cec8cb7cca: network connection: disconnected
[  557.158506] cdc_ncm 3-3.2:2.0 enxa0cec8cb7cca: network connection: disconnected
[  557.190514] cdc_ncm 3-3.2:2.0 enxa0cec8cb7cca: network connection: disconnected
  • 启动两个模块后的 dmesg 输出:
[  624.246651] usb 3-3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[  624.246653] usb 3-3.2: Product: USB 10/100/1G/2.5G LAN
[  624.246654] usb 3-3.2: Manufacturer: Realtek
[  624.246655] usb 3-3.2: SerialNumber: 000000001
[  624.330110] usb 3-3.2: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[  624.444293] r8152 3-3.2:1.0 eth0: v2.12.0 (2019/04/29)
[  624.444295] r8152 3-3.2:1.0 eth0: Hello 
[  624.606497] usbcore: registered new interface driver cdc_ncm
[  624.608322] usbcore: registered new interface driver cdc_wdm
[  624.656599] cdc_mbim 2-4:1.0: setting rx_max = 16384
[  624.657267] cdc_mbim 2-4:1.0: cdc-wdm0: USB WDM device
[  624.657816] cdc_mbim 2-4:1.0 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-4, CDC MBIM, d2:c8:53:b2:65:df
[  624.659148] usbcore: registered new interface driver cdc_mbim
[  624.661511] cdc_mbim 2-4:1.0 wwp0s20u4: renamed from wwan0
[  624.675680] r8152 3-3.2:1.0 enxa0cec8cb7cca: renamed from eth0
[  628.423530] IPv6: ADDRCONF(NETDEV_CHANGE): enxa0cec8cb7cca: link becomes ready
[  628.423959] r8152 3-3.2:1.0 enxa0cec8cb7cca: carrier on

任何帮助是极大的赞赏!

答案1

我明白了。我只需要将包含的内容复制50-usb-realtek-net.rules到我的文件中/udev/rules.d,这样就不会发生冲突。

相关内容