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

Add support for snat, dnat and ipmc crm resources #1258

Merged
merged 2 commits into from
Dec 23, 2020

Conversation

PrabhuSreenivasan
Copy link
Contributor

@PrabhuSreenivasan PrabhuSreenivasan commented Nov 20, 2020

Signed-off-by: Prabhu Sreenivasan [email protected]

- What I did
Added support for snat, dnat and ipmc resources under CRM module.

- How I did it
New feature NAT adds new resources snat_enty and dnat_entry that needs to be monitored. ipmc_entry tracks IP multicast resources used by switch.

- How to verify it
sonic-utilities tests and crm spytest

- Associated PRs
sonic-net/sonic-swss#1511
sonic-net/sonic-buildimage#6012

- Previous command output (if the output of a command-line utility has changed)


root@sonic:/home/admin# crm show thresholds all

Resource Name         Threshold Type      Low Threshold    High Threshold
--------------------  ----------------  ---------------  ----------------
ipv4_route            percentage                     70                85
ipv6_route            percentage                     70                85
ipv4_nexthop          percentage                     70                85
ipv6_nexthop          percentage                     70                85
ipv4_neighbor         percentage                     70                85
ipv6_neighbor         percentage                     70                85
nexthop_group_member  percentage                     70                85
nexthop_group         percentage                     70                85
acl_table             percentage                     70                85
acl_group             percentage                     70                85
acl_entry             percentage                     70                85
acl_counter           percentage                     70                85
fdb_entry             percentage                     70                85


root@sonic:/home/admin# crm show resources all

Resource Name           Used Count    Available Count
--------------------  ------------  -----------------
ipv4_route                      54              32698
ipv6_route                       2              10238
ipv4_nexthop                     0              65460
ipv6_nexthop                     0              65460
ipv4_neighbor                    0              24576
ipv6_neighbor                    0              12288
nexthop_group_member             0              32768
nexthop_group                    0                256
fdb_entry                        0              65535


Stage    Bind Point    Resource Name      Used Count    Available Count
-------  ------------  ---------------  ------------  -----------------
INGRESS  PORT          acl_group                   0                256
INGRESS  PORT          acl_table                   0                  3
INGRESS  LAG           acl_group                   0                256
INGRESS  LAG           acl_table                   0                  3
INGRESS  VLAN          acl_group                   0                256
INGRESS  VLAN          acl_table                   0                  9
INGRESS  RIF           acl_group                   0                256
INGRESS  RIF           acl_table                   0                  9
INGRESS  SWITCH        acl_group                   0                256
INGRESS  SWITCH        acl_table                   0                  9
EGRESS   PORT          acl_group                   0                256
EGRESS   PORT          acl_table                   0                  2
EGRESS   LAG           acl_group                   0                256
EGRESS   LAG           acl_table                   0                  2
EGRESS   VLAN          acl_group                   0                256
EGRESS   VLAN          acl_table                   0                  2
EGRESS   RIF           acl_group                   0                256
EGRESS   RIF           acl_table                   0                  2
EGRESS   SWITCH        acl_group                   0                256
EGRESS   SWITCH        acl_table                   0                  2


Table ID    Resource Name    Used Count    Available Count
----------  ---------------  ------------  -----------------

- New command output (if the output of a command-line utility has changed)

root@sonic:/home/admin# crm show thresholds all

Resource Name         Threshold Type      Low Threshold    High Threshold
--------------------  ----------------  ---------------  ----------------
ipv4_route            percentage                     70                85
ipv6_route            percentage                     70                85
ipv4_nexthop          percentage                     70                85
ipv6_nexthop          percentage                     70                85
ipv4_neighbor         percentage                     70                85
ipv6_neighbor         percentage                     70                85
nexthop_group_member  percentage                     70                85
nexthop_group         percentage                     70                85
acl_table             percentage                     70                85
acl_group             percentage                     70                85
acl_entry             percentage                     70                85
acl_counter           percentage                     70                85
fdb_entry             percentage                     70                85
ipmc_entry            percentage                     70                85
snat_entry            percentage                     70                85
dnat_entry            percentage                     70                85

root@sonic:/home/admin# crm show thresholds snat

Resource Name    Threshold Type      Low Threshold    High Threshold
---------------  ----------------  ---------------  ----------------
snat_entry       percentage                     70                85

root@sonic:/home/admin# crm show thresholds dnat

Resource Name    Threshold Type      Low Threshold    High Threshold
---------------  ----------------  ---------------  ----------------
dnat_entry       percentage                     70                85

root@sonic:/home/admin# crm show thresholds ipmc

Resource Name    Threshold Type      Low Threshold    High Threshold
---------------  ----------------  ---------------  ----------------
ipmc_entry       percentage         

root@sonic:/home/admin# crm show resources snat

Resource Name      Used Count    Available Count
---------------  ------------  -----------------
snat_entry                  0               1024

root@sonic:/home/admin# crm show resources dnat

Resource Name      Used Count    Available Count
---------------  ------------  -----------------
dnat_entry                  0               1024

root@sonic:/home/admin# crm show resources ipmc

Resource Name      Used Count    Available Count
---------------  ------------  -----------------
ipmc_entry                  0              24576

root@sonic:/home/admin# crm show resources all

Resource Name           Used Count    Available Count
--------------------  ------------  -----------------
ipv4_route                      54              32698
ipv6_route                       2              10238
ipv4_nexthop                     0              65460
ipv6_nexthop                     0              65460
ipv4_neighbor                    0              24576
ipv6_neighbor                    0              12288
nexthop_group_member             0              32768
nexthop_group                    0                256
fdb_entry                        0              65535
ipmc_entry                       0              24576
snat_entry                       0               1024
dnat_entry                       0               1024


Stage    Bind Point    Resource Name      Used Count    Available Count
-------  ------------  ---------------  ------------  -----------------
INGRESS  PORT          acl_group                   0                256
INGRESS  PORT          acl_table                   0                  3
INGRESS  LAG           acl_group                   0                256
INGRESS  LAG           acl_table                   0                  3
INGRESS  VLAN          acl_group                   0                256
INGRESS  VLAN          acl_table                   0                  9
INGRESS  RIF           acl_group                   0                256
INGRESS  RIF           acl_table                   0                  9
INGRESS  SWITCH        acl_group                   0                256
INGRESS  SWITCH        acl_table                   0                  9
EGRESS   PORT          acl_group                   0                256
EGRESS   PORT          acl_table                   0                  2
EGRESS   LAG           acl_group                   0                256
EGRESS   LAG           acl_table                   0                  2
EGRESS   VLAN          acl_group                   0                256
EGRESS   VLAN          acl_table                   0                  2
EGRESS   RIF           acl_group                   0                256
EGRESS   RIF           acl_table                   0                  2
EGRESS   SWITCH        acl_group                   0                256
EGRESS   SWITCH        acl_table                   0                  2


Table ID    Resource Name    Used Count    Available Count
----------  ---------------  ------------  -----------------

@lguohan
Copy link
Contributor

lguohan commented Nov 20, 2020

please add unit tests accordingly.

Signed-off-by: Prabhu Sreenivasan <[email protected]>
Signed-off-by: Prabhu Sreenivasan <prabhu.sreenivasan@broadcom>
@PrabhuSreenivasan
Copy link
Contributor Author

please add unit tests accordingly.

I have updated the PR with sonic-utilities test cases for the newly added resources.

lguohan
lguohan previously approved these changes Nov 25, 2020
Copy link
Contributor

@lguohan lguohan left a comment

Choose a reason for hiding this comment

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

i am wondering if there is no data in the db, what is the output, will the command throw exception?

@PrabhuSreenivasan
Copy link
Contributor Author

i am wondering if there is no data in the db, what is the output, will the command throw exception?

When no data on CONFIG_DB, crm show threshold CLI command will not have these resources listed.
When no data on COUNTERS_DB, crm show resources CLI command will not have these resources, instead will print

CRM counters are not ready. They would be populated after the polling interval.

No exception will be observed on both cases.

root@sonic:/home/admin# crm show thresholds all

Resource Name         Threshold Type      Low Threshold    High Threshold
--------------------  ----------------  ---------------  ----------------
ipv4_route            percentage                     70                85
ipv6_route            percentage                     70                85
ipv4_nexthop          percentage                     70                85
ipv6_nexthop          percentage                     70                85
ipv4_neighbor         percentage                     70                85
ipv6_neighbor         percentage                     70                85
nexthop_group_member  percentage                     70                85
nexthop_group         percentage                     70                85
acl_table             percentage                     70                85
acl_group             percentage                     70                85
acl_entry             percentage                     70                85
acl_counter           percentage                     70                85
fdb_entry             percentage                     70                85


root@sonic:/home/admin# crm show thresholds snat

Resource Name    Threshold Type      Low Threshold    High Threshold
---------------  ----------------  ---------------  ----------------


root@sonic:/home/admin# crm show thresholds dnat

Resource Name    Threshold Type      Low Threshold    High Threshold
---------------  ----------------  ---------------  ----------------


root@sonic:/home/admin# crm show thresholds ipmc

Resource Name    Threshold Type      Low Threshold    High Threshold
---------------  ----------------  ---------------  ----------------


root@sonic:/home/admin# crm show resources all

Resource Name           Used Count    Available Count
--------------------  ------------  -----------------
ipv4_route                      65              32687
ipv6_route                       2              10238
ipv4_nexthop                     0              65476
ipv6_nexthop                     0              65476
ipv4_neighbor                    0              24576
ipv6_neighbor                    0              12288
nexthop_group_member             0              32768
nexthop_group                    0                256
fdb_entry                        0              65535


Stage    Bind Point    Resource Name      Used Count    Available Count
-------  ------------  ---------------  ------------  -----------------
INGRESS  PORT          acl_group                   0                256
INGRESS  PORT          acl_table                   0                  3
INGRESS  LAG           acl_group                   0                256
INGRESS  LAG           acl_table                   0                  3
INGRESS  VLAN          acl_group                   0                256
INGRESS  VLAN          acl_table                   0                  9
INGRESS  RIF           acl_group                   0                256
INGRESS  RIF           acl_table                   0                  9
INGRESS  SWITCH        acl_group                   0                256
INGRESS  SWITCH        acl_table                   0                  9
EGRESS   PORT          acl_group                   0                256
EGRESS   PORT          acl_table                   0                  2
EGRESS   LAG           acl_group                   0                256
EGRESS   LAG           acl_table                   0                  2
EGRESS   VLAN          acl_group                   0                256
EGRESS   VLAN          acl_table                   0                  2
EGRESS   RIF           acl_group                   0                256
EGRESS   RIF           acl_table                   0                  2
EGRESS   SWITCH        acl_group                   0                256
EGRESS   SWITCH        acl_table                   0                  2


Table ID    Resource Name    Used Count    Available Count
----------  ---------------  ------------  -----------------

root@sonic:/home/admin# crm show resources snat

CRM counters are not ready. They would be populated after the polling interval.
root@sonic:/home/admin# crm show resources dnat

CRM counters are not ready. They would be populated after the polling interval.
root@sonic:/home/admin# crm show resources ipmc

CRM counters are not ready. They would be populated after the polling interval.
        

@PrabhuSreenivasan
Copy link
Contributor Author

retest this please

@ben-gale
Copy link
Collaborator

All, @arlakshm - this has been quiet for 6 days - can we get some review input so we can move forwards please? The clock is ticking ...

@ben-gale
Copy link
Collaborator

@arlakshm , @lguohan - What's the next step here? This has been inactive for 7 days now - how do we move towards merge pls?

@arlakshm arlakshm merged commit f555e9e into sonic-net:master Dec 23, 2020
@PrabhuSreenivasan PrabhuSreenivasan deleted the crm_ipmc_nat branch December 23, 2020 16:04
@rlhui
Copy link
Contributor

rlhui commented Dec 27, 2020

@ben-gale - fyi on a test failure which might be related to this PR - https://github.com/Azure/sonic-buildimage/issues/6302

arlakshm pushed a commit to sonic-net/sonic-swss that referenced this pull request Dec 29, 2020
What I did
Added support for snat, dnat and ipmc resources under CRM module.

Why I did it
New feature NAT adds new resources snat_enty and dnat_entry that needs to be monitored. ipmc_entry tracks IP multicast resources used by switch.

Associated PRs
sonic-net/sonic-utilities/pull/1258
sonic-net/sonic-buildimage#6012

Signed-off-by: Prabhu Sreenivasan <[email protected]>
anand-kumar-subramanian pushed a commit to anand-kumar-subramanian/sonic-utilities that referenced this pull request Mar 2, 2021
Signed-off-by: Prabhu Sreenivasan [email protected]

- What I did
Added support for snat, dnat and ipmc resources under CRM module.

- How I did it
New feature NAT adds new resources snat_enty and dnat_entry that needs to be monitored. ipmc_entry tracks IP multicast resources used by switch.

- How to verify it
sonic-utilities tests and crm spytest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants