Skip to content

Added support for Indirection Table editing#98

Merged
safchain merged 7 commits intosafchain:masterfrom
VladimiroPaschali:master
Apr 30, 2025
Merged

Added support for Indirection Table editing#98
safchain merged 7 commits intosafchain:masterfrom
VladimiroPaschali:master

Conversation

@VladimiroPaschali
Copy link
Copy Markdown
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
Copy Markdown
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