summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-30 21:36:52 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-30 21:45:37 +0200
commit705022319916222d78082114245c7639c073bd32 (patch)
treef814f8bff50065e99cfadb97c71087d8ab290308
parentc1b298e5ec11313156eb3a9f871fe4f3cd4cbd64 (diff)
downloadvyos-1x-705022319916222d78082114245c7639c073bd32.tar.gz
vyos-1x-705022319916222d78082114245c7639c073bd32.zip
ethernet: T3787: remove deprecated UDP fragmentation offloading option
Deprecated in the Linux Kernel by commit 08a00fea6de277df12ccfadc21 ("net: Remove references to NETIF_F_UFO from ethtool."). (cherry picked from commit f5e46ee6cc2b6c1c1869e26beca4ccd5bf52b62f)
-rw-r--r--interface-definitions/interfaces-ethernet.xml.in6
-rw-r--r--python/vyos/ethtool.py3
-rw-r--r--python/vyos/ifconfig/ethernet.py28
-rwxr-xr-xsrc/migration-scripts/interfaces/20-to-2112
4 files changed, 4 insertions, 45 deletions
diff --git a/interface-definitions/interfaces-ethernet.xml.in b/interface-definitions/interfaces-ethernet.xml.in
index ca076e3fa..ceeda12a0 100644
--- a/interface-definitions/interfaces-ethernet.xml.in
+++ b/interface-definitions/interfaces-ethernet.xml.in
@@ -104,12 +104,6 @@
<valueless/>
</properties>
</leafNode>
- <leafNode name="ufo">
- <properties>
- <help>Enable UDP Fragmentation Offloading</help>
- <valueless/>
- </properties>
- </leafNode>
</children>
</node>
<leafNode name="speed">
diff --git a/python/vyos/ethtool.py b/python/vyos/ethtool.py
index 98985e972..5a5d84bed 100644
--- a/python/vyos/ethtool.py
+++ b/python/vyos/ethtool.py
@@ -122,9 +122,6 @@ class Ethtool:
def get_tcp_segmentation_offload(self):
return self._get_generic('tcp-segmentation-offload')
- def get_udp_fragmentation_offload(self):
- return self._get_generic('udp-fragmentation-offload')
-
def get_rx_buffer(self):
# Configuration of RX ring-buffers is not supported on every device,
# thus when it's impossible return None
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py
index 696fec03b..7d29da8fc 100644
--- a/python/vyos/ifconfig/ethernet.py
+++ b/python/vyos/ifconfig/ethernet.py
@@ -71,11 +71,6 @@ class EthernetIf(Interface):
'possible': lambda i, v: EthernetIf.feature(i, 'tso', v),
# 'shellcmd': 'ethtool -K {ifname} tso {value}',
},
- 'ufo': {
- 'validate': lambda v: assert_list(v, ['on', 'off']),
- 'possible': lambda i, v: EthernetIf.feature(i, 'ufo', v),
- # 'shellcmd': 'ethtool -K {ifname} ufo {value}',
- },
}}
_sysfs_set = {**Interface._sysfs_set, **{
@@ -338,26 +333,6 @@ class EthernetIf(Interface):
print('Adapter does not support changing tcp-segmentation-offload settings!')
return False
- def set_ufo(self, state):
- """
- Enable UDP fragmentation offloading. State can be either True or False.
-
- Example:
- >>> from vyos.ifconfig import EthernetIf
- >>> i = EthernetIf('eth0')
- >>> i.set_udp_offload(True)
- """
- if not isinstance(state, bool):
- raise ValueError('Value out of range')
-
- enabled, fixed = self.ethtool.get_udp_fragmentation_offload()
- if enabled != state:
- if not fixed:
- return self.set_interface('gro', 'on' if state else 'off')
- else:
- print('Adapter does not support changing udp-fragmentation-offload settings!')
- return False
-
def set_ring_buffer(self, b_type, b_size):
"""
Example:
@@ -403,9 +378,6 @@ class EthernetIf(Interface):
# TSO (TCP segmentation offloading)
self.set_tso(dict_search('offload.tso', config) != None)
- # UDP fragmentation offloading
- self.set_ufo(dict_search('offload.ufo', config) != None)
-
# Set physical interface speed and duplex
if {'speed', 'duplex'} <= set(config):
speed = config.get('speed')
diff --git a/src/migration-scripts/interfaces/20-to-21 b/src/migration-scripts/interfaces/20-to-21
index 9210330d6..4b0e70d35 100755
--- a/src/migration-scripts/interfaces/20-to-21
+++ b/src/migration-scripts/interfaces/20-to-21
@@ -15,7 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# T3619: mirror Linux Kernel defaults for ethernet offloading options into VyOS
-# CLI. See https://phabricator.vyos.net/T3619#102254 for all the details.
+# CLI. See https://phabricator.vyos.net/T3619#102254 for all the details.
+# T3787: Remove deprecated UDP fragmentation offloading option
from sys import argv
@@ -84,14 +85,9 @@ for ifname in config.list_nodes(base):
elif enabled and not fixed:
config.set(base + [ifname, 'offload', 'tso'])
- # If UFO is enabled by the Kernel - we reflect this on the CLI. If UFO is
- # enabled via CLI but not supported by the NIC - we remove it from the CLI
- configured = config.exists(base + [ifname, 'offload', 'ufo'])
- enabled, fixed = eth.get_udp_fragmentation_offload()
- if configured and fixed:
+ # Remove deprecated UDP fragmentation offloading option
+ if config.exists(base + [ifname, 'offload', 'ufo']):
config.delete(base + [ifname, 'offload', 'ufo'])
- elif enabled and not fixed:
- config.set(base + [ifname, 'offload', 'ufo'])
try:
with open(file_name, 'w') as f: