-
Notifications
You must be signed in to change notification settings - Fork 554
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
[flex-counters] Delay flex counters stats init for faster boot time #1749
[flex-counters] Delay flex counters stats init for faster boot time #1749
Conversation
@shlomibitton please resolve conflicts for the review to start. |
Add flex counters unit-test Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
@liat-grozovik done. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@qiluo-msft kindly reminder. we need the fix merged in order to test fastboot and get some improvements. |
This is with the fix to the bug where PORT_STAT is empty on COUNTERS DB as a result of query port counter statistics from the CPU interface. |
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.
As comments
std::unordered_set<std::string> counter_stats; | ||
for (const auto& it: port_stat_ids) | ||
auto flex_counters_orch = gDirectory.get<FlexCounterOrch*>(); | ||
/* Delay installing the counters if they are yet enabled |
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.
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.
@qiluo-msft please check this file:
https://github.com/Azure/sonic-buildimage/blob/master/dockers/docker-orchagent/enable_counters.py#L55
it will enable the counters on CONFIG DB, we handle this change here:
https://github.com/Azure/sonic-swss/pull/1749/files#diff-77a2299548b8c0b1cfa565b28cdc46051dbb6c325d91011fab5fe9df283a03c8R112
and then update m_port_counter_enabled = true
If the counter is already enabled, the normal flow will take place like it used to be before.
…onic-net#1749) **What I did** Update flex counters DB with counters stats only when counters are enabled. As long as the polling counters are not enabled, flex counters information will stored internally on PortsOrch. **Why I did it** Creating flex counters objects on the DB will trigger 'SYNCD' to access the HW for query statistics capabilities. This HW access takes time and will be better to finish boot before doing this (mainly for fast-reboot but good to have in general). The flex counters are not crucial at boot time, we can delay it to the end of the boot process. **How I verified it** Reboot a switch and observer the flex counters DB populated after counters are enabled.
…t time (sonic-net#1749)" (sonic-net#1793) This reverts commit e56c492.
Signed-off-by: Shlomi Bitton shlomibi@nvidia.com
What I did
Update flex counters DB with counters stats only when counters are enabled.
As long as the polling counters are not enabled, flex counters information will stored internally on PortsOrch.
Why I did it
Creating flex counters objects on the DB will trigger 'SYNCD' to access the HW for query statistics capabilities.
This HW access takes time and will be better to finish boot before doing this (mainly for fast-reboot but good to have in general).
The flex counters are not crucial at boot time, we can delay it to the end of the boot process.
How I verified it
Reboot a switch and observer the flex counters DB populated after counters are enabled.
Details if related