From 481dcc2f48d74ef73ea9133f54ac0ab40413e474 Mon Sep 17 00:00:00 2001 From: Vaibhav Dahiya Date: Mon, 18 Nov 2024 23:30:41 +0000 Subject: [PATCH] [xcvrd] Fix swsscommon set port table handle in media_settings parser Signed-off-by: Vaibhav Dahiya --- sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py | 2 +- sonic-xcvrd/xcvrd/xcvrd_utilities/xcvr_table_helper.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py b/sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py index 6a746c71f..87d6852f0 100644 --- a/sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py +++ b/sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py @@ -365,7 +365,7 @@ def notify_media_setting(logical_port_name, transceiver_dict, fvs[index] = (str(media_key), str(val_str)) index += 1 - xcvr_table_helper.get_app_port_tbl(asic_index).set(port_name, fvs) + xcvr_table_helper.get_app_set_port_tbl(asic_index).set(port_name, fvs) xcvr_table_helper.get_state_port_tbl(asic_index).set(logical_port_name, [(NPU_SI_SETTINGS_SYNC_STATUS_KEY, NPU_SI_SETTINGS_NOTIFIED_VALUE)]) helper_logger.log_notice("Notify media setting: Published ASIC-side SI setting " "for lport {} in APP_DB".format(logical_port_name)) diff --git a/sonic-xcvrd/xcvrd/xcvrd_utilities/xcvr_table_helper.py b/sonic-xcvrd/xcvrd/xcvrd_utilities/xcvr_table_helper.py index 863eda5b5..4a271f285 100644 --- a/sonic-xcvrd/xcvrd/xcvrd_utilities/xcvr_table_helper.py +++ b/sonic-xcvrd/xcvrd/xcvrd_utilities/xcvr_table_helper.py @@ -25,6 +25,7 @@ def __init__(self, namespaces): self.cfg_port_tbl, self.state_port_tbl, self.pm_tbl, self.firmware_info_tbl = {}, {}, {}, {}, {}, {}, {}, {}, {} self.state_db = {} self.cfg_db = {} + self.app_set_port_tbl = {} for namespace in namespaces: asic_id = multi_asic.get_asic_index_from_namespace(namespace) self.state_db[asic_id] = daemon_base.db_connect("STATE_DB", namespace) @@ -39,6 +40,7 @@ def __init__(self, namespaces): self.app_port_tbl[asic_id] = swsscommon.ProducerStateTable(appl_db, swsscommon.APP_PORT_TABLE_NAME) self.cfg_db[asic_id] = daemon_base.db_connect("CONFIG_DB", namespace) self.cfg_port_tbl[asic_id] = swsscommon.Table(self.cfg_db[asic_id], swsscommon.CFG_PORT_TABLE_NAME) + self.app_set_port_tbl[asic_id] = swsscommon.Table(appl_db, swsscommon.APP_PORT_TABLE_NAME) def get_intf_tbl(self, asic_id): return self.int_tbl[asic_id] @@ -61,6 +63,9 @@ def get_firmware_info_tbl(self, asic_id): def get_app_port_tbl(self, asic_id): return self.app_port_tbl[asic_id] + def get_app_set_port_tbl(self, asic_id): + return self.app_set_port_tbl[asic_id] + def get_state_db(self, asic_id): return self.state_db[asic_id]