Skip to content

Commit a3b4be1

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 <[email protected]>
1 parent 8415aee commit a3b4be1

8 files changed

Lines changed: 758 additions & 1 deletion

File tree

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 |
@@ -10862,6 +10865,7 @@ This sub-section explains the show commands for displaying the running configura
1086210865
6) acl
1086310866
7) ports
1086410867
8) syslog
10868+
9) copp
1086510869

1086610870
**show runningconfiguration all**
1086710871

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

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

1099311011

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

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)