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

[yang]YANG model for policer table #23

Closed
wants to merge 2 commits into from
Closed

Conversation

dgsudharsan
Copy link
Owner

Signed-off-by: Sudharsan Dhamal Gopalarathnam sudharsand@nvidia.com

Why I did it

Added yang model for policer table

How I did it

Creating yang model for policer

How to verify it

Added unit tests to verify the change.

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)

Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
@dgsudharsan dgsudharsan changed the title [yang]YANG changes for policer table [yang]YANG model for policer table Feb 5, 2022
}


typedef policer_packet_action {

Choose a reason for hiding this comment

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

Wonder why it is called "policer_packet_action". This enum derives from sai_packet_action_t and can be reused accross different modules, not just policer. I suggest calling it just "packet_action".

EDIT: I see that in the implementation inside orchagent, copporch and policerorch packet_action_map are two different maps, thus I suggest to leave copp_packet_action and add policer_packet_action with same content to reflect that. Otherwise adding a new action to packet_action_map inside copporch would require automatic support of this action from policerorch when adding it here, which might not be supported.

Ideally, copporch should be reusing the implementation of policerorch and then it could be a single typedef of policer_packet_action but I don't see that is how it works.

Copy link
Owner Author

Choose a reason for hiding this comment

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

@stepanblyschak Currently both policerorch and copporch support the same actions. IMO the code is duplicate (which should be cleaned up) and I don't see a scenario where an action supported in copp orch will not be supported in policerorch or vice versa. In fact in both examples we just map the value to SAI attribute and invoke create policer. Since copp uses policer I feel it's better not to duplicate it at yang level.

Comment on lines +1 to +5
{% if yang_model_type == "cvl" %}
/* this is sonic cvl yang model */
{% else %}
/* this is sonic py yang model */
{% endif %}

Choose a reason for hiding this comment

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

What is the purpose to be a jinja template and have these comments?

Copy link
Owner Author

@dgsudharsan dgsudharsan Feb 8, 2022

Choose a reason for hiding this comment

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

The j2 template was introduced recently. The main purpose is to support both config management class (py yang) which DPB and other sonic applications use as well as sonic-mgmt framework (cvl).
Currently this is just used for comments but in the future we could add more j2 checks. So It is better to define it as j2 instead of json.

@dgsudharsan dgsudharsan closed this Feb 9, 2022
dgsudharsan pushed a commit that referenced this pull request Mar 8, 2022
ce72b0d Longxiang Lyu Thu Feb 24 06:05:12 2022 Put handler member functions as virtual in base (#30)
ef59e4f Jing Zhang Fri Feb 25 11:38:28 2022 Incrementing tolerance on mux state inconsistency (#27)
2d12892 Longxiang Lyu Wed Feb 16 03:32:06 2022 Rename LinkManagerStateMachine to ActiveStandbyStateMachine (#26)
f38634c Jing Zhang Thu Feb 17 17:23:56 2022 Update log level for mux probing and mux state chance (#23)
a8434dd Jing Zhang Thu Feb 17 17:21:01 2022 Handle xcvrd crashing scenarios (#22)
2ebdb2b Longxiang Lyu Mon Feb 14 13:26:07 2022 [make] Enable make extra includes (#24)
dgsudharsan pushed a commit that referenced this pull request Mar 23, 2022
Changes:

Update submodule branch to 202012
[sonic-linkmgrd][202012] submodule update

a8ddff5 Jing Zhang Fri Feb 25 11:38:28 2022 Incrementing tolerance on mux state inconsistency (#27)
a3f78a3 Jing Zhang Thu Feb 17 17:23:56 2022 Update log level for mux probing and mux state chance (#23)
05156fb Jing Zhang Thu Feb 17 17:21:01 2022 Handle xcvrd crashing scenarios (#22)
74529ef Longxiang Lyu Mon Feb 14 13:26:07 2022 [make] Enable make extra includes (#24)

sign-off: Jing Zhang zhangjing@microsoft.com
dgsudharsan pushed a commit that referenced this pull request Jun 7, 2022
[sonic-linkmgrd][master] Submodule Update

9c8a16e Jing Zhang Sun Jun 5 08:27:07 2022 -0700 Separate I2C mux state probing and gRPC forwarding state probing (#86)
491c4ee Longxiang Lyu Sun Jun 5 23:26:19 2022 +0800 Fix peer mux wait back off factor (#84)
a0b6b14 Jing Zhang Wed Jun 1 10:33:12 2022 -0700 Revert "Update log level for mux probing and mux state chance (#23)" (#85)
3c2b546 Jing Zhang Tue May 31 10:14:42 2022 -0700 Add default route support to active-active state machine (#78)
6fa892e Longxiang Lyu Fri May 27 09:15:06 2022 +0800 Degrade LinkProberStateMachineBase virtual function logging level (#80)
7b695ca Longxiang Lyu Fri May 27 09:14:02 2022 +0800 Fix mux wait timer and peer mux wait timer (#81)
dgsudharsan pushed a commit that referenced this pull request Jun 30, 2022
[sonic-linkmgrd][202012] submodule update

0839af2 Longxiang Lyu Wed Jun 15 08:46:21 2022 +0800 [202012] Fix IP header checksum in handleSendSwitchCommand (#89)
afc4972 Jing Zhang Wed Jun 1 10:33:12 2022 -0700 Revert "Update log level for mux probing and mux state chance (#23)" (#85)
ed52d0a Longxiang Lyu Tue May 31 10:28:30 2022 +0800 Add a command line option to store logs into a separate file (#83)

sign-off: Jing Zhang zhangjing@microsoft.com
dgsudharsan pushed a commit that referenced this pull request Jul 6, 2022
linkmgrd:
* d27ca81 2022-06-05 |  Separate I2C mux state probing and gRPC forwarding state probing  (#86) (HEAD -> 202205) [Jing Zhang]
* 9d7d301 2022-06-01 | Revert "Update log level for mux probing and mux state chance (#23)" (#85) [Jing Zhang]
* 60d3d77 2022-06-05 | Fix peer mux wait back off factor (#84) [Longxiang Lyu]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
dgsudharsan pushed a commit that referenced this pull request Oct 7, 2024
…tically (sonic-net#19465)

src/sonic-dash-api

* 43d9f7c - (HEAD -> 202311, origin/202311) [build]Update pool sonicbld to sonic-ububtu-1c since it's deprecated (#23) (23 hours ago) [Jianquan Ye]
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.

2 participants