From 68a11e77212c09d87d98b4a4724f57e06e6442da Mon Sep 17 00:00:00 2001 From: Aryeh Feigin <101218333+arfeigin@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:18:07 +0200 Subject: [PATCH] Preserve copp tables through DB migration (#2524) This PR should be merged together with sonic-net/sonic-swss#2548 and is required to 202205 and 202211. This PR implements [fastboot] Preserve CoPP table HLD to improve fastboot flow (sonic-net/SONiC#1107). - What I did Preserve COPP table contents through DB migration. (Mellanox only) - How I did it Skipped deleting of COPP tables in DB migrator. - How to verify it Observe COPP table contents are preserved right after reboot. --- scripts/db_migrator.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/db_migrator.py b/scripts/db_migrator.py index c63d564042..6c8ef21b6f 100755 --- a/scripts/db_migrator.py +++ b/scripts/db_migrator.py @@ -884,7 +884,12 @@ def common_migration_ops(self): new_cfg = {**init_cfg, **curr_cfg} self.configDB.set_entry(init_cfg_table, key, new_cfg) - self.migrate_copp_table() + # Avoiding copp table migration is platform specific at the moment as I understood this might cause issues for some + # vendors, probably Broadcom. This change can be checked with any specific vendor and if this works fine the platform + # condition can be modified and extend. If no vendor has an issue with not clearing copp tables the condition can be + # removed together with calling to migrate_copp_table function. + if self.asic_type != "mellanox": + self.migrate_copp_table() if self.asic_type == "broadcom" and 'Force10-S6100' in self.hwsku: self.migrate_mgmt_ports_on_s6100() else: