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 #4077

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

dvlogic
Copy link

@dvlogic dvlogic commented Sep 16, 2024

Change Summary

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.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T6716

Related PR(s)

Component(s) name

Ethernet activation script (20-ethernet_offload.py)

Proposed changes

Delete lines of code that set the ethernet offload setting based on the Kernel offload setting.

How to test

On a system where the kernel enables offloading at boot and/or the offload is currently set in the config:

configure
delete interfaces ethernet eth0 offload 
commit
load
show interfaces ethernet eth0 offload 

No offloading settings should be shown. On VyOS 1.5, without this PR, the offload settings will automatically be restored.

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@dvlogic dvlogic requested a review from a team as a code owner September 16, 2024 23:35
Copy link

github-actions bot commented Sep 16, 2024

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Sep 16, 2024

✅ No issues found in unused-imports check.. Please refer the workflow run

Copy link
Contributor

@jestabro jestabro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One modification that we may want to consider: only set in config during live boot, before installation:

diff --git a/src/activation-scripts/20-ethernet_offload.py b/src/activation-scripts/20-ethernet_offload.py
index 33b0ea469..4c7d8b521 100755
--- a/src/activation-scripts/20-ethernet_offload.py
+++ b/src/activation-scripts/20-ethernet_offload.py
@@ -20,6 +20,7 @@

 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']
@@ -36,7 +37,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

... etc. It will still hold that after installation, activation will not enable against user settings.

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.

Note(2): Allow the previous behavior where the offload settings get set,
based on the Kernel, if the boot is a live boot.
@dvlogic dvlogic force-pushed the dont_auto_enable_offload branch from cc2ac9a to b6c2a74 Compare September 17, 2024 19:25
@dvlogic
Copy link
Author

dvlogic commented Sep 17, 2024

I like @jestabro suggestion and updated the PR commit to reflect.

@jestabro
Copy link
Contributor

@Mergifyio backport circinus

Copy link
Contributor

mergify bot commented Sep 17, 2024

backport circinus

✅ Backports have been created

@c-po c-po merged commit 4d5cba6 into vyos:current Sep 17, 2024
8 of 9 checks passed
@dvlogic dvlogic deleted the dont_auto_enable_offload branch September 17, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants