Linux disables ethernet auto-negotiation on plugging-in the cable?

6,630

After hours of searching I found the solution in the most obvious place:

NetworkManager seems to somehow have disabled autonegotiation right in the settings for my ethernet port:

Connections - KDE System Settings

The weird part is that even after knowing NetworkManager can change the ethernet link-mode I cannot find even a single source online detailing that functionality. The only way according to the google search results I found is setting it via ethtool.

Share:
6,630

Related videos on Youtube

fallingcats
Author by

fallingcats

Updated on September 18, 2022

Comments

  • fallingcats
    fallingcats almost 2 years

    I recently noticed I am only getting 100Mbit/s of througput on my gigabit home network.

    When looking into it with ethtool I found my ArchLinux Box was using 100baseT/Half as link speed instead of 1000baseT/Full which its NIC and the switch connected to it support.I am not sure why but the NIC seems to not be advertising its link-modes according to ethtool:

    Settings for enp0s31f6:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Speed: 100Mb/s
        Duplex: Half
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: off
        MDI-X: on (auto)
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes
    

    When enabling auto-negotioation explicitly by running ethtool --change enp0s31f6 autoneg on it seems to advertise all its modes to the switch and uses 1000baseT/Full.

    That only works most of the time and for a while though. When I unplug the cable and pluggin it back in switches autoneg off most of the time, but not always. Also, sometimes setting autoneg to on immediately disables it again. Rebooting also disables it again.

    Note that auto-negotiation does not get disabled when unplugging but when replugging. dsmeg logs this when autoneg was enabled and I plug in a cable:

    [153692.029252] e1000e: enp0s31f6 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
    [153699.577779] e1000e: enp0s31f6 NIC Link is Up 100 Mbps Half Duplex, Flow Control: None
    [153699.577782] e1000e 0000:00:1f.6 enp0s31f6: 10/100 speed: disabling TSO
    

    I am using the intel NIC of my asrock motherboard (from ~2015) and an unmanaged switch (Netgear GS208).

    • Andrew Henle
      Andrew Henle over 6 years
      That's just weird. It's not like you're using some rare NIC chip on an uncommon software platform, either, so it's not likely to be a driver bug. I'd guess it's an intermittent hardware issue. Do you have other RJ45 ports on the same motherboard you can try? Maybe even another cable? Open the box up and make sure everything is properly seated? Yeah, it's an onboard NIC, so that probably won't do anything, but maybe the RJ45 connector is loose?
    • dirkt
      dirkt over 6 years
      IIRC there were some funny bugs and issues with the Intel NIC driver(s). Might be one of those, or a new one.
    • fallingcats
      fallingcats over 6 years
      @dirkt My notebook has the same problem but uses an atheros nic
    • dirkt
      dirkt over 6 years
      Hm. Under what conditions does the problem show up? When the Intel NIC or the Atheros NIC are connected to the same device on the other side? What about when they are connected to something else?
    • fallingcats
      fallingcats over 6 years
      Why I connect either of them to any of my two switches, using different cables.
    • ctrl-alt-delor
      ctrl-alt-delor over 6 years
      I see no reason to close this. Why the vote to close?