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

wireguard: T5409: Added 'set interfaces wireguard wgX threaded' #2130

Merged
merged 3 commits into from
Aug 17, 2023

Conversation

aapostoliuk
Copy link
Contributor

Change Summary

Added 'set interfaces wireguard wgX threaded' command.
Process traffic from each peer in a dedicated thread.

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)

Component(s) name

wireguard

Proposed changes

Added 'set interfaces wireguard wgX threaded' command.
Process traffic from each peer in a dedicated thread.
This command is allowed only if one enabled peer exists

How to test

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

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team August 2, 2023 13:16
@c-po
Copy link
Member

c-po commented Aug 2, 2023

Any reason to not enable this by default?

@zdc
Copy link
Contributor

zdc commented Aug 5, 2023

Any reason to not enable this by default?

Zero, if not negative, benefit for p2p interfaces. Also, bigger overall CPU usage (but distributed between cores).

Added 'set interfaces wireguard wgX threaded' command.
Process traffic from each peer in a dedicated thread.
Copy link
Member

@c-po c-po left a comment

Choose a reason for hiding this comment

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

IMHO this should be enabled by default as it should improve overall system responsiveness if load is distributed among multiple cores.

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

I think if WireGuard has it off by default, we should probably follow the same approach.

@c-po
Copy link
Member

c-po commented Aug 7, 2023

I think if WireGuard has it off by default, we should probably follow the same approach.

If it will be a config option, can we then try to streamline it, as it‘s kind of an offload option? As we use offloading for other interface types ethernet, openvpn, too?

set interfaces wireguard wgN offload multicore

@c-po
Copy link
Member

c-po commented Aug 17, 2023

As discussed in todays maintainer meeting we agreed on:
set interfaces wireguard wgN per-client-thread

And also implement this for the WIFI subsystem

Using threaded as CLI node is a very deep term used by kernel threads. To make
this more understandable to users, rename the node to per-client-thread.

It's also not necessary to test if any one peer is configured and probing if
the option is set. There is a base test which requires at least one peer
to be configured.
Provides a per-device control to enable/disable the threaded mode for all the
napi instances of the given network device, without the need for a device
up/down.
@c-po c-po merged commit 49f25c5 into vyos:current Aug 17, 2023
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants