summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2022-03-11 11:01:04 -0500
committerGitHub <noreply@github.com>2022-03-11 11:01:04 -0500
commit2894b52454311f8e011bed910704064be7471275 (patch)
tree43a155f1927f16bdad5cf08db320134b1c97958d /python
parentc1e04cea0817db07b22a8bd8e6b2f2c0a1e682f4 (diff)
downloadvyos-1x-2894b52454311f8e011bed910704064be7471275.tar.gz
vyos-1x-2894b52454311f8e011bed910704064be7471275.zip
[Ethtool] T4297: Update drivers supporting speed/flow/duplex
The iavf, ice, and i40e drivers do not support speed, flow, or duplex control using ethtool. As a result, interface configuration changes fail to commit when using those drivers. This patch fixes that by correctly marking those drivers as not supporting those controls.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ethtool.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/python/vyos/ethtool.py b/python/vyos/ethtool.py
index 80d44eee6..672ee2cc9 100644
--- a/python/vyos/ethtool.py
+++ b/python/vyos/ethtool.py
@@ -18,6 +18,9 @@ import re
from vyos.util import popen
+# These drivers do not support using ethtool to change the speed, duplex, or flow control settings
+_drivers_without_speed_duplex_flow = ['vmxnet3', 'virtio_net', 'xen_netfront', 'iavf', 'ice', 'i40e']
+
class Ethtool:
"""
Class is used to retrive and cache information about an ethernet adapter
@@ -188,7 +191,7 @@ class Ethtool:
if duplex not in ['auto', 'full', 'half']:
raise ValueError(f'Value "{duplex}" for duplex is invalid!')
- if self.get_driver_name() in ['vmxnet3', 'virtio_net', 'xen_netfront']:
+ if self.get_driver_name() in _drivers_without_speed_duplex_flow:
return False
if speed in self._speed_duplex:
@@ -198,7 +201,7 @@ class Ethtool:
def check_flow_control(self):
""" Check if the NIC supports flow-control """
- if self.get_driver_name() in ['vmxnet3', 'virtio_net', 'xen_netfront']:
+ if self.get_driver_name() in _drivers_without_speed_duplex_flow:
return False
return self._flow_control