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

[switchdev 7/x] Add function EnableHwTcOffload to the network pkg #628

Merged

Conversation

ykulazhenkov
Copy link
Collaborator

@ykulazhenkov ykulazhenkov commented Feb 12, 2024

This function ensures that hw-tc-offload feature is enabled for the interface if the interface supports it.
required to be compatible with the current switchdev implementation

uses github.com/safchain/ethtool lib

cc @adrianchiris @SchSeba @zeeke

depends on #633

only last commit to review

Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@coveralls
Copy link

coveralls commented Feb 12, 2024

Pull Request Test Coverage Report for Build 8051307951

Details

  • -41 of 125 (67.2%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 35.142%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/helper/mock/mock_helper.go 0 10 0.0%
pkg/host/mock/mock_host.go 0 10 0.0%
pkg/host/internal/lib/ethtool/ethtool.go 3 24 12.5%
Totals Coverage Status
Change from base Build 8050110093: 0.4%
Covered Lines: 4295
Relevant Lines: 12222

💛 - Coveralls

@ykulazhenkov ykulazhenkov changed the title [switchdev 6/x] Add function EnableHwTcOffload to the network pkg [switchdev 7/x] Add function EnableHwTcOffload to the network pkg Feb 21, 2024
@ykulazhenkov ykulazhenkov force-pushed the pr-enable-hw-tc-offload branch from c87a5f9 to 5c9c6fa Compare February 22, 2024 07:39
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

pkg/host/internal/lib/ethtool/ethtool.go Outdated Show resolved Hide resolved
pkg/host/internal/network/network.go Outdated Show resolved Hide resolved
pkg/host/internal/network/network.go Outdated Show resolved Hide resolved
@ykulazhenkov ykulazhenkov force-pushed the pr-enable-hw-tc-offload branch from 5c9c6fa to 7861d5b Compare February 22, 2024 10:14
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@ykulazhenkov ykulazhenkov requested a review from e0ne February 22, 2024 10:17
@ykulazhenkov ykulazhenkov force-pushed the pr-enable-hw-tc-offload branch from 7861d5b to a20d5e5 Compare February 22, 2024 10:33
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

Copy link
Collaborator

@adrianchiris adrianchiris left a comment

Choose a reason for hiding this comment

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

LGTM!

will require rebase once [switchdev 6/x] is merged

@ykulazhenkov ykulazhenkov force-pushed the pr-enable-hw-tc-offload branch from a20d5e5 to eb2cc96 Compare February 23, 2024 09:08
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@ykulazhenkov ykulazhenkov force-pushed the pr-enable-hw-tc-offload branch from eb2cc96 to d00c856 Compare February 26, 2024 14:21
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

Copy link
Collaborator

@adrianchiris adrianchiris left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@e0ne e0ne left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments

return err
}
if _, isKnown := knownFeatures[hwTcOffloadFeatureName]; !isKnown {
log.Log.V(2).Info("EnableHwTcOffload(): can't enable feature, feature is not supported", "device", ifaceName)
Copy link
Member

Choose a reason for hiding this comment

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

I think this can log with V(0), or it can even return an error.

It really depends on how you're going to use this function, but if the user set a flag somewhere to enable HwTcOffload, it is expected to work or to get an error somewhere. WDYT?
Same for L329

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agree, I fixed the log level

This function ensures that hw-tc-offload
feature is enabled for the interface if the interface
supports it.

relies on github.com/safchain/ethtool lib

Signed-off-by: Yury Kulazhenkov <[email protected]>
@ykulazhenkov ykulazhenkov force-pushed the pr-enable-hw-tc-offload branch from d00c856 to 154a9ed Compare February 26, 2024 15:23
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

Copy link
Member

@zeeke zeeke left a comment

Choose a reason for hiding this comment

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

LGTM

@zeeke zeeke merged commit ebf0adc into k8snetworkplumbingwg:master Feb 27, 2024
12 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.

5 participants