-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONiC Yang model support for COPP (#7199)
* SONiC Yang model support for COPP * Tables: COPP_GROUP, COPP_TRAP.
- Loading branch information
Showing
6 changed files
with
406 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/sonic-yang-models/tests/yang_model_tests/tests/copp.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"COPP_TRAP_WITH_EXIST_GROUP": { | ||
"desc": "Configure COPP_TRAP with group in COPP_GROUP table." | ||
}, | ||
"COPP_TRAP_WITH_NON_EXIST_GROUP": { | ||
"desc": "Configure COPP_TRAP with group which does not exist in COPP_GROUP table.", | ||
"eStrKey" : "LeafRef" | ||
}, | ||
"COPP_GROUP_MANDATORY_TRAP_ACTION": { | ||
"desc": "Configure COPP_GROUP with no trap_action.", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"COPP_GROUP_MANDATORY_METER_TYPE": { | ||
"desc": "Configure COPP_GROUP with no meter_type.", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"COPP_GROUP_PIR_LESS_THAN_CIR": { | ||
"desc": "Configure COPP_GROUP with PIR less than CIR.", | ||
"eStr": ["pir must be greater than or equal to cir"] | ||
}, | ||
"COPP_TRAP_MANDATORY_TRAP_IDS": { | ||
"desc": "Configure COPP_TRAP with no trap_ids.", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"COPP_GROUP_WHEN_SRTCM_WITH_PIR": { | ||
"desc": "Configure COPP_GROUP with srtcm and pir.", | ||
"eStrKey" : "When" | ||
} | ||
} |
147 changes: 147 additions & 0 deletions
147
src/sonic-yang-models/tests/yang_model_tests/tests_config/copp.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
{ | ||
"COPP_TRAP_WITH_EXIST_GROUP": { | ||
"sonic-copp:sonic-copp": { | ||
"sonic-copp:COPP_GROUP": { | ||
"COPP_GROUP_LIST": [{ | ||
"name": "queue1_group1", | ||
"trap_action":"trap", | ||
"trap_priority":"1", | ||
"queue": "1", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"6000", | ||
"cbs":"6000", | ||
"red_action":"drop" | ||
}] | ||
}, | ||
"sonic-copp:COPP_TRAP": { | ||
"COPP_TRAP_LIST": [{ | ||
"name": "ip2me", | ||
"trap_ids": "ip2me", | ||
"trap_group": "queue1_group1" | ||
}] | ||
} | ||
} | ||
}, | ||
|
||
"COPP_TRAP_WITH_NON_EXIST_GROUP": { | ||
"sonic-copp:sonic-copp": { | ||
"sonic-copp:COPP_GROUP": { | ||
"COPP_GROUP_LIST": [{ | ||
"name": "queue2_group2", | ||
"trap_action":"trap", | ||
"trap_priority":"2", | ||
"queue": "2", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"5000", | ||
"cbs":"5000", | ||
"red_action":"drop" | ||
}] | ||
}, | ||
"sonic-copp:COPP_TRAP": { | ||
"COPP_TRAP_LIST": [{ | ||
"name": "udld", | ||
"trap_ids": "udld", | ||
"trap_group": "queue3_group3" | ||
}] | ||
} | ||
} | ||
}, | ||
|
||
"COPP_GROUP_MANDATORY_TRAP_ACTION": { | ||
"sonic-copp:sonic-copp": { | ||
"sonic-copp:COPP_GROUP": { | ||
"COPP_GROUP_LIST": [{ | ||
"name": "queue3_group4", | ||
"trap_priority":"3", | ||
"queue": "3", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"5000", | ||
"cbs":"5000", | ||
"red_action":"drop" | ||
}] | ||
} | ||
} | ||
}, | ||
|
||
"COPP_GROUP_MANDATORY_METER_TYPE": { | ||
"sonic-copp:sonic-copp": { | ||
"sonic-copp:COPP_GROUP": { | ||
"COPP_GROUP_LIST": [{ | ||
"name": "queue4_group5", | ||
"trap_action":"trap", | ||
"trap_priority":"4", | ||
"queue": "4", | ||
"mode":"sr_tcm", | ||
"cir":"5000", | ||
"cbs":"5000", | ||
"red_action":"drop" | ||
}] | ||
} | ||
} | ||
}, | ||
|
||
"COPP_GROUP_PIR_LESS_THAN_CIR": { | ||
"sonic-copp:sonic-copp": { | ||
"sonic-copp:COPP_GROUP": { | ||
"COPP_GROUP_LIST": [{ | ||
"name": "queue5_group6", | ||
"trap_action":"trap", | ||
"trap_priority":"5", | ||
"queue": "5", | ||
"mode":"tr_tcm", | ||
"cir":"5000", | ||
"cbs":"5000", | ||
"pir":"4000", | ||
"pbs":"4000", | ||
"red_action":"drop" | ||
}] | ||
} | ||
} | ||
}, | ||
|
||
"COPP_TRAP_MANDATORY_TRAP_IDS": { | ||
"sonic-copp:sonic-copp": { | ||
"sonic-copp:COPP_GROUP": { | ||
"COPP_GROUP_LIST": [{ | ||
"name": "queue6_group7", | ||
"trap_action":"trap", | ||
"trap_priority":"6", | ||
"queue": "6", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"6000", | ||
"cbs":"6000", | ||
"red_action":"drop" | ||
}] | ||
}, | ||
"sonic-copp:COPP_TRAP": { | ||
"COPP_TRAP_LIST": [{ | ||
"name": "bgp", | ||
"trap_group": "queue6_group7" | ||
}] | ||
} | ||
} | ||
}, | ||
|
||
"COPP_GROUP_WHEN_SRTCM_WITH_PIR": { | ||
"sonic-copp:sonic-copp": { | ||
"sonic-copp:COPP_GROUP": { | ||
"COPP_GROUP_LIST": [{ | ||
"name": "queue6_group7", | ||
"trap_action":"trap", | ||
"trap_priority":"6", | ||
"queue": "6", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"6000", | ||
"cbs":"6000", | ||
"pir":"6000", | ||
"red_action":"drop" | ||
}] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.