Fix unused ports being admin-up in t1-smartswitch-ha topology#22769
Open
nnelluri-cisco wants to merge 3 commits intosonic-net:masterfrom
Open
Fix unused ports being admin-up in t1-smartswitch-ha topology#22769nnelluri-cisco wants to merge 3 commits intosonic-net:masterfrom
nnelluri-cisco wants to merge 3 commits intosonic-net:masterfrom
Conversation
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.
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
@zjswhhh @yue-fred-gao @aronovic |
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.
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
895dd41 to
d768c12
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Back port request
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