Fix OVS bridge grouping to create single bridge with multiple uplinks#128
Merged
almaslennikov merged 1 commit intoMellanox:network-operator-26.1.xfrom Jan 15, 2026
Conversation
When SriovNetworkNodePolicy specifies groupingPolicy: all, the operator
should create a single OVS bridge with all matching PFs as uplinks.
Previously, it was incorrectly creating separate bridges for each PF.
Changes:
- Update ApplyBridgeConfig to propagate GroupingPolicy to node state
- Add applyGroupedBridgeConfig() to create single bridge configuration
with all matching PFs as uplinks when groupingPolicy is "all"
- Modify CreateOVSBridge() to support multiple uplinks per bridge
- Remove ConfigureBridgesGrouping() as grouped bridge creation is now
handled entirely by the controller via ApplyBridgeConfig
- Add unit tests for grouped bridge functionality
Fixes issue where applying a policy like:
```
bridge:
ovs:
bridge:
groupingPolicy: all
```
Would create multiple bridges (br-ens2f0np0, br-ens2f1np1, etc.)
instead of a single bridge (br-<policy-name>) containing all PFs.
Signed-off-by: Alexander Maslennikov <amaslennikov@nvidia.com>
|
Thanks for your PR,
To skip the vendors CIs, Maintainers can use one of:
|
Greptile SummaryThis PR fixes OVS bridge grouping when Key changes:
Testing:
Architecture improvement: Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Controller
participant Policy as SriovNetworkNodePolicy
participant State as SriovNetworkNodeState
participant Daemon as GenericPlugin
participant Bridge as bridge.ConfigureBridges
participant OVS as ovs.CreateOVSBridge
Note over Controller,Policy: Controller applies policy to node state
Controller->>Policy: ApplyBridgeConfig(state)
alt groupingPolicy == "all"
Policy->>State: Set GroupingPolicy in state.Spec.Bridges
Policy->>Policy: applyGroupedBridgeConfig(state)
Policy->>State: Collect all matching interfaces as uplinks
Policy->>State: Sort uplinks by PCI address
Policy->>State: Delete existing per-PF bridges for these uplinks
Policy->>State: Create single bridge entry (br-{policyName}) with all uplinks
else no grouping policy
loop For each matching interface
Policy->>State: Create individual bridge (br-{pciAddr}) with single uplink
end
end
Note over Daemon,OVS: Daemon applies state to host
Daemon->>Bridge: ConfigureBridges(state.Spec.Bridges, state.Status.Bridges)
loop For each bridge in spec
Bridge->>OVS: CreateOVSBridge(bridgeConfig)
OVS->>OVS: Validate uplinks list (len >= 1)
OVS->>OVS: Save config to store
OVS->>OVS: Delete all uplink interfaces from any existing bridges
OVS->>OVS: Delete/recreate bridge if config changed
OVS->>OVS: Create bridge with specified config
loop For each uplink in config
OVS->>OVS: Add uplink interface to bridge
end
end
|
Comment on lines
+467
to
+469
| // applyGroupedBridgeConfig creates a single OVS bridge entry with all matching interfaces as uplinks | ||
| // when groupingPolicy is "all". The first uplink will be used to create the bridge, | ||
| // and the remaining uplinks will be added by the daemon using AddInterfaceToOVSBridge. |
There was a problem hiding this comment.
syntax: Comment is outdated - all uplinks are added in CreateOVSBridge() via the loop at ovs.go:182-196, not via separate AddInterfaceToOVSBridge calls
Suggested change
| // applyGroupedBridgeConfig creates a single OVS bridge entry with all matching interfaces as uplinks | |
| // when groupingPolicy is "all". The first uplink will be used to create the bridge, | |
| // and the remaining uplinks will be added by the daemon using AddInterfaceToOVSBridge. | |
| // applyGroupedBridgeConfig creates a single OVS bridge entry with all matching interfaces as uplinks | |
| // when groupingPolicy is "all". All uplinks will be added to the bridge by CreateOVSBridge. |
rollandf
approved these changes
Jan 15, 2026
ece76a1
into
Mellanox:network-operator-26.1.x
11 of 14 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When SriovNetworkNodePolicy specifies groupingPolicy: all, the operator should create a single OVS bridge with all matching PFs as uplinks. Previously, it was incorrectly creating separate bridges for each PF.
Changes:
Fixes issue where applying a policy like:
Would create multiple bridges (br-ens2f0np0, br-ens2f1np1, etc.) instead of a single bridge (br-) containing all PFs.