k8snetworkplumbingwg / ovs-cni

Open vSwitch CNI plugin
Apache License 2.0
218 stars 70 forks source link

Add support for automatic bridge selection in HW offload mode #301

Closed ykulazhenkov closed 3 months ago

ykulazhenkov commented 6 months ago

Add support for automatic bridge selection in HW offload mode

If deviceID argument is passed it can be used for automatic bridge selection: VF deviceID > PF > Bond(Optional) > Bridge

What this PR does / why we need it: This is required to optimize HW offloading use-case when Virtual Functions from multiple NICs on a host are exposed as a single resource.

Example:

We have two NICs on a host, and we want to expose all VFs from these NICs as a single resource. To support HW offloading, each NIC should be attached to a separate OVS bridge. Without changes from this PR, it is not possible to define NetworkAttachDefinition for OVS-cni, which will cover this use-case, because you need to explicitly specify the bridge name in the CNI config.

After changes from this PR, it is possible to define NetworkAttachDefinition without the bridge name and rely on the fact that ovs-cni will be able to automatically select the right OVS bridge (bridge to which NIC is attached) from the allocated Virtual Function (allocated by sriov device plugin, injected in deviceID field by multus)

Special notes for your reviewer: Context is Software bridge management feature in sriov-network-operator

Release note:

Added support for automatic bridge selection for HW offloading use-case.
if `deviceID` argument is set, then it is possible to omit `bridge` argument. Bridge will be automatically selected by the CNI plugin by following
the chain: Virtual Function PCI address (provided in `deviceID` argument) > Physical Function > Bond interface 
(optional, if Physical Function is part of a bond interface) > ovs bridge

cc @zeeke @adrianchiris @SchSeba

kubevirt-bot commented 6 months ago

Hi @ykulazhenkov. 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/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
phoracek commented 5 months ago

/retest

phoracek commented 4 months ago

@ykulazhenkov hi. I believe that @SchSeba is planning to review this and help getting it merged once he's back at work.

SchSeba commented 4 months ago

Hi @ykulazhenkov can you please rebase I would like to see the github actions green on this one

ykulazhenkov commented 4 months ago

Hi @ykulazhenkov can you please rebase I would like to see the github actions green on this one

@SchSeba done

ykulazhenkov commented 3 months ago

@SchSeba Thanks for the review, Sebastian. I addressed your comments

kubevirt-bot commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: e0ne, 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
SchSeba commented 3 months ago

/retest