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

Use switch object to detect counter capability in flex counter #1540

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

Conversation

stephenxs
Copy link
Contributor

Use switch object to detect counter capability in flex counter. This is to fix the follow error message on VS platform

This was a day 1 issue but is exposed recently.

E               2025 Feb 20 15:43:21.906623 vlab-03 ERR syncd#syncd: :- queryStatsCapability: parameter switchId oid:0x100000001 object type is SAI_OBJECT_TYPE_PORT, but expected SAI_OBJECT_TYPE_SWITCH
E               
E               2025 Feb 20 15:43:21.910428 vlab-03 ERR syncd#syncd: :- queryStatsCapability: parameter switchId oid:0x1500000003 object type is SAI_OBJECT_TYPE_QUEUE, but expected SAI_OBJECT_TYPE_SWITCH

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -479,6 +479,9 @@ class CounterContext : public BaseCounterContext
{
std::map<std::string, uint32_t> m_counterChunkSizeMapFromPrefix;

protected:
sai_object_id_t m_switchId;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this dont need to be a member, move it to function locally, since you are using this in 1 place

Copy link
Contributor Author

@stephenxs stephenxs Feb 21, 2025

Choose a reason for hiding this comment

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

but I do not want to fetch it every time it is called since the switch id hasn't changed

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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