Skip to content

Commit

Permalink
Set FEC to reed-solomon if the port speed is 100G (#1383)
Browse files Browse the repository at this point in the history
* Set FEC to reed-solomon if the port speed is 100G
  • Loading branch information
prsunny authored Feb 9, 2018
1 parent ecf5c8d commit a145f2c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ def parse_xml(filename, platform=None, port_config_file=None):

for port_name in port_speeds:
ports.setdefault(port_name, {})['speed'] = port_speeds[port_name]
if port_speeds[port_name] == '100000':
ports.setdefault(port_name, {})['fec'] = 'rs'
for port_name in port_descriptions:
ports.setdefault(port_name, {})['description'] = port_descriptions[port_name]

Expand Down
2 changes: 1 addition & 1 deletion src/sonic-config-engine/tests/sample_output/ports.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"PORT_TABLE:Ethernet12": {
"speed": "1000000",
"speed": "100000",
"description": "Interface description"
},
"OP": "SET"
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-config-engine/tests/simple-sample-graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
<MultiPortsInterface>false</MultiPortsInterface>
<PortName>0</PortName>
<Priority>0</Priority>
<Speed>1000000</Speed>
<Speed>100000</Speed>
<Description>Interface description</Description>
</a:EthernetInterface>
</EthernetInterfaces>
Expand Down
3 changes: 3 additions & 0 deletions src/sonic-config-engine/tests/test_cfggen.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,6 @@ def test_minigraph_ethernet_interfaces(self):
argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "PORT[\'Ethernet8\']"'
output = self.run_script(argument)
self.assertEqual(output.strip(), "{'alias': 'fortyGigE0/8', 'lanes': '37,38,39,40', 'description': 'Interface description', 'speed': '40000'}")
argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "PORT[\'Ethernet12\']"'
output = self.run_script(argument)
self.assertEqual(output.strip(), "{'alias': 'fortyGigE0/12', 'lanes': '33,34,35,36', 'fec': 'rs', 'speed': '100000', 'description': 'Interface description'}")

0 comments on commit a145f2c

Please sign in to comment.