k8snetworkplumbingwg / ovs-cni

Open vSwitch CNI plugin
Apache License 2.0
224 stars 71 forks source link

Add support for userspace device drivers with HW offload mode #322

Closed kim-tae-kyung closed 3 months ago

kim-tae-kyung commented 4 months ago

Add support for SR-IOV Virtual Functions (VFs) using both hardware offload (switchdev) and userspace device drivers such as vfio-pci. If the MAC address is provided via arguments, update the VF’s MAC address accordingly using netlink.

What this PR does / why we need it:

This feature is essential for scenarios where SR-IOV VFs require both userspace device drivers and hardware offload. For instance, containerized network functions with Intel E810 may enable eswitch switchdev mode for hardware offload while using the vfio-pci driver for running DPDK or VPP. Another use case is the KubeVirt SR-IOV Interface. After merging this PR, users can create a KubeVirt VM supported by OVS hardware offload without modifying the KubeVirt source code.

Special notes for your reviewer:

Even in scenarios where userspace device drivers are employed, and there is no netdevice for the VF on the host, the CNI should still return the name and sandbox for the VF interface to be recognized by Multus.

Release note:

- Support HW offload with userspace device driver
- Support MAC address update in HW offload mode
kubevirt-bot commented 4 months ago

Hi @kim-tae-kyung. Thanks for your PR.

I'm waiting for a k8snetworkplumbingwg member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
phoracek commented 4 months ago

@kim-tae-kyung thanks for the PR.

@ykulazhenkov any chance you would be interested in reviewing this? Sadly, I'm not all that familiar with the SR-IOV portion of the project, and I don't feel confident reviewing this.

kim-tae-kyung commented 3 months ago

@ykulazhenkov Thanks for your review! I have reflected your comments. You made me realize that there were missing features and duplicated codes.

ykulazhenkov commented 3 months ago

@phoracek The PR looks good to me. Can you trigger the CI check?

phoracek commented 3 months ago

/test pull-e2e-ovs-cni

phoracek commented 3 months ago

Thanks a lot for the review @ykulazhenkov

@SchSeba do you also want to take a look before we merge this?

kubevirt-bot commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kim-tae-kyung, SchSeba, ykulazhenkov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/k8snetworkplumbingwg/ovs-cni/blob/main/OWNERS)~~ [SchSeba] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
phoracek commented 3 months ago

/lgtm

kim-tae-kyung commented 3 months ago

Thanks to All!