Skip to content

Commit 7f83a99

Browse files
hrachyamShuotian Cheng
authored andcommitted
orchagent: Adding support for COPP (#57)
* Added new class CoppOrch * Added schema for COPP_TABLE
1 parent 2c92bc8 commit 7f83a99

10 files changed

Lines changed: 604 additions & 37 deletions

File tree

doc/swss-schema.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,61 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
319319

320320
---------------------------------------------
321321

322+
###COPP_TABLE
323+
Control plane policing configuration table.
324+
The settings in this table configure trap group, which is assigned a list of trap IDs (protocols), priority of CPU queue priority, and a policer.
325+
The CPU queue priority is strict priority.
326+
The policer is created and exclusively owned by the given trap group; it will be not shared (bound to) any other object.
327+
328+
packet_action = "drop" | "forward" | "copy" | "copy_cancel" | "trap" | "log" | "deny" | "transit"
329+
330+
key = "COPP_TABLE:name"
331+
name_list = name | name,name_list
332+
queue = number; strict queue priority. Higher number means higher priority.
333+
trap_ids = name_list; Acceptable values: bgp, lacp, arp, lldp, snmp, ssh, ttl error, ip2me
334+
trap_action = packet_action; trap action which will be applied to all trap_ids.
335+
336+
;Settings for embedded policer. NOTE - if no policer settings are specified, then no policer is created.
337+
meter_type = "packets" | "bytes"
338+
mode = "sr_tcm" | "tr_tcm" | "storm"
339+
color = "aware" | "blind"
340+
cbs = number ;packets or bytes depending on the meter_type value
341+
cir = number ;packets or bytes depending on the meter_type value
342+
pbs = number ;packets or bytes depending on the meter_type value
343+
pir = number ;packets or bytes depending on the meter_type value
344+
345+
green_action = packet_action
346+
yellow_action = packet_action
347+
red_action = packet_action
348+
349+
Example:
350+
127.0.0.1:6379> hgetall "COPP_TABLE:Group.P7"
351+
1) "cbs"
352+
2) "1024"
353+
3) "cir"
354+
4) "6600"
355+
5) "color"
356+
6) "aware"
357+
7) "meter_type"
358+
8) "packets"
359+
9) "mode"
360+
10) "sr_tcm"
361+
11) "pbs"
362+
12) "1024"
363+
13) "pir"
364+
14) "4096"
365+
15) "red_action"
366+
16) "drop"
367+
17) "trap_ids"
368+
18) "lacp"
369+
19) "trap_action"
370+
20) "trap"
371+
127.0.0.1:6379>
372+
373+
Note: The configuration will be created as json file to be consumed by swssconfig tool, which will place the table into the redis database.
374+
It's possible to create separate configuration files for different ASIC platforms.
375+
376+
----------------------------------------------
322377

323378
###Configuration files
324379
What configuration files should we have? Do apps, orch agent each need separate files?

orchagent/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ else
1010
DBGFLAGS = -g
1111
endif
1212

13-
orchagent_SOURCES = main.cpp orchdaemon.cpp orch.cpp routeorch.cpp neighorch.cpp intfsorch.cpp portsorch.cpp
13+
orchagent_SOURCES = main.cpp orchdaemon.cpp orch.cpp routeorch.cpp neighorch.cpp intfsorch.cpp portsorch.cpp copporch.cpp
1414

1515
orchagent_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
1616
orchagent_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)

0 commit comments

Comments
 (0)