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

[Mellanox] Enhance is_module_host_management_mode to also check syncd's sai.profile #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tshalvi
Copy link
Owner

@tshalvi tshalvi commented Jun 10, 2024

Why I did it

Two steps are required to enable the host CMIS management feature: enabling it in the switch's sai.profile and performing a config reload. During the timeframe between these two steps, the control sysfs might be accessed, but they will not be present on the system until the latter step, the config reload, is completed. The code should try to access the control sysfs only after the config reload step. A good indication that this has been done is to check if the relevant entry is included in syncd's sai.profile. In contrast to the switch's sai.profile, syncd's sai.profile is only updated with the Host CMIS management support flag after the reload is complete.

Work item tracking
  • Microsoft ADO (number only):

How I did it

I updated the is_module_host_management_mode() implementation to first look for the Host CMIS management support flag in syncd's sai.profile, and only if it does not exist for some reason, look for it in the switch's sai.profile.

How to verify it

Add the Host CMIS management support flag to the switch's sai.profile and verify that the following log does not appear:
ERR pmon#xcvrd: Exception occured at DomInfoUpdateTask thread due to Exception('control sysfs for SFP 20 does not exist')

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)

…for the Host CMIS management flag in syncd's sai.profile
@@ -267,12 +267,16 @@ def get_cpld_component_list(cls):
@classmethod
@utils.read_only_cache()
def is_module_host_management_mode(cls):
sai_profile_file_syncd = os.path.join('/tmp/', 'sai.profile')
if os.path.exists(sai_profile_file_syncd):

Choose a reason for hiding this comment

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

I would suggest to add an "else" - if this file doesn't exist for some reason, try to check the under-sku file.
Need to think if we want to have this approach -
on the one hand it may cause the bug to appear again. on the second hand, it is under /tmp/ folder and might be deleted. we want to continue the flow even if file was deleted from inside the docker.

tshalvi pushed a commit that referenced this pull request Sep 24, 2024
* Update to Linux 6.1.94

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>

* Integrate HW-MGMT 7.0040.1008 Changes (#18)

* Integrate HW-MGMT 7.0040.1011 Changes (#19)

* Update sonic-linux-kernel submodule (#20)

Signed-off-by: Vivek Reddy <vkarri@nvidia.com>

---------

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
Co-authored-by: Vivek <vivekreddykarri98@gmail.com>
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.

2 participants