Skip to content

Commit 4d5cba6

Browse files
authored
Merge pull request #4077 from dvlogic/dont_auto_enable_offload
T6716: don't automatically set ethernet offload
2 parents 53fa5c9 + b6c2a74 commit 4d5cba6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/activation-scripts/20-ethernet_offload.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@
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+
# T6716: Honor the configured offload settings and don't automatically add
21+
# them to the config if the kernel has them set (unless its a live boot)
2022

2123
from vyos.ethtool import Ethtool
2224
from vyos.configtree import ConfigTree
25+
from vyos.system.image import is_live_boot
2326

2427
def activate(config: ConfigTree):
2528
base = ['interfaces', 'ethernet']
@@ -36,7 +39,7 @@ def activate(config: ConfigTree):
3639
enabled, fixed = eth.get_generic_receive_offload()
3740
if configured and fixed:
3841
config.delete(base + [ifname, 'offload', 'gro'])
39-
elif enabled and not fixed:
42+
elif is_live_boot() and enabled and not fixed:
4043
config.set(base + [ifname, 'offload', 'gro'])
4144

4245
# If GSO is enabled by the Kernel - we reflect this on the CLI. If GSO is
@@ -45,7 +48,7 @@ def activate(config: ConfigTree):
4548
enabled, fixed = eth.get_generic_segmentation_offload()
4649
if configured and fixed:
4750
config.delete(base + [ifname, 'offload', 'gso'])
48-
elif enabled and not fixed:
51+
elif is_live_boot() and enabled and not fixed:
4952
config.set(base + [ifname, 'offload', 'gso'])
5053

5154
# If LRO is enabled by the Kernel - we reflect this on the CLI. If LRO is
@@ -54,7 +57,7 @@ def activate(config: ConfigTree):
5457
enabled, fixed = eth.get_large_receive_offload()
5558
if configured and fixed:
5659
config.delete(base + [ifname, 'offload', 'lro'])
57-
elif enabled and not fixed:
60+
elif is_live_boot() and enabled and not fixed:
5861
config.set(base + [ifname, 'offload', 'lro'])
5962

6063
# If SG is enabled by the Kernel - we reflect this on the CLI. If SG is
@@ -63,7 +66,7 @@ def activate(config: ConfigTree):
6366
enabled, fixed = eth.get_scatter_gather()
6467
if configured and fixed:
6568
config.delete(base + [ifname, 'offload', 'sg'])
66-
elif enabled and not fixed:
69+
elif is_live_boot() and enabled and not fixed:
6770
config.set(base + [ifname, 'offload', 'sg'])
6871

6972
# If TSO is enabled by the Kernel - we reflect this on the CLI. If TSO is
@@ -72,7 +75,7 @@ def activate(config: ConfigTree):
7275
enabled, fixed = eth.get_tcp_segmentation_offload()
7376
if configured and fixed:
7477
config.delete(base + [ifname, 'offload', 'tso'])
75-
elif enabled and not fixed:
78+
elif is_live_boot() and enabled and not fixed:
7679
config.set(base + [ifname, 'offload', 'tso'])
7780

7881
# Remove deprecated UDP fragmentation offloading option

0 commit comments

Comments
 (0)