Skip to content

Commit

Permalink
[xcvrd] removing the delete notification message logic for command pr…
Browse files Browse the repository at this point in the history
…obe 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>
  • Loading branch information
vdahiya12 authored Dec 12, 2020
1 parent 4da0bfc commit 8555077
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ def delete_port_from_y_cable_table(logical_port_name, y_cable_tbl):
y_cable_tbl._del(logical_port_name)


# Delete port from Y cable status table
def delete_port_from_y_cable_command_table(logical_port_name, y_cable_command_tbl):
y_cable_command_tbl._del(logical_port_name)


def update_table_mux_status_for_response_tbl(table_name, status, logical_port_name):
fvs = swsscommon.FieldValuePairs([('response', status)])
table_name.set(logical_port_name, fvs)
Expand Down Expand Up @@ -154,7 +149,7 @@ def update_tor_active_side(read_side, state, logical_port_name):
return -1


def update_appdb_port_mux_cable_response_table(logical_port_name, asic_index, appl_db):
def update_appdb_port_mux_cable_response_table(logical_port_name, asic_index, appl_db, read_side):

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

read_side = y_cable.check_read_side(physical_port)
if read_side is None:

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

if probe_identifier == "probe":
update_appdb_port_mux_cable_response_table(port_m, asic_index, appl_db)
delete_port_from_y_cable_command_table(port_m, y_cable_command_tbl[asic_index])
(status, fv) = y_cable_tbl[asic_index].get(port_m)
if status is False:
helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format(
port_m, y_cable_tbl[asic_index]))
continue
mux_port_dict = dict(fv)
read_side = mux_port_dict.get("read_side")
update_appdb_port_mux_cable_response_table(port_m, asic_index, appl_db, int(read_side))

def task_run(self):
self.task_thread = threading.Thread(target=self.task_worker)
Expand Down

0 comments on commit 8555077

Please sign in to comment.