7

I found a lot of answers like "you need r8168" or "you need r8169", but no explanation. I understood that it depends on the linux kernel, but I didn't find any list of kernels preferring one or the other in the first two pages of Google. So my sub-questions:

  1. How can I find the right driver for any specific Ubuntu kernel?
  2. What is the key difference between r8168 and r8169 that makes them stable only with some kernels?
  3. (Later edit) If there is no clear list, are there any rules behind "if there are problems and you don't have r8168, you probably need it" and "if there are problems and you already have r8168, you probably need to purge it"?

I have 16.04 with kernel 4.15.0-118-generic, but I'm more interested in the general principles than in what I should use now.

Pavel V.
  • 256

1 Answers1

10

r8169 is an in-tree kernel driver that supports a few Ethernet adapters including R8168.

r8168 module built from source provided by Realtek.

In some cases new adapters don't get good support by Linux kernel immediately after they are released. In that case using r8168 makes sense as a temporary solution till Linux driver is fixed.

So if your Ethernet adapter works well, then there is no need to install r8168. People get problems if they install r8169-dkms and forget about it. Later they get a kernel upgrade to another major version and the driver doesn't build.

If you run apt show r8168-dkms, you'll see

This driver should only be used for devices not yet supported by the in-kernel driver r8169. Please see the README.Debian for instructions how to report bugs against r8169 that made it necessary to use r8168-dkms. . Installation of the r8168-dkms package will disable the in-kernel r8169 module. To re-enable r8169, the r8168-dkms package must be purged. . This package provides the dkms source code for the r8168 kernel modules. Kernel source or headers are required to compile these modules.

Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • So it depends more on the exact ethernet adapter? However, I'm still not sure whether I understand the guidelines of installing or purging r8168-dkms - see my editted subquestion. – Pavel V. Oct 03 '20 at 14:01
  • 2
    As the README says, r8168 is only to add new devices. If your ethernet is working with the default r8169, there is no need whatsoever to add new device IDs. In other words, if the default driver covers devices 001, 002 and 003 and your device is 002 and works as expected with r8169, you needn't install r8168 which only covers newer devices 004 and 005. – chili555 Oct 03 '20 at 15:25
  • 1
    @chili555 It is not only about IDs. In some cases r8169 works poorly with some revisions. – Pilot6 Oct 03 '20 at 17:49
  • 1
    @Pilot6 Yes, indeed, and for reasons that are not at all clear. – chili555 Oct 03 '20 at 19:10
  • 1
    @chili555 The reasons are clear enough. Realtek release new hardware revisions that are not really supported by kernel. They provide Linux drivers at their site, that are r8168. Later kernel developers add support of new revisions. So it is clear to me. – Pilot6 Oct 03 '20 at 19:15
  • The point of my question is how to be (almost) sure if the cause for generic problems if I have only r8169 is in it (and I need r8168) or somewhere else. A list of the revisions with which r8169 works poorly would help a lot - if it exists. – Pavel V. Oct 05 '20 at 07:28
  • 1
    This is a moving target. If a new hardware revision works poorly with a specific kernel, it makes sense to try the latest r8168. As simple as that. – Pilot6 Oct 05 '20 at 08:36
  • 1
    It's not that simple. In my case r8169 fails to work or slow down the network after reboot occasionally. It's never an honest term saying 'a device is supported' in linux distros. – funicorn Apr 15 '21 at 02:06
  • @funicorn From what I can tell, it's only dishonest with regards to realtek. Something about the way that company designs & supports their hardware. – Linas Feb 03 '23 at 19:41