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

Fix for credo gbsyncd warm-reboot #1499

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

Conversation

byu343
Copy link
Contributor

@byu343 byu343 commented Jan 14, 2025

To support credo gbsyncd warm-reboot, we found several issues to be fixed in sonic-sairedis as follows:

  1. More attributes are needed for the create_switch of credo gbsyncd warm-boot. The fix here is to pass all the attributes when SAI_SWITCH_ATTR_TYPE is SAI_SWITCH_TYPE_PHY.
  2. firstRun being true disallows the start of warm-reboot. It was set to true when no switch attributes is found under the key of HIDDEN* in ASIC_DB or GB_ASIC_DB. However, all such HIDDEN attributes are unrelated to the credo gbsyncd, so hasNoHiddenKeysDefined is always true for gbsyncd. The fix here is to determine the first run also based on no switch objects having been created in ASIC_DB or GB_ASIC_DB.
  3. SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP is not supported by credo gbsyncd and unrelated to it. Skip the steps related to it when it is not available

More attributes are needed for the create_switch of credo gbsyncd
warm-boot. The fix here is to pass all the attributes when SAI_SWITCH_ATTR_TYPE is SAI_SWITCH_TYPE_PHY.
firstRun being true disallows the start of warm-reboot.
It was set to true when no switch attributes is found under the key of
HIDDEN* in ASIC_DB or GB_ASIC_DB. However, all such attributes are unrelated
to the credo gbsyncd, so hasNoHiddenKeysDefined is always true for gbsyncd.
The fix here is to determine the first run also based
on no switch objects has been created in ASIC_DB or GB_ASIC_DB.
… supported

SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP is not supported by credo gbsyncd.
Skip the steps related to it when it is not available
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kcudnik
Copy link
Collaborator

kcudnik commented Jan 14, 2025

This needs to be discussed, nice passing more attributes in warm boot make no sense, by design warm boot should have the same attributes after warm boot. Exception is attributes pointers which changes because of memory allocation for syncd process and hardware info to point which switch should be instantiated. If you are changing this then there is some issue inside libsai in vendor code for warm boot

@@ -61,9 +61,26 @@ ComparisonLogic::ComparisonLogic(

// TODO needs to be removed and done in generic

m_current->m_defaultTrapGroupRid = m_switch->getSwitchDefaultAttrOid(SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP);
m_temp->m_defaultTrapGroupRid = m_switch->getSwitchDefaultAttrOid(SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP);
try
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why tis is modified?

@@ -691,6 +691,15 @@ bool RedisClient::hasNoHiddenKeysDefined() const
return keys.size() == 0;
}

bool RedisClient::hasNoSwitchDefined() const
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why there would be no switch? What is purpose of this? You have flag isveryfirstrun

@@ -4645,7 +4645,16 @@ void Syncd::performWarmRestartSingleSwitch(
sai_attribute_t *attrList = list.get_attr_list();

uint32_t attrCount = list.get_attr_count();

bool isPhy = false;
for (uint32_t idx = 0; idx < attrCount; idx++)
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a function for that in sai utils

@@ -4662,7 +4671,7 @@ void Syncd::performWarmRestartSingleSwitch(
* new process could be loaded at different address space.
*/

if (id == SAI_SWITCH_ATTR_SWITCH_HARDWARE_INFO || meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_POINTER)
if (isPhy || id == SAI_SWITCH_ATTR_SWITCH_HARDWARE_INFO || meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_POINTER)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can pass all attributes, look at my comment in main thread

@@ -5103,7 +5112,7 @@ bool Syncd::isVeryFirstRun()
* this is first run, let's query HIDDEN ?
*/

bool firstRun = m_client->hasNoHiddenKeysDefined();
bool firstRun = m_client->hasNoHiddenKeysDefined() && m_client->hasNoSwitchDefined();
Copy link
Collaborator

Choose a reason for hiding this comment

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

You already have flag isveryfirst run, why this is modified?

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.

3 participants