Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ycabled] add support for detach mode in 'active-active' topology #309

Merged
merged 1 commit into from
Oct 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
('grpc.http2.max_pings_without_data', 0)
]

CONFIG_MUX_STATES = ["active", "standby", "auto", "manual", "detach"]

DEFAULT_PORT_IDS = [0, 1]

SYSLOG_IDENTIFIER = "y_cable_helper"
Expand Down Expand Up @@ -297,7 +299,7 @@ def check_mux_cable_port_type(logical_port_name, port_tbl, asic_index):
val = mux_table_dict.get("state", None)
cable_type = mux_table_dict.get("cable_type", None)

if val in ["active", "standby", "auto", "manual"]:
if val in CONFIG_MUX_STATES:
if cable_type == "active-active":
helper_logger.log_debug("Y_CABLE_DEBUG:check_mux_cable_port_type returning True active-active port {}".format(logical_port_name))
return (True , "active-active")
Expand Down Expand Up @@ -670,7 +672,7 @@ def check_identifier_presence_and_setup_channel(logical_port_name, port_tbl, hw_
soc_ipv4 = soc_ipv4_full.split('/')[0]
cable_type = mux_table_dict.get("cable_type", None)

if val in ["active", "standby", "auto", "manual"] and cable_type == "active-active":
if val in CONFIG_MUX_STATES and cable_type == "active-active":

# import the module and load the port instance
y_cable_presence[:] = [True]
Expand Down Expand Up @@ -1191,7 +1193,7 @@ def check_identifier_presence_and_update_mux_table_entry(state_db, port_tbl, y_c

val = mux_table_dict.get("state", None)

if val in ["active", "auto", "manual", "standby"]:
if val in CONFIG_MUX_STATES:

# import the module and load the port instance
physical_port_list = logical_port_name_to_physical_port_list(
Expand Down Expand Up @@ -1631,7 +1633,7 @@ def check_identifier_presence_and_update_mux_info_entry(state_db, mux_tbl, asic_
mux_table_dict = dict(fvs)
if "state" in mux_table_dict:
val = mux_table_dict.get("state", None)
if val in ["active", "auto", "manual", "standby"]:
if val in CONFIG_MUX_STATES:

if mux_tbl.get(asic_index, None) is not None:
# fill in the newly found entry
Expand Down