Skip to content

[Workaround for XSight SAI] Updated VLAN member task to improve logic for removing VLAN members and handling bridge ports - #145

Merged
gord1306 merged 1 commit into
edge-core:202311.Xfrom
chenkelly:202311.X.FDB
Oct 2, 2025
Merged

[Workaround for XSight SAI] Updated VLAN member task to improve logic for removing VLAN members and handling bridge ports#145
gord1306 merged 1 commit into
edge-core:202311.Xfrom
chenkelly:202311.X.FDB

Conversation

@chenkelly

Copy link
Copy Markdown
Contributor

What I did
Sync 2838438
Perform platform checking because XSAI currently lacks FDB flush notification support.
Ensured proper handling of FDB entries during bridge port removal.

…nd handling bridge ports.

Ensured proper handling of FDB entries during bridge port removal.
@chenkelly
chenkelly requested a review from gord1306 October 1, 2025 06:08
@gord1306
gord1306 requested a review from Copilot October 1, 2025 08:37
@chenkelly chenkelly changed the title Updated VLAN member task to improve logic for removing VLAN members and handling bridge ports, restricted to the xsight platform only. [Workaround for XSight SAI] Updated VLAN member task to improve logic for removing VLAN members and handling bridge ports Oct 1, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the VLAN member task to improve logic for removing VLAN members and handling bridge ports, specifically for the xsight platform. The changes add platform-specific behavior to handle limitations in XSAI FDB flush notification support.

  • Added platform checking to conditionally handle VLAN member removal
  • Implemented different bridge port removal logic for xsight platform
  • Added platform-specific FDB entry handling during bridge port removal

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread orchagent/portsorch.cpp
else if (op == DEL_COMMAND)
{
if (getPort(vlan_alias, vlan) && vlan.m_members.find(port_alias) != vlan.m_members.end())
string platform = getenv("platform") ? getenv("platform") : "";

Copilot AI Oct 1, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform string is retrieved multiple times in the same method (lines 4684 and 5905). Consider retrieving it once at the beginning of the method and reusing the variable to avoid redundant environment variable lookups.

Copilot uses AI. Check for mistakes.
Comment thread orchagent/portsorch.cpp
if (getPort(vlan_alias, vlan) && vlan.m_members.find(port_alias) != vlan.m_members.end())
string platform = getenv("platform") ? getenv("platform") : "";

if (platform == XS_PLATFORM_SUBSTRING)

Copilot AI Oct 1, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constant XS_PLATFORM_SUBSTRING is used but not defined in this diff. Ensure this constant is properly defined and consider using a more descriptive name that clearly indicates it's checking for the xsight platform.

Copilot uses AI. Check for mistakes.
Comment thread orchagent/portsorch.cpp
Comment on lines +4688 to +4705
if (getPort(vlan_alias, vlan) && vlan.m_members.find(port_alias) != vlan.m_members.end())
{
it++;
continue;
if (removeVlanMember(vlan, port))
{
if (m_portVlanMember[port.m_alias].empty())
{
removeBridgePort(port);
}
it = consumer.m_toSync.erase(it);
}
else
{
it++;
}
}
else
/* Cannot locate the VLAN */
it = consumer.m_toSync.erase(it);

Copilot AI Oct 1, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform-specific logic duplicates the existing logic below (lines 4709-4728) with only minor differences. Consider refactoring this into a common function that takes platform-specific behavior as parameters to reduce code duplication.

Copilot uses AI. Check for mistakes.
@gord1306
gord1306 merged commit 83abd99 into edge-core:202311.X Oct 2, 2025
1 check passed
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.

3 participants