如何修复 Ubuntu 18.04.5 LTS 以太网控制器 1 Gbps 适配器现在仅限于 100 Mpbs 下载速度?

如何修复 Ubuntu 18.04.5 LTS 以太网控制器 1 Gbps 适配器现在仅限于 100 Mpbs 下载速度?

在两台独立的笔记本电脑上,两台都是 HP OMEN Laptop 15-dc1xxx SKU 7TK52UA#ABA,从 18.04.3 LTS 升级到 18.04.5 会破坏千兆速度。在运行内核 5.4.0-42-generic 时,千兆速度在几周内运行良好,RTL8111/8168/8411 PCI Express 千兆以太网控制器的下载速度。下载速度现在限制在大约 100-130 Mbps,上传速度仍能达到 1 Gbps(1000 Mbps)。

AT&T Gigapower(千兆上行和下行),并更换了网关,以为这才是问题所在。事实证明,这并不是问题的根源。

尝试恢复千兆速度而不必回滚内核版本。

系统+连接信息+速度测试

以下是更多系统信息:

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"

$ sudo grep -e [0-9] -e [A-Z] /sys/class/dmi/id/{chassis_{type,vendor,version,serial},product_{family,name,serial,sku,uuid,version}}
/sys/class/dmi/id/chassis_type:10
/sys/class/dmi/id/chassis_vendor:HP
/sys/class/dmi/id/chassis_version:Chassis Version
/sys/class/dmi/id/chassis_serial:xxxxxxxxxx
/sys/class/dmi/id/product_family:103C_5335KV HP OMEN
/sys/class/dmi/id/product_name:OMEN by HP Laptop 15-dc1xxx
/sys/class/dmi/id/product_serial:xxxxxxxxx
/sys/class/dmi/id/product_sku:7TK52UA#ABA
/sys/class/dmi/id/product_uuid:39444335-3833-5a36-5a4c-040e3c8a6d6c

$ lspci -nn | grep -i ethernet
03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 16)

$ sudo lshw -C network
  *-network                 
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: eno1
       version: 16
       serial: 04:0e:3c:8a:6d:6c
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.1.80 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:17 ioport:3000(size=256) memory:84404000-84404fff memory:84400000-84403fff
  *-network DISABLED
       description: Wireless interface
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: wlo1
       version: 1a
       serial: 50:e0:85:f2:b5:ca
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=5.4.0-42-generic firmware=48.4fa0041f.0 latency=0 link=no multicast=yes wireless=IEEE 802.11
       resources: irq:18 memory:84300000-84303fff

$ ethtool eno1
Settings for eno1:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
                                         1000baseT/Full 
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 1000Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
    Current message level: 0x00000033 (51)
                   drv probe ifdown ifup
    Link detected: yes

$ nmcli -g 802-3-ethernet -m multiline con show "Wired connection 1" 
802-3-ethernet.port:
802-3-ethernet.speed:0
802-3-ethernet.duplex:
802-3-ethernet.auto-negotiate:yes
802-3-ethernet.mac-address:04:0E:3C:xx:xx:xx
802-3-ethernet.cloned-mac-address:
802-3-ethernet.generate-mac-address-mask:
802-3-ethernet.mac-address-blacklist:
802-3-ethernet.mtu:auto
802-3-ethernet.s390-subchannels:
802-3-ethernet.s390-nettype:
802-3-ethernet.s390-options:
802-3-ethernet.wake-on-lan:default
802-3-ethernet.wake-on-lan-password:

$ sudo dmidecode -s bios-version
F.12

更新: 测试了 Ubuntu 20.04.1 LTS Live。

  • 实时速度 - 123.7 Mbps/下载 & 321.6 Mbps/上传
  • 18.04.3 和 18.04.5 的上传速度为 850-950 Mbps。

更新:将其中一台笔记本电脑升级到 20.04.1 LTS 以重新确认

  • 升级后的有线速度为下行 125 Mbps、上行 884.7 Mbps
  • 将“链路协商”设置为忽略、自动或 1Gb/s 完整时,结果相同
  • 无线速度(仅供参考)196 Mbps/下载 & 370 Mbps/上传

更新:升级的系统信息

root@hpomenlpt02:/var/log# dmidecode -s bios-version
F.13

root@hpomenlpt02:/var/log# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"

Sep  2 00:04:21 hpomenlpt02 kernel: [  125.750914] Generic FE-GE Realtek PHY r8169-300:00: attached PHY driver [Generic FE-GE Realtek PHY] (mii_bus:phy_addr=r8169-300:00, irq=IGNORE)
Sep  2 00:04:21 hpomenlpt02 kernel: [  125.862804] r8169 0000:03:00.0 eno1: Link is Down
Sep  2 00:04:21 hpomenlpt02 kernel: [  125.883048] iwlwifi 0000:04:00.0: Applying debug destination EXTERNAL_DRAM
Sep  2 00:04:21 hpomenlpt02 kernel: [  126.068202] iwlwifi 0000:04:00.0: FW already configured (0) - re-configuring
Sep  2 00:04:21 hpomenlpt02 kernel: [  126.084566] iwlwifi 0000:04:00.0: BIOS contains WGDS but no WRDS
Sep  2 00:04:24 hpomenlpt02 kernel: [  128.849144] r8169 0000:03:00.0 eno1: Link is Up - 1Gbps/Full - flow control off
Sep  2 00:04:24 hpomenlpt02 kernel: [  128.849172] IPv6: ADDRCONF(NETDEV_CHANGE): eno1: link becomes ready
Sep  2 00:04:25 hpomenlpt02 kernel: [  129.456614] wlo1: authenticate with a6:98:13:e4:9d:e3
Sep  2 00:04:25 hpomenlpt02 kernel: [  129.461971] wlo1: send auth to a6:98:13:e4:9d:e3 (try 1/3)
Sep  2 00:04:25 hpomenlpt02 kernel: [  129.497916] wlo1: authenticated
Sep  2 00:04:25 hpomenlpt02 kernel: [  129.501195] wlo1: associate with a6:98:13:e4:9d:e3 (try 1/3)
Sep  2 00:04:25 hpomenlpt02 kernel: [  129.506221] wlo1: RX AssocResp from a6:98:13:e4:9d:e3 (capab=0x511 status=0 aid=91)
Sep  2 00:04:25 hpomenlpt02 kernel: [  129.508531] wlo1: AP has invalid WMM params (AIFSN=1 for ACI 2), will use 2
Sep  2 00:04:25 hpomenlpt02 kernel: [  129.508535] wlo1: AP has invalid WMM params (AIFSN=1 for ACI 3), will use 2
Sep  2 00:04:25 hpomenlpt02 kernel: [  129.514155] wlo1: associated
Sep  2 00:04:25 hpomenlpt02 kernel: [  129.527588] wlo1: Limiting TX power to 127 (127 - 0) dBm as advertised by a6:98:13:e4:9d:e3
Sep  2 00:04:25 hpomenlpt02 kernel: [  129.628042] IPv6: ADDRCONF(NETDEV_CHANGE): wlo1: link becomes ready

更新:笔记本电脑型号

更新:固件从 F.12 升级至 F.18 Rev. A

提醒:有两台 HP Omen 15-dc1057nr 笔记本电脑

  • 在测试期间,其中一个从 Ubuntu 18.04.5 LTS 升级到了 20.04.1 LTS。

在 Ubuntu 20.04.1 LTS 上测试

  • 状态:成功;千兆速度再次与 BIOS F.18 Rev. A 配合使用

在 Ubuntu 18.04.5 LTS 上测试

  • 状态:失败;在 BIOS F.18 中以及使用 r8169 或 r8168 时
  • 光纤/千兆连接仍然速度变慢
  • 下载速度:130.2 Mbps,上传速度:868.6 Mbps

请参阅下面 r8168 上有关 20.04.1 LTS 的评论中的说明。

按照链接中的“使用 USB 恢复驱动器恢复 BIOS”->“创建 USB 恢复驱动器”步骤操作如何

这款特定的 HP Omen 15-dc1057nr 在 BIOS 菜单中没有用于更新 BIOS 的选项,也没有用于从本地媒体更新 BIOS 的选项。要强制 HP Omen 访问 HP BIOS 更新屏幕,请执行以下操作:

  • 按住视窗钥匙和同时按下 键。
  • 在继续按住这些键的同时,按住力量按钮2至3秒钟。
  • 释放力量按钮并继续按下视窗键,直到出现 HP BIOS 更新屏幕。(注意:在此步骤中,有几次我不得不放开 Windows 和 B 键才能出现屏幕;参见 HP)
  • 如果遇到任何问题,请参阅上面“使用按键组合恢复 BIOS”部分下的相同链接进行检查。

更新:第二台笔记本电脑之前运行的是 Ubuntu 18.04.5 LTS,升级到了 20.04.1 LTS

  • 从 18.04.5 LTS 升级到 20.04.1 LTS 没有任何问题

  • 千兆下载速度仍限制在约 130 Mbps/下

  • 上传速度仍为 800+ Mbps/以上

  • 使用“忽略、自动和手动 1 Gb/s 全速”模式对有线千兆连接进行测试 - 速度仍然不超过 130 Mbps/下行

  • 创建了实时 USB 并测试了以下内容:

    • Ubuntu 18.04.3 LTS Live - 结果:下载速度超过 850 Mbps,上传速度超过 900 Mbps
    • Ubuntu 18.04.5 LTS Live - 结果:尚无定论
      • 速度测试 1:下载速度 907 Mbps,上传速度 886 Mbps
      • 速度测试 2:下载速度 126 Mbps,上传速度 864 Mbps
      • 速度测试 3:下载速度 122 Mbps,上传速度 880 Mbps
      • 系统日志内核消息报告链路已达到 1 Gbps/完全流量控制已关闭
    • Ubuntu 20.04.1 LTS Live - 结果:下载速度约 130 Mbps,上传速度约 850 Mbps
  • 已验证的 BIOS 固件位于 F18:

    $ sudo cat /sys/class/dmi/id/bios_version
    F.18
    
  • 为确保万无一失,验证了 DMI 信息与第二台 HP Omen dc-1057nr 相同

    $ sudo grep -e [0-9] -e [A-Z] /sys/class/dmi/id/{chassis_{type,vendor,version,serial},product_{family,name,serial,sku,uuid,version}}
    /sys/class/dmi/id/chassis_type:10
    /sys/class/dmi/id/chassis_vendor:HP
    /sys/class/dmi/id/chassis_version:Chassis Version
    /sys/class/dmi/id/chassis_serial:xxxxxxxxxxx
    /sys/class/dmi/id/product_family:103C_5335KV HP OMEN
    /sys/class/dmi/id/product_name:OMEN by HP Laptop 15-dc1xxx
    /sys/class/dmi/id/product_serial:xxxxxxxxxxx
    /sys/class/dmi/id/product_sku:7TK52UA#ABA
    /sys/class/dmi/id/product_uuid:39444335-3833-5a36-5a4c-040e3c8a6d6c
    

答案1

BIOS

HP Omen 15-dc1057nr

您的 BIOS 版本为 F.12(或 F.13)。

有较新的 BIOS 可用,版本 F.18 Rev.A,日期为 2020 年 8 月 3 日,可以下载这里

注意:确认我拥有适合您型号的正确网页。

注意:更新 BIOS 之前请做好备份。

注意:BIOS 回滚文档是这里

以太网

让我们尝试不同的以太网驱动程序。

sudo apt-get update

sudo apt-get install dkms r8168-dkms

reboot

重新测试下载速度。

更新#1:

千兆速度需要 Ubuntu 20.04.1 和 BIOS 更新至 F.18。

更新 #2:

#!/bin/sh

# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1779817
#
# Attached is a work-around for the in-kernel driver that is as unhacky as I can make it.

# filename: r8169_disable_msi

# Drop it in /etc/initramfs-tools/scripts/init-top and chmod a+x it. Add 'r8169_disable_msi'
# to your kernel command line (/etc/default/grub, GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# usually.) 

# Remember to update-initramfs and update-grub as necessary.

# sudo update-initramfs -c -k $(uname -r)
# sudo update-grub
# reboot

# For the moment it disables MSI on everything with the ID 0x10ec:0x8168, as there seems to
# be no way to get the MAC version from userspace - and certainly not before the driver is
# loaded. Other PCI IDs may need adding..

# Still hoping we can cherry pick the in-driver workaround for bionic...?

PREREQ=""
prereqs()
{
    echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
    prereqs
    exit 0
    ;;
esac

disable_msi () {
    for i in /sys/bus/pci/devices/*; do 
        if [ $(cat $i/vendor) = "0x10ec" -a $(cat $i/device) = "0x8168" ]; then
            echo 0 >$i/msi_bus
        fi
    done
}

for x in $(cat /proc/cmdline); do
        case ${x} in
        r8169_disable_msi)
        disable_msi
        break
                ;;
        esac
done

相关内容