Skip to content

fixes for bridge port removing - #149

Merged
vincentchiang-ec merged 3 commits into
202311.Xfrom
fix_remove_bridge_port
Dec 3, 2025
Merged

fixes for bridge port removing#149
vincentchiang-ec merged 3 commits into
202311.Xfrom
fix_remove_bridge_port

Conversation

@vincentchiang-ec

Copy link
Copy Markdown
Contributor

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

Yurii Tretiakov 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>
@vincentchiang-ec
vincentchiang-ec merged commit 02c2c8a into 202311.X Dec 3, 2025
1 check passed
@vincentchiang-ec
vincentchiang-ec deleted the fix_remove_bridge_port branch December 3, 2025 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant