问题

问题

问题

您好,我最近运行了 Ubuntu 电脑一段时间,获取更新,重新启动,有线网络停止工作。以前的版本也是 20.04。不知道具体版本。

我没有连接,并且定期弹出通知连接更新失败的窗口。

更新 2021-06-14
我发现冷启动(关机 -> 启动)后连接可以正常工作,但重启后连接则不正常。

正如@heynnema 指出的那样,这是RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller我主板上的集成问题B85-G41 PC Mate(MS-7850)。请参阅解决方案

日志和其他东西

$ inxi -Fx
System:    Host: ****** Kernel: 5.8.0-53-generic x86_64 bits: 64 compiler: N/A Desktop: Gnome 3.36.7 
Machine:   Type: Desktop System: MSI product: MS-7850 v: 1.0 serial: <superuser/root required> 
           Mobo: MSI model: B85-G41 PC Mate(MS-7850) v: 1.0 serial: <superuser/root required> UEFI: American Megatrends v: 2.9
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI driver: r8169 v: kernel 
           port: d000 bus ID: 03:00.0 
           IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: d8:cb:8a:c6:f6:d8 
$ 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: enp3s0
       version: 0c
       serial: d8:cb:8a:c6:f6:d8
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.8.0-53-generic duplex=full firmware=rtl8168g-2_0.0.1 02/06/13 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:17 ioport:d000(size=256) memory:f7100000-f7100fff memory:f2100000-f2103fff

它正在尝试连接,但显示了开始时提到的弹出窗口(无法写入确切的消息,它快速闪烁)。

$ tail -f  /var/log/syslog (edited)
NetworkManager[1052]: <info>  [1622575610.6830] device (enp3s0): Activation: starting connection 'Wired connection 1' (baec95cb-6dc1-4f0e-9f03-449a60f01d9e)
NetworkManager[1052]: <info>  [1622575610.6831] audit: op="connection-activate" uuid="baec95cb-6dc1-4f0e-9f03-449a60f01d9e" name="Wired connection 1" pid=1585 uid=1000 result="success"
NetworkManager[1052]: <info>  [1622575610.6833] device (enp3s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
NetworkManager[1052]: <info>  [1622575610.6848] device (enp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
NetworkManager[1052]: <info>  [1622575610.6854] device (enp3s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
NetworkManager[1052]: <info>  [1622575610.6860] dhcp4 (enp3s0): activation: beginning transaction (timeout in 45 seconds)
avahi-daemon[1047]: Joining mDNS multicast group on interface enp3s0.IPv6 with address fe80::c201:e5e1:9239:f63.
avahi-daemon[1047]: New relevant interface enp3s0.IPv6 for mDNS.
avahi-daemon[1047]: Registering new address record for fe80::c201:e5e1:9239:f63 on enp3s0.*.
NetworkManager[1052]: <info>  [1622575611.9842] dhcp6 (enp3s0): activation: beginning transaction (timeout in 45 seconds)
kernel: [ 1859.560671] r8169 0000:03:00.0 enp3s0: rtl_rxtx_empty_cond == 0 (loop: 42, delay: 100).
kernel: [ 1885.671779] r8169 0000:03:00.0 enp3s0: rtl_rxtx_empty_cond == 0 (loop: 42, delay: 100).
NetworkManager[1052]: <warn>  [1622575656.0903] dhcp4 (enp3s0): request timed out
NetworkManager[1052]: <info>  [1622575656.0903] dhcp4 (enp3s0): state changed unknown -> timeout
NetworkManager[1052]: <warn>  [1622575657.0859] dhcp6 (enp3s0): request timed out
NetworkManager[1052]: <info>  [1622575657.0860] dhcp6 (enp3s0): state changed unknown -> timeout
NetworkManager[1052]: <info>  [1622575657.0861] device (enp3s0): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
NetworkManager[1052]: <warn>  [1622575657.0883] device (enp3s0): Activation: failed for connection 'Wired connection 1'
NetworkManager[1052]: <info>  [1622575657.0888] device (enp3s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
avahi-daemon[1047]: Withdrawing address record for fe80::c201:e5e1:9239:f63 on enp3s0.
avahi-daemon[1047]: Leaving mDNS multicast group on interface enp3s0.IPv6 with address fe80::c201:e5e1:9239:f63.
avahi-daemon[1047]: Interface enp3s0.IPv6 no longer relevant for mDNS.
NetworkManager[1052]: <info>  [1622575657.1070] dhcp4 (enp3s0): canceled DHCP transaction
NetworkManager[1052]: <info>  [1622575657.1071] dhcp4 (enp3s0): state changed timeout -> done
NetworkManager[1052]: <info>  [1622575657.1073] dhcp6 (enp3s0): canceled DHCP transaction
NetworkManager[1052]: <info>  [1622575657.1073] dhcp6 (enp3s0): state changed timeout -> done
NetworkManager[1052]: <info>  [1622575657.1121] policy: auto-activating connection 'Wired connection 1' (baec95cb-6dc1-4f0e-9f03-449a60f01d9e)

我试过

(PC 现在通过 USB Wifi 适配器连接)

$ sudo rmmod r8169
$ sudo modprobe r8169

$ sudo apt install r8168-dkms
(reboot - doesn't work - so removed)
$ sudo apt purge r8168-dkms

我还删除了原始的有线连接配置文件,并用以下设置替换了新的配置文件:

在此处输入图片描述 在此处输入图片描述 在此处输入图片描述 在此处输入图片描述 在此处输入图片描述

答案1

$ lspci -nn | grep -i 以太网

03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)

您可能遇到了 r8168 以太网板的 MSI/MSIX 中断问题。安装以下补丁来修复它... 严格遵循嵌入式说明...

#!/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

相关内容