feat(neutron): split UnderstackDriver into L2 and Undersync mechanism drivers#2043
Open
nidzrai wants to merge 1 commit into
Open
feat(neutron): split UnderstackDriver into L2 and Undersync mechanism drivers#2043nidzrai wants to merge 1 commit into
nidzrai wants to merge 1 commit into
Conversation
cardoe
reviewed
May 18, 2026
skrobul
approved these changes
May 20, 2026
| understack_driver.trunk_driver = understack_trunk_driver | ||
|
|
||
| port_context.allocate_dynamic_segment.assert_called_once() | ||
| port_context.continue_binding.assert_called_once() |
Collaborator
There was a problem hiding this comment.
This is good, but I think it would be valuable to assert that correct arguments were given (segmentation_id and next_segment_to_bind), something like this:
def test_with_no_trunk(
self,
mocker,
port_context,
understack_driver,
understack_trunk_driver,
vlan_network_segment,
):
mocker.patch.object(
port_context, "allocate_dynamic_segment", return_value=vlan_network_segment
)
mocker.patch.object(port_context, "continue_binding")
type(port_context).segments_to_bind = mocker.PropertyMock(
return_value=port_context.network.network_segments
)
understack_driver.bind_port(port_context)
understack_driver.trunk_driver = understack_trunk_driver
port_context.allocate_dynamic_segment.assert_called_once()
# Find the VXLAN segment that should be used as parent segment_id
vxlan_segment = next(
s for s in port_context.segments_to_bind
if s[api.NETWORK_TYPE] == "vxlan"
)
port_context.continue_binding.assert_called_once_with(
segment_id=vxlan_segment[api.ID],
next_segments_to_bind=[vlan_network_segment],
)
mfencik
reviewed
May 20, 2026
Contributor
mfencik
left a comment
There was a problem hiding this comment.
Overall looks good, as I understand this is the first step in many as we want to separate all undersync operations to the understackundersync driver.
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.
Split the existing UnderstackDriver into two hierarchical ML2 mechanism drivers:
continue_binding() to pass the VLAN segment to the next driver
set_binding() to finalise the port as ACTIVE
Also fixes bind_port() to use context.segments_to_bind instead of
context.network.network_segments so the driver only sees segments for the
current binding level.
tested On dev stack, following are the logs to confirm the split working correctly.