Skip to content

[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

Conversation

mykolaxgerasymenko
Copy link
Contributor

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)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@mykolaxgerasymenko
Copy link
Contributor Author

@stepanblyschak I found that you added this ACL container to sonic-flex_counter yang model.
Please review my changes.

akokhan
akokhan previously approved these changes Nov 16, 2021
@@ -159,6 +159,11 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

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?

Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added RIF poll interval

stepanblyschak
stepanblyschak previously approved these changes Nov 17, 2021
@mykolaxgerasymenko
Copy link
Contributor Author

@praveen-li @lguohan @neethajohn
Please review.

Copy link
Member

@praveen-li praveen-li left a 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 {
Copy link
Member

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.

Copy link
Contributor Author

@mykolaxgerasymenko mykolaxgerasymenko Nov 18, 2021

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@mykolaxgerasymenko
Copy link
Contributor Author

/Azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 9276 in repo Azure/sonic-buildimage

@mykolaxgerasymenko mykolaxgerasymenko force-pushed the mykolag/poll_interval_missing_in_yang branch from cf41ab8 to 052332b Compare November 22, 2021 10:21
@qiluo-msft qiluo-msft added the YANG YANG model related changes label Nov 22, 2021
@mykolaxgerasymenko mykolaxgerasymenko force-pushed the mykolag/poll_interval_missing_in_yang branch 2 times, most recently from 97ade43 to 7ef8fbf Compare November 24, 2021 18:06
@mykolaxgerasymenko mykolaxgerasymenko force-pushed the mykolag/poll_interval_missing_in_yang branch from 7ef8fbf to 84da083 Compare November 26, 2021 09:12
@Junchao-Mellanox
Copy link
Collaborator

/azpw run Azure.sonic-buildimage

@mykolaxgerasymenko mykolaxgerasymenko force-pushed the mykolag/poll_interval_missing_in_yang branch from 84da083 to ac4a143 Compare November 30, 2021 11:11
@mykolaxgerasymenko mykolaxgerasymenko force-pushed the mykolag/poll_interval_missing_in_yang branch from f9778ca to 0514390 Compare November 30, 2021 18:46
dgsudharsan
dgsudharsan previously approved these changes Nov 30, 2021
@@ -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;
Copy link
Collaborator

@qiluo-msft qiluo-msft Dec 1, 2021

Choose a reason for hiding this comment

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

poll_interval_range_1s_30s

type poll_interval_range_1s_30s;


Is there a technical reason that the maximal is 30s? How about just using non-zero uint32? #Closed

Copy link
Contributor Author

@mykolaxgerasymenko mykolaxgerasymenko Dec 1, 2021

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?

Copy link
Collaborator

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?

Copy link
Contributor Author

@mykolaxgerasymenko mykolaxgerasymenko Dec 2, 2021

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?

Copy link
Contributor Author

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.

@mykolaxgerasymenko
Copy link
Contributor Author

@qiluo-msft @praveen-li
Addresses comments were resolved. Could you please review?

qiluo-msft
qiluo-msft previously approved these changes Dec 6, 2021
Copy link
Collaborator

@qiluo-msft qiluo-msft left a 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.

@qiluo-msft
Copy link
Collaborator

Please resolve conflict.

@qiluo-msft
Copy link
Collaborator

@akokhan, @stepanblyschak, @dgsudharsan Your review conclusions are dismissed due to new commits. Would you like to check again?

@mykolaxgerasymenko
Copy link
Contributor Author

Please resolve conflict.

Conflict has been resolved.

@qiluo-msft
Copy link
Collaborator

You mentioned

To verify this fix, a PR (add set_owner to feature yang) that fix another bug in SONiC should be merged to master.

Can we merge this PR before that one?

@mykolaxgerasymenko
Copy link
Contributor Author

You mentioned

To verify this fix, a PR (add set_owner to feature yang) that fix another bug in SONiC should be merged to master.

Can we merge this PR before that one?

@qiluo-msft
I think we can merge this PR before #9075. These are two independent issues.
But merging can lead to conflicts in 9075 that need to be resolved.
Also we can merge #9418.

@qiluo-msft qiluo-msft merged commit b0f06ba into sonic-net:master Dec 8, 2021
qiluo-msft pushed a commit that referenced this pull request Dec 10, 2021
…#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
judyjoseph pushed a commit that referenced this pull request Dec 27, 2021
#### 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.
@arlakshm
Copy link
Contributor

arlakshm commented Mar 1, 2022

cherry-pick failing in 202106. Please create a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Included in 202111 Branch Request for 202106 Branch Request for 202111 Branch For PRs being requested for 202111 branch YANG YANG model related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.