[teamsyncd]: Whenever a portchannel's operstate goes sown, disable all member ports that are still up otherwise #3998
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.
What I did
In the portchannel state reactor code (
onMsg-->addLag), when portchannel'soperstatechanges, trigger the code that updates member interface's status up to date in appl_db (onChange). And set individual member interface state to disabled there if port channel is operdown. This prevents the member port from continuing to forward traffic despite port channel not up.This fixes: sonic-net/sonic-buildimage#2066
Why I did it
In our testing we found that when
min_linkis set to 2 and we have only one member interface UP in a portchannel, the portchannel is correctly put inoperdownstate by teamd. However, the remaining UP interface remains in selected state in the portchannel, and keeps forwarding the traffic. The fix addresses that by deselecting all the remaining UP interfaces in a portchannel when it goes down.How I verified it
Before my fix, when the
min_link==2requirement wasn't met:See above
Ethernet360is still inselectedstate, and thus continues to forward L2 traffic that was broadcasted into same vlan domain that Po1 is part of, despite Po1 being inDwstate.With my fix when
min_link==2requirement wasn't met:See above
Ethernet360innot syncedstate due to us disabling the member port in lag table in appl_db. The interface isn't forwarding traffic anymore due to effectively being "disabled" in hardware.And when
min_link==2requirement is met agatin, it gets "enabled":Details if related