-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Port Speed Configuration
Currently Port speed is set...
Port Speed Configuration feature allows user to specify speed for each individual switch port.
If no speed specified, port will be configured to the default value(?) (add where is the default and how to change)
To configure port speed different from the default one, user is required specify a valid port speed value in the platform specific configuration file know as "minigraph".
Port speed property is specified in the corresponding platform specific xml file.
File location: sonic-mgmt/tree/master/ansible/minigraph
In the XML hierarchy speed is under DeviceMiniGraph/DeviceDataPlaneInfo/IPInterfaces/IPInterface
XML tag for spped is PortSpeed
.
<DeviceMiniGraph ...>
...
<DeviceDataPlaneInfo>
...
<IPInterfaces>
...
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet100</AttachTo>
<Prefix>10.0.0.32/31</Prefix>
<PortSpeed>100G</PortSpeed> <-- [NEW]
<CableLength>1.5m</CableLength> <-- [NEW]
</IPInterface>
...
</IPInterfaces>
</DeviceDataPlaneInfo>
</DeviceMiniGraph ...>
sonic-cfggen
will consume the minigraph file and the ports configuration template to generate port configuration json file.
Template location and name is sonic-buildimage/dockers/docker-orchagent/ports_config.json.j2
[
{% for interface in interface_aux_properties %}
{
"PORT_TABLE:{{ interface['name'] }}": {
"speed": "{{ interface['speed'] }}",
"cable_length": "{{ interface['cable_length'] }}",
},
"OP": "SET"
}
{% endfor %}
]
[
{
"PORT_TABLE:Ethernet100": {
"speed": "100G",
"cable_length": "1.5m",
},
"OP": "SET"
},
{
...
}
]
Json file is applied using swssconfig utility after orchagent start similar to mirror, ipinip and other configs.
Command to be executed in the run-time to fetch port properties from the minigraph and create a ports configuration json file.
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/ports_config.json.j2 > /etc/swss/config.d/ports_config.json
127.0.0.1:6379> hgetall PORT_TABLE:Ethernet100
...
11) "speed"
12) "100G"
13) "cable_length"
14) "1.5m"
Orchagent (portsorch) handles PORT_TABLE updates.
- make sure table is updated not recreated
- add support for speed field; validate and set to HW via SAI.
- apply speed via /etc/network/interfaces like MTU?
- cable length handling to be added at the same level?
-
For Users
-
For Developers
-
Subgroups/Working Groups
-
Presentations
-
Join Us