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

fixed unsupported resource issue #1641

Merged
merged 2 commits into from
Feb 15, 2021

Conversation

PrabhuSreenivasan
Copy link
Contributor

Signed-off-by: Prabhu Sreenivasan [email protected]

Fix sonic-net/sonic-buildimage#6563

What I did
Instead of erasing unsupported resource from m_resourcesMap, mark it as unsupported.

Why I did it
Erasing an entry while iterating using range based iterator makes the iterator invalid.
Also removing a resource from the m_resourcesMap impacts cross access while iterating other maps (eg crmUsedCntsTableMap).

How I verified it
Added a new unsupported resource for testing and verified the logs.

Details if related

Signed-off-by: Prabhu Sreenivasan <[email protected]>
@lguohan
Copy link
Contributor

lguohan commented Feb 15, 2021

/Azurepipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -439,6 +439,10 @@ void CrmOrch::getResAvailableCounters()
sai_attribute_t attr;
attr.id = crmResSaiAvailAttrMap.at(res.first);

// ignore unsupported resources
if (res.second.resStatus != CrmResourceStatus::CRM_RES_SUPPORTED)
continue;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@PrabhuSreenivasan please use { } notation and move it at the beginning of the loop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nazariig , Thanks. I have made the suggested changes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Signed-off-by: Prabhu Sreenivasan <[email protected]>
@qiluo-msft qiluo-msft merged commit de03dd7 into sonic-net:master Feb 15, 2021
@PrabhuSreenivasan PrabhuSreenivasan deleted the crm_loop_issue branch February 16, 2021 10:02
daall pushed a commit that referenced this pull request Feb 16, 2021
Fix sonic-net/sonic-buildimage#6563

**What I did**
Instead of erasing unsupported resource from m_resourcesMap, mark it as unsupported.

**Why I did it**
Erasing an entry while iterating using range based iterator makes the iterator invalid.
Also removing a resource from the m_resourcesMap impacts cross access while iterating other maps (eg crmUsedCntsTableMap).

**How I verified it**
Added a new unsupported resource for testing and verified the logs.
DavidZagury pushed a commit to DavidZagury/sonic-swss that referenced this pull request Mar 4, 2021
Fix sonic-net/sonic-buildimage#6563

**What I did**
Instead of erasing unsupported resource from m_resourcesMap, mark it as unsupported.

**Why I did it**
Erasing an entry while iterating using range based iterator makes the iterator invalid.
Also removing a resource from the m_resourcesMap impacts cross access while iterating other maps (eg crmUsedCntsTableMap).

**How I verified it**
Added a new unsupported resource for testing and verified the logs.
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-swss that referenced this pull request Oct 5, 2021
Fix sonic-net/sonic-buildimage#6563

**What I did**
Instead of erasing unsupported resource from m_resourcesMap, mark it as unsupported.

**Why I did it**
Erasing an entry while iterating using range based iterator makes the iterator invalid.
Also removing a resource from the m_resourcesMap impacts cross access while iterating other maps (eg crmUsedCntsTableMap).

**How I verified it**
Added a new unsupported resource for testing and verified the logs.
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…c-net#1641)

* [console][show] Force refresh all lines status during show line
* Fix UTs

Signed-off-by: Jing Kan [email protected]
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.

Not supported attribute SAI_SWITCH_ATTR_AVAILABLE_IPMC_ENTRY
6 participants