Bug 1807171

Summary: reset ethtool autonet/speed/duplex setting when deactivating profile in NetworkManager
Product: Red Hat Enterprise Linux 8 Reporter: Thomas Haller <thaller>
Component: NetworkManagerAssignee: Thomas Haller <thaller>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.2CC: acardace, atragler, bgalvani, jmaxwell, lrintel, rkhan, sukulkar, thaller, till, vbenes
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: NetworkManager-1.25.2-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:49:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1807630    

Description Thomas Haller 2020-02-25 17:54:23 UTC
In a NetworkManager profile, you can set the ethernet.{auto-negotiate,duplex,speed} settings.

If you leave them all unset (the default), NetworkManager won't touch the settings of the device when activating the profile. Otherwise, it will set them.


When deactivating the profile, NetworkManager currently does not restore the previous settings. It must.


That is especially a problem, because if your interface has the wrong speed settings, then it won't get carrier. And you won't be able to activate a profile on a device that has no carrier (at least not if the profile uses DHCP or other IP addressing methods that require carrier).


Example:

 - have a profile that sets speed settings (e.g. by disabling autoneg)
 - activate profile.
 - unplug cable (connection goes down, the ethtool settings are left at the previous speed settings)
 - plug cable into another port, where the other side does not support the set ethtool settings.

The result is that the link won't get carrier, and you won't be able to activate the profile to set different speed settings.



TODO:

1) during disconnect, by default the previous settings (if NM changed them) must be restored. Usually, that means to restore autoneg because that's the default.

2) we should have a per-device configuration, that instead tells NetworkManager to always restore an explicit other setting (and not the one that was found before activating the profile).



Upstream bug: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/356#note_407786

Comment 1 Thomas Haller 2020-02-25 17:58:15 UTC
3) possibly there should be a D-Bus API to set the ethtool settings of a device. Because even with 1) and 2), you still can get into a situation where you just won't be able to activate a profile.

the problem is, how would anybody know how to use this API. E.g. if a user (or worse: some application) runs into this issue, how could it possibly know that changing the ethtool settings is the right way to fix it?

Comment 9 errata-xmlrpc 2020-11-04 01:49:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (NetworkManager bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4499