Skip to content

Commit 8555077

Browse files
authored
[xcvrd] removing the delete notification message logic for command probe in mux cable driver (sonic-net#134)
Summary: This PR provides removes the delete logic on command probe message received from linkmgr after processing the message What is the motivation for this PR? the delete message tends to create an error scenario if many probe messages come and redis-api fails to retrieve the message contents Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
1 parent 4da0bfc commit 8555077

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ def delete_port_from_y_cable_table(logical_port_name, y_cable_tbl):
8282
y_cable_tbl._del(logical_port_name)
8383

8484

85-
# Delete port from Y cable status table
86-
def delete_port_from_y_cable_command_table(logical_port_name, y_cable_command_tbl):
87-
y_cable_command_tbl._del(logical_port_name)
88-
89-
9085
def update_table_mux_status_for_response_tbl(table_name, status, logical_port_name):
9186
fvs = swsscommon.FieldValuePairs([('response', status)])
9287
table_name.set(logical_port_name, fvs)
@@ -154,7 +149,7 @@ def update_tor_active_side(read_side, state, logical_port_name):
154149
return -1
155150

156151

157-
def update_appdb_port_mux_cable_response_table(logical_port_name, asic_index, appl_db):
152+
def update_appdb_port_mux_cable_response_table(logical_port_name, asic_index, appl_db, read_side):
158153

159154
status = None
160155
y_cable_response_tbl = {}
@@ -169,7 +164,6 @@ def update_appdb_port_mux_cable_response_table(logical_port_name, asic_index, ap
169164
physical_port = physical_port_list[0]
170165
if _wrapper_get_presence(physical_port):
171166

172-
read_side = y_cable.check_read_side(physical_port)
173167
if read_side is None:
174168

175169
status = 'unknown'
@@ -595,8 +589,14 @@ def task_worker(self):
595589
probe_identifier = fvp_dict["command"]
596590

597591
if probe_identifier == "probe":
598-
update_appdb_port_mux_cable_response_table(port_m, asic_index, appl_db)
599-
delete_port_from_y_cable_command_table(port_m, y_cable_command_tbl[asic_index])
592+
(status, fv) = y_cable_tbl[asic_index].get(port_m)
593+
if status is False:
594+
helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format(
595+
port_m, y_cable_tbl[asic_index]))
596+
continue
597+
mux_port_dict = dict(fv)
598+
read_side = mux_port_dict.get("read_side")
599+
update_appdb_port_mux_cable_response_table(port_m, asic_index, appl_db, int(read_side))
600600

601601
def task_run(self):
602602
self.task_thread = threading.Thread(target=self.task_worker)

0 commit comments

Comments
 (0)