Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[voq][chassis]fix recirc port admin status #10769

Merged
merged 5 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,12 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
if inband_port in ports.keys():
ports[inband_port]['admin_status'] = 'up'

# bring up the recirc port for voq chassis
for port, port_attributes in ports.items():
port_role = port_attributes.get('role', None)
if port_role == 'Rec':
ports[port]['admin_status'] = 'up'
arlakshm marked this conversation as resolved.
Show resolved Hide resolved

results['PORT'] = ports
results['CONSOLE_PORT'] = console_ports

Expand Down
48 changes: 36 additions & 12 deletions src/sonic-config-engine/tests/test_cfggen.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,18 +893,42 @@ def test_minigraph_voq_inband_port(self):
output = self.run_script(argument)
output_dict = utils.to_dict(output.strip())
self.assertDictEqual(
output_dict['Ethernet-IB0'],
{'lanes': '133',
'alias': 'Recycle0',
'description': 'Recycle0',
'mtu': '9100',
'tpid': '0x8100',
'pfc_asym': 'off',
'admin_status': 'up',
'fec': 'rs',
'speed': '100000'
}
)
output_dict['Ethernet-IB0'], {
'admin_status': 'up',
'alias': 'Recirc0/1',
'coreId': '1',
'corePortId': '222',
'description': 'Recirc0/1',
'index': '52',
'lanes': '222',
'mtu': '9100',
'numVoq': '8',
'pfc_asym': 'off',
'role': 'Inb',
'speed': '400000',
'tpid': '0x8100'
})

def test_minigraph_voq_recirc_ports(self):
argument = "-m {} -p {} --var-json PORT".format(self.sample_graph_voq, self.voq_port_config)
output = self.run_script(argument)
output_dict = utils.to_dict(output.strip())
self.assertDictEqual(
output_dict['Ethernet-Rec0'], {
'alias': 'Recirc0/0',
'coreId': '0',
'corePortId': '221',
'description': 'Recirc0/0',
'index': '51',
'lanes': '221',
'mtu': '9100',
'numVoq': '8',
'pfc_asym': 'off',
'role': 'Rec',
'speed': '400000',
'tpid': '0x8100',
'admin_status': 'up'
})

def test_minigraph_dhcp(self):
argument = '-m "' + self.sample_graph_simple_case + '" -p "' + self.port_config + '" -v DHCP_RELAY'
Expand Down
45 changes: 11 additions & 34 deletions src/sonic-config-engine/tests/voq-sample-port-config.ini
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
# name lanes alias
Ethernet0 29,30,31,32 fortyGigE0/0
Ethernet4 25,26,27,28 fortyGigE0/4
Ethernet8 37,38,39,40 fortyGigE0/8
Ethernet12 33,34,35,36 fortyGigE0/12
Ethernet16 41,42,43,44 fortyGigE0/16
Ethernet20 45,46,47,48 fortyGigE0/20
Ethernet24 5,6,7,8 fortyGigE0/24
Ethernet28 1,2,3,4 fortyGigE0/28
Ethernet32 9,10,11,12 fortyGigE0/32
Ethernet36 13,14,15,16 fortyGigE0/36
Ethernet40 21,22,23,24 fortyGigE0/40
Ethernet44 17,18,19,20 fortyGigE0/44
Ethernet48 49,50,51,52 fortyGigE0/48
Ethernet52 53,54,55,56 fortyGigE0/52
Ethernet56 61,62,63,64 fortyGigE0/56
Ethernet60 57,58,59,60 fortyGigE0/60
Ethernet64 65,66,67,68 fortyGigE0/64
Ethernet68 69,70,71,72 fortyGigE0/68
Ethernet72 77,78,79,80 fortyGigE0/72
Ethernet76 73,74,75,76 fortyGigE0/76
Ethernet80 105,106,107,108 fortyGigE0/80
Ethernet84 109,110,111,112 fortyGigE0/84
Ethernet88 117,118,119,120 fortyGigE0/88
Ethernet92 113,114,115,116 fortyGigE0/92
Ethernet96 121,122,123,124 fortyGigE0/96
Ethernet100 125,126,127,128 fortyGigE0/100
Ethernet104 85,86,87,88 fortyGigE0/104
Ethernet108 81,82,83,84 fortyGigE0/108
Ethernet112 89,90,91,92 fortyGigE0/112
Ethernet116 93,94,95,96 fortyGigE0/116
Ethernet120 97,98,99,100 fortyGigE0/120
Ethernet124 101,102,103,104 fortyGigE0/124
Ethernet-IB0 133 Recycle0
# name lanes alias index role speed coreId corePortId numVoq
Ethernet0 6,7 Ethernet1/1 1 Ext 100000 0 1 8
Ethernet4 2,3 Ethernet2/1 2 Ext 100000 0 2 8
Ethernet8 4,5 Ethernet3/1 3 Ext 100000 0 3 8
Ethernet12 0,1 Ethernet4/1 4 Ext 100000 0 4 8
Ethernet16 14,15 Ethernet5/1 5 Ext 100000 0 5 8
Ethernet20 10,11 Ethernet6/1 6 Ext 100000 0 6 8
Ethernet24 12,13 Ethernet7/1 7 Ext 100000 0 7 8
Ethernet28 8,9 Ethernet8/1 8 Ext 100000 0 8 8
Ethernet-Rec0 221 Recirc0/0 51 Rec 400000 0 221 8
Ethernet-IB0 222 Recirc0/1 52 Inb 400000 1 222 8