Skip to content

LAG: Accept user specified lag.ifindex, also when listed in descending order #2248

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions netsim/modules/lag.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,12 @@ def set_lag_ifindex(bond: Box, intf: Box, topology: Box) -> bool:
if is_mside: # For M: side we need matching lag.ifindex
if next_ifindex is None: # Do we have a local preference?
next_ifindex = _dataplane.get_next_id(ID_SET) # No -> allocate globally
bond.lag.ifindex = link_lag_ifindex = next_ifindex # Put on the link for the other M side to match
bond.lag.ifindex = link_lag_ifindex = next_ifindex # Put on the link for the other M side to match
else:
if next_ifindex is None:
next_ifindex = topology.defaults.lag.start_lag_id # Start at start_lag_id (default 1)
link_lag_ifindex = next_ifindex
intf.lag.ifindex = link_lag_ifindex # Put it on the interface for bond naming
elif next_ifindex and next_ifindex>link_lag_ifindex:
link_lag_ifindex = next_ifindex # Cannot accept link level lag.ifindex
if is_mside:
bond.lag.ifindex = next_ifindex # Override the unacceptable link value
_n._lag_ifindex = link_lag_ifindex + 1 # Track next ifindex to assign, per node
intf.lag.ifindex = intf_lag_ifindex = link_lag_ifindex
elif link_lag_ifindex is None or is_mside:
Expand Down
Loading