-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[DPB][YANG] Add POLL_INTERVAL in flex_counter yang model #9276
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
[DPB][YANG] Add POLL_INTERVAL in flex_counter yang model #9276
Conversation
@stepanblyschak I found that you added this ACL container to sonic-flex_counter yang model. |
@@ -159,6 +159,11 @@ module sonic-flex_counter { | |||
leaf FLEX_COUNTER_DELAY_STATUS { | |||
type flex_delay_status; | |||
} | |||
leaf POLL_INTERVAL { |
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.
How about adding POLL_INTERVAL leaf to every container on the same level here? Why is this fix specific to ACL?
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.
I added the POLL_INTERVAL leaf to ACL container, because only the ACL requires this for DPB feature.
But I will try to add this leaf to other containers and test it.
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.
Do you have other counters enabled in your configuration? I believe if you do, then it will also affect DPB. Don't see anything special about ACL. I think it is better to add it to this PR.
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.
I added POLL_INTERVAL for other containers. But I didn't find poll intervals for some container here: https://github.com/Azure/sonic-utilities/blob/master/counterpoll/main.py
For example, there is no polling interval range for RIF: https://github.com/Azure/sonic-utilities/blob/master/counterpoll/main.py#L254
Therefore, I did not add the poll interval for containers which I did not find in this file.
Maybe you know where I can find these polling intervals?
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.
@noaOrMlnx Please, comment on the RIF poll interval question
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.
@noaOrMlnx thank you.
But here only the default value of poll_interval for RIF.
Do we need a range of polling interval here for the RIF as well as for other containers?
Or we can use only default value without range?
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.
Added RIF poll interval
@praveen-li @lguohan @neethajohn |
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.
Looks good overall to me, Kindly address the comments from other reviewers. Thx
@@ -119,6 +149,12 @@ module sonic-flex_counter { | |||
leaf FLEX_COUNTER_DELAY_STATUS { | |||
type flex_delay_status; | |||
} | |||
leaf POLL_INTERVAL { |
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.
If it stayed in same range and with same default value, then we can have typedef similar as Example:flex_delay_status.
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.
But we have three different ranges and three different default values for POLL_INTERVAL for different containers.
Or do you mean that we can have typedef just for range 1000..30000 and default 10000?
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.
@praveen-li
I added a typedef for poll_interval range 1000..30000 and default 10000.
Comments from other reviewers have been resolved.
Please review.
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.
@praveen-li I added a typedef for all poll_interval ranges. Please review.
/Azp run |
Commenter does not have sufficient privileges for PR 9276 in repo Azure/sonic-buildimage |
cf41ab8
to
052332b
Compare
97ade43
to
7ef8fbf
Compare
7ef8fbf
to
84da083
Compare
/azpw run Azure.sonic-buildimage |
84da083
to
ac4a143
Compare
f9778ca
to
0514390
Compare
@@ -39,6 +57,9 @@ module sonic-flex_counter { | |||
leaf FLEX_COUNTER_DELAY_STATUS { | |||
type flex_delay_status; | |||
} | |||
leaf POLL_INTERVAL { | |||
type poll_interval_range_1s_30s; |
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
It was suggested in the comments to use ranges from this file: https://github.com/Azure/sonic-utilities/blob/master/counterpoll/main.py#L26
When the PR was opened, this range was from 1 to 30 seconds. But two weeks ago, the maximum was increased to the 60 seconds.
About using non-zero uint32: Do you mean using the whole range for uint32: range 1..4294967295? And have only one maximum range for all containers?
Is this correct?
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.
Yes that's my question. How do you think?
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 far as I understand, the POLL_INTERVAL range is limited by the CLI. For example - https://github.com/Azure/sonic-utilities/blob/master/counterpoll/main.py#L94.
I think for consistency, we can have the same maximum range for all containers here. But we should limit the lower bound.
As for me we can use not limiting the upper bound of the polling interval, however the lower bound is useful. Setting the counters polling interval to < 100ms will produce a huge load on the CPU.
The same was written in the comments: #9276 (comment)
So, we can use the same following range for all containers: 100..4294967295.
What do you think?
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
Extended poll interval range to max uint32 with limiting lower bound: range 100..4294967295.
Please review.
Signed-off-by: Mykola Gerasymenko <[email protected]>
Signed-off-by: Mykola Gerasymenko <[email protected]>
@qiluo-msft @praveen-li |
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.
LGTM. Please also check with other reviewers.
Please resolve conflict. |
@akokhan, @stepanblyschak, @dgsudharsan Your review conclusions are dismissed due to new commits. Would you like to check again? |
Conflict has been resolved. |
You mentioned
Can we merge this PR before that one? |
@qiluo-msft |
…#9418) Fixes #9326 #### Why I did it When we try execute DPB from CLI we have error: `libyang[0]: Invalid value "False" in "has_global_scope" element. (path: /sonic-feature:sonic-feature/FEATURE/FEATURE_LIST[name='bgp']/has_global_scope)` The reason for this issue is that has_global_scope and other have been stored in redis database with value False or True form capital letter: ``` "FEATURE":{ "bgp":{ "auto_restart":"enabled", "has_global_scope":"False", "has_per_asic_scope":"True", "has_timer":"False", "high_mem_alert":"disabled", "state":"enabled" } ``` But yang model support boolean just in lowercase letters (https://datatracker.ietf.org/doc/html/rfc6020#section-9.5.1). #### How I did it Added boolean to sonic-types as typedef with different literal cases. #### How to verify it Run the command config interface breakout <breakout_mode> **NOTE:** To verify this fix, the following PRs that fix other problems in SONiC must be merged into master: 1) /pull/9075 2) /pull/9276
#### Why I did it DPB falls due to missing POLL_INTERVAL in sonic-flex_counter yang model. #### How I did it Added POLL_INTERVAL leaf to ACL container in sonic-flex_counter yang model. #### How to verify it Run the command config interface breakout <interface> <breakout_mode> **NOTE:** To verify this fix, a PR ([add set_owner to feature yang](#9075)) that fix another bug in SONiC should be merged to master.
cherry-pick failing in 202106. Please create a new PR |
Why I did it
DPB falls due to missing POLL_INTERVAL in sonic-flex_counter yang model.
How I did it
Added POLL_INTERVAL leaf to ACL container in sonic-flex_counter yang model.
How to verify it
Run the command config interface breakout <breakout_mode>
NOTE:
To verify this fix, a PR (add set_owner to feature yang) that fix another bug in SONiC should be merged to master.
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)