Skip to content

Commit f035c7d

Browse files
Update HLD to account for new media_settings.json format for gearboxes (#2232)
* Update HLD to account for new media_settings.json format for gearboxes Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai> * Add swss PR to the HLD Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai> --------- Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
1 parent 3007862 commit f035c7d

File tree

1 file changed

+77
-83
lines changed

1 file changed

+77
-83
lines changed

doc/media-settings/Dynamic-gearbox-tuning.md

Lines changed: 77 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
## Revision
44

5-
| Version | Date | Author | Description |
6-
|:-------:|:-----------:|:----------------------:|:--------------------------------------------------:|
7-
| 0.1 | 12/19/2024 | Jan Mazurek | Initial version |
8-
| 0.2 | 01/07/2026 | Brian Gallagher | Updated after publishing PRs to implement this HLD |
5+
| Version | Date | Author | Description |
6+
|:-------:|:-----------:|:----------------------:|:-----------------------------------------------------------------------:|
7+
| 0.1 | 12/19/2024 | Jan Mazurek | Initial version |
8+
| 0.2 | 01/07/2026 | Brian Gallagher | Updated after publishing PRs to implement this HLD |
9+
| 0.3 | 02/27/2026 | Brian Gallagher | Changed the format of the media_settings.json to avoid changes in xcvrd |
910

1011
## Summary
1112

@@ -53,105 +54,96 @@ The media settings file currently supports lookups for a variety of media tuning
5354

5455
## Design Proposal
5556

56-
### 1\. sonic-buildimage \- Add GEARBOX\_MEDIA\_SETTINGS Section in Media Settings File
57+
### 1\. sonic-buildimage \- Add gearbox-specific attributes in the Media Settings File
5758

58-
The first proposed change is to add support for a new section to the media settings file of gearbox-enabled SKUs specifically for gearbox tunings. Support is added for GEARBOX\_GLOBAL\_MEDIA\_SETTINGS and GEARBOX\_PORT\_MEDIA\_SETTINGS as top-level keys, representing global gearbox settings over a range of ports and individual logical port configurations, respectively. These new keys will include sub-sections for line-side and system-side tunings for logical ports which have gearbox connections.
59+
The first proposed change is to add support for gearbox-specific signal integrity tuning attributes. Existing attributes can be configured for either the line-side or system-side of a gearbox by prepending either `gb_line_` or `gb_system_` to the attribute name. For instance, to configure values for `pre1` on the line-side of the gearbox, the `gb_line_pre1` attribute would be specified in media_settings.json.
5960

6061
#### Example media_settings.json
6162

6263
```
6364
{
64-
"GEARBOX_GLOBAL_MEDIA_SETTINGS": {
65+
"MEDIA_SETTINGS": {
6566
"2-32": {
66-
"line": {
67-
"COPPER100": {
68-
"main": {
69-
"lane0": "0x75",
70-
"lane1": "0x75",
71-
"lane2": "0x75",
72-
"lane3": "0x75",
73-
"lane4": "0x75",
74-
"lane5": "0x75",
75-
"lane6": "0x75",
76-
"lane7": "0x75"
77-
},
78-
...
79-
}
80-
},
81-
"system": {
82-
"Default": {
83-
"main": {
84-
"lane0": "0x75",
85-
"lane1": "0x75",
86-
"lane2": "0x75",
87-
"lane3": "0x75",
88-
"lane4": "0x75",
89-
"lane5": "0x75",
90-
"lane6": "0x75",
91-
"lane7": "0x75"
92-
},
93-
...
94-
}
95-
}
96-
}
97-
},
98-
"GEARBOX_PORT_MEDIA_SETTINGS": {
99-
"1": {
100-
"line": {
101-
"COPPER100": {
102-
"main": {
103-
"lane0": "0x75",
104-
"lane1": "0x75",
105-
"lane2": "0x75",
106-
"lane3": "0x75",
107-
"lane4": "0x75",
108-
"lane5": "0x75",
109-
"lane6": "0x75",
110-
"lane7": "0x75"
111-
},
112-
...
113-
}
67+
"COPPER100": {
68+
"gb_line_pre1": {
69+
"lane0": "0x75",
70+
"lane1": "0x75",
71+
},
72+
"gb_line_main": {
73+
"lane0": "0x75",
74+
"lane1": "0x75",
75+
},
76+
"gb_line_post1": {
77+
"lane0": "0x75",
78+
"lane1": "0x75",
79+
},
80+
"gb_system_pre1": {
81+
"lane0": "0x75",
82+
"lane1": "0x75",
83+
"lane2": "0x75",
84+
"lane3": "0x75",
85+
},
86+
"gb_system_main": {
87+
"lane0": "0x75",
88+
"lane1": "0x75",
89+
"lane2": "0x75",
90+
"lane3": "0x75",
91+
},
92+
"gb_system_post1": {
93+
"lane0": "0x75",
94+
"lane1": "0x75",
95+
"lane2": "0x75",
96+
"lane3": "0x75",
97+
},
98+
...
11499
},
115-
"system": {
116-
"Default": {
117-
"main": {
118-
"lane0": "0x75",
119-
"lane1": "0x75",
120-
"lane2": "0x75",
121-
"lane3": "0x75",
122-
"lane4": "0x75",
123-
"lane5": "0x75",
124-
"lane6": "0x75",
125-
"lane7": "0x75"
126-
},
127-
...
128-
}
129-
}
130100
}
131101
},
132102
"PORT_MEDIA_SETTINGS": {
133-
"33": {
103+
"1": {
134104
"COPPER100": {
135-
"main": {
136-
"lane0": "0x6d",
137-
"lane1": "0x6d",
138-
"lane2": "0x6d",
139-
"lane3": "0x6d",
140-
"lane4": "0x6d",
141-
"lane5": "0x6d",
142-
"lane6": "0x6d",
143-
"lane7": "0x6d"
105+
"gb_line_pre1": {
106+
"lane0": "0x5",
107+
"lane1": "0x5",
108+
},
109+
"gb_line_main": {
110+
"lane0": "0x5",
111+
"lane1": "0x5",
112+
},
113+
"gb_line_post1": {
114+
"lane0": "0x5",
115+
"lane1": "0x5",
116+
},
117+
"gb_system_pre1": {
118+
"lane0": "0x5",
119+
"lane1": "0x5",
120+
"lane2": "0x5",
121+
"lane3": "0x5",
144122
},
145-
...
146-
}
123+
"gb_system_main": {
124+
"lane0": "0x5",
125+
"lane1": "0x5",
126+
"lane2": "0x5",
127+
"lane3": "0x5",
128+
},
129+
"gb_system_post1": {
130+
"lane0": "0x5",
131+
"lane1": "0x5",
132+
"lane2": "0x5",
133+
"lane3": "0x5",
134+
},
135+
...
136+
},
147137
}
148138
}
149139
}
150140
```
151141

152142
### 2\. sonic-platform-daemons \- Update Media Settings Parser / xcvrd
153143

154-
The second proposed change is to expand the media settings parser to parse the new gearbox settings section(s) in the media settings file. Currently xcvrd uses the parser file to parse tuning values for ASIC-port connections and sets these values in APPL\_DB. The aim here is to expand this functionality to include the new gearbox tunings. To facilitate this, we will simply add new gearbox media settings keys to the lookup function within the parser and make additional calls to parse the gearbox values. Updating APPL\_DB with gearbox tuning values will follow the same design as ASIC tunings while simply adding a unique prefix to the key-value pair to distinguish between line-side and system-side values. Parsing gearbox tunings will follow the same lookup logic as current ASIC tunings, and will support global gearbox settings over a range of ports (GEARBOX\_GLOBAL\_MEDIA\_SETTINGS) or individual logical port configurations (GEARBOX\_PORT\_MEDIA\_SETTINGS). This change will not disrupt vendors and SKUs which do not implement gearboxes or rely on specific vendor/media keys to perform tuning value lookups.
144+
`xcvrd` requires only minimal changes to support the above format. When calculating the speed for a media key, the line-side lane count will be used in the calculation. For example, when calculating lane speed, `xcvrd` performs calculations like `speed = int(int(int(port_speed) /lane_count)/1000)`. The gearbox line-side lane count will be used for `lane_count` in these calculations. Additionally, `xcvrd` requires some minor changes in its logic for publishing SI settings to APPL_DB to make sure it publishes the correct lane-width size for the line-side settings. These changes can be found in [this PR](https://github.com/sonic-net/sonic-platform-daemons/pull/728).
145+
146+
Other than that, `xcvrd` requires no further changes and will pick up the new attributes and publish them to APPL_DB out-of-the-box.
155147

156148
#### Example gearbox port APPL\_DB:
157149

@@ -238,6 +230,8 @@ The second proposed change is to expand the media settings parser to parse the n
238230

239231
The third proposed change is to alter the way the orchagent process sets gearbox tunings. Upon detecting a change within APPL\_DB for a particular port, orchagent will be triggered to run doPortTask() with SET\_COMMAND on the logical port. Since the media settings parser change from above will use the same mechanism as before to update APPL\_DB with gearbox tunings, similarly the same flow and system can be used within orchagent as before to set the gearbox tuning values. This will involve creating new serdes attributes for line-side and system-side tunings. These new serdes attributes will then be used to make SAI calls and program the relevant gearbox ports in a manner similar to how ASIC tunings are currently applied. In the current iteration of this feature, only tunings with serdes attributes of the form ('pre3', 'pre2', 'pre1', 'main', 'post1', 'post2', 'post3') will be parsed and applied to gearbox ports. This change will allow orchagent to dynamically set the appropriate tunings to gearboxes if customers ever wish to change the configuration of their ports or transceivers and will eliminate the need for engineers to spend time doing so manually.
240232

233+
These changes can be found in [this PR](https://github.com/sonic-net/sonic-swss/pull/4113).
234+
241235
## Overview \- Big Picture
242236

243237
The following diagram depicts an overview of the new proposed dynamic gearbox tuning flow. Intentionally, this is identical to the current flow of ASIC-port dynamic tuning with media settings as shown in [SONiC/Media-based-Port-settings.md at master](https://github.com/sonic-net/SONiC/blob/master/doc/media-settings/Media-based-Port-settings.md).

0 commit comments

Comments
 (0)