summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-03-24 09:32:09 +0100
committerGitHub <noreply@github.com>2024-03-24 09:32:09 +0100
commitd69ad851ba0edc18841d5f44db8f7555f1adc910 (patch)
tree0809cbd2fe3a3c8d87909251978b64487e57118f /python
parent19df61f2291f19cbbea1dc94587f3ee8bb251212 (diff)
parent946f93778f15f4af9f31cd5b164efcd931693635 (diff)
downloadvyos-1x-d69ad851ba0edc18841d5f44db8f7555f1adc910.tar.gz
vyos-1x-d69ad851ba0edc18841d5f44db8f7555f1adc910.zip
Merge pull request #3177 from c-po/eee-T6152
Revert "ethernet: T5566: disable energy efficient ethernet (EEE) for interfaces"
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ethtool.py24
-rw-r--r--python/vyos/ifconfig/ethernet.py31
2 files changed, 0 insertions, 55 deletions
diff --git a/python/vyos/ethtool.py b/python/vyos/ethtool.py
index 473c98d0c..5e241fc08 100644
--- a/python/vyos/ethtool.py
+++ b/python/vyos/ethtool.py
@@ -24,7 +24,6 @@ from vyos.utils.process import popen
_drivers_without_speed_duplex_flow = ['vmxnet3', 'virtio_net', 'xen_netfront',
'iavf', 'ice', 'i40e', 'hv_netvsc', 'veth', 'ixgbevf',
'tun']
-_drivers_without_eee = ['vmxnet3', 'virtio_net', 'xen_netfront', 'hv_netvsc']
class Ethtool:
"""
@@ -63,8 +62,6 @@ class Ethtool:
_auto_negotiation = False
_auto_negotiation_supported = None
_flow_control = None
- _eee = False
- _eee_enabled = None
def __init__(self, ifname):
# Get driver used for interface
@@ -118,15 +115,6 @@ class Ethtool:
if not bool(err):
self._flow_control = loads(out)
- # Get current Energy Efficient Ethernet (EEE) settings, but this is
- # not supported by all NICs (e.g. vmxnet3 does not support is)
- out, _ = popen(f'ethtool --show-eee {ifname}')
- if len(out.splitlines()) > 1:
- self._eee = True
- # read current EEE setting, this returns:
- # EEE status: disabled || EEE status: enabled - inactive || EEE status: enabled - active
- self._eee_enabled = bool('enabled' in out.splitlines()[1])
-
def check_auto_negotiation_supported(self):
""" Check if the NIC supports changing auto-negotiation """
return self._auto_negotiation_supported
@@ -211,15 +199,3 @@ class Ethtool:
'flow-control settings!')
return 'on' if bool(self._flow_control[0]['autonegotiate']) else 'off'
-
- def check_eee(self):
- """ Check if the NIC supports eee """
- if self.get_driver_name() in _drivers_without_eee:
- return False
- return self._eee
-
- def get_eee(self):
- if self._eee_enabled == None:
- raise ValueError('Interface does not support changing '\
- 'EEE settings!')
- return self._eee_enabled
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py
index c3f5bbf47..8d96c863f 100644
--- a/python/vyos/ifconfig/ethernet.py
+++ b/python/vyos/ifconfig/ethernet.py
@@ -404,34 +404,6 @@ class EthernetIf(Interface):
print(f'could not set "{rx_tx}" ring-buffer for {ifname}')
return output
- def set_eee(self, enable):
- """
- Enable/Disable Energy Efficient Ethernet (EEE) settings
-
- Example:
- >>> from vyos.ifconfig import EthernetIf
- >>> i = EthernetIf('eth0')
- >>> i.set_eee(enable=False)
- """
- if not isinstance(enable, bool):
- raise ValueError('Value out of range')
-
- if not self.ethtool.check_eee():
- self._debug_msg(f'NIC driver does not support changing EEE settings!')
- return False
-
- current = self.ethtool.get_eee()
- if current != enable:
- # Assemble command executed on system. Unfortunately there is no way
- # to change this setting via sysfs
- cmd = f'ethtool --set-eee {self.ifname} eee '
- cmd += 'on' if enable else 'off'
- output, code = self._popen(cmd)
- if code:
- Warning(f'could not change "{self.ifname}" EEE setting!')
- return output
- return None
-
def update(self, config):
""" General helper function which works on a dictionary retrived by
get_config_dict(). It's main intention is to consolidate the scattered
@@ -442,9 +414,6 @@ class EthernetIf(Interface):
value = 'off' if 'disable_flow_control' in config else 'on'
self.set_flow_control(value)
- # Always disable Energy Efficient Ethernet
- self.set_eee(False)
-
# GRO (generic receive offload)
self.set_gro(dict_search('offload.gro', config) != None)