LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Realtek 8168 negotiating wrong speed (https://www.linuxquestions.org/questions/linux-networking-3/realtek-8168-negotiating-wrong-speed-4175718183/)

Enesha 10-26-2022 10:20 PM

Realtek 8168 negotiating wrong speed
 
Hey guys thanks in advance for your help.

So I have a a server that just upgraded to Ubuntu 22.10, using kernel 6.0.3-060003-generic from the previous release. The server has two network cards that im playing with to give lan and internet access separately...The details are unimportant. Here is my sitch. Card at en01 works properly and connects at 1000 speed.

Network card 2 at enp5s0 only connects to the verizon supplied router at 100. I tried multiple ethernet cables as well. A windows machine connecting to the router connects at 1000. The system reports that the router only advertises 100 which is just wrong. I'm sure it is a driver or config problem. I am using an rtl 8168 (the working card is an intel e1000e) which I installed under another kernel same result. When I installed the driver (not sure where i got it) I believe I black listed 8169 for some compatibility reason.

I am including below excerpts from various outputs that might be helpful. Thanks in advance

From dmesg
kernel: pci 0000:05:00.0: [10ec:8168] type 00 class 0x020000
kernel: r8168: loading out-of-tree module taints kernel.
kernel: r8168: module verification failed: signature and/or required key missing - tainting kernel
kernel: r8168 Gigabit Ethernet driver 8.050.03-NAPI loaded
kernel: r8168: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.
kernel: r8168 Copyright (C) 2022 Realtek NIC software team <nicfae@realtek.com>
kernel: r8168 0000:05:00.0 enp5s0: renamed from eth0
kernel: r8168: enp5s0: link up

from lspci
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)

from ethtool
Settings for enp5s0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 100baseT/Half 100baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 100Mb/s
Duplex: Full
Auto-negotiation: on
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
MDI-X: Unknown
netlink error: Operation not permitted
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: yes

Note the bold part that shows advertised speed at only 100. This is a brand new fios router with a 10g port. It does not only do 100.

Thanks :)

pan64 10-27-2022 02:38 AM

If I need to guess it is not the correct driver. Sometimes kernel loads a "similar" driver which will work perfectly only with a similar chip (for example R8169), but this is just a guess.

Enesha 10-27-2022 10:07 PM

Quote:

Originally Posted by pan64 (Post 6388909)
If I need to guess it is not the correct driver. Sometimes kernel loads a "similar" driver which will work perfectly only with a similar chip (for example R8169), but this is just a guess.

I had suspected something similar but if you look at the dmesg output it looks like it's loading an official kernel mod. I assume the kernel chose correctly. I checked realtek (https://www.realtek.com/en/component...press-software) They do have a driver module available but it looks like it was updated in june and only goes up to kernel 5.17. This version of Ubuntu starts with 6.

Would you have any suggestions on how to proceed?

yvesjv 10-28-2022 12:23 PM

Downgrade your kernel to a known working stable version, reboot into it and 'hold' it against kernel upgrades.
May as well recompile your kernel for performance too if you want ( ͡~ ͜ʖ ͡° )

Debian6to11 10-28-2022 04:57 PM

The correct package for Debian is "r8168-dkms" (purged and installed this package today on Parrot Linux).

What is the output of the following?
Code:

modprobe --show-depends <module>

Enesha 10-29-2022 10:19 AM

Quote:

Originally Posted by yvesjv (Post 6389177)
Downgrade your kernel to a known working stable version, reboot into it and 'hold' it against kernel upgrades.
May as well recompile your kernel for performance too if you want ( ͡~ ͜ʖ ͡° )

Are you saying the kernel included with the official ubuntu release is not a known stable version?

uname -a
Linux haven 6.0.3-060003-generic #202210220459-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 22 08:10:12 UTC x86_64 x86_64 x86_64 GNU/Linux

I do obviously have several other kernels installed from upgrades. There are two that are at 5.15 (which is under the 5.17 that the realtek driver seems to want) I always thought for performance security and stability the newer kernel is desired.

As far as remaking the kernel....I've dabbled with that before and have never successfully built one that boots. I've edited and compiled many other programs but no love from the kernel

Enesha 10-29-2022 10:24 AM

Quote:

Originally Posted by Debian6to11 (Post 6389213)
The correct package for Debian is "r8168-dkms" (purged and installed this package today on Parrot Linux).

What is the output of the following?
Code:

modprobe --show-depends <module>

The output is as follows

modprobe --show-depends r8168
insmod /lib/modules/6.0.3-060003-generic/updates/dkms/r8168.ko

Here is me trying to install 8168

aptitude install r8168-dkms
r8168-dkms is already installed at the requested version (8.050.03-2)
r8168-dkms is already installed at the requested version (8.050.03-2)
The following packages will be REMOVED:
beignet-opencl-icd{u} libdrm-intel1{u} libpciaccess0{u}
ocl-icd-libopencl1{u}

I did not continue and remove anything

Debian6to11 10-29-2022 02:01 PM

If your wifi is working and you can connect to the internet, you can try purging and reinstalling the package.

You can also see if the driver (r8169) is loaded with these two commands
Code:

lsmod
inxi-n

Code:

inxi -n
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: 28:92:4a:28:30:2c

Edit: on my Parrot system the driver is r8168, the output above is for Debian sid
Code:

inxi -n
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8168
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: 28:92:4a:28:30:2c


Enesha 10-29-2022 03:46 PM

Quote:

Originally Posted by Debian6to11 (Post 6389386)
If your wifi is working and you can connect to the internet, you can try purging and reinstalling the package.

You can also see if the driver (r8169) is loaded with these two commands
Code:

lsmod
inxi-n

Code:

inxi -n
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: 28:92:4a:28:30:2c

Edit: on my Parrot system the driver is r8168, the output above is for Debian sid
Code:

inxi -n
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8168
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: 28:92:4a:28:30:2c


Thanks for your continued assistance. I had to aptitude install inxi. Here are the outputs you requested

lsmod | grep 8168
r8168 577536 0

Network:
Device-1: Intel Ethernet I217-LM driver: e1000e
IF: eno1 state: up speed: 1000 Mbps duplex: full mac: 98:90:96:b7:ff:fa
Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
driver: r8168
IF: enp5s0 state: up speed: 100 Mbps duplex: full mac: 00:e0:4c:2a:0f:c3

AS you can see it continues to negotiate 100 not 1000. AS I said above the device has 1 10gb port and 3 1gb ports Tried connecting to 10 and 1 and same result

I'm having some other potential problems with my hard drive so I might replace it and try a fresh install, see if that changes anything

yvesjv 10-30-2022 03:26 PM

Quote:

Originally Posted by Enesha (Post 6389350)
Are you saying the kernel included with the official ubuntu release is not a known stable version?

uname -a
Linux haven 6.0.3-060003-generic #202210220459-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 22 08:10:12 UTC x86_64 x86_64 x86_64 GNU/Linux

I do obviously have several other kernels installed from upgrades. There are two that are at 5.15 (which is under the 5.17 that the realtek driver seems to want) I always thought for performance security and stability the newer kernel is desired.

As far as remaking the kernel....I've dabbled with that before and have never successfully built one that boots. I've edited and compiled many other programs but no love from the kernel

If everything works ok when you have reverted back into your previous 5.17 kernel, then you could zcat the /proc/config.gz file to the /usr/src/linux-6.x.z/ folder of the latest kernel as your new .config file.
Then it is a simple command to load your good working config: yes "" | make oldconfig
The follow this guide from the famous Falko Timme starting at 'make menuconfig': https://www.howtoforge.com/kernel_compilation_ubuntu_p2
It's also good to copy the latest firmware into the /lib/firmware/ folder
https://git.kernel.org/pub/scm/linux...x-firmware.git

Only thing I'm not sure towards Ubuntu (and variants) is if you have to regenerate your initramfs?
As I've abandoned Debian since the systemd debacle and been a happy slackware user since, I regenerate the initrd everytime I install a custom kernel... it just works ( ° ͜ʖ °)

Enesha 10-31-2022 01:04 AM

Quote:

Originally Posted by Enesha (Post 6389404)
Thanks for your continued assistance. I had to aptitude install inxi. Here are the outputs you requested

lsmod | grep 8168
r8168 577536 0

Network:
Device-1: Intel Ethernet I217-LM driver: e1000e
IF: eno1 state: up speed: 1000 Mbps duplex: full mac: 98:90:96:b7:ff:fa
Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
driver: r8168
IF: enp5s0 state: up speed: 100 Mbps duplex: full mac: 00:e0:4c:2a:0f:c3

AS you can see it continues to negotiate 100 not 1000. AS I said above the device has 1 10gb port and 3 1gb ports Tried connecting to 10 and 1 and same result

I'm having some other potential problems with my hard drive so I might replace it and try a fresh install, see if that changes anything



Ok so I reinstalled Ubuntu. Somehow after whatever updates I only ended up with
Linux haven 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Which is under the 5.17 specieied on their website. (GBE Ethernet LINUX driver r8168 for kernel up to 5.17)

The system installed a 8168 during the install. It has the same problem. Incidentally I changed the router for other reasons ans the same thing)
directions are to ./autorun.sh (as root or with sudo)

./autorun.sh

Check old driver and unload it.
Build the module and install
warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
You are using: gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Skipping BTF generation for /home/enesha/r8168-8.050.03/src/r8168.ko due to unavailability of vmlinux
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
At main.c:160:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
sign-file: certs/signing_key.pem: No such file or directory
Warning: modules_install: missing 'System.map' file. Skipping depmod.
Backup r8169.ko
rename r8169.ko to r8169.bak
DEPMOD 5.15.0-52-generic
load module r8168
Updating initramfs. Please wait.
update-initramfs: Generating /boot/initrd.img-5.15.0-52-generic
I: The initramfs will attempt to resume from /dev/sdb3
I: (UUID=68f9157f-b408-40e7-87a9-9daa1438fce2)
I: Set the RESUME variable to override this.
Completed.


It did load the 8168 presumeably just built by the realtek installer. Still only works at 100

im stumped

pan64 10-31-2022 02:10 AM

just curious: did you test it with the initial driver (r8169) ?

yvesjv 10-31-2022 01:57 PM

Correct, I looked up the latest driver and appears it is only up to 5.17
https://www.realtek.com/en/component...press-software

May as well try the dkms available at
https://packages.ubuntu.com/search?keywords=r8168-dkms

Another angle is to check the config on the network switch. I've seen dodgy cabling and other hurdles through the years...
If the switchport is hardcoded for auto-mdix, test with another known good device so as to rule out layer 1 issues.

Enesha 10-31-2022 05:58 PM

Quote:

Originally Posted by pan64 (Post 6389616)
just curious: did you test it with the initial driver (r8169) ?

So the new install included an 8169. Either myself or that installer seemed to remove it. WHen I went to test again, aptitude told me there was no 8169 package but it was included with 8168.

I ordered another nic that claims linux support and is a different chipset. I feel kinda defeated here

Enesha 10-31-2022 06:01 PM

Quote:

Originally Posted by yvesjv (Post 6389707)
Correct, I looked up the latest driver and appears it is only up to 5.17
https://www.realtek.com/en/component...press-software

May as well try the dkms available at
https://packages.ubuntu.com/search?keywords=r8168-dkms

Another angle is to check the config on the network switch. I've seen dodgy cabling and other hurdles through the years...
If the switchport is hardcoded for auto-mdix, test with another known good device so as to rule out layer 1 issues.

Yup that's the driver I tried that gave me that error above. r8168-dkms is what's installed.

I thought hardware at first too. but it was a brand new fios router and a win machine got 1000. That not withstanding I did get a different router from tplink because I don't like the access the fios router gives to verizon. It was on sale. Claims gig ports. Same link negotiation and same listed as only advertising 100 from the router


All times are GMT -5. The time now is 03:09 PM.