Skip to content

Commit 379adaf

Browse files
committed
Added CoPP show configuration command
What I did: CoPP show commands: * show copp configuration * show copp configuration detailed --trapid <trap_id> * show copp configuration detailed --group <group> Added UT for the CLI commands. HLD: sonic-net/SONiC#1943 Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
1 parent c78e0f7 commit 379adaf

File tree

8 files changed

+758
-1
lines changed

8 files changed

+758
-1
lines changed

doc/Command-Reference.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@
250250
* [Historical Memory Statistics for Last 3 Hours](#historical-memory-statistics-for-last-3-hours)
251251
* [Historical Memory Statistics for Specific Metric (Used Memory)](#historical-memory-statistics-for-specific-metric-used-memory)
252252
* [View Memory Statistics Configuration](#view-memory-statistics-configuration)
253+
* [CoPP Commands](#copp-commands)
254+
* [Overview](#overview)
255+
* [CoPP show commands](#copp-show-commands)
253256
## Document History
254257

255258
| Version | Modification Date | Details |
@@ -10863,6 +10866,7 @@ This sub-section explains the show commands for displaying the running configura
1086310866
6) acl
1086410867
7) ports
1086510868
8) syslog
10869+
9) copp
1086610870

1086710871
**show runningconfiguration all**
1086810872

@@ -10989,6 +10993,20 @@ This command displays the running configuration of the snmp module.
1098910993
admin@sonic:~$ show runningconfiguration ports Ethernet0
1099010994
```
1099110995

10996+
**show runningconfiguration copp**
10997+
10998+
This command displays the running configuration of copp
10999+
11000+
- Usage:
11001+
```
11002+
show runningconfiguration copp
11003+
```
11004+
11005+
- Example:
11006+
```
11007+
admin@sonic:~$ show runningconfiguration copp
11008+
```
11009+
1099211010
Go Back To [Beginning of the document](#) or [Beginning of this section](#Startup--Running-Configuration)
1099311011

1099411012

@@ -14802,3 +14820,106 @@ Enabled: false
1480214820
Sampling Interval: 5
1480314821
Retention Period: 15
1480414822
```
14823+
---
14824+
# CoPP Commands
14825+
14826+
## Overview
14827+
This sub-section explains the list of commands available for CoPP (Control Plane Policing) feature.
14828+
14829+
---
14830+
14831+
## CoPP Show Commands
14832+
14833+
These commands are used to display the current CoPP configuration and their status.
14834+
14835+
### Usage
14836+
```bash
14837+
show copp configuration <detailed> [--trapid <trap_id>] [--group <trap_group>]
14838+
```
14839+
14840+
**Example**:
14841+
14842+
```bash
14843+
show copp configuration
14844+
show copp configuration detailed --group queue1_group3
14845+
show copp configuration detailed --trapid neighbor_miss
14846+
```
14847+
14848+
### Show CoPP Configuration
14849+
14850+
Command to display the current CoPP configurations and hardware status of the traps.
14851+
14852+
```bash
14853+
admin@sonic:~$ show copp configuration
14854+
```
14855+
14856+
**Sample Output**:
14857+
14858+
```bash
14859+
admin@sonic:~$ show copp configuration
14860+
TrapId Trap Group Action CBS CIR Meter Type Mode HW Status
14861+
--------------- ------------- -------- ----- ----- ------------ ------ -------------
14862+
arp_req queue4_group2 copy 600 600 packets sr_tcm installed
14863+
arp_resp queue4_group2 copy 600 600 packets sr_tcm installed
14864+
bgp queue4_group1 trap 6000 6000 packets sr_tcm not-installed
14865+
bgpv6 queue4_group1 trap 6000 6000 packets sr_tcm not-installed
14866+
dest_nat_miss queue1_group2 trap 600 600 packets sr_tcm installed
14867+
dhcp queue4_group3 trap 100 100 packets sr_tcm installed
14868+
dhcpv6 queue4_group3 trap 100 100 packets sr_tcm installed
14869+
eapol queue4_group1 trap 6000 6000 packets sr_tcm installed
14870+
ip2me queue1_group1 trap 6000 6000 packets sr_tcm installed
14871+
lacp queue4_group1 trap 6000 6000 packets sr_tcm installed
14872+
lldp queue4_group3 trap 100 100 packets sr_tcm installed
14873+
neigh_discovery queue4_group2 copy 600 600 packets sr_tcm installed
14874+
neighbor_miss queue1_group3 trap 200 200 packets sr_tcm installed
14875+
sample_packet queue2_group1 trap 1000 1000 packets sr_tcm not-installed
14876+
src_nat_miss queue1_group2 trap 600 600 packets sr_tcm installed
14877+
udld queue4_group3 trap 100 100 packets sr_tcm installed
14878+
```
14879+
14880+
### Show CoPP Configuration Detailed
14881+
14882+
Command to display the detailed CoPP configuration of a specific trap ID.
14883+
14884+
```bash
14885+
admin@sonic:~$ show copp configuration detailed --trapid neighbor_miss
14886+
```
14887+
14888+
**Sample Output**:
14889+
14890+
```bash
14891+
Trap Group.................. queue1_group3
14892+
queue....................... 1
14893+
Trap Priority............... 1
14894+
Trap Action................. trap
14895+
Meter Type.................. packets
14896+
Mode........................ sr_tcm
14897+
CBS......................... 200
14898+
CIR......................... 200
14899+
Green Action................ forward
14900+
Yellow Action............... forward
14901+
Red Action.................. drop
14902+
Oper Status................. installed
14903+
```
14904+
14905+
Command to display the detailed CoPP configuration of a specific CoPP group.
14906+
14907+
```bash
14908+
admin@sonic:~$ show copp configuration detailed --group queue1_group3
14909+
```
14910+
14911+
**Sample Output**:
14912+
14913+
```bash
14914+
Trap Id(s).................. neighbor_miss
14915+
queue....................... 1
14916+
Trap Priority............... 1
14917+
Trap Action................. trap
14918+
Meter Type.................. packets
14919+
Mode........................ sr_tcm
14920+
CBS......................... 200
14921+
CIR......................... 200
14922+
Yellow Action............... forward
14923+
Green Action................ forward
14924+
Red Action.................. drop
14925+
```

dump/plugins/copp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"bfd": "SAI_HOSTIF_TRAP_TYPE_BFD",
4444
"bfdv6": "SAI_HOSTIF_TRAP_TYPE_BFDV6",
4545
"src_nat_miss": "SAI_HOSTIF_TRAP_TYPE_SNAT_MISS",
46-
"dest_nat_miss": "SAI_HOSTIF_TRAP_TYPE_DNAT_MISS"
46+
"dest_nat_miss": "SAI_HOSTIF_TRAP_TYPE_DNAT_MISS",
47+
"neighbor_miss": "SAI_HOSTIF_TRAP_TYPE_NEIGHBOR_MISS"
4748
}
4849

4950
CFG_COPP_TRAP_TABLE_NAME = "COPP_TRAP"

0 commit comments

Comments
 (0)