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 9/9] Enable new switchdev implementation #643

Merged
merged 7 commits into from
Mar 28, 2024

Conversation

ykulazhenkov
Copy link
Collaborator

@ykulazhenkov ykulazhenkov commented Feb 26, 2024

This PR contains multiple commits to disable and remove current switchdev implementation and to enable new one.

Depends on #628 and #642

This PR should be the last one in the series

cc @adrianchiris @zeeke @SchSeba

last 5 commits are relevant for the PR

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 marked this pull request as draft February 26, 2024 14:37
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 26, 2024

Pull Request Test Coverage Report for Build 8373549591

Details

  • 189 of 289 (65.4%) changed or added relevant lines in 9 files are covered.
  • 24 unchanged lines in 8 files lost coverage.
  • Overall coverage increased (+0.7%) to 38.486%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/daemon/daemon.go 1 2 50.0%
pkg/plugins/generic/generic_plugin.go 0 1 0.0%
pkg/host/internal/udev/udev.go 36 40 90.0%
api/v1/helper.go 12 19 63.16%
pkg/plugins/k8s/k8s_plugin.go 73 85 85.88%
pkg/host/mock/mock_host.go 34 48 70.83%
pkg/host/internal/sriov/sriov.go 21 44 47.73%
pkg/helper/mock/mock_helper.go 10 48 20.83%
Files with Coverage Reduction New Missed Lines %
pkg/daemon/daemon.go 1 47.37%
pkg/host/internal/service/service.go 2 17.04%
pkg/client/clientset/versioned/typed/sriovnetwork/v1/fake/fake_sriovnetworknodestate.go 2 48.65%
pkg/host/internal/udev/udev.go 3 67.86%
api/v1/helper.go 3 46.92%
pkg/plugins/k8s/k8s_plugin.go 4 77.51%
pkg/host/internal/sriov/sriov.go 4 43.93%
pkg/helper/mock/mock_helper.go 5 20.67%
Totals Coverage Status
Change from base Build 8340797420: 0.7%
Covered Lines: 4855
Relevant Lines: 12615

💛 - Coveralls

@ykulazhenkov ykulazhenkov marked this pull request as ready for review February 26, 2024 16:46
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.

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-turn-on-switchdev branch from 4157e8f to a271d5a Compare March 5, 2024 10:36
Copy link

github-actions bot commented Mar 5, 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 reopened this Mar 5, 2024
Copy link

github-actions bot commented Mar 5, 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 reopened this Mar 8, 2024
Copy link

github-actions bot commented Mar 8, 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

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

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

partial review.
nice work one comment that is critical is the removed of the vfs to skip I didn't see any replacement for that functionallity

# Restart system services
chroot $chroot_path /bin/bash -c systemctl restart NetworkManager.service >/dev/null 2>&1 || true
chroot $chroot_path /bin/bash -c systemctl restart ovs-vswitchd.service >/dev/null 2>&1 || true
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

we do not release ovs and network manager anymore on cleanup?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't patch NetworkManager anymore so there is no need to reload it. Restart of the ovs was always useless, because it doesn't not change anything (hw-offloading option is stored in ovsdb and will be preserved after restart)

log.Log.Error(err, "PrepareVFRepUdevRule(): failed to write representor name UDEV script")
return err
}
if err := os.Chmod(targetPath, 0755); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if we write the file with that permission should we also change the permissions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Permissions from WriteFile function are used for new files only. We need to hanlde scenario with exisiting file as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

this file may be written with permissions other than 755? or you want to handle a case where the file's permissions somehow changed ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this file may be written with permissions other than 755? or you want to handle a case where the file's permissions somehow changed ?

Yes, to handle permission change. I'm fine to remove this call if you both think that this is not needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

im fine with either :)

}

// skipConfigVf Use systemd service to configure switchdev mode or BF-2 NICs in OpenShift
func skipConfigVf(ifSpec sriovnetworkv1.Interface, ifStatus sriovnetworkv1.InterfaceExt, mlxHelper mlx.MellanoxInterface) (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.

how we handle the BF cards if we remove this one?

Copy link
Collaborator Author

@ykulazhenkov ykulazhenkov Mar 14, 2024

Choose a reason for hiding this comment

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

I assume there is no need for special handling of BF cards anymore. Creation of VFs should work in both BF modes(DPU and NIC) when the operator is in any configuration mode(in daemon or in systemd mode). If you need to create VFs on boot, e.g. for hw-offloading use-case, you need to switch the operator to systemd mode.

Did I miss something?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we are running some validations internally base on OCP deployment and BF2 just to be sure everything continue to work as expected

cc @zeeke

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.

Great work @ykulazhenkov went over the PR added some nits.
Overall LGTM from my side.

any idea why k8s CI is failing ?

@SchSeba
Copy link
Collaborator

SchSeba commented Mar 18, 2024

Hi @ykulazhenkov will you be able to rebase this PR please :)

Additional checks to perform:
- Eswitch mode
- VdpaType for VFs

Signed-off-by: Yury Kulazhenkov <[email protected]>
PrepareVFRepUdevRule() function creates helper scrip
for udev rules that rename VF representors
in switchdev mode.

Signed-off-by: Yury Kulazhenkov <[email protected]>
This commit removes services and scripts related
to old switchdev implementations

Signed-off-by: Yury Kulazhenkov <[email protected]>
@ykulazhenkov ykulazhenkov force-pushed the pr-turn-on-switchdev branch from f5678a8 to ca9cc92 Compare March 18, 2024 11:59
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 Mar 18, 2024

Hi @ykulazhenkov will you be able to rebase this PR please :)

@SchSeba
done, thx

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.

Signed-off-by: Yury Kulazhenkov <[email protected]>
Fix the function to correctly handle
devices which doesn't support
software_steering

Signed-off-by: Yury Kulazhenkov <[email protected]>
@ykulazhenkov ykulazhenkov force-pushed the pr-turn-on-switchdev branch from e0bfa73 to b7fb8ce Compare March 20, 2024 18:49
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-turn-on-switchdev branch from b7fb8ce to 9cdd37c Compare March 21, 2024 09:53
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-turn-on-switchdev branch from 9cdd37c to c5a086f Compare March 21, 2024 10:07
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-turn-on-switchdev branch from c5a086f to b40c9ba Compare March 21, 2024 10:36
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.

The operator will create two rules specific
for PFs in swithcdev mode:
- rule to persist PF name after switching to switchdev mode
- rule to rename VF representors

First rule can be applied before PF is switched to switchdev
mode. Second rule can be applied only when the PF is already
in switchdev mode(phys_port_name and phys_switch_id) may
not be available when PF is in legacy mode.

reload of UDEV rules is required to apply VF representor rule
for already created VFs.

Signed-off-by: Yury Kulazhenkov <[email protected]>
@ykulazhenkov ykulazhenkov force-pushed the pr-turn-on-switchdev branch from b40c9ba to 0bdf464 Compare March 21, 2024 10:37
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

@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.

Glad to see bash scripts removal!

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.

No regression has been showed against OpenShift/OVNk Hardware Offloading scenario

LGTM

@zeeke zeeke merged commit 160d177 into k8snetworkplumbingwg:master Mar 28, 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.

6 participants