AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1201127
Accepted
heynnema
heynnema
Asked: 2020-01-07 14:36:44 +0800 CST2020-01-07 14:36:44 +0800 CST 2020-01-07 14:36:44 +0800 CST

r8168/r8169 以太网从睡眠恢复后无法连接到 Internet

  • 772

我的 r8168(使用 r8169 驱动程序)以太网卡从睡眠状态恢复后无法连接到 Internet。它似乎没有获得 ipv4 地址。

sudo lshw -C 网络(未连接电缆)

  *-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:02:00.0
       logical name: eth0
       version: 0c
       serial: xx:xx:xx:xx:xx:xx
       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 firmware=rtl8168g-2_0.0.1 02/06/13 latency=0 link=no multicast=yes port=MII
       resources: irq:18 ioport:e000(size=256) memory:f7d00000-f7d00fff memory:f0000000-f0003fff

这个问题显示了一个完全相同的问题,但我能看到的任何修复都不能修复我损坏的网络。

  • 网络在 Windows 10 上运行良好
  • 网络在 Ubuntu 19.10 中运行良好,直到我从睡眠中恢复
  • 重新启动并不能修复损坏的网络
  • 关闭计算机电源并不能修复损坏的网络
  • 重新启动 NetworkManager 并不能修复损坏的网络
  • 尝试使用 netplan 而不是 NetworkManager 并不能修复损坏的网络
  • 卸载并重新加载 r8169 驱动程序并不能修复损坏的网络
  • 我尝试在 GRUB 中添加pci=nomsi或pcie_pme=nomsi到内核行,但它不能修复损坏的网络
  • 笔记本主板换了
  • 外部 USB-> 以太网适配器工作正常

更新#1:

[   18.014660] NETDEV WATCHDOG: eth0 (r8169): transmit queue 0 timed out
[   18.014680] WARNING: CPU: 1 PID: 1420 at net/sched/sch_generic.c:447 dev_watchdog+0x258/0x260
[   18.014680] Modules linked in: [modules list redacted]
[   18.014759] CPU: 1 PID: 1420 Comm: clamd Not tainted 5.3.0-23-generic #25-Ubuntu
[   18.014760] Hardware name: TOSHIBA Satellite E55-A/ZEMAA, BIOS 1.50 12/02/2013
[   18.014764] RIP: 0010:dev_watchdog+0x258/0x260
[   18.014767] Code: 85 c0 75 e5 eb 9f 4c 89 ff c6 05 ae 37 eb 00 01 e8 0d f9 fa ff 44 89 e9 4c 89 fe 48 c7 c7 28 d3 e0 92 48 89 c2 e8 03 20 74 ff <0f> 0b eb 80 0f 1f 40 00 0f 1f 44 00 00 55 48 89 e5 41 57 49 89 d7
[   18.014768] RSP: 0000:ffffb71ac001ce30 EFLAGS: 00010286
[   18.014770] RAX: 0000000000000000 RBX: ffff90b1431ed000 RCX: 0000000000000006
[   18.014771] RDX: 0000000000000007 RSI: 0000000000000096 RDI: ffff90b14f897440
[   18.014773] RBP: ffffb71ac001ce60 R08: 00000000000003c8 R09: 0000000000000004
[   18.014774] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001
[   18.014775] R13: 0000000000000000 R14: ffff90b14ddb6480 R15: ffff90b14ddb6000
[   18.014776] FS:  00007f82ea445d80(0000) GS:ffff90b14f880000(0000) knlGS:0000000000000000
[   18.014778] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   18.014779] CR2: 00007f82d6205000 CR3: 00000004064d6001 CR4: 00000000001606e0
[   18.014780] Call Trace:
[   18.014782]  <IRQ>
[   18.014787]  ? pfifo_fast_enqueue+0x150/0x150
[   18.014792]  call_timer_fn+0x32/0x130
[   18.014795]  __run_timers.part.0+0x177/0x270
[   18.014799]  ? enqueue_hrtimer+0x3d/0x90
[   18.014803]  ? recalibrate_cpu_khz+0x10/0x10
[   18.014806]  ? ktime_get+0x42/0xa0
[   18.014809]  run_timer_softirq+0x2a/0x50
[   18.014812]  __do_softirq+0xe1/0x2d6
[   18.014815]  ? hrtimer_interrupt+0x13b/0x220
[   18.014818]  irq_exit+0xae/0xb0
[   18.014821]  smp_apic_timer_interrupt+0x7b/0x140
[   18.014823]  apic_timer_interrupt+0xf/0x20
[   18.014824]  </IRQ>
[   18.014827] RIP: 0033:0x7f82eceb91e7
[   18.014829] Code: 00 48 81 fa 80 00 00 00 0f 82 9c 02 00 00 c5 fe 6f 0e c5 f5 74 0f c5 fe 6f 56 20 c5 ed 74 57 20 c5 fe 6f 5e 40 c5 e5 74 5f 40 <c5> fe 6f 66 60 c5 dd 74 67 60 c5 ed db e9 c5 dd db f3 c5 cd db ed
[   18.014830] RSP: 002b:00007fff32fd9458 EFLAGS: 00000206 ORIG_RAX: ffffffffffffff13
[   18.014832] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff00000000ffff
[   18.014833] RDX: 000000000000008c RSI: 00007f82d6205c6a RDI: 00007f82da1c92b2
[   18.014834] RBP: 00007f82d6205bd8 R08: 0000000000000046 R09: 0000000000000003
[   18.014835] R10: 0000000000026d38 R11: 0000000000026d1d R12: 00007f82da1c9368
[   18.014836] R13: 0000000000000046 R14: 00007f82da1c9220 R15: 00007f82da1c8130
resume ethernet 19.10
  • 2 2 个回答
  • 1349 Views

2 个回答

  • Voted
  1. Best Answer
    heynnema
    2020-01-18T19:36:20+08:002020-01-18T19:36:20+08:00

    在可靠工作多年后,一些软件更新中断了我的以太网连接。我相信这是由于 r8169 驱动程序的变化。

    经过几天的故障排除,甚至更换了我的主板,它最初可以工作,但几天后它又失败了。

    我启动到 Ubuntu Live USB 19.10,以太网也无法在那里工作。

    我启动到 Windows 10,但它在那里没有工作,但它以前有。所以我使用 Windows 网络故障排除过程来重置以太网适配器,它又开始工作了。

    回到 Ubuntu,我重试了r8168-dkms我之前尝试过的驱动程序,但没有运气,只是这次它似乎工作了。安装后需要重新启动。

    更新#1:

    这终于解决了这个问题。为 r8168/r8169 启用了 MSI 中断,此脚本仅针对此卡禁用此功能。按照脚本开头的安装说明进行操作。

    #!/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..
    
    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
    
    • 3
  2. ARibeiro
    2021-09-27T09:40:02+08:002021-09-27T09:40:02+08:00

    我有一个类似的问题。

    我的主板:技嘉DS3H。

    当我在 Windows 中启动并在 linux 中重新启动时,来自 ubuntu 20.04 的 realtek r8169 驱动程序可以工作。

    但是当我留在 linux 或仅在 linux 中重新启动时它会失败。

    为了解决这个问题,我更新了我的发行版 21.04 并安装了内核 5.14.2。

    我使用的是 ubuntu 20.04(内核 5.11),但在此过程中,我将发行版更新为 21.04。

    将 Ubuntu 发行版从 LTS 更新为正常

    要将 ubuntu 发行版从 lts 更新为正常,您可以点击此链接: https ://www.howtogeek.com/351360/how-to-upgrade-to-the-latest-version-of-ubuntu/

    脚步:

    sudo apt install update-manager-core
    

    在 release-upgrades 文件中将 Prompt=lts 替换为 Prompt=normal。

    sudo nano /etc/update-manager/release-upgrades
    

    检查当前系统是否有任何升级:

    do-release-upgrade -c
    

    最后进行系统升级:

    sudo do-release-upgrade
    

    之后,您可以继续进行内核安装。

    内核安装

    以下命令为 ubuntu 安装主线内核安装程序:

    sudo add-apt-repository ppa:cappelikan/ppa
    sudo apt-get update
    sudo apt-get install mainline
    

    只需从 GUI 应用程序打开主线。

    现在你可以看到有很多新的内核编译。

    我建议你安装 5.14.2,因为这个版本依赖于 glibc6 2.33(仍然兼容 ubuntu stable 21.04)。

    所有其他版本 5.14.3 及更高版本需要 glibc6 2.34,尚未安装在 ubuntu stable 21.04(2021/set)中。

    这解决了我的 realtek r8169 驱动程序连接问题。

    签署内核以进行安全启动

    如果您启用了安全启动,您可能还需要这个:https ://gloveboxes.github.io/Ubuntu-for-Azure-Developers/docs/signing-kernel-for-secure-boot.html

    • 0

相关问题

  • 从休眠状态恢复显示模糊的“静态”屏幕

  • 从休眠或挂起恢复后的图形问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve