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] [active-standby] add changes for correcting telemetry values for 'active-standby' when the cable is present but vendor name and part number is not recognized #478

Merged
merged 3 commits into from
May 1, 2024

Conversation

vdahiya12
Copy link
Contributor

@vdahiya12 vdahiya12 commented Apr 24, 2024

Description

This change creates unknown, N/A values for active-standby cable type
Since streaming telemetry today looks for active-standby for posting values to State DB, this change introduces a one time posting of fields with 'pseudo-cable' type when cable port instances are attempted to be created by ycabled.

For almost all cases this was covered except when vendor name and part number does not match to our mapping logic today

mapping = {
    "credo": {
        "cacl05321p2pa1ms": "credo.y_cable_credo",
        "cacl1x321p2pa1ms": "credo.y_cable_credo",
        "cacl15321p2pa1ms": "credo.y_cable_credo",
        "cacl2x321p2pa1ms": "credo.y_cable_credo",

        "cac105321p2pa2ms": "credo.y_cable_credo",
        "cac11x321p2pa2ms": "credo.y_cable_credo",
        "cac115321p2pa2ms": "credo.y_cable_credo",
        "cac12x321p2pa2ms": "credo.y_cable_credo"
    },
    "molex": {
        "2164351001": "broadcom.y_cable_broadcom",
        "2164351002": "broadcom.y_cable_broadcom",
        "2164351003": "broadcom.y_cable_broadcom",
        "2164351004": "broadcom.y_cable_broadcom",
        "2164352001": "broadcom.y_cable_broadcom",
        "2164352002": "broadcom.y_cable_broadcom",
        "2164352003": "broadcom.y_cable_broadcom",
        "2164352004": "broadcom.y_cable_broadcom",
        "2164352501": "broadcom.y_cable_broadcom",
        "2164352502": "broadcom.y_cable_broadcom",
        "2164352503": "broadcom.y_cable_broadcom",
        "2164352504": "broadcom.y_cable_broadcom"
    },
    "microsoft": {
        "simulated": "microsoft.y_cable_simulated"
    }
}

This change should cover such an issue

as their will be a one-time post of such values

vdahiya@sonic:~$ redis-cli -n 6 hgetall "MUX_CABLE_INFO|Ethernet48"
 1) "tor_active"
 2) "unknown"
 3) "time_post"
 4) "2024-Apr-29 22:45:07.495362"
 5) "mux_direction"
 6) "unknown"
 7) "manual_switch_count"
 8) "N/A"
 9) "auto_switch_count"
10) "N/A"
11) "link_status_self"
12) "unknown"
13) "link_status_peer"
14) "unknown"
15) "link_status_nic"
16) "unknown"
17) "self_eye_height_lane1"
18) "N/A"

Motivation and Context

How Has This Been Tested?

UT and posting the changes on test device.

MSFT ADO

27242275

Additional Information (Optional)

for 'active-standby' when the cable is present but vendor name and part
number is not recognized

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 requested a review from prgeor April 24, 2024 23:20
vdahiya12 and others added 2 commits April 26, 2024 19:40
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@prgeor prgeor merged commit 9d0c550 into sonic-net:master May 1, 2024
5 checks passed
@vdahiya12
Copy link
Contributor Author

@StormLiangMS @yxieca please cherry-pick into the branches tagged

mssonicbld pushed a commit to mssonicbld/sonic-platform-daemons that referenced this pull request May 9, 2024
…s for 'active-standby' when the cable is present but vendor name and part number is not recognized (sonic-net#478)

* [ycabled] [active-standby] add changes for correcting telemetry values
for 'active-standby' when the cable is present but vendor name and part
number is not recognized

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

* add tests

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

---------

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

Cherry-pick PR to 202305: #486

mssonicbld pushed a commit that referenced this pull request May 9, 2024
…s for 'active-standby' when the cable is present but vendor name and part number is not recognized (#478)

* [ycabled] [active-standby] add changes for correcting telemetry values
for 'active-standby' when the cable is present but vendor name and part
number is not recognized

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

* add tests

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

---------

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
mssonicbld pushed a commit to mssonicbld/sonic-platform-daemons that referenced this pull request Aug 28, 2024
…s for 'active-standby' when the cable is present but vendor name and part number is not recognized (sonic-net#478)

* [ycabled] [active-standby] add changes for correcting telemetry values
for 'active-standby' when the cable is present but vendor name and part
number is not recognized

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

* add tests

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

---------

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

Cherry-pick PR to 202311: #536

mssonicbld pushed a commit that referenced this pull request Aug 28, 2024
…s for 'active-standby' when the cable is present but vendor name and part number is not recognized (#478)

* [ycabled] [active-standby] add changes for correcting telemetry values
for 'active-standby' when the cable is present but vendor name and part
number is not recognized

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

* add tests

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

---------

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants