Skip to content

Cascade PortChannel admin shutdown to member ports#4424

Open
spandan-nexthop wants to merge 1 commit intosonic-net:masterfrom
spandan-nexthop:spandan-nexthop.pc-shut-member-cascade
Open

Cascade PortChannel admin shutdown to member ports#4424
spandan-nexthop wants to merge 1 commit intosonic-net:masterfrom
spandan-nexthop:spandan-nexthop.pc-shut-member-cascade

Conversation

@spandan-nexthop
Copy link
Copy Markdown

When a PortChannel is admin-shut, force all member ports admin-down. This allows the peer device to immediately detect link-down instead of waiting for LACP timeout.
On PortChannel admin-up (or member removal/LAG deletion), restore each member to its configured admin state from APP_DB.

What I did
Added cascadeLagAdminStatusToMembers() in portsorch which propagates LAG admin-down to member ports via setPortAdminStatus().
Added a guard in doPortTask() to prevent APP_DB from overriding the forced state.
On LAG admin-up (or member removal/LAG deletion), each member's configured admin status is restored to the intended state.

Why I did it
When a PortChannel is admin-shut, its member links' transceivers remain physically active.
The peer device must rely on LACP timeout to detect the PortChannel is down, which introduces unnecessary delay (up to 90s with long timeout).

How I verified it

  • New DVS tests: test_lag_admin_down_cascades_to_members, test_lag_deletion_restores_member_admin_state
  • On hardware: config interface shutdown PortChannelXXXX → verify member port LEDs go off and peer detects link-down immediately

Details if related
Fixes: sonic-net/sonic-buildimage#26494

cc: @venkit-nexthop @kalash-nexthop

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

When a PortChannel is admin-shut, force all member ports admin-down.
This allows the peer device to immediately detect link-down instead
of waiting for LACP timeout.
On PortChannel admin-up (or member removal/LAG deletion),
restore each member to its configured admin state from APP_DB.

Signed-off-by: Spandan Chowdhury <spandan@nexthop.ai>
@spandan-nexthop spandan-nexthop force-pushed the spandan-nexthop.pc-shut-member-cascade branch from c849920 to b8f0a86 Compare April 2, 2026 17:05
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

Enhancement: Cascade PortChannel admin shutdown to member ports

2 participants