3

I have dual boot for windows 10 and Ubuntu 20.14.

Since some time ago, I have a problem with my PC... When it starts in Ubuntu sometimes randomly (I mean, about 30% of startups it the problem comes out) says Activation of network connection failed, it's a desktop PC so I use ethernet port.

Experimenting with some solutions on the web when the problem is presented nothing solves the problem. I've tried:

  • Reenable wired connection sugested here
  • Reboot all routers - I have 2 and are connected like this: [ISP router] <LAN port - WAN port> [Tplinkrouter] <LAN port - Eth port> [PC]. Solution sugested here
  • Reinstall network manager and reboot: sudo apt-get install --reinstall network-manager ; sudo reboot now sugested here too

Also, something really funny is the fact that when I reboot from Windows 10 to Ubuntu the problem disappear, if I reboot from Ubuntu to Ubuntu then problem comes out again...

Some context about my system:

  • Windows 10 fast boot is disabled
  • Dual boot is on nvme drive
  • The problem never comes out on Windows
  • sudo lshw -C network output (when problem is not presented):
*-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:05:00.0
logical name: enp5s0
version: 0c
serial: b4:2e:99:e7:89:ea
size: 100Mbit/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-48-generic duplex=full firmware=rtl8168g-2_0.0.1 02/06/13 ip=192.168.1.65 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:35 ioport:f000(size=256) memory:fcb00000-fcb00fff memory:f0300000-f0303fff

Something to solve this annoying failure?

Thanks in advance.

Edit 1:

lspci -nn | grep -i ethernet output:

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

Edit 2:

Following @heynnema solution:

Step 1. Adding script "r8169_disable_msi" to /etc/initramfs-tools/scripts/init-top path and do a chmod a+x to it:

To check that here is ls -l /etc/initramfs-tools/scripts/init-top output:

total 4
-rwxr-xr-x 1 root root 1118 mar 30 11:59 r8169_disable_msi

Step 2. "Add 'r8169_disable_msi' to your kernel command line (/etc/default/grub, GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" usually.)" so I made changes to /etc/default/grub file to this:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0 GRUB_TIMEOUT_STYLE=hidden GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=lsb_release -i -s 2&gt; /dev/null || echo Debian #GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX_DEFAULT="quiet splash r8169_disable_msi" GRUB_CMDLINE_LINUX=""

Uncomment to enable BadRAM filtering, modify to suit your needs

This works with Linux (no patch required) and with any kernel that obtains

the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)

#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

Uncomment to disable graphical terminal (grub-pc only)

#GRUB_TERMINAL=console

The resolution used on graphical terminal

note that you can use only modes which your graphic card supports via VBE

you can see them in real GRUB with the command `vbeinfo'

#GRUB_GFXMODE=640x480 GRUB_GFXMODE=1920x1080

Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux

#GRUB_DISABLE_LINUX_UUID=true

Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY="true"

Uncomment to get a beep at grub start

#GRUB_INIT_TUNE="480 440 1"

Step 3. sudo update-initramfs -c -k $(uname -r) output:

update-initramfs: Generating /boot/initrd.img-5.8.0-48-generic
W: Possible missing firmware /lib/firmware/amdgpu/navi12_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_sdma1.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_mes.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_dmcu.bin for module amdgpu
I: The initramfs will attempt to resume from /dev/nvme0n1p6
I: (UUID=64e37a0f-3360-471d-8c6d-02a5865d7e77)
I: Set the RESUME variable to override this.

Step 4. sudo update-grub output:

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.8.0-48-generic
Found initrd image: /boot/initrd.img-5.8.0-48-generic
Found linux image: /boot/vmlinuz-5.8.0-45-generic
Found initrd image: /boot/initrd.img-5.8.0-45-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
done

This solution worked.

1 Answers1

2

Link speed

Your ethernet card is capable of 1Gb speed, but is only being used at 100Mb speed. This usually indicates either a cable problem, or that some network device like an ethernet hub/switch/router isn't providing 1G speed. First, check that you're using cat 5e or cat 6 ethernet cables.

sudo lshw -C network

size: 100Mbit/s
capacity: 1Gbit/s

ethernet driver

The r8169 driver is known to have some problems. Install this driver and see if things improve.

sudo apt update

sudo apt install dkms r8168-dkms

reboot

MSI interrupt problem

Some r816x ethernet cards don't handle MSI/MSIX interrupts properly. If needed, we may need to implement a patch to work around the problem. Information provided when needed. Show me:

lspci -nn | grep -i ethernet

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

Here's the required patch. Instructions are in the script. Follow closely.

# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1779817

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

heynnema
  • 70,711
  • I installed r8168 and the problem persist... I already made an edit to de question to show the output of lspci -nn | grep -i ethernet – Antonio Davila Mar 30 '21 at 17:43
  • Also @heynnema after r8168 drivers where installed and also rebooted to Ubuntu the problem persist but after rebooting to Windows, the ethernet port was unable to connect to internet... So I ran the networking problem solver tool and the problem was unable to get a valid ip, I've not touched anything about static ip in both routers, even in my ubuntu system. – Antonio Davila Mar 30 '21 at 17:52
  • @AntonioDavila Did you check your ethernet cable, as per my answer. Until you can get 1G link speed, something is wrong there. I've updated my answer to include the MSI/MSIX patch. Follow the instructions VERY carefully. Report back. – heynnema Mar 30 '21 at 17:54
  • can you check my edit 2 if I did all correct?, now that pc is running avoid boot problems jeje :) – Antonio Davila Mar 30 '21 at 18:20
  • @AntonioDavila You can leave GRUB_CMDLINE_LINUX_DEFAULT="r8169_disable_msi" as GRUB_CMDLINE_LINUX_DEFAULT="quiet splash r8169_disable_msi" and redo sudo update-grub. Did you check your cables? In sudo lshw -c network are you getting 1G link speeds? – heynnema Mar 30 '21 at 18:25
  • @AntonioDavila You also need to install/reinstall your AMD/ATI driver/firmware files. – heynnema Mar 30 '21 at 18:28
  • One of my cables in my network was a cat5, to check again the capacity directly connected my PC to the ISP router with a cat5e, and I still have a size of 100Mbit/s in sudo lshw -C network output, so maybe ISP router only has a 100Mbit/s capacity?... also correct changes are done, let me do a reboot – Antonio Davila Mar 30 '21 at 18:32
  • @AntonioDavila Google the router make/model # and check if it has gigabit LAN ports. – heynnema Mar 30 '21 at 18:34
  • My router is a Ping V7610I1, and it's manual here in point 1.1 Specifications says: 4 10/100 MBase-T Ethernet interface (LAN) so maybe it doesn't have any gigabit port... – Antonio Davila Mar 30 '21 at 18:51
  • @AntonioDavila Does the patch work? – heynnema Mar 30 '21 at 20:04
  • Working fine until now! – Antonio Davila Apr 03 '21 at 15:22