Skip to content

Commit

Permalink
[Mellanox] Adding a new field to CONFIG DB: "subport" (sonic-net#18204)
Browse files Browse the repository at this point in the history
- Why I did it
The field 'subport' represents the index of the split port within a physical port. For example, if a port is split into 4, the subport of the first logical port is 1, the subport of the second logical port is 2, and so on.
In xcvrd, the CMIS manager uses the subport to calculate the lane mask, which is used to control the data path per lane. In Nvidia platform, the subport is missing and is always set to 0. According to the xcvrd code, when subport=0, it will always correspond to the first logical port. Therefore, if we shut down any logical port that is not the first one, we will see the operational status of the first logical port also becomes down.
This PR aims to add the subport field to CONFIG DB and prevent such scenarios. This is applicable only for static default breakout mode. For DPB, subport calculation will happen on the fly (changes are not in Sonic yet).
(Subport HLD: HLD of subport: [link to the HLD document])

- How I did it
I have added the 'subport' field to all relevant Nvidia hwsku.json files (minigraph generation is based on them). Additionally, I introduced the new 'subport' field to portconfig.py, so that sonic-cfggen will be able to generate the minigraph with it. In this file, I also fixed an error that caused all attributes from hwsku.json to be applied only to the first logical ports associated with a physical port.
Furthermore, I updated hwsku_json_checker to include the new field and applied a fix to the sample_hwsku.json file. sample_hwsku.json is the file that sonic-config-engine's unit tests rely on for its tests. Previously, it only included attributes for the first logical port of a split physical port. For example, if Ethernet4, a 4-lane port, was split into 2 ports, then sample_hwsku.json included only the entry for Ethernet4, with no entry for Ethernet6. This misalignment with the structure of other hwsku.json files has been corrected as well.

- How to verify it
Ensure that each logical port has the correct value of 'subport' in CONFIG DB, and that shutting down a logical port affects only that port and not other ports in the split.
  • Loading branch information
tshalvi authored Feb 29, 2024
1 parent f30936d commit 744a152
Show file tree
Hide file tree
Showing 8 changed files with 873 additions and 357 deletions.
384 changes: 256 additions & 128 deletions device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/hwsku.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,100 +1,132 @@
{
"interfaces": {
"Ethernet0": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet8": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet16": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet24": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet32": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet40": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet48": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet56": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet64": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet72": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet80": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet88": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet96": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet104": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet112": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet120": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet128": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet136": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet144": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet152": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet160": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet168": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet176": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet184": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet192": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet200": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet208": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet216": {
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet224": {
"default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet232": {
"default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet240": {
"default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
},
"Ethernet248": {
"default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]"
"default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]",
"subport": "1"
}
}
}
Loading

0 comments on commit 744a152

Please sign in to comment.