summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-31 23:03:01 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-31 23:36:14 +0200
commitb0d4112bd6073e4a947869c3bd80f8e87783fbfa (patch)
treec8266c7b3c60625072eec0706d89ad0ab37cf4a5 /src/conf_mode
parent56fa0d4baaeb7624918d77172fa7e1500d694b93 (diff)
downloadvyos-1x-b0d4112bd6073e4a947869c3bd80f8e87783fbfa.tar.gz
vyos-1x-b0d4112bd6073e4a947869c3bd80f8e87783fbfa.zip
vyos.ethtool: T3163: purify code to read and change flow-control settings
It makes no sense to have a parser for the ethtool values in ethtool.py and ethernet.py - one instance ios more then enough! (cherry picked from commit 0229645c8248decb5664056df8aa5cd5dff41802)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-ethernet.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py
index f3f3fede8..6e0d8c4e8 100755
--- a/src/conf_mode/interfaces-ethernet.py
+++ b/src/conf_mode/interfaces-ethernet.py
@@ -78,6 +78,10 @@ def verify(ethernet):
raise ConfigError(f'Adapter does not support changing speed and duplex '\
f'settings to: {speed}/{duplex}!')
+ if 'disable_flow_control' in ethernet:
+ if not ethtool.check_flow_control():
+ raise ConfigError('Adapter does not support changing flow-control settings!')
+
if 'ring_buffer' in ethernet:
max_rx = ethtool.get_ring_buffer_max('rx')
if not max_rx: