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

[intfsorch] add RIF flex counter group #765

Merged
merged 5 commits into from
Feb 20, 2019
Merged

Conversation

mykolaf
Copy link
Collaborator

@mykolaf mykolaf commented Jan 22, 2019

Signed-off-by: Mykola Faryma [email protected]

What I did

  • add RIF counter flex group
  • add logic to register RIF objects in Flex Counter
    Why I did it

How I verified it

Details if related

@mykolaf
Copy link
Collaborator Author

mykolaf commented Jan 23, 2019

retest this please

}
}

// for (auto it = m_rifsToRemove.begin(); it != m_rifsToRemove.end();)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Commented out by mistake or irrelevant?

@mykolaf
Copy link
Collaborator Author

mykolaf commented Jan 28, 2019

depend on schema sonic-net/sonic-swss-common#256

@lguohan
Copy link
Contributor

lguohan commented Feb 2, 2019

retest this please

/* Initialize DB connectors */
m_counter_db = shared_ptr<DBConnector>(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
m_flex_db = shared_ptr<DBConnector>(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
// m_state_db = shared_ptr<DBConnector>(new DBConnector(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove commented code

string value;
for (auto it = m_rifsToAdd.begin(); it != m_rifsToAdd.end(); ++it)
{
SWSS_LOG_NOTICE("Registering begin -> %s ", it->m_alias.c_str());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we have a separate for-loop for this log? With the log in below for-loop, this appears to be redundant.

for (auto it = m_rifsToAdd.begin(); it != m_rifsToAdd.end(); )
{
const auto id = sai_serialize_object_id(it->m_rif_id);
SWSS_LOG_NOTICE("Registering %s, id %s", it->m_alias.c_str(), id.c_str());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggest to change this to INFO level

}
if (m_vidToRidTable->hget("", id, value))
{
SWSS_LOG_NOTICE("Registering %s it is ready", it->m_alias.c_str());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggest INFO level

{
SWSS_LOG_ENTER();

SWSS_LOG_NOTICE("Registering %ld new intfs, deleting %ld ", m_rifsToAdd.size(), m_rifsToRemove.size());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggest to change to INFO/DEBUG level


SelectableTimer* m_updateMapsTimer = nullptr;
std::vector<Port> m_rifsToAdd;
std::vector<Port> m_rifsToRemove;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see this updated any where. Is it missed?

@@ -466,6 +507,9 @@ bool IntfsOrch::removeRouterIntfs(Port &port)
return false;
}

const auto id = sai_serialize_object_id(port.m_rif_id);
removeRifFromFlexCounter(id, port.m_alias);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this called directly whereas addRifToFlexCounter is based on timer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is due to FC logic.
The Flex counter will try to determine the object's type based on the vid. The VIDTOIRID is not instantly available on create.
For the delete flow it's the opposite.

If there will be some issues with this logic, I believe the FC flow should be changed. Right now it's tricky to dynamically add/remove objects that need to be polled.

Copy link

@tieguoevan tieguoevan May 9, 2019

Choose a reason for hiding this comment

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

How to ensure deleting flex counter is before deleting rif in syncd? If deleting rif happened before deleting flex counter, rid cannot be found in the VIDTOIRID.

Mykola Faryma added 2 commits February 13, 2019 15:54
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
@mykolaf
Copy link
Collaborator Author

mykolaf commented Feb 18, 2019

retest this please

@prsunny prsunny merged commit 920c3a4 into sonic-net:master Feb 20, 2019
@mykolaf mykolaf deleted the rif branch February 18, 2020 13:18
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…d ports (sonic-net#765)

Provided a new ConfigMgmt class for
- Config Validation
- Adding ports
- Deleting ports

Signed-off-by: Praveen Chaudhary [email protected]
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
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.

6 participants