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

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

Merged

Conversation

ykulazhenkov
Copy link
Contributor

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 kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 1, 2024
@kubevirt-bot
Copy link
Collaborator

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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kubevirt-bot kubevirt-bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 1, 2024
@phoracek
Copy link
Member

phoracek commented Mar 5, 2024

/retest

Copy link

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

LGTM

@phoracek
Copy link
Member

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

@SchSeba
Copy link
Collaborator

SchSeba commented Apr 25, 2024

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

@ykulazhenkov
Copy link
Contributor Author

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

@SchSeba done

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.

thanks I like this image!

just one comment that I am not sure

pkg/sriov/sriov.go Show resolved Hide resolved
bridgeName, err = driver.FindBridgeByInterface(uplinkName)
if err != nil {
errList = append(errList,
fmt.Errorf("failed to get bridge name - failed to find bridge name by uplink name %s: %v", bridgeName, err))
Copy link
Collaborator

Choose a reason for hiding this comment

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

bridgeName -> uplinkName

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

pkg/sriov/sriov.go Outdated Show resolved Hide resolved
If deviceID argument is passed it can be used for automatic
bridge selection: VF deviceID > PF > Bond(Optional) > Bridge

Signed-off-by: Yury Kulazhenkov <[email protected]>
@ykulazhenkov
Copy link
Contributor Author

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

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.

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label May 2, 2024
@kubevirt-bot
Copy link
Collaborator

[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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 2, 2024
@SchSeba
Copy link
Collaborator

SchSeba commented May 2, 2024

/retest

@kubevirt-bot kubevirt-bot merged commit 6f8174b into k8snetworkplumbingwg:main May 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants