Skip to content

vpp: implement CRM counters for neighbour, nexthop, nexthop group and members - #1814

Merged
yue-fred-gao merged 4 commits into
sonic-net:masterfrom
yue-fred-gao:neigh_nh_crm
Mar 30, 2026
Merged

vpp: implement CRM counters for neighbour, nexthop, nexthop group and members#1814
yue-fred-gao merged 4 commits into
sonic-net:masterfrom
yue-fred-gao:neigh_nh_crm

Conversation

@yue-fred-gao

Copy link
Copy Markdown
Contributor

why

vpp doesn't track the usage of neighbour, nexthop, nexthop group and members due to it doesn't have hard limit on those objects except heap memory allocated to vpp process. But for test coverage with crm/test_crm.py, we need to track the usage although the max of those objects can be very large.

what this PR does

  1. implement CRM counters for neighbour, nexthop, nexthop group and members
  2. refactor CRM functions to a new class CRMTracker for better code maintenance.

how is it tested

passed crm/test_crm.py

Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: Yue Gao <yuega2@cisco.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

dypet
dypet previously approved these changes Mar 25, 2026
Comment thread vslib/vpp/CRMTracker.h
uint32_t m_maxSNATEntries = 100;
uint32_t m_maxDNATEntries = 100;
uint32_t m_maxIPMCEntries = 100;
uint32_t m_maxDoubleNATEntries = 50;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do these values need to be maintained to stay in sync with defaults from SwitchStateBase?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It doesn't have to be because vpp can have its own max. Actually I was tempted to set them to 0 since we don't support the features. But I am not sure if there is any side effect so I left them the same value as the past (inherited from SwitchStateBase) to be safe.

Signed-off-by: Yue Gao <yuega2@cisco.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

mssonicbld added a commit to mssonicbld/sonic-mgmt.msft that referenced this pull request Mar 26, 2026
<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:
Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
    - [ ] Skipped for non-supported platforms
- [x] Test case improvement

### Back port request
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511

### Approach
#### What is the motivation for this PR?
Properly categorize test cases in ipfwd/test_nhop_group.py.
#### How did you do it?
1. Previously some test cases are marked "to be included". This PR properly skip the ones that are not supported and give proper reason. PR sonic-net/sonic-sairedis#1802 is submitted to report supported ecmp type in capability advertisement.
2. Enable test_nhop_group_member_count test case. This depends on PR sonic-net/sonic-sairedis#1814 to provide CRM support in sonic-vpp.
#### How did you verify/test it?
Run sonic-mgmt test
#### Any platform specific information?
vpp
#### Supported testbed topology if it's a new test case?

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
mssonicbld added a commit to Azure/sonic-mgmt.msft that referenced this pull request Mar 26, 2026
<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:
Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
 - [ ] Skipped for non-supported platforms
- [x] Test case improvement

### Back port request
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511

### Approach
#### What is the motivation for this PR?
Properly categorize test cases in ipfwd/test_nhop_group.py.
#### How did you do it?
1. Previously some test cases are marked "to be included". This PR properly skip the ones that are not supported and give proper reason. PR sonic-net/sonic-sairedis#1802 is submitted to report supported ecmp type in capability advertisement.
2. Enable test_nhop_group_member_count test case. This depends on PR sonic-net/sonic-sairedis#1814 to provide CRM support in sonic-vpp.
#### How did you verify/test it?
Run sonic-mgmt test
#### Any platform specific information?
vpp
#### Supported testbed topology if it's a new test case?

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
@yue-fred-gao

Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1071202:

✅Stage TestAsan:

  • Job vstest: retried.

✅Stage Test:

  • Job vstest: retried.
  • Job vstest: retried.

@yue-fred-gao

Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1071202:

✅Stage Test:

  • Job vstest: retried.
  • Job vstest: retried.

✅Stage TestAsan:

  • Job vstest: retried.

@yue-fred-gao
yue-fred-gao merged commit 9f8160c into sonic-net:master Mar 30, 2026
19 checks passed
@yue-fred-gao
yue-fred-gao deleted the neigh_nh_crm branch March 30, 2026 15:10
yejianquan pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Apr 8, 2026
Description of PR
Summary:
Fixes # (issue)
crm tests in vpp were disabled because sonic-vpp didn't support crm counters. With PR sonic-net/sonic-sairedis#1814 and sonic-net/sonic-sairedis#1811, the feature is enabled so we can turn on the test for sonic-vpp

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202205
 202305
 202311
 202405
 202411
 202505
 202511
Approach
What is the motivation for this PR?
enable crm/test_crm.py and crm/test_crm_available.py

How did you do it?
Remove sonic-vpp conditional marker and add the tests to pr_test_scripts for t1_lag_vpp

How did you verify/test it?
Run the corresponding tests in sonic-mgmt and all test passed

Any platform specific information?
vpp specific

Signed-off-by: Yue Gao <yuega2@cisco.com>
rraghav-cisco pushed a commit to rraghav-cisco/sonic-mgmt that referenced this pull request Apr 20, 2026
Description of PR
Summary:
Fixes # (issue)
crm tests in vpp were disabled because sonic-vpp didn't support crm counters. With PR sonic-net/sonic-sairedis#1814 and sonic-net/sonic-sairedis#1811, the feature is enabled so we can turn on the test for sonic-vpp

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202205
 202305
 202311
 202405
 202411
 202505
 202511
Approach
What is the motivation for this PR?
enable crm/test_crm.py and crm/test_crm_available.py

How did you do it?
Remove sonic-vpp conditional marker and add the tests to pr_test_scripts for t1_lag_vpp

How did you verify/test it?
Run the corresponding tests in sonic-mgmt and all test passed

Any platform specific information?
vpp specific

Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: Raghavendran Ramanathan <rraghav@cisco.com>
justin-wong-ce pushed a commit to justin-wong-ce/sonic-sairedis that referenced this pull request Apr 20, 2026
… members (sonic-net#1814)

* Implement crm counters to track neighbor, nh and nh group/member

Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: Justin Wong <jvwong@arista.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

Cherry-pick PR to msft-202603: Azure/sonic-sairedis.msft#125

rraghav-cisco pushed a commit to rraghav-cisco/sonic-mgmt that referenced this pull request May 11, 2026
Description of PR
Summary:
Fixes # (issue)
crm tests in vpp were disabled because sonic-vpp didn't support crm counters. With PR sonic-net/sonic-sairedis#1814 and sonic-net/sonic-sairedis#1811, the feature is enabled so we can turn on the test for sonic-vpp

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202205
 202305
 202311
 202405
 202411
 202505
 202511
Approach
What is the motivation for this PR?
enable crm/test_crm.py and crm/test_crm_available.py

How did you do it?
Remove sonic-vpp conditional marker and add the tests to pr_test_scripts for t1_lag_vpp

How did you verify/test it?
Run the corresponding tests in sonic-mgmt and all test passed

Any platform specific information?
vpp specific

Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: Raghavendran Ramanathan <rraghav@cisco.com>
selldinesh pushed a commit to selldinesh/sonic-mgmt that referenced this pull request Jun 11, 2026
Description of PR
Summary:
Fixes # (issue)
crm tests in vpp were disabled because sonic-vpp didn't support crm counters. With PR sonic-net/sonic-sairedis#1814 and sonic-net/sonic-sairedis#1811, the feature is enabled so we can turn on the test for sonic-vpp

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202205
 202305
 202311
 202405
 202411
 202505
 202511
Approach
What is the motivation for this PR?
enable crm/test_crm.py and crm/test_crm_available.py

How did you do it?
Remove sonic-vpp conditional marker and add the tests to pr_test_scripts for t1_lag_vpp

How did you verify/test it?
Run the corresponding tests in sonic-mgmt and all test passed

Any platform specific information?
vpp specific

Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: selldinesh <dinesh.sellappan@keysight.com>
selldinesh pushed a commit to selldinesh/sonic-mgmt that referenced this pull request Jun 25, 2026
Description of PR
Summary:
Fixes # (issue)
crm tests in vpp were disabled because sonic-vpp didn't support crm counters. With PR sonic-net/sonic-sairedis#1814 and sonic-net/sonic-sairedis#1811, the feature is enabled so we can turn on the test for sonic-vpp

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202205
 202305
 202311
 202405
 202411
 202505
 202511
Approach
What is the motivation for this PR?
enable crm/test_crm.py and crm/test_crm_available.py

How did you do it?
Remove sonic-vpp conditional marker and add the tests to pr_test_scripts for t1_lag_vpp

How did you verify/test it?
Run the corresponding tests in sonic-mgmt and all test passed

Any platform specific information?
vpp specific

Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: selldinesh <dinesh.sellappan@keysight.com>
ssithaia-ebay pushed a commit to ssithaia-ebay/sflow-yang-sonic-mgmt that referenced this pull request Jul 21, 2026
Description of PR
Summary:
Fixes # (issue)
crm tests in vpp were disabled because sonic-vpp didn't support crm counters. With PR sonic-net/sonic-sairedis#1814 and sonic-net/sonic-sairedis#1811, the feature is enabled so we can turn on the test for sonic-vpp

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202205
 202305
 202311
 202405
 202411
 202505
 202511
Approach
What is the motivation for this PR?
enable crm/test_crm.py and crm/test_crm_available.py

How did you do it?
Remove sonic-vpp conditional marker and add the tests to pr_test_scripts for t1_lag_vpp

How did you verify/test it?
Run the corresponding tests in sonic-mgmt and all test passed

Any platform specific information?
vpp specific

Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: ssithaia-ebay <ssithaian@ebay.com>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Jul 22, 2026
Description of PR
Summary:
Fixes # (issue)
crm tests in vpp were disabled because sonic-vpp didn't support crm counters. With PR sonic-net/sonic-sairedis#1814 and sonic-net/sonic-sairedis#1811, the feature is enabled so we can turn on the test for sonic-vpp

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202205
 202305
 202311
 202405
 202411
 202505
 202511
Approach
What is the motivation for this PR?
enable crm/test_crm.py and crm/test_crm_available.py

How did you do it?
Remove sonic-vpp conditional marker and add the tests to pr_test_scripts for t1_lag_vpp

How did you verify/test it?
Run the corresponding tests in sonic-mgmt and all test passed

Any platform specific information?
vpp specific

Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: Yael Tzur <ytzur@nvidia.com>
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.

4 participants