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

Modify get_host_lane_assignment_option to return value based on application id #352

Merged
merged 5 commits into from
Mar 18, 2023

Conversation

mihirpat1
Copy link
Contributor

@mihirpat1 mihirpat1 commented Mar 7, 2023

The changes with this PR needs to be merged along with sonic-net/sonic-platform-daemons#342

Description

The API get_host_lane_assignment_option doesn't return the host_lane_assignment_options using the application id and always returns value from Application Descriptor 1 (AppSel = 1)

Motivation and Context

The API get_host_lane_assignment_option will now take the AppSel id as the input and would return the host_lane_assignment_option from the relevant Application Descriptor

How Has This Been Tested?

Testcase summary
Please refer to the test details attached to sonic-net/sonic-platform-daemons#342

Additional Information (Optional)

@mihirpat1 mihirpat1 changed the title Channel breakout support Retrieve channel from CONFIG_DB to enable breakout support Mar 7, 2023
@mihirpat1
Copy link
Contributor Author

@prgeor @jaganbal-a @keboliu @shyam77git - It will be great if you can help in reviewing this PR

@mihirpat1 mihirpat1 marked this pull request as ready for review March 7, 2023 07:53
@mihirpat1 mihirpat1 requested a review from prgeor March 7, 2023 07:53
@shyam77git
Copy link

Please add UT cases and logs

@prgeor prgeor requested a review from keboliu March 7, 2023 18:14
@prgeor
Copy link
Collaborator

prgeor commented Mar 7, 2023

@shyam77git @jaganbal-a please review

@prgeor
Copy link
Collaborator

prgeor commented Mar 7, 2023

@keboliu please review

@prgeor prgeor self-assigned this Mar 7, 2023
@prgeor prgeor added the CMIS label Mar 7, 2023
@mihirpat1
Copy link
Contributor Author

Please add UT cases and logs

I have updated it now.

'''
return self.xcvr_eeprom.read(consts.HOST_LANE_ASSIGNMENT_OPTION)
appl_advt = self.get_application_advertisement()
return appl_advt[app]['host_lane_assignment_options'] if len(appl_advt) > 0 else 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we check if app is within the number of appl_advt[]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I have now added check for appl <= 0 now as well.

@@ -715,11 +715,15 @@ def get_media_interface_technology(self):
'''
return self.xcvr_eeprom.read(consts.MEDIA_INTERFACE_TECH)

def get_host_lane_assignment_option(self):
def get_host_lane_assignment_option(self, app=1):
Copy link
Collaborator

Choose a reason for hiding this comment

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

PR title does not seem to be matching with this API change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated the PR title now

@mihirpat1 mihirpat1 changed the title Retrieve channel from CONFIG_DB to enable breakout support Modify get_host_lane_assignment_option to return value based on application id Mar 9, 2023
@prgeor prgeor merged commit bbaa678 into sonic-net:master Mar 18, 2023
yxieca pushed a commit that referenced this pull request Mar 24, 2023
…cation id (#352)

* Retrieve channel from CONFIG_DB to enable breakout support

Signed-off-by: Mihir Patel <patelmi@microsoft.com>

* Enhanced test_get_host_lane_assignment_option

* Resolved test case failure

* Addressed review comments

---------

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
yxieca pushed a commit that referenced this pull request Aug 29, 2023
…cation id (#352)

* Retrieve channel from CONFIG_DB to enable breakout support

Signed-off-by: Mihir Patel <patelmi@microsoft.com>

* Enhanced test_get_host_lane_assignment_option

* Resolved test case failure

* Addressed review comments

---------

Signed-off-by: Mihir Patel <patelmi@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.

4 participants