summaryrefslogtreecommitdiff
path: root/src/migration-scripts/interfaces
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:34:25 +0200
commit0229645c8248decb5664056df8aa5cd5dff41802 (patch)
tree087ffff33d98fa816c9eddf007e4d2e400616021 /src/migration-scripts/interfaces
parent8834c22dc3f5758c1d2364579acc428cfc0fe650 (diff)
downloadvyos-1x-0229645c8248decb5664056df8aa5cd5dff41802.tar.gz
vyos-1x-0229645c8248decb5664056df8aa5cd5dff41802.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!
Diffstat (limited to 'src/migration-scripts/interfaces')
-rwxr-xr-xsrc/migration-scripts/interfaces/20-to-218
1 files changed, 8 insertions, 0 deletions
diff --git a/src/migration-scripts/interfaces/20-to-21 b/src/migration-scripts/interfaces/20-to-21
index bd89dcdb4..0bd858760 100755
--- a/src/migration-scripts/interfaces/20-to-21
+++ b/src/migration-scripts/interfaces/20-to-21
@@ -104,6 +104,14 @@ for ifname in config.list_nodes(base):
config.delete(speed_path)
config.delete(duplex_path)
+ # Also while processing the interface configuration, not all adapters support
+ # changing disabling flow-control - or change this setting. If disabling
+ # flow-control is not supported by the NIC, we remove the setting from CLI
+ flow_control_path = base + [ifname, 'disable-flow-control']
+ if config.exists(flow_control_path):
+ if not eth.check_flow_control():
+ config.delete(flow_control_path)
+
try:
with open(file_name, 'w') as f:
f.write(config.to_string())