diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-03-11 19:11:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-11 19:11:20 +0100 |
commit | 7d69edf280fd5c5757b8975e9310edfd8e1ea3be (patch) | |
tree | 43a155f1927f16bdad5cf08db320134b1c97958d /python/vyos/ethtool.py | |
parent | c1e04cea0817db07b22a8bd8e6b2f2c0a1e682f4 (diff) | |
parent | 2894b52454311f8e011bed910704064be7471275 (diff) | |
download | vyos-1x-7d69edf280fd5c5757b8975e9310edfd8e1ea3be.tar.gz vyos-1x-7d69edf280fd5c5757b8975e9310edfd8e1ea3be.zip |
Merge pull request #1245 from dberlin/patch-1
[Ethtool] T4297: Update drivers supporting speed/flow/duplex
Diffstat (limited to 'python/vyos/ethtool.py')
-rw-r--r-- | python/vyos/ethtool.py | 7 |
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 |