Skip to content

Commit cc2ac9a

Browse files
Dave Vogeldvogel-fp
authored andcommitted
T6716: don't automatically set ethernet offload
Remove the lines of code that checked if the kernel had offloading enabled and was then forcing the config to set it to "on." The behavior now mirrors the config and offloading will only be enabled if the config is explicitly set to enabled. Note: the code is still present to disable the offloading, in the config, if the kernel doesn't support it.
1 parent 53fa5c9 commit cc2ac9a

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/activation-scripts/20-ethernet_offload.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
# CLI. See https://vyos.dev/T3619#102254 for all the details.
1818
# T3787: Remove deprecated UDP fragmentation offloading option
1919
# T6006: add to activation-scripts: migration-scripts/interfaces/20-to-21
20-
20+
# T6716: Honor the configured offload settings and don't automacially add
21+
# them to the config if the kernel has them set.
2122
from vyos.ethtool import Ethtool
2223
from vyos.configtree import ConfigTree
2324

@@ -36,44 +37,34 @@ def activate(config: ConfigTree):
3637
enabled, fixed = eth.get_generic_receive_offload()
3738
if configured and fixed:
3839
config.delete(base + [ifname, 'offload', 'gro'])
39-
elif enabled and not fixed:
40-
config.set(base + [ifname, 'offload', 'gro'])
4140

4241
# If GSO is enabled by the Kernel - we reflect this on the CLI. If GSO is
4342
# enabled via CLI but not supported by the NIC - we remove it from the CLI
4443
configured = config.exists(base + [ifname, 'offload', 'gso'])
4544
enabled, fixed = eth.get_generic_segmentation_offload()
4645
if configured and fixed:
4746
config.delete(base + [ifname, 'offload', 'gso'])
48-
elif enabled and not fixed:
49-
config.set(base + [ifname, 'offload', 'gso'])
5047

5148
# If LRO is enabled by the Kernel - we reflect this on the CLI. If LRO is
5249
# enabled via CLI but not supported by the NIC - we remove it from the CLI
5350
configured = config.exists(base + [ifname, 'offload', 'lro'])
5451
enabled, fixed = eth.get_large_receive_offload()
5552
if configured and fixed:
5653
config.delete(base + [ifname, 'offload', 'lro'])
57-
elif enabled and not fixed:
58-
config.set(base + [ifname, 'offload', 'lro'])
5954

6055
# If SG is enabled by the Kernel - we reflect this on the CLI. If SG is
6156
# enabled via CLI but not supported by the NIC - we remove it from the CLI
6257
configured = config.exists(base + [ifname, 'offload', 'sg'])
6358
enabled, fixed = eth.get_scatter_gather()
6459
if configured and fixed:
6560
config.delete(base + [ifname, 'offload', 'sg'])
66-
elif enabled and not fixed:
67-
config.set(base + [ifname, 'offload', 'sg'])
6861

6962
# If TSO is enabled by the Kernel - we reflect this on the CLI. If TSO is
7063
# enabled via CLI but not supported by the NIC - we remove it from the CLI
7164
configured = config.exists(base + [ifname, 'offload', 'tso'])
7265
enabled, fixed = eth.get_tcp_segmentation_offload()
7366
if configured and fixed:
7467
config.delete(base + [ifname, 'offload', 'tso'])
75-
elif enabled and not fixed:
76-
config.set(base + [ifname, 'offload', 'tso'])
7768

7869
# Remove deprecated UDP fragmentation offloading option
7970
if config.exists(base + [ifname, 'offload', 'ufo']):

0 commit comments

Comments
 (0)