Skip to content

Fix unused ports being admin-up in t1-smartswitch-ha topology#22769

Open
nnelluri-cisco wants to merge 3 commits intosonic-net:masterfrom
nnelluri-cisco:fix/t1-smartswitch-ha-admin-down-ports
Open

Fix unused ports being admin-up in t1-smartswitch-ha topology#22769
nnelluri-cisco wants to merge 3 commits intosonic-net:masterfrom
nnelluri-cisco:fix/t1-smartswitch-ha-admin-down-ports

Conversation

@nnelluri-cisco
Copy link
Contributor

@nnelluri-cisco nnelluri-cisco commented Mar 6, 2026

For t1-smartswitch-ha, ports not connected to VMs or DPUs (Ethernet96-Ethernet208) were incorrectly set to admin-up in the generated golden_config_db.json because the full PORT table from minigraph (which defaults all ports to admin-up) was copied.

After the DPU loop, detect unused ports by checking INTERFACE and PORTCHANNEL_MEMBER tables, and set admin_status=down for any port that is neither connected to a VM nor a DPU port.

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • [ X] 202505
  • [X ] 202511

How did you do it?

In generate_smartswitch_golden_config_db() within generate_golden_config_db.py, after the DPU port loop, added logic specific to t1-smartswitch-ha topology to detect unused ports
and set their admin_status to down in the generated golden_config_db.json.

Unused ports are identified by checking that they are absent from both the INTERFACE table (T0 direct links and DPU interfaces) and the PORTCHANNEL_MEMBER table (T2 spine LACP
members), and are not DPU ports.

How did you verify/test it?

Deployed testbed with t1-smartswitch-ha topology and verified that Ethernet96, Ethernet104, Ethernet112, Ethernet120, Ethernet128, Ethernet136, Ethernet144, Ethernet152,
Ethernet160, Ethernet168, Ethernet176, Ethernet184, Ethernet192, Ethernet200, and Ethernet208 show admin-down after load_minigraph.

Any platform specific information?

Applicable to smartswitch platforms (Cisco and Mellanox) used with t1-smartswitch-ha topology.

Supported testbed topology if it's a new test case?

t1-smartswitch-ha

Documentation

un used ports were down
Ethernet96 1552,1553,1554,1555,1556,1557,1558,1559 400G 9100 N/A etp96 routed down down N/A off
Ethernet104 1544,1545,1546,1547,1548,1549,1550,1551 400G 9100 N/A etp104 routed down down N/A off
Ethernet112 1296,1297,1298,1299,1300,1301,1302,1303 400G 9100 N/A etp112 routed down down N/A off
Ethernet120 1288,1289,1290,1291,1292,1293,1294,1295 400G 9100 N/A etp120 routed down down N/A off
Ethernet128 1280,1281,1282,1283,1284,1285,1286,1287 400G 9100 N/A etp128 routed down down N/A off
Ethernet136 1032,1033,1034,1035,1036,1037,1038,1039 400G 9100 N/A etp136 routed down down N/A off
Ethernet144 264,265,266,267,268,269,270,271 400G 9100 N/A etp144 routed down down N/A off
Ethernet152 272,273,274,275,276,277,278,279 400G 9100 N/A etp152 routed down down N/A off
Ethernet160 16,17,18,19,20,21,22,23 400G 9100 N/A etp160 routed down down N/A off
Ethernet168 256,257,258,259,260,261,262,263 400G 9100 N/A etp168 routed down down N/A off
Ethernet176 1024,1025,1026,1027,1028,1029,1030,1031 400G 9100 N/A etp176 routed down down N/A off
Ethernet184 768,769,770,771,772,773,774,775 400G 9100 N/A etp184 routed down down N/A off
Ethernet192 520,521,522,523,524,525,526,527 400G 9100 N/A etp192 routed down down N/A off
Ethernet200 776,777,778,779,780,781,782,783 400G 9100 N/A etp200 routed down down N/A off
Ethernet208 512,513,514,515,516,517,518,519 400G 9100 N/A etp208 routed down down N/A off
Ethernet216 528,529,530,531,532,533,534,535 400G 9100 N/A etp216 routed down down N/A off

For t1-smartswitch-ha, ports not connected to VMs or DPUs
(Ethernet96-Ethernet208) were incorrectly set to admin-up in the
generated golden_config_db.json because the full PORT table from
minigraph (which defaults all ports to admin-up) was copied verbatim.

After the DPU loop, detect unused ports by checking INTERFACE and
PORTCHANNEL_MEMBER tables, and set admin_status=down for any port
that is neither connected to a VM nor a DPU port.
@mssonicbld
Copy link
Collaborator

/azp run

@github-actions github-actions bot requested review from r12f, wangxin and xwjiang-ms March 6, 2026 06:04
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nnelluri-cisco
Copy link
Contributor Author

@zjswhhh @yue-fred-gao @aronovic
Please review and approve the change

PORTCHANNEL_MEMBER keys can use port aliases (e.g. etp1) instead of
interface names (e.g. Ethernet8), causing PortChannel member ports to
not be recognized as connected and incorrectly set to admin-down.

Build an alias-to-port-name mapping from the PORT table and resolve
aliases before adding members to connected_ports.
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 6, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nnelluri-cisco nnelluri-cisco force-pushed the fix/t1-smartswitch-ha-admin-down-ports branch from 895dd41 to d768c12 Compare March 6, 2026 23:35
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

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.

2 participants