Skip to content

Orchagent - reassert bridge port admin state on VLAN member re-add - #4773

Draft
johanna-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:orchagent-reassert-bridge-port-admin
Draft

Orchagent - reassert bridge port admin state on VLAN member re-add#4773
johanna-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:orchagent-reassert-bridge-port-admin

Conversation

@johanna-nexthop

Copy link
Copy Markdown

What I did

Updated PortsOrch::addBridgePort() to reassert the bridge port state when reusing an existing bridge port:

  • Set SAI_BRIDGE_PORT_ATTR_ADMIN_STATE to true.
  • Restore the host interface VLAN tag mode to SAI_HOSTIF_VLAN_TAG_KEEP.
  • Handle SAI failures using the existing status-processing logic.
  • Return failure if restoring the host interface VLAN tag mode fails.

Why I did it

A bridge port can remain present after a failed or incomplete removal while being left administratively disabled or with an incorrect host interface VLAN tag mode.

When the VLAN member is added again, the existing bridge port is reused. Previously, its state was not reasserted, which could leave the port disabled or incorrectly configured.

This change ensures that reused bridge ports are restored to the expected operational state before continuing.

How I verified it

Added the addBridgePortReassertsAdminStateOnReuse unit test, which:

  • Creates a bridge port for Ethernet0.
  • Forces its admin state to false.
  • Re-adds the port using the existing bridge port.
  • Verifies that SAI_BRIDGE_PORT_ATTR_ADMIN_STATE is restored to true.

Details if related

Signed-off-by: Johanna <johanna@nexthop.ai>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks!

---Powered by SONiC BuildBot

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.

2 participants