Skip to content

Commit 2ac2edc

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 a44336d commit 2ac2edc

File tree

8 files changed

+754
-1
lines changed

8 files changed

+754
-1
lines changed

doc/Command-Reference.md

+121
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@
243243
* [Historical Memory Statistics for Last 3 Hours](#historical-memory-statistics-for-last-3-hours)
244244
* [Historical Memory Statistics for Specific Metric (Used Memory)](#historical-memory-statistics-for-specific-metric-used-memory)
245245
* [View Memory Statistics Configuration](#view-memory-statistics-configuration)
246+
* [CoPP Commands](#copp-commands)
247+
* [Overview](#overview)
248+
* [CoPP show commands](#copp-show-commands)
246249
## Document History
247250

248251
| Version | Modification Date | Details |
@@ -10600,6 +10603,7 @@ This sub-section explains the show commands for displaying the running configura
1060010603
6) acl
1060110604
7) ports
1060210605
8) syslog
10606+
9) copp
1060310607

1060410608
**show runningconfiguration all**
1060510609

@@ -10726,6 +10730,20 @@ This command displays the running configuration of the snmp module.
1072610730
admin@sonic:~$ show runningconfiguration ports Ethernet0
1072710731
```
1072810732

10733+
**show runningconfiguration copp**
10734+
10735+
This command displays the running configuration of copp
10736+
10737+
- Usage:
10738+
```
10739+
show runningconfiguration copp
10740+
```
10741+
10742+
- Example:
10743+
```
10744+
admin@sonic:~$ show runningconfiguration copp
10745+
```
10746+
1072910747
Go Back To [Beginning of the document](#) or [Beginning of this section](#Startup--Running-Configuration)
1073010748

1073110749

@@ -14574,3 +14592,106 @@ Enabled: false
1457414592
Sampling Interval: 5
1457514593
Retention Period: 15
1457614594
```
14595+
---
14596+
# CoPP Commands
14597+
14598+
## Overview
14599+
This sub-section explains the list of commands available for CoPP (Control Plane Policing) feature.
14600+
14601+
---
14602+
14603+
## CoPP Show Commands
14604+
14605+
These commands are used to display the current CoPP configuration and their status.
14606+
14607+
### Usage
14608+
```bash
14609+
show copp configuration <detailed> [--trapid <trap_id>] [--group <trap_group>]
14610+
```
14611+
14612+
**Example**:
14613+
14614+
```bash
14615+
show copp configuration
14616+
show copp configuration detailed --group queue1_group3
14617+
show copp configuration detailed --trapid neighbor_miss
14618+
```
14619+
14620+
### Show CoPP Configuration
14621+
14622+
Command to display the current CoPP configurations and hardware status of the traps.
14623+
14624+
```bash
14625+
admin@sonic:~$ show copp configuration
14626+
```
14627+
14628+
**Sample Output**:
14629+
14630+
```bash
14631+
admin@sonic:~$ show copp configuration
14632+
TrapId Trap Group Action CBS CIR Meter Type Mode HW Status
14633+
--------------- ------------- -------- ----- ----- ------------ ------ -------------
14634+
arp_req queue4_group2 copy 600 600 packets sr_tcm installed
14635+
arp_resp queue4_group2 copy 600 600 packets sr_tcm installed
14636+
bgp queue4_group1 trap 6000 6000 packets sr_tcm not-installed
14637+
bgpv6 queue4_group1 trap 6000 6000 packets sr_tcm not-installed
14638+
dest_nat_miss queue1_group2 trap 600 600 packets sr_tcm installed
14639+
dhcp queue4_group3 trap 100 100 packets sr_tcm installed
14640+
dhcpv6 queue4_group3 trap 100 100 packets sr_tcm installed
14641+
eapol queue4_group1 trap 6000 6000 packets sr_tcm installed
14642+
ip2me queue1_group1 trap 6000 6000 packets sr_tcm installed
14643+
lacp queue4_group1 trap 6000 6000 packets sr_tcm installed
14644+
lldp queue4_group3 trap 100 100 packets sr_tcm installed
14645+
neigh_discovery queue4_group2 copy 600 600 packets sr_tcm installed
14646+
neighbor_miss queue1_group3 trap 200 200 packets sr_tcm installed
14647+
sample_packet queue2_group1 trap 1000 1000 packets sr_tcm not-installed
14648+
src_nat_miss queue1_group2 trap 600 600 packets sr_tcm installed
14649+
udld queue4_group3 trap 100 100 packets sr_tcm installed
14650+
```
14651+
14652+
### Show CoPP Configuration Detailed
14653+
14654+
Command to display the detailed CoPP configuration of a specific trap ID.
14655+
14656+
```bash
14657+
admin@sonic:~$ show copp configuration detailed --trapid neighbor_miss
14658+
```
14659+
14660+
**Sample Output**:
14661+
14662+
```bash
14663+
Trap Group.................. queue1_group3
14664+
queue....................... 1
14665+
Trap Priority............... 1
14666+
Trap Action................. trap
14667+
Meter Type.................. packets
14668+
Mode........................ sr_tcm
14669+
CBS......................... 200
14670+
CIR......................... 200
14671+
Green Action................ forward
14672+
Yellow Action............... forward
14673+
Red Action.................. drop
14674+
Oper Status................. installed
14675+
```
14676+
14677+
Command to display the detailed CoPP configuration of a specific CoPP group.
14678+
14679+
```bash
14680+
admin@sonic:~$ show copp configuration detailed --group queue1_group3
14681+
```
14682+
14683+
**Sample Output**:
14684+
14685+
```bash
14686+
Trap Id(s).................. neighbor_miss
14687+
queue....................... 1
14688+
Trap Priority............... 1
14689+
Trap Action................. trap
14690+
Meter Type.................. packets
14691+
Mode........................ sr_tcm
14692+
CBS......................... 200
14693+
CIR......................... 200
14694+
Yellow Action............... forward
14695+
Green Action................ forward
14696+
Red Action.................. drop
14697+
```

dump/plugins/copp.py

+2-1
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)