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

[y_cable] refactor y_cable to a seperate logic and new daemon from xcvrd #219

Merged
merged 48 commits into from
Jan 20, 2022

Conversation

vdahiya12
Copy link
Contributor

@vdahiya12 vdahiya12 commented Oct 18, 2021

Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com

Description

This PR separates the logic of Y-Cable from xcvrd. Before this change we were utilizing xcvrd daemon to control all aspects of Y-Cable right from initialization to processing requests from other entities like orch,linkmgr.
Now we would have another daemon ycabled which will serve this purpose.
Logically everything still remains the same from the perspective of other daemons.
it also take care aspects like init/delete daemon from Y-Cable perspective.

dependent-startup                EXITED    Jan 18 05:40 AM

xcvrd                            RUNNING   pid 33, uptime 20:02:58
ycabled                          RUNNING   pid 218, uptime 0:22:12

Motivation and Context

Required for separating the logic of Y-Cable from xcvrd. This is to ensure that the daemon always works and responds to linkmgr to address its requests

How Has This Been Tested?

Built an image with the changes and ran dualtor specific tests on the change on a 7050cx3 testbed.

Additional Information (Optional)

Additionally this PR also fixes vs platform ycable initialization.
is_vs variable represents kvm based testbed support for ycabled daemon

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 marked this pull request as draft October 18, 2021 18:09
@lgtm-com
Copy link

lgtm-com bot commented Oct 18, 2021

This pull request introduces 2 alerts when merging 6f2c778 into 1565a23 - view on LGTM.com

new alerts:

  • 1 for Except block handles 'BaseException'
  • 1 for Syntax error

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 requested a review from prgeor October 29, 2021 23:36
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 marked this pull request as ready for review October 29, 2021 23:48
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Nov 2, 2021

This pull request introduces 8 alerts and fixes 1 when merging 7422365 into ddb22b9 - view on LGTM.com

new alerts:

  • 6 for Unused local variable
  • 2 for Unused import

fixed alerts:

  • 1 for Except block handles 'BaseException'

@prgeor prgeor self-assigned this Nov 7, 2021
@prgeor prgeor added the Y-Cable label Nov 7, 2021
@prgeor
Copy link
Collaborator

prgeor commented Nov 7, 2021

@vdahiya12 can yo fix LGTM warnings?

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Nov 9, 2021

This pull request introduces 12 alerts and fixes 1 when merging f4d160c into 1fd3d16 - view on LGTM.com

new alerts:

  • 9 for Unused local variable
  • 2 for Unused import
  • 1 for Except block handles 'BaseException'

fixed alerts:

  • 1 for Except block handles 'BaseException'

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Nov 14, 2021

This pull request introduces 12 alerts and fixes 1 when merging c2e15fb into 7b95211 - view on LGTM.com

new alerts:

  • 9 for Unused local variable
  • 2 for Unused import
  • 1 for Except block handles 'BaseException'

fixed alerts:

  • 1 for Except block handles 'BaseException'

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Nov 14, 2021

This pull request introduces 5 alerts and fixes 1 when merging abfc6f0 into 7b95211 - view on LGTM.com

new alerts:

  • 5 for Unused local variable

fixed alerts:

  • 1 for Except block handles 'BaseException'

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Nov 14, 2021

This pull request introduces 1 alert and fixes 1 when merging e082871 into 7b95211 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

fixed alerts:

  • 1 for Except block handles 'BaseException'

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Nov 14, 2021

This pull request fixes 1 alert when merging 37e1a50 into 7b95211 - view on LGTM.com

fixed alerts:

  • 1 for Except block handles 'BaseException'

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 15, 2022

This pull request introduces 5 alerts and fixes 1 when merging a2ee7b8 into 07542cb - view on LGTM.com

new alerts:

  • 4 for Unreachable code
  • 1 for Unused local variable

fixed alerts:

  • 1 for Except block handles 'BaseException'

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 18, 2022

This pull request introduces 1 alert and fixes 1 when merging c73c508 into c4127c2 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

fixed alerts:

  • 1 for Except block handles 'BaseException'

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 18, 2022

This pull request introduces 1 alert and fixes 1 when merging 9ee55b2 into c4127c2 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

fixed alerts:

  • 1 for Except block handles 'BaseException'

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 18, 2022

This pull request fixes 1 alert when merging c34bea7 into c4127c2 - view on LGTM.com

fixed alerts:

  • 1 for Except block handles 'BaseException'

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 18, 2022

This pull request fixes 1 alert when merging fd6e520 into c4127c2 - view on LGTM.com

fixed alerts:

  • 1 for Except block handles 'BaseException'

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 19, 2022

This pull request fixes 1 alert when merging 519307d into c4127c2 - view on LGTM.com

fixed alerts:

  • 1 for Except block handles 'BaseException'

prgeor
prgeor previously approved these changes Jan 19, 2022
Comment on lines 33 to 35
from xcvrd.xcvrd import *
from xcvrd.xcvrd_utilities.sfp_status_helper import *
from xcvrd.xcvrd_utilities.port_mapping import *
Copy link
Collaborator

Choose a reason for hiding this comment

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

these imports are already there at line 1 to 3

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, can you please approve again

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 19, 2022

This pull request fixes 1 alert when merging 73a82bc into c4127c2 - view on LGTM.com

fixed alerts:

  • 1 for Except block handles 'BaseException'

@vdahiya12 vdahiya12 requested a review from prgeor January 19, 2022 20:13
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 20, 2022

This pull request fixes 1 alert when merging 067c589 into c4127c2 - view on LGTM.com

fixed alerts:

  • 1 for Except block handles 'BaseException'

@vdahiya12 vdahiya12 merged commit 94fa239 into sonic-net:master Jan 20, 2022
@qiluo-msft
Copy link
Contributor

This commit could not be cleanly cherry-picked to 202012. Please submit another PR.

vdahiya12 pushed a commit to vdahiya12/sonic-platform-daemons that referenced this pull request Jan 28, 2022
…vrd (sonic-net#219)

* [xcvrd] suuport for integrating y cable within xcvrd

This PR separates the logic of Y-Cable from xcvrd. Before this change we were utilizing xcvrd daemon to control all aspects of Y-Cable right from initialization to processing requests from other entities like orch,linkmgr.
Now we would have another daemon ycabled which will serve this purpose.
Logically everything still remains the same from the perspective of other daemons.
it also take care aspects like init/delete daemon from Y-Cable perspective.

dependent-startup                EXITED    Jan 18 05:40 AM

xcvrd                            RUNNING   pid 33, uptime 20:02:58
ycabled                          RUNNING   pid 218, uptime 0:22:12
Motivation and Context
Required for separating the logic of Y-Cable from xcvrd. This is to ensure that the daemon always works and responds to linkmgr to address its requests

How Has This Been Tested?
Built an image with the changes and ran dualtor specific tests on the change on a 7050cx3 testbed.
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
vdahiya12 added a commit that referenced this pull request Jan 31, 2022
…vrd (#237)

* [y_cable] refactor y_cable to a seperate logic and new daemon from xcvrd (#219)

* [xcvrd] suuport for integrating y cable within xcvrd

This PR separates the logic of Y-Cable from xcvrd. Before this change we were utilizing xcvrd daemon to control all aspects of Y-Cable right from initialization to processing requests from other entities like orch,linkmgr.
Now we would have another daemon ycabled which will serve this purpose.
Logically everything still remains the same from the perspective of other daemons.
it also take care aspects like init/delete daemon from Y-Cable perspective.

dependent-startup                EXITED    Jan 18 05:40 AM

xcvrd                            RUNNING   pid 33, uptime 20:02:58
ycabled                          RUNNING   pid 218, uptime 0:22:12
Motivation and Context
Required for separating the logic of Y-Cable from xcvrd. This is to ensure that the daemon always works and responds to linkmgr to address its requests

How Has This Been Tested?
Built an image with the changes and ran dualtor specific tests on the change on a 7050cx3 testbed.
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
vdahiya12 added a commit to sonic-net/sonic-utilities that referenced this pull request Mar 21, 2022
Creating this PR because there was a conflict in #1961 and cherry-pick did not work

Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com

What I did
This PR supports for muxcable status command to support HWSTATUS as well.
the HWSTATUS could be either of these values
consistent/inconsistent/absent/Not-Y-Cable-Port/unknown

How I did it
Made the changes in both sonic-platform-daemons as well as sonic-utilities.
This PR is dependent on sonic-net/sonic-platform-daemons#219

How to verify it
Ran the changes on Arista7260cx3 platform as well as unit-tests

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

PORT         STATUS    HEALTH     HWSTATUS    LAST_SWITCHOVER_TIME
-----------  --------  ---------  ----------  ---------------------------
Ethernet0    active    unhealthy  consistent  2022-Mar-14 19:40:06.851394
Ethernet4    active    unhealthy  consistent  2022-Mar-14 19:40:06.863977
Ethernet8    active    unhealthy  consistent  2022-Mar-14 19:40:06.867504
Ethernet12   active    unhealthy  consistent  2022-Mar-14 19:40:07.149011
Ethernet16   active    unhealthy  consistent  2022-Mar-14 19:40:07.179085
Ethernet20   active    unhealthy  consistent  2022-Mar-14 19:40:07.174677
Ethernet40   active    healthy    consistent  2022-Mar-14 19:40:07.264452
Ethernet44   active    healthy    consistent  2022-Mar-14 19:40:07.452626
Ethernet48   active    unhealthy  consistent  2022-Mar-14 19:40:07.511005
Ethernet52   active    unhealthy  consistent  2022-Mar-14 19:40:07.644608
Ethernet56   active    unhealthy  consistent  2022-Mar-14 19:40:07.630628
Ethernet60   active    unhealthy  consistent  2022-Mar-14 19:40:07.739968
Ethernet64   active    unhealthy  consistent  2022-Mar-14 19:40:07.784666
Ethernet68   active    healthy    consistent  2022-Mar-14 19:40:07.728138
Ethernet72   active    healthy    consistent  2022-Mar-14 19:40:07.901363
Ethernet76   active    healthy    consistent  2022-Mar-14 19:40:07.957279
Ethernet80   active    healthy    consistent  2022-Mar-14 19:40:08.011392
Ethernet84   active    healthy    consistent  2022-Mar-14 19:40:08.149346
Ethernet104  active    healthy    consistent  2022-Mar-14 19:40:09.312243
Ethernet108  active    healthy    consistent  2022-Mar-14 19:40:09.312293
Ethernet112  active    healthy    consistent  2022-Mar-14 19:40:09.313652
Ethernet116  active    healthy    consistent  2022-Mar-14 19:40:09.313820
Ethernet120  active    healthy    consistent  2022-Mar-14 19:40:09.318580
Ethernet124  standby   unhealthy  consistent  2022-Mar-14 19:43:57.893061

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
vdahiya12 pushed a commit to vdahiya12/sonic-platform-daemons that referenced this pull request Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants