-
Notifications
You must be signed in to change notification settings - Fork 283
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -691,6 +691,15 @@ bool RedisClient::hasNoHiddenKeysDefined() const | |
return keys.size() == 0; | ||
} | ||
|
||
bool RedisClient::hasNoSwitchDefined() const | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
auto keys = m_dbAsic->keys("ASIC_STATE:SAI_OBJECT_TYPE_SWITCH:*"); | ||
|
||
return keys.size() == 0; | ||
} | ||
|
||
void RedisClient::removeVidAndRid( | ||
_In_ sai_object_id_t vid, | ||
_In_ sai_object_id_t rid) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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++) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a function for that in sai utils |
||
{ | ||
auto id = attrList[idx].id; | ||
if (id == SAI_SWITCH_ATTR_TYPE && attrList[idx].value.s32 == SAI_SWITCH_TYPE_PHY) | ||
{ | ||
isPhy = true; | ||
break; | ||
} | ||
} | ||
for (uint32_t idx = 0; idx < attrCount; idx++) | ||
{ | ||
auto id = attrList[idx].id; | ||
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can pass all attributes, look at my comment in main thread |
||
{ | ||
attrs.push_back(attrList[idx]); | ||
continue; | ||
|
@@ -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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You already have flag isveryfirst run, why this is modified? |
||
|
||
SWSS_LOG_NOTICE("First Run: %s", firstRun ? "True" : "False"); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why tis is modified?