Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T6716: don't automatically set ethernet offload (backport #4077) #4078

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/activation-scripts/20-ethernet_offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
# CLI. See https://vyos.dev/T3619#102254 for all the details.
# T3787: Remove deprecated UDP fragmentation offloading option
# T6006: add to activation-scripts: migration-scripts/interfaces/20-to-21
# T6716: Honor the configured offload settings and don't automatically add
# them to the config if the kernel has them set (unless its a live boot)

from vyos.ethtool import Ethtool
from vyos.configtree import ConfigTree
from vyos.system.image import is_live_boot

def activate(config: ConfigTree):
base = ['interfaces', 'ethernet']
Expand All @@ -36,7 +39,7 @@ def activate(config: ConfigTree):
enabled, fixed = eth.get_generic_receive_offload()
if configured and fixed:
config.delete(base + [ifname, 'offload', 'gro'])
elif enabled and not fixed:
elif is_live_boot() and enabled and not fixed:
config.set(base + [ifname, 'offload', 'gro'])

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

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

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

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

# Remove deprecated UDP fragmentation offloading option
Expand Down
Loading