diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2022-03-11 11:01:04 -0500 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-03-11 19:12:16 +0100 |
commit | cfa98d3e281f258e733664bbf375d3633ffe0205 (patch) | |
tree | 5dfed7e70cb14ac1cde3d49fe56f0aee43e61ff5 /python | |
parent | 71307ab2a126d3c9086a9b6f3aba6be202a52139 (diff) | |
download | vyos-1x-cfa98d3e281f258e733664bbf375d3633ffe0205.tar.gz vyos-1x-cfa98d3e281f258e733664bbf375d3633ffe0205.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.
(cherry picked from commit 2894b52454311f8e011bed910704064be7471275)
Diffstat (limited to 'python')
-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 |