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

Failsafe enabling of UDP GRO for forwarding #370

Merged
merged 7 commits into from
May 24, 2024

Conversation

lmagyar
Copy link
Contributor

@lmagyar lmagyar commented May 22, 2024

Proposed Changes

Revert this suggested optimization altogether, makes more problem then solves.

We could ask TS with this curl --unix-socket /var/run/tailscale/tailscaled.sock http://local-tailscaled.sock/localapi/v0/check-udp-gro-forwarding, but that is a bad idea, undocumented api, let them solve this on their own.

Related Issues

fixes #362

Summary by CodeRabbit

  • Chores

    • Removed the ethtool package from the Tailscale Docker image to streamline the installation process.
  • Refactor

    • Simplified the post-tailscaled/run script by removing unnecessary declarations and Linux optimizations for subnet routers and exit nodes.

Copy link

coderabbitai bot commented May 22, 2024

Walkthrough

The recent updates to the Tailscale Home Assistant Community Add-on involve refining the Docker setup by removing ethtool and simplifying network configurations in the post-tailscaled/run script. These changes aim to enhance the add-on's functionality and potentially address reported connectivity issues.

Changes

File Path Change Summary
tailscale/Dockerfile Removed ethtool=6.6-r0 from the package installation list in apk add.
tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run Removed network-related declarations (interface, options, routes, route, login_server, tags, keyexpiry) and Linux optimizations for subnet routers and exit nodes.

Assessment against linked issues

Objective Addressed Explanation
Resolve connectivity issues to Home Assistant (#362) The changes may improve connectivity, but further testing is needed to confirm if all issues are resolved.

Poem

Code changes dance like rabbits in the night,
Removing hurdles, making paths more bright.
With ethtool gone and scripts refined,
Connectivity puzzles, we aim to unwind.
On digital fields where data flows,
May seamless connections be what future shows!
🐇🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between cea1e9a and 65db3a7.
Files selected for processing (2)
  • tailscale/Dockerfile (1 hunks)
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run (2 hunks)
Files skipped from review due to trivial changes (2)
  • tailscale/Dockerfile
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run

@lmagyar
Copy link
Contributor Author

lmagyar commented May 22, 2024

Or just let it silently failing?

With ethtool -K "${interface}" rx-udp-gro-forwarding on rx-gro-list off &> /dev/null || true???

@frenck frenck added the bugfix Inconsistencies or issues which will cause a problem for users or implementors. label May 23, 2024
@frenck
Copy link
Member

frenck commented May 23, 2024

Or just let it silently failing?

With ethtool -K "${interface}" rx-udp-gro-forwarding on rx-gro-list off &> /dev/null || true???

That is maybe not a bad idea... We could try?

@lmagyar lmagyar marked this pull request as draft May 23, 2024 21:37
@lmagyar lmagyar changed the title Revert "Linux optimizations for subnet routers and exit nodes" Failsafe enabling of UDP GRO for forwarding May 23, 2024
@lmagyar lmagyar force-pushed the pr-revert-linux-optimizations branch from 65db3a7 to cdf8745 Compare May 23, 2024 21:47
@lmagyar
Copy link
Contributor Author

lmagyar commented May 23, 2024

TS suggest this optimization conditionally (tx-udp-segmentation is enabled on their tun interface source), the reverted code tries to do it always and on much more interface than it should (still don't understand the errors in the issue).

So I suggest "capturing" their warning and trying ethtool only if TS suggest it and only on the interface they suggest. They test everything, so ethtool should work when they suggest. The "capturing" fails silently (undocumented API can change), ethtool fails with warning.

Moved the code after TS is up, because we can't call TS API before it's up, so there will be a TS warning, then we set it up.

This version is quite safe to be silent on any error.

Warning: UDP GRO forwarding is suboptimally configured on enu1u1, UDP forwarding throughput capability will increase with a configuration change.
See https://tailscale.com/s/ethtool-config-udp-gro
[23:37:19] INFO: Tailscale is running
[23:37:20] INFO: Enable UDP GRO for forwarding on enu1u1

@lmagyar lmagyar marked this pull request as ready for review May 23, 2024 22:26
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 65db3a7 and a5799d6.
Files selected for processing (1)
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Nice piece of bash 👍

../Frenck

@frenck frenck merged commit 9a4acae into hassio-addons:main May 24, 2024
11 checks passed
@lmagyar lmagyar deleted the pr-revert-linux-optimizations branch May 24, 2024 08:29
@github-actions github-actions bot locked and limited conversation to collaborators May 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix Inconsistencies or issues which will cause a problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connectivity to Hass suddenly stopped - no known changes occured
2 participants