Skip to content

Commit

Permalink
[xcvrd] Fix swsscommon set port table handle in media_settings parser
Browse files Browse the repository at this point in the history
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
  • Loading branch information
vdahiya12 committed Nov 18, 2024
1 parent e772183 commit 481dcc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
5 changes: 5 additions & 0 deletions sonic-xcvrd/xcvrd/xcvrd_utilities/xcvr_table_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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]
Expand All @@ -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]

Expand Down

0 comments on commit 481dcc2

Please sign in to comment.