RTL8111/8168/8411 Realtek Ethernet controller not working - r8169 related

RTL8111/8168/8411 ethernet controller has stopped working after upgrading from Fedora 36 to Fedora 37, since the upgrading I cannot access internet via ethernet cable anymore.
I tried to upgrade to Fedora 38 hoping that the problem would be solved in a later release but it was not.
Currently I have Fedora 38 as working release.

Some useful outputs with comments.

lspci -v (partial output) :

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10)
	Subsystem: ASUSTeK Computer Inc. Device 205f
	!!! Unknown header type 7f
	I/O ports at 4000 [size=256]
	Memory at b2104000 (64-bit, non-prefetchable) [size=4K]
	Memory at b2100000 (64-bit, non-prefetchable) [size=16K]
	Kernel driver in use: r8169
	Kernel modules: r8169, r8168

Something I would like to note is the line: !!! Unknown header type 7f, what does it mean?

Secondly, r8168 was not there originally (not in F36, not in F37 nor in F38), I “installed” it because I read that r8169 was faulty and r8168 was more stable. I took it from here: Make Linux load specific driver for given device (Realtek NIC) - Unix & Linux Stack Exchange
It did not work.

lsmod | grep r8 :

r8168                 667648  0
r8169                 114688  0

ip a (partial output) :

2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 38:d5:47:90:f9:7b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.74/24 brd 192.168.1.255 scope global dynamic noprefixroute enp2s0
       valid_lft 21137sec preferred_lft 21137sec

lshw -C NETWORK (partial output) :

*-generic                 
       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: enp2s0
       version: ff
       serial: 38:d5:47:90:f9:7b
       width: 32 bits
       clock: 66MHz
       capabilities: bus_master vga_palette cap_list ethernet physical
       configuration: broadcast=yes driver=r8169 ip=192.168.1.74 latency=255 maxlatency=255 mingnt=255 multicast=yes
       resources: irq:18 ioport:4000(size=256) memory:b2104000-b2104fff memory:b2100000-b2103ff

ethtool enp2s0 :

netlink error: No such device
netlink error: No such device
netlink error: No such device
netlink error: No such device
netlink error: No such device
netlink error: No such device
No data available

This last output seems particularly weird.

dmesg | grep 'enp2s0':


[    3.936871] r8169 0000:02:00.0 enp2s0: renamed from eth0
[   73.394165] r8169 0000:02:00.0 enp2s0: Link is Down
[   76.266079] r8169 0000:02:00.0 enp2s0: Link is Up - 1Gbps/Full - flow control off
[   76.266123] IPv6: ADDRCONF(NETDEV_CHANGE): enp2s0: link becomes ready
[   76.276504] r8169 0000:02:00.0 enp2s0: Link is Up - 1Gbps/Full - flow control off
[  164.730399] NETDEV WATCHDOG: enp2s0 (r8169): transmit queue 0 timed out 6367 ms
[  234.363375] r8169 0000:02:00.0 enp2s0: Can't reset secondary PCI bus, detach NIC
[  303.995376] r8169 0000:02:00.0 enp2s0: Can't reset secondary PCI bus, detach NIC
[  583.293456] r8169 0000:02:00.0 enp2s0: Link is Down
[  583.321617] r8169 0000:02:00.0 enp2s0: rtl_chipcmd_cond == 1 (loop: 100, delay: 100).
[  585.865808] r8169 0000:02:00.0 enp2s0: rtl_eriar_cond == 1 (loop: 100, delay: 100).
[  590.299699] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[  590.321666] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[  590.344432] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[  590.349182] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[  590.349788] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[  590.350657] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[  590.351315] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[  590.351895] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[  590.352462] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[  590.353067] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[  592.011606] r8169 0000:02:00.0 enp2s0: Link is Down
[  601.997980] r8169 0000:02:00.0 enp2s0: rtl_eriar_cond == 1 (loop: 100, delay: 100).
[  602.025175] r8169 0000:02:00.0 enp2s0: rtl_chipcmd_cond == 1 (loop: 100, delay: 100).
[ 1275.868101] r8169 0000:02:00.0 enp2s0: rtl_eriar_cond == 1 (loop: 100, delay: 100).
[ 1275.868896] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[ 1275.891179] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[ 1275.895142] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[ 1275.895799] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[ 1275.896593] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[ 1275.897391] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[ 1275.897969] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[ 1275.898524] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[ 1275.899081] r8169 0000:02:00.0 enp2s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[ 1277.501879] r8169 0000:02:00.0 enp2s0: Link is Down
[ 1287.522521] r8169 0000:02:00.0 enp2s0: rtl_eriar_cond == 1 (loop: 100, delay: 100).
[ 1287.556524] r8169 0000:02:00.0 enp2s0: rtl_chipcmd_cond == 1 (loop: 100, delay: 100).

A weird behavior that I noticed is that when I boot the computer it is able to to use the cable connection in order to, at least, ping www.google.com but as soon as I try to open a browser and browse to, let’s say, wikipedia.org the connection crashes and I am unable to make it work again.

If more details are needed I will provide them.
Thank you.

One always must evaluate the accuracy of someone’s opinion on the internet.

In this case, if your network was functional and you chose to install a different driver that broke it, then you suffer the consequences. The adage that “if it ain’t broke don’t fix it” has a reason for existing and still has a very meaningful intent.

I would suggest that one do the best possible to remove whatever you “installed” since it seems it did not work.

$ lsmod | grep r8
r8169                 114688  0

$ modinfo r8169
filename:       /lib/modules/6.4.4-200.fc38.x86_64/kernel/drivers/net/ethernet/realtek/r8169.ko.xz
firmware:       rtl_nic/rtl8125b-2.fw
firmware:       rtl_nic/rtl8125a-3.fw
firmware:       rtl_nic/rtl8107e-2.fw
firmware:       rtl_nic/rtl8168fp-3.fw
firmware:       rtl_nic/rtl8168h-2.fw
firmware:       rtl_nic/rtl8168g-3.fw
firmware:       rtl_nic/rtl8168g-2.fw
firmware:       rtl_nic/rtl8106e-2.fw
firmware:       rtl_nic/rtl8106e-1.fw
firmware:       rtl_nic/rtl8411-2.fw
firmware:       rtl_nic/rtl8411-1.fw
firmware:       rtl_nic/rtl8402-1.fw
firmware:       rtl_nic/rtl8168f-2.fw
firmware:       rtl_nic/rtl8168f-1.fw
firmware:       rtl_nic/rtl8105e-1.fw
firmware:       rtl_nic/rtl8168e-3.fw
firmware:       rtl_nic/rtl8168e-2.fw
firmware:       rtl_nic/rtl8168e-1.fw
firmware:       rtl_nic/rtl8168d-2.fw
firmware:       rtl_nic/rtl8168d-1.fw
license:        GPL
softdep:        pre: realtek
description:    RealTek RTL-8169 Gigabit Ethernet driver
author:         Realtek and the Linux r8169 crew <netdev@vger.kernel.org>
rhelversion:    9.99
alias:          pci:v000010ECd00003000sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008125sv*sd*bc*sc*i*
alias:          pci:v00000001d00008168sv*sd00002410bc*sc*i*
alias:          pci:v00001737d00001032sv*sd00000024bc*sc*i*
alias:          pci:v000016ECd00000116sv*sd*bc*sc*i*
alias:          pci:v00001259d0000C107sv*sd*bc*sc*i*
alias:          pci:v00001186d00004302sv*sd*bc*sc*i*
alias:          pci:v00001186d00004300sv*sd*bc*sc*i*
alias:          pci:v00001186d00004300sv00001186sd00004B10bc*sc*i*
alias:          pci:v000010ECd00008169sv*sd*bc*sc*i*
alias:          pci:v000010FFd00008168sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008168sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008167sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008162sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008161sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008136sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008129sv*sd*bc*sc*i*
alias:          pci:v000010ECd00002600sv*sd*bc*sc*i*
alias:          pci:v000010ECd00002502sv*sd*bc*sc*i*
depends:        
retpoline:      Y
intree:         Y
name:           r8169
vermagic:       6.4.4-200.fc38.x86_64 SMP preempt mod_unload 
sig_id:         PKCS#7
signer:         Fedora kernel signing key
sig_key:        70:79:D9:DF:13:30:0E:58:EA:0B:93:81:B3:8E:AB:B4:09:57:2B:19
sig_hashalgo:   sha256

Is what works for me with this adapter

04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
	Subsystem: ASRock Incorporation Motherboard (one of many) [1849:8168]
	Kernel driver in use: r8169
	Kernel modules: r8169

The problem arose when I upgraded from F36 o F37, installing r8168 was me trying to solve the issue, but it did not solve it.

I’ll edit the question pointing that out.

But I agree that since it does not seem to help I should remove it.

Please post the relevant portion of lspci -nnk as I did so we may see specifically which adapter chipset is used. Mine has the [10ec:8168] [1849:8168] chipset and works.

Relevant portion of lspci -nnk

02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 10)
	Subsystem: ASUSTeK Computer Inc. Device [1043:205f]
	Kernel driver in use: r8169
	Kernel modules: r8169, r8168

One may check for that specific chipset at the linux hardware database

This one seems to be my card:

I am trying to probe my computer to see which drivers I should use, but the page I linked says r8169…

EDIT:
probing done, I confirm what I wrote above.

In the end the r8169 driver was indeed the problem.

I followed these steps sunwire/dkms-r8168 Copr (without the secure boot steps) in order to install the r8168 driver.

Then I followed these steps SLES 12 SP4 | Administration Guide | Managing Kernel Modules in order to permanently blacklist the r8169 module.

1 Like

Glad you found the fix.

However the card shown from the LHDB site is not yours.
In you r lspci output above you indicated yours is chipset [10ec:8168:1043:205f] which does not match the one you linked to.

This link matches.

1 Like

I had the same problem. Connectivity only for somewhere between a few seconds to a few minutes. No way to restore connectivity other than rebooting.

Since I updated to the latest kernel from fedora-testing (kernel-6.4.7-200.fc38.x86_64) the connection has been solid for more than 2 days now.