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 5/x] Add skipVFconfiguration option for generic_plugin #614

Merged

Conversation

ykulazhenkov
Copy link
Collaborator

@ykulazhenkov ykulazhenkov commented Feb 2, 2024

Add skipVFconfiguration option for generic_plugin

If WithSkipVFConfiguration() option is passed during the plugin initialization, then the plugin will configure PFs and create VFs, but will skip VF configuration phase.

This option is used by the systemd service during the pre phase. At this point we only need to create VFs but not configure them(e.g. bind to driver, create VDPA device, etc)

In the post phase the plugin will be called without this option and as a result will execute full plugin flow, meaning it will re-check that VFs are create and will continue configurations of VFs.

cc @adrianchiris @zeeke @SchSeba

Copy link

github-actions bot commented Feb 2, 2024

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 2, 2024

Pull Request Test Coverage Report for Build 7929101016

Details

  • -75 of 182 (58.79%) changed or added relevant lines in 7 files are covered.
  • 6 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+3.9%) to 33.817%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/sriov-network-config-daemon/service.go 3 4 75.0%
pkg/platforms/openstack/openstack.go 0 1 0.0%
api/v1/helper.go 2 6 33.33%
pkg/plugins/generic/generic_plugin.go 12 18 66.67%
pkg/helper/mock/mock_helper.go 0 8 0.0%
pkg/host/mock/mock_host.go 0 8 0.0%
pkg/host/internal/sriov/sriov.go 90 137 65.69%
Files with Coverage Reduction New Missed Lines %
cmd/sriov-network-config-daemon/service.go 1 74.47%
pkg/consts/constants.go 2 50.0%
pkg/host/internal/sriov/sriov.go 3 42.44%
Totals Coverage Status
Change from base Build 7918604669: 3.9%
Covered Lines: 4058
Relevant Lines: 12000

💛 - Coveralls

@ykulazhenkov ykulazhenkov marked this pull request as draft February 8, 2024 10:47
Copy link

github-actions bot commented Feb 9, 2024

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

github-actions bot commented Feb 9, 2024

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

github-actions bot commented Feb 9, 2024

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 changed the title [switchdev 5/x] Add VendorPluginWithPhases interface and implement it in generic_plugin [switchdev 5/x] Add skipVFconfiguration option for generic_plugin Feb 9, 2024
@ykulazhenkov ykulazhenkov marked this pull request as ready for review February 9, 2024 14:25
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.

Left one minor comment. Overall PR LGTM

return nil
}

func (s *sriov) ConfigSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetworkv1.InterfaceExt, skipVFConfiguration bool) error {
Copy link
Member

Choose a reason for hiding this comment

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

can we make this function private and remove it from the interface?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good. I made the function private.

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

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

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
Copy link
Collaborator Author

@zeeke thx for the review, I addressed your comment.

api/v1/helper.go Show resolved Hide resolved
return nil
}

func (s *sriov) configSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetworkv1.InterfaceExt, skipVFConfiguration bool) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

still need to give this one a bit more thought ...

Copy link
Collaborator

Choose a reason for hiding this comment

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

We had an offline discussion about it. latest iteration is OK imo.
(had some concerns about how this plays out with Externally managed)

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
Copy link
Collaborator Author

ykulazhenkov commented Feb 14, 2024

I updated PR to avoid usage of the information from the status field during the configuration. The status field may can contain outdated information because, for example, eswitch mode or VF count was changed by the previous step of the configuration.

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

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.

@adrianchiris
Copy link
Collaborator

overall im LGTM. lets have a final pass after rebase.

If skipVFConfiguration flag is set, the function will
configure PF and create VFs on it, but will skip VFs configuration.
This change is required to be able to use this function
in the pre configuration phase in systemd mode.

Signed-off-by: Yury Kulazhenkov <[email protected]>
If WithSkipVFConfiguration() option is passed
during the plugin initialization, then
the plugin will configure PFs and create VFs,
but will skip VF configuration phase.

This is required to support pre configuration
phase in systemd mode.

Signed-off-by: Yury Kulazhenkov <[email protected]>
During the pre phase the plugin should be called
with WithSkipVFConfiguration option to
prevent VF configuration.

In the post phase plugin should be executed as is.

Signed-off-by: Yury Kulazhenkov <[email protected]>
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

@@ -258,8 +258,8 @@ func (s *sriov) DiscoverSriovDevices(storeManager store.ManagerInterface) ([]sri
iface.Name = name
iface.Mac = s.networkHelper.GetNetDevMac(name)
iface.LinkSpeed = s.networkHelper.GetNetDevLinkSpeed(name)
iface.LinkType = s.GetLinkType(name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can get mtu, mac, link type from netlink Link obj and avoid a bunch of file operations.

not related to this PR. i will submit a small refactor to DiscoverSriovDevices.

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!

@adrianchiris adrianchiris merged commit 644acd4 into k8snetworkplumbingwg:master Feb 19, 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.

4 participants