Skip to content

Commit

Permalink
Remove ports from TRANSCEIVER_INFO table, if they don't exist in Conf…
Browse files Browse the repository at this point in the history
…ig DB
  • Loading branch information
noaOrMlnx committed Nov 6, 2024
1 parent 8cdc32f commit aa0135a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sonic-xcvrd/xcvrd/xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2178,6 +2178,15 @@ def init(self):

self.log_notice("XCVRD INIT: After port config is done")
port_mapping_data = port_event_helper.get_port_mapping(self.namespaces)
# remove ports from TRANSCEIVER_INFO table, if they don't exist in CONFIG DB
logical_ports_list = port_mapping_data.logical_port_list
asic_id = multi_asic.get_asic_index_from_namespace(self.namespaces)

transceiver_info_table = self.xcvr_table_helper.get_intf_tbl(asic_id)

ports_in_transceiver_only = list(set(transceiver_info_table.get_keys()) - set(logical_ports_list))
for trans_port in ports_in_transceiver_only:
transceiver_info_table._del(trans_port)

self.initialize_port_init_control_fields_in_port_table(port_mapping_data)

Expand Down

0 comments on commit aa0135a

Please sign in to comment.