@@ -72,6 +72,7 @@ def __init__(self, namespace, socket=None):
72
72
version_info = device_info .get_sonic_version_info ()
73
73
asic_type = version_info .get ('asic_type' )
74
74
self .asic_type = asic_type
75
+ self .hwsku = device_info .get_hwsku ()
75
76
76
77
if asic_type == "mellanox" :
77
78
from mellanox_buffer_migrator import MellanoxBufferMigrator
@@ -124,6 +125,43 @@ def migrate_interface_table(self):
124
125
self .configDB .set_entry (table , key [0 ], data [key ])
125
126
if_db .append (key [0 ])
126
127
128
+ def migrate_mgmt_ports_on_s6100 (self ):
129
+ '''
130
+ During warm-reboot, add back two 10G management ports which got removed from 6100
131
+ to ensure no change in bcm.config from older image
132
+ '''
133
+ if device_info .is_warm_restart_enabled ('swss' ) == False :
134
+ log .log_notice ("Skip migration on {}, warm-reboot flag not set" .format (self .hwsku ))
135
+ return True
136
+
137
+ entries = {}
138
+ entries ['Ethernet64' ] = {'alias' : 'tenGigE1/1' , 'description' : 'tenGigE1/1' , 'index' : '64' , 'lanes' : '129' , 'mtu' : '9100' , 'pfc_asym' : 'off' , 'speed' : '10000' }
139
+ entries ['Ethernet65' ] = {'alias' : 'tenGigE1/2' , 'description' : 'tenGigE1/2' , 'index' : '65' , 'lanes' : '131' , 'mtu' : '9100' , 'pfc_asym' : 'off' , 'speed' : '10000' }
140
+ added_ports = 0
141
+ for portName in entries .keys ():
142
+ if self .configDB .get_entry ('PORT' , portName ):
143
+ log .log_notice ("Skipping migration for port {} - entry exists" .format (portName ))
144
+ continue
145
+
146
+ log .log_notice ("Migrating port {} to configDB for warm-reboot on {}" .format (portName , self .hwsku ))
147
+ self .configDB .set_entry ('PORT' , portName , entries [portName ])
148
+
149
+ #Copy port to APPL_DB
150
+ key = 'PORT_TABLE:' + portName
151
+ for field , value in entries [portName ].items ():
152
+ self .appDB .set (self .appDB .APPL_DB , key , field , value )
153
+ self .appDB .set (self .appDB .APPL_DB , key , 'admin_status' , 'down' )
154
+ log .log_notice ("Copied port {} to appdb" .format (key ))
155
+ added_ports += 1
156
+
157
+ #Update port count in APPL_DB
158
+ portCount = self .appDB .get (self .appDB .APPL_DB , 'PORT_TABLE:PortConfigDone' , 'count' )
159
+ if portCount != '' :
160
+ total_count = int (portCount ) + added_ports
161
+ self .appDB .set (self .appDB .APPL_DB , 'PORT_TABLE:PortConfigDone' , 'count' , str (total_count ))
162
+ log .log_notice ("Port count updated from {} to : {}" .format (portCount , self .appDB .get (self .appDB .APPL_DB , 'PORT_TABLE:PortConfigDone' , 'count' )))
163
+ return True
164
+
127
165
def migrate_intf_table (self ):
128
166
'''
129
167
Migrate all data from existing INTF table in APP DB during warmboot with IP Prefix
@@ -546,6 +584,10 @@ def common_migration_ops(self):
546
584
self .configDB .set_entry (init_cfg_table , key , new_cfg )
547
585
548
586
self .migrate_copp_table ()
587
+ if self .asic_type == "broadcom" and 'Force10-S6100' in self .hwsku :
588
+ self .migrate_mgmt_ports_on_s6100 ()
589
+ else :
590
+ log .log_notice ("Asic Type: {}, Hwsku: {}" .format (self .asic_type , self .hwsku ))
549
591
550
592
# To migrate buffer on Mellanox platforms
551
593
# For legacy branches, this is the only place it can be called because
0 commit comments