fixes for bridge port removing - #149
Merged
Merged
Conversation
added 3 commits
December 3, 2025 02:26
During remove bridge port there is possible race can occur In function removeBridgePort there is present check of port.m_fdb_count counter which decreases after flush notification processed. This counter decreases directly in m_portList DB. In removeBridgePort several times m_portList updated with entire port structure including m_fdb_count counter. It can be situation when decrement occured right after data from m_portList is copied to port structure with non decreased counter. Further m_portList will be updated with old m_fdb_count and because flush already occured this counter stay non decremented forever. The proposal is to change only specific fields excluding m_fdb_count. Signed-off-by: Yurii Tretiakov <ytretiakov@larch-networks.com> Signed-off-by: Anton Parkhomenko <aparkhomenko@larch-networks.com>
Fdb entry consist of mac, vlan and port_name fields. It seems that during seeking through map there are only mac and vlan is taken into account. So when mac move occured, new entry with updated port_name is not placed in the map, only just changed fdbdata that leads to incorrect port m_fdb_count decrement in the future. The proposal is to remove old entry from map when mac move occured. This guarantee placement of new entry in the map. Signed-off-by: Yurii Tretiakov <ytretiakov@larch-networks.com> Signed-off-by: Anton Parkhomenko <aparkhomenko@larch-networks.com>
…warm reboot issue During warm reboot fdb DB m_entries restored via addFdbEntry function. Port_name field of fdb entry stays empty, that leads to impossibility of decrementing m_fdb_count in the future. To prevent this just add port_name into fdb entry before addFdbEntry call. Signed-off-by: Yurii Tretiakov <ytretiakov@larch-networks.com> Signed-off-by: Anton Parkhomenko <aparkhomenko@larch-networks.com>
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.
What I did
Provided fixes for existing issues in orchagent related to removing of bridge port and FDB counters
Why I did it
To fix issues raised by EC
How I verified it
Build fresh SONiC image and run tests
Please update src/sonic-swss ref also in sonic-buildimage repo