e1000e Ethernet issues (again)

A few month ago I had similar issues with the GBit-Ethernet-Adapter in my T420 Thinkpad. Then it didn’t activated the interface after going to sleep and waking up again. A workaround was to use ethtool to do a quick test, which also woke the ethernet interface up again. Later I had issues again and could solve them by switching from NetworkManager to systemd-networkd. Now, with Kernel 5.0.x the Interface takes about 30-60s to wake up, after the system has been woken. This alone is annoying, but the second thing is, that auto-negotiation only set the interface to 100 Mbit/s. If I unplug and replug the Ethernet it will go back to 1000 Mbit/s.

Somehow Manjaro doesn’t like the ethernet interfaces on this machine. Never had any issues with Ubuntu or Windows before. I tested the cable
(Cat6a) and switch port (Netgear ProSafe) - they seem to be perfectly fine and also worked stable for years.

Any ideas?

Both of these issues can be corrected with a systemd service, I will post you some info shortly.

I don’t see there being any actual fix to these issues, as it seems to be a problem with either recent intel firmware or kernel updates. Those things are not exactly within our control to fix.

Please post:

inxi -Fxxxz

Unless there is no alternative, do not post terminal output as a pic.

Please post all terminal command output as text with code tags.

Information on how to properly post hardware specs and logs:

Please format any terminal output with three backticks before and after, as shown in this picture:

Here is an example of how you can correct your adapter’s speed setting with a service unit.

1000baseT Ethernet Configuration Service File

Create the required service file:

/etc/systemd/system/nic-config.service

The contents of the service file are as follows:

#/etc/systemd/system/nic-config.service
#sudo systemctl enable nic-config.service
#sudo systemctl start nic-config.service
#sudo systemctl status nic-config.service
#sudo systemctl daemon-reload

[Unit]
Description=NIC Configuration 
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/ethtool -s eno1 speed 1000 duplex full autoneg off
Restart=on-failure

[Install]
WantedBy=multi-user.target

If your adapter ID is different than “eth0” you will need to substitute you own adapter’s ID into the ExecStart line of the service file.

Save your newly created service file, then:

Enable the service:

sudo systemctl enable nic-config.service

Start the service:

sudo systemctl start nic-config.service

Reload running services:

sudo systemctl daemon-reload

Check the new service’s status:

sudo systemctl status nic-config.service

Reboot your system and your new NIC configuration parameters should now be automatically be loaded at each start.

(edit)

If the settings in the above service don’t work well for you, then try substituting this in the ExecStart line .

ExecStart=/usr/bin/ethtool -s eth0 autoneg on

Thank you very much for your fast reply! I will test this out and report back.

Here’s some additional information:

System:
  Host: cf-thinkpad Kernel: 5.0.5-1-MANJARO x86_64 bits: 64 compiler: gcc 
  v: 8.2.1 Desktop: KDE Plasma 5.15.3 tk: Qt 5.12.2 wm: kwin_x11 dm: SDDM 
  Distro: Manjaro Linux 
Machine:
  Type: Laptop System: LENOVO product: 4236MBG v: ThinkPad T420 
  serial: <filter> Chassis: type: 10 serial: <filter> 
  Mobo: LENOVO model: 4236MBG serial: <filter> UEFI: LENOVO 
  v: 83ET80WW (1.50 ) date: 03/06/2018 
Battery:
  ID-1: BAT0 charge: 18.0 Wh condition: 18.1/56.2 Wh (32%) volts: 12.3/10.8 
  model: SANYO 42T4791 type: Li-ion serial: <filter> status: Unknown 
  Device-1: hidpp_battery_0 model: Logitech Anywhere MX serial: <filter> 
  charge: 50% rechargeable: yes status: Discharging 
CPU:
  Topology: Dual Core model: Intel Core i5-2540M bits: 64 type: MT MCP 
  arch: Sandy Bridge rev: 7 L2 cache: 3072 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 20741 
  Speed: 797 MHz min/max: 800/3300 MHz Core speeds (MHz): 1: 797 2: 797 
  3: 797 4: 798 
Graphics:
  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics 
  vendor: Lenovo driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:0126 
  Display: x11 server: X.Org 1.20.4 driver: intel compositor: kwin_x11 
  tty: N/A 
  OpenGL: renderer: Mesa DRI Intel Sandybridge Mobile v: 3.3 Mesa 18.3.5 
  compat-v: 3.0 direct render: Yes 
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio 
  vendor: Lenovo driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
  chip ID: 8086:1c20 
  Sound Server: ALSA v: k5.0.5-1-MANJARO 
Network:
  Device-1: Intel 82579LM Gigabit Network vendor: Lenovo ThinkPad T520 
  driver: e1000e v: 3.2.6-k port: 5080 bus ID: 00:19.0 chip ID: 8086:1502 
  IF: enp0s25 state: up speed: 1000 Mbps duplex: full mac: <filter> 
  Device-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi 
  v: kernel port: efa0 bus ID: 03:00.0 chip ID: 8086:0085 
  IF: wlp3s0 state: down mac: <filter> 
Drives:
  Local Storage: total: 350.27 GiB used: 170.69 GiB (48.7%) 
  ID-1: /dev/sda vendor: Crucial model: CT120M500SSD1 size: 111.79 GiB 
  speed: 6.0 Gb/s serial: <filter> rev: MU05 scheme: GPT 
  ID-2: /dev/sdb vendor: Crucial model: CT256M550SSD3 size: 238.47 GiB 
  speed: 3.0 Gb/s serial: <filter> rev: MU02 scheme: GPT 
Partition:
  ID-1: / size: 89.65 GiB used: 30.98 GiB (34.6%) fs: ext4 dev: /dev/sda2 
  ID-2: /home size: 233.72 GiB used: 139.71 GiB (59.8%) fs: ext4 
  dev: /dev/sdb1 
  ID-3: swap-1 size: 20.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 
Sensors:
  System Temperatures: cpu: 44.0 C mobo: N/A 
  Fan Speeds (RPM): cpu: 1973 
Info:
  Processes: 190 Uptime: 17h 30m Memory: 7.67 GiB used: 1.35 GiB (17.7%) 
  Init: systemd v: 241 Compilers: gcc: 8.2.1 Shell: bash v: 5.0.0 
  running in: konsole inxi: 3.0.32
$ sudo ethtool enp0s25
Swipe your finger across the fingerprint reader
Settings for enp0s25:
        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
        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
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: off (auto)
        Supports Wake-on: pumbg
        Wake-on: d
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

Network Restart Service

Create the following file with a root text editor:

/etc/systemd/system/network-restart.service

Add the following contents to the file:

#/etc/systemd/system/network-restart.service
#sudo systemctl enable network-restart.service
#sudo systemctl start network-restart.service
#sudo systemctl stop network-restart.service
#sudo systemctl disable network-restart.service
#systemctl status network-restart.service
#sudo systemctl daemon-reload

[Unit]
Description=Network Suspend/Resume Service 
Before=sleep.target
StopWhenUnneeded=yes

[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStartPre=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking off'
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/systemctl stop NetworkManager
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/ip link set enp0s25 down
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/modprobe -r e1000e
ExecStop=/usr/bin/sleep 5
ExecStop=-/usr/bin/modprobe e1000e
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/ip link set enp0s25 up
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/systemctl start NetworkManager
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking on'
ExecStop=/usr/bin/sleep 1

[Install]
WantedBy=sleep.target

The sleep units in the service may be reduced, (or eliminated) if you do not like the delay it creates. Be aware though, that doing so may reduce the reliability of the service.

Once you have created and saved the service file, enable the service:

sudo systemctl enable network-restart.service

Then reboot the computer.

For others wishing to adapt this service to their installation (if different than above).

If your adapter’s designation is different than “enp0s25” you will need to substitute you own adapter’s ID into the service file.

If you are using a different driver module you will also need to substitute it in place of “e1000e” in the service file.

You can find your adapter driver/module and device ID with the following command:

inxi -n