Skip to content

Added support for Indirection Table editing #98

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

Merged
merged 7 commits into from
Apr 30, 2025

Conversation

VladimiroPaschali
Copy link
Contributor

The following changes introduce support for Indirection Table editing similar to the functionality provided by the following ethtool CLI commands:
sudo ethtool --set-rxfh-indir $ETH equal 10 or sudo ethtool --set-rxfh-indir $ETH weight 1 1

  • New functions: GetIndir, SetIndir, fillIndirTable
  • New structs: Indir and SetIndir

The GetIndir(intf string) function retrieves the current Indirection Table for the specified network interface, and returns an Indirstruct.

The SetIndir(intf string, setIndir SetIndir) function sets a new Indirection Table for the specified interface. The function accepts a SetIndir struct, which should have either: SetIndir.Equal value set or SetIndir.Weight slice set.

The function then calls the fillIndirTable, an Internal helper function that generates the Indirection Table based on the input parameters, following the same logic used in ethtool.c.

An usage example can be seen in theTestIndir(...) function in ethtool_test.go.

@safchain
Copy link
Owner

@VladimiroPaschali thanks for the contribution. Could you have a look at the CI issues.

@safchain safchain merged commit 4e0e68f into safchain:master Apr 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants