Skip to content

Commit 915f283

Browse files
authored
[voq][chassis]fix recirc port admin status (#10769)
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan [email protected] Why I did it resolves #10761. For VOQ chassis, the Recirc port, which was added for the Everflow, stays admin down after load minigraph. This PR add the fix to make the recirc port as admin up How I did it The PR adds a change in minigraph.py, if port has role as Rec make the the port as admin-status up. How to verify it UT Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
1 parent a6b1b0a commit 915f283

File tree

3 files changed

+47
-46
lines changed

3 files changed

+47
-46
lines changed

src/sonic-config-engine/minigraph.py

+6
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,12 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
15401540
if inband_port in ports.keys():
15411541
ports[inband_port]['admin_status'] = 'up'
15421542

1543+
# bring up the recirc port for voq chassis
1544+
for port, port_attributes in ports.items():
1545+
port_role = port_attributes.get('role', None)
1546+
if port_role == 'Rec':
1547+
ports[port]['admin_status'] = 'up'
1548+
15431549
results['PORT'] = ports
15441550
results['CONSOLE_PORT'] = console_ports
15451551

src/sonic-config-engine/tests/test_cfggen.py

+30-12
Original file line numberDiff line numberDiff line change
@@ -896,18 +896,36 @@ def test_minigraph_voq_inband_port(self):
896896
output = self.run_script(argument)
897897
output_dict = utils.to_dict(output.strip())
898898
self.assertDictEqual(
899-
output_dict['Ethernet-IB0'],
900-
{'lanes': '133',
901-
'alias': 'Recycle0',
902-
'description': 'Recycle0',
903-
'mtu': '9100',
904-
'tpid': '0x8100',
905-
'pfc_asym': 'off',
906-
'admin_status': 'up',
907-
'fec': 'rs',
908-
'speed': '100000'
909-
}
910-
)
899+
output_dict['Ethernet-IB0'], {
900+
"lanes": "222",
901+
"alias": "Recirc0/1",
902+
"index": "52",
903+
"role": "Inb",
904+
"speed": "400000",
905+
"description": "Recirc0/1",
906+
"mtu": "9100",
907+
"tpid": "0x8100",
908+
"pfc_asym": "off",
909+
"admin_status": "up"
910+
})
911+
912+
def test_minigraph_voq_recirc_ports(self):
913+
argument = "-m {} -p {} --var-json PORT".format(self.sample_graph_voq, self.voq_port_config)
914+
output = self.run_script(argument)
915+
output_dict = utils.to_dict(output.strip())
916+
self.assertDictEqual(
917+
output_dict['Ethernet-Rec0'], {
918+
"lanes": "221",
919+
"alias": "Recirc0/0",
920+
"index": "51",
921+
"role": "Rec",
922+
"speed": "400000",
923+
"description": "Recirc0/0",
924+
"mtu": "9100",
925+
"tpid": "0x8100",
926+
"pfc_asym": "off",
927+
"admin_status": "up"
928+
})
911929

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

0 commit comments

Comments
 (0)