我的以太网有问题。无法连接。从此站点上的其他答案中,我得到了以下消息。
lspci-nn|复制代码
03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [10ec:8136] (rev 07)
sudo modprobe r8101
modprobe: FATAL: Module r8101 not found in directory /lib/modules/4.4.0-72-generic
消息 | grep -e eth
[ 2.078821] r8169 0000:03:00.0 eth0: rtl_counters_cond == 1 (loop: 1000, delay: 10).
[ 2.078853] r8169 0000:03:00.0 eth0: RTL8101e at 0xf841a000, ff:ff:ff:ff:ff:ff, XID 9cf0f8ff IRQ 89
[ 2.173432] r8169 0000:03:00.0 enp3s0: renamed from eth0
消息 | grep -e eth -e r8169
[ 2.022696] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[ 2.022711] r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
[ 2.022824] r8169 0000:03:00.0 (unnamed net_device) (uninitialized): unknown MAC, using family default
[ 2.032807] r8169 0000:03:00.0 (unnamed net_device) (uninitialized): rtl_chipcmd_cond == 1 (loop: 100, delay: 100).
[ 2.078821] r8169 0000:03:00.0 eth0: rtl_counters_cond == 1 (loop: 1000, delay: 10).
[ 2.078853] r8169 0000:03:00.0 eth0: RTL8101e at 0xf841a000, ff:ff:ff:ff:ff:ff, XID 9cf0f8ff IRQ 89
[ 2.173432] r8169 0000:03:00.0 enp3s0: renamed from eth0
[ 2.195505] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1 (loop: 1000, delay: 10).
[ 242.859397] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1 (loop: 1000, delay: 10).
[ 245.874622] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1 (loop: 1000, delay: 10).
rtl_counters_cond 似乎每隔几秒或几分钟重复一次,并在输出中持续数十行。我已经截断它了。
请帮助。
答案1
我遇到了同样的错误,并通过重新加载网络设备驱动程序解决了这个问题。首先需要找到合适的 pci 设备:
find /sys/devices -name enp3s0
我得到了/sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/net/enp3s0
。然后删除 pci 设备并重新扫描总线:
echo 1 >/sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/remove
echo 1 >/sys/devices/pci0000:00/0000:00:1c.2/rescan
完成,网络接口重新初始化。
我得到了下一个内核日志:
Apr 17 12:43:55 host kernel: r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1 (loop: 1000, delay: 10).
Apr 17 12:43:55 host kernel: r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1 (loop: 1000, delay: 10).
Apr 17 12:43:55 host kernel: r8169 0000:03:00.0 (unregistered net_device): rtl_counters_cond == 1 (loop: 1000, delay: 10).
Apr 17 12:44:28 host kernel: pci 0000:03:00.0: [10ec:8168] type 00 class 0x020000
Apr 17 12:44:28 host kernel: pci 0000:03:00.0: reg 0x10: [io 0x0000-0x00ff]
Apr 17 12:44:28 host kernel: pci 0000:03:00.0: reg 0x18: [mem 0x00000000-0x00000fff 64bit]
Apr 17 12:44:28 host kernel: pci 0000:03:00.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
Apr 17 12:44:28 host kernel: pci 0000:03:00.0: supports D1 D2
Apr 17 12:44:28 host kernel: pci 0000:03:00.0: PME# supported from D0 D1 D2 D3hot D3cold
Apr 17 12:44:28 host kernel: pci 0000:03:00.0: System wakeup disabled by ACPI
Apr 17 12:44:28 host kernel: i915 0000:00:02.0: BAR 6: [??? 0x00000000 flags 0x2] has bogus alignment
Apr 17 12:44:28 host kernel: pci 0000:03:00.0: BAR 4: assigned [mem 0xf0100000-0xf0103fff 64bit pref]
Apr 17 12:44:28 host kernel: pci 0000:03:00.0: BAR 2: assigned [mem 0xf7d00000-0xf7d00fff 64bit]
Apr 17 12:44:28 host kernel: pci 0000:03:00.0: BAR 0: assigned [io 0xe000-0xe0ff]
Apr 17 12:44:28 host kernel: r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
Apr 17 12:44:28 host kernel: r8169 0000:03:00.0: irq 29 for MSI/MSI-X
Apr 17 12:44:28 host kernel: r8169 0000:03:00.0 eth0: RTL8168g/8111g at 0xffffc90007ce2000, 80:ee:73:xx:xx:xx, XID 0c000800 IRQ 29
Apr 17 12:44:28 host kernel: r8169 0000:03:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
Apr 17 12:44:28 host kernel: IPv6: ADDRCONF(NETDEV_UP): enp3s0: link is not ready
Apr 17 12:44:28 host kernel: r8169 0000:03:00.0 enp3s0: link down
Apr 17 12:44:28 host kernel: r8169 0000:03:00.0 enp3s0: link down
Apr 17 12:44:28 host kernel: IPv6: ADDRCONF(NETDEV_UP): enp3s0: link is not ready
Apr 17 12:44:31 host kernel: r8169 0000:03:00.0 enp3s0: link up
Apr 17 12:44:31 host kernel: IPv6: ADDRCONF(NETDEV_CHANGE): enp3s0: link becomes ready
您还可以尝试以其他方式重新加载驱动程序本身,如下所示:rmmod r8169; modprobe r8169
。我没有尝试这个,因为我有第二个类似的网络设备用于 ssh。
答案2
未连接的以太网存在此问题,生成了 OP 提到的相同类型的日志垃圾邮件。
该方法修复了这个问题。这里有一个快速脚本来执行此操作以感谢修复。:)
#!/bin/bash
DEVICE=$(find /sys/devices -name $1|sed -e 's/\/net\/.*//')
[ -z "$DEVICE" ] && echo "There doesn't seem to be a device $1" && exit 2
echo "Removing device at $DEVICE"
echo 1 > $DEVICE/remove
sleep 2
DEVICE_RESTART=$(dirname $DEVICE)
echo "Rescanning $DEVICE_RESTART"
echo 1 > $DEVICE_RESTART/rescan
以下是它的使用情况:
sbicknel@bick-ubtu2:~$ /tmp/restart_ethernet enp2s0
There doesn't seem to be a device enp2s0
sbicknel@bick-ubtu2:~$ sudo /tmp/restart_ethernet enp5s0
Removing device at /sys/devices/pci0000:00/0000:00:1c.5/0000:05:00.0
Rescanning /sys/devices/pci0000:00/0000:00:1c.5
sbicknel@bick-ubtu2:~$
答案3
就我而言,我必须重新加载设备:
首先使用以下命令搜索设备 (例如 enp3s0) id:
find /sys/devices -name enp3s0**
/sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/net/enp3s0
然后重启设备:
echo 1 > /sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/remove
echo 1 > /sys/devices/pci0000:00/0000:00:1c.2/rescan**
答案4
尝试从 BIOS 设置中禁用局域网唤醒。