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

[show][config] fix show mux status health field; add support for hwmode functionality to toggle mux, check mux direction for Y cable (#1467) #1491

Merged
merged 3 commits into from
Mar 11, 2021

Conversation

vdahiya12
Copy link
Contributor

@vdahiya12 vdahiya12 commented Mar 11, 2021

Summary

This PR fixes the show mux status "health" field.

There is also support for new commands for muxcable
show muxcable hwmode muxdirection
sudo config muxcable hwmode state active all
which can check the muxdirection and toggle the mux direction directly through eeprom

What I did

Fixed the show mux status health field
Also added these new commands

vdahiya@BN9-0101-0301-01UT0:~$ show muxcable hwmode muxdirection 
Port         Direction
-----------  -----------
Ethernet0    active
Ethernet4    active
Ethernet8    active
Ethernet12   active
Ethernet16   active
vdahiya@BN9-0101-0301-01UT0:~$ sudo config muxcable hwmode state active all
Muxcables at all ports will be changed to active state. Continue? [y/N]: y
Success in toggling port Ethernet0 to active
Success in toggling port Ethernet4 to active
Success in toggling port Ethernet8 to active
Success in toggling port Ethernet12 to active
Success in toggling port Ethernet16 to active

How I did it

Added the changes to show/muxcable.py to correctly retrieve health "state" field from the "MUX_LINKMGR_TABLE" state DB table.
For new cli commands added the support in show/muxcable.py and config/muxcable.py

How to verify it

Ran the command on the 7050 testbed

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

Signed-off-by: vaibhav-dahiya [email protected]

…de functionality to toggle mux, check mux direction for Y cable (sonic-net#1467)

This PR fixes the show mux status "health" field.

There is also support for new commands for muxcable
show muxcable hwmode muxdirection
sudo config muxcable hwmode state active all
which can check the muxdirection and toggle the mux direction directly through eeprom

What I did
Fixed the show mux status health field
Also added these new commands

vdahiya@BN9-0101-0301-01UT0:~$ show muxcable hwmode muxdirection
Port         Direction
-----------  -----------
Ethernet0    active
Ethernet4    active
Ethernet8    active
Ethernet12   active
Ethernet16   active
vdahiya@BN9-0101-0301-01UT0:~$ sudo config muxcable hwmode state active all
Muxcables at all ports will be changed to active state. Continue? [y/N]: y
Success in toggling port Ethernet0 to active
Success in toggling port Ethernet4 to active
Success in toggling port Ethernet8 to active
Success in toggling port Ethernet12 to active
Success in toggling port Ethernet16 to active
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
show/muxcable.py Outdated
namespaces = multi_asic.get_front_end_namespaces()
for namespace in namespaces:
asic_id = multi_asic.get_asic_index_from_namespace(namespace)
per_npu_statedb[asic_id] = SonicV2Connector(use_unix_socket_path=False, namespace=namespace)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit tests are failing b/c this part is different b/w the master and 202012 branches

Suggested change
per_npu_statedb[asic_id] = SonicV2Connector(use_unix_socket_path=False, namespace=namespace)
per_npu_statedb[asic_id] = swsscommon.SonicV2Connector(use_unix_socket_path=False, namespace=namespace)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daall there are still some config_breakout failures.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are unrelated, it seems like there is some general issue with the check-build setup for 202012 in utilities. I can open a dummy PR later to debug this further, this change is OK

Signed-off-by: vaibhav-dahiya <[email protected]>
@daall daall merged commit c073d60 into sonic-net:202012 Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants