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

[SmartSwitch] Define DPU helper functions #20724

Merged
merged 10 commits into from
Nov 26, 2024
Merged

Conversation

vvolam
Copy link
Contributor

@vvolam vvolam commented Nov 7, 2024

Why I did it

Add new DPU helper functions to avoid code duplication

Work item tracking
  • Microsoft ADO (number only): 30158318

How I did it

  • Define new is_dpu, get_num_dpus helpers.
  • Define get_platform_json_data and get_dpu_info helper function for common code and refactor code accordingly.

How to verify it

Verified the changes on smart switch

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vvolam vvolam changed the title Define DPU helper functions [SmartSwitch] Define DPU helper functions Nov 11, 2024
prgeor
prgeor previously approved these changes Nov 17, 2024
@prgeor
Copy link
Contributor

prgeor commented Nov 17, 2024

@vvolam please check the build errors

@vvolam
Copy link
Contributor Author

vvolam commented Nov 18, 2024

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vvolam
Copy link
Contributor Author

vvolam commented Nov 18, 2024

@vvolam please check the build errors

@prgeor There is a known build issue which got fixed through #20791. I have restarted the pipeline after the fix.

@lguohan
Copy link
Collaborator

lguohan commented Nov 19, 2024

no unit test?

Copy link

linux-foundation-easycla bot commented Nov 24, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@vvolam
Copy link
Contributor Author

vvolam commented Nov 24, 2024

no unit test?

@lguohan

As coverage check is not present for sonic-buildimage, lot of PRs are missing unit tests which confused me. I have added unittests for all smartswitch function in device_info.py file. Thank you for pointing this.

I will work to add coverage check for sonic-buildimage PRs as well.

@vvolam vvolam requested a review from prgeor November 24, 2024 14:53
prgeor
prgeor previously approved these changes Nov 25, 2024
yxieca
yxieca previously approved these changes Nov 25, 2024
@yxieca yxieca merged commit 5cc485b into sonic-net:master Nov 26, 2024
22 checks passed
VladimirKuk pushed a commit to Marvell-switching/sonic-buildimage that referenced this pull request Jan 21, 2025
Why I did it
Add new DPU helper functions to avoid code duplication

How I did it
Define new is_dpu, get_num_dpus helpers.
Define get_platform_json_data and get_dpu_info helper function for common code and refactor code accordingly.

How to verify it
Verified the changes on smart switch
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.

7 participants