Skip to content

[CoPP]: Added neighbor_miss trap verification and cli test#18326

Merged
yxieca merged 2 commits intosonic-net:masterfrom
rminnikanti:neighbor_miss
Aug 25, 2025
Merged

[CoPP]: Added neighbor_miss trap verification and cli test#18326
yxieca merged 2 commits intosonic-net:masterfrom
rminnikanti:neighbor_miss

Conversation

@rminnikanti
Copy link
Copy Markdown
Contributor

@rminnikanti rminnikanti commented May 10, 2025

Description of PR

  1. Added/updated tests to cover sonic-net/SONiC#1943
  2. If the platform supports the CoPP neighbor_miss trap, verify that VLAN subnet traffic is policed under the neighbor_miss CoPP (200 PPS). If not, verify it under the existing default CoPP logic.
  3. CoPP trap capability of platform is determined by COPP_TRAP_CAPABILITY_TABLE in STATE_DB.
  4. Added a test case to verify the show copp configuration CLI output - test_verify_copp_configuration_cli.
  5. Updated the existing test case to validate the trap installation status for the trap being verified with traffic.

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Approach

What is the motivation for this PR?

sonic-net/SONiC#1943

How did you do it?

  1. Modified update_copp_config.py script to not modify neighbor_miss trap CBS/CIR values if the platform supports this trap type. This way verification will be able to verify neighbor_miss trap is policed under its own copp but not under default trap.
  2. Updated existing tests to verify the installation status of the trap before performing traffic test for the respective trap.

How did you verify/test it?

Tested by running copp component tests on T0 topology on marvell-teralynx platform.

copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-ARP]PASSED                               [  5%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-IP2ME]PASSED                             [ 10%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-SNMP]PASSED                              [ 15%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-SSH]PASSED                               [ 20%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-DHCP]PASSED                              [ 25%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-DHCP6]PASSED                             [ 30%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-BGP]PASSED                               [ 35%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-LACP]PASSED                              [ 40%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-LLDP]PASSED                              [ 45%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-UDLD] PASSED                             [ 50%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-Default]PASSED                           [ 55%]
copp/test_copp.py::TestCOPP::test_trap_neighbor_miss[4-VlanSubnet-str-marvell-01]PASSED           [ 60%]
copp/test_copp.py::TestCOPP::test_trap_neighbor_miss[4-VlanSubnetIPinIP-str-marvell-01]PASSED     [ 65%]
copp/test_copp.py::TestCOPP::test_trap_neighbor_miss[6-VlanSubnet-str-marvell-01]PASSED           [ 70%]
copp/test_copp.py::TestCOPP::test_trap_neighbor_miss[6-VlanSubnetIPinIP-str-marvell-01]PASSED     [ 75%]
copp/test_copp.py::TestCOPP::test_add_new_trap[str-marvell-01]PASSED                              [ 80%]
copp/test_copp.py::TestCOPP::test_remove_trap[str-marvell-01-delete_feature_entry]PASSED          [ 85%]
copp/test_copp.py::TestCOPP::test_remove_trap[str-marvell-01-disable_feature_status]PASSED        [ 90%]
copp/test_copp.py::TestCOPP::test_trap_config_save_after_reboot[str-marvell-01]PASSED             [ 95%]
copp/test_copp.py::test_verify_copp_configuration_cli[str-marvell-01] PASSED                      [100%]

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@rminnikanti
Copy link
Copy Markdown
Contributor Author

@prabhataravind @prsunny, please review.

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps

Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

prsunny
prsunny previously approved these changes Jul 16, 2025
Copy link
Copy Markdown
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

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

lgtm

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Jul 16, 2025

@rminnikanti , can you check the test failure? As I understand, this test should fall back to old behavior if new traps are not installed, hence should not have a dependency on (sonic-net/sonic-buildimage#22406)

@rminnikanti
Copy link
Copy Markdown
Contributor Author

@prsunny, tests also verify the new show copp configuration CLI and also uses new STATE_DB capability table.

CLI command is not yet part of the master image:

PR failures log:

_ansible_no_log = None
stdout =
stderr =
Usage: show [OPTIONS] COMMAND [ARGS]...
Try "show -h" for help.

Error: No such command "copp".

FAILED

sonic-utilities submodule in master doesn't yet include the new copp CLI changes.
sonic-utilities submodule in master is last updated on May 22nd, CoPP CLI merged on Jun 13th.

commit c19ece7106b30d941aff8774f1742486eebc1ec3
Author: mssonicbld <79238446+mssonicbld@users.noreply.github.com>
Date:   Thu May 22 19:01:49 2025 +0800

    [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#22614)

@nhe-NV
Copy link
Copy Markdown
Contributor

nhe-NV commented Jul 24, 2025

Should it also be part of the 202505 branch, right? I don't see the label for 202505

@rminnikanti
Copy link
Copy Markdown
Contributor Author

@nhe-NV I edited the PR description and added 202505 backport from my side.

@rminnikanti
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-mgmt

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-mgmt

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@rminnikanti rminnikanti requested a review from prsunny July 26, 2025 01:31
@rminnikanti
Copy link
Copy Markdown
Contributor Author

@prsunny @prabhataravind PR checks are passing now. Can you please review

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Aug 4, 2025

@prabhataravind , would you review and signoff?

@nhe-NV
Copy link
Copy Markdown
Contributor

nhe-NV commented Aug 5, 2025

@prabhataravind , would you review and signoff?

I see the label for 202505 is not added, I will add it in case not missing

@prabhataravind prabhataravind requested a review from ZhaohuiS August 7, 2025 19:49
@prabhataravind
Copy link
Copy Markdown
Contributor

prabhataravind commented Aug 7, 2025

@dgsudharsan could you pls review as well, esp from Nvidia platform pov?

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Aug 11, 2025

@StormLiangMS , would you help with merge?

@ZhaohuiS
Copy link
Copy Markdown
Contributor

image test_copp passed on VKM testbed.

@rminnikanti
Copy link
Copy Markdown
Contributor Author

@yxieca can you please help merge this PR?

@yxieca yxieca merged commit 663f59a into sonic-net:master Aug 25, 2025
19 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Aug 26, 2025
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps


Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202505: #20397

mssonicbld pushed a commit that referenced this pull request Aug 27, 2025
* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps


Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
@nhe-NV nhe-NV mentioned this pull request Sep 10, 2025
11 tasks
xixuej pushed a commit to xixuej/sonic-mgmt that referenced this pull request Sep 17, 2025
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps


Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
vidyac86 pushed a commit to vidyac86/sonic-mgmt that referenced this pull request Oct 23, 2025
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps


Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps


Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 16, 2025
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps

Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps

Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
Signed-off-by: Aharon Malkin <amalkin@nvidia.com>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps

Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps


Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps

Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps

Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
Signed-off-by: Yael Tzur <ytzur@nvidia.com>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Mar 27, 2026
…#18326)

* Added neighbor_miss trap and copp cli tests

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps


Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.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.

8 participants