Skip to content

Commit

Permalink
[YANG] Add route flow counter support
Browse files Browse the repository at this point in the history
  • Loading branch information
Junchao-Mellanox committed Jan 20, 2022
1 parent 2c42552 commit 3091693
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,16 @@
"desc": "Out of range poll interval.",
"eStrKey": "Range",
"eStr": "100..4294967295"
},
"FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_VRF": {
"desc": "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_VRF no failure."
},
"FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_DEFAULT_VRF": {
"desc": "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_DEFAULT_VRF no failure."
},
"FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_INVALID_MAX_MATCH_COUNT": {
"desc": "Out of range max_match_count.",
"eStrKey": "Range",
"eStr": "1..50"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
"FLOW_CNT_TRAP": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"FLOW_CNT_ROUTE": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
}
}
}
Expand Down Expand Up @@ -97,8 +101,79 @@
"FLOW_CNT_TRAP": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
},
"FLOW_CNT_ROUTE": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
}
}
}
},
"FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_VRF": {
"sonic-vrf:sonic-vrf":{
"sonic-vrf:VRF": {
"VRF_LIST": [
{
"name":"Vrf1"
}
]
}
},
"sonic-flex_counter:sonic-flex_counter": {
"sonic-flex_counter:FLOW_COUNTER_ROUTE_PATTERN_TABLE": {
"PATTERN_LIST": [
{
"vrf_name": "Vrf1",
"ip_prefix": "1.1.1.0/24",
"max_match_count": 30
},
{
"vrf_name": "Vrf1",
"ip_prefix": "2000::/64",
"max_match_count": 30
}
]
}
}
},
"FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_DEFAULT_VRF": {
"sonic-flex_counter:sonic-flex_counter": {
"sonic-flex_counter:FLOW_COUNTER_ROUTE_PATTERN_TABLE": {
"PATTERN_LIST": [
{
"vrf_name": "",
"ip_prefix": "1.1.1.0/24",
"max_match_count": 30
},
{
"vrf_name": "",
"ip_prefix": "2000::/64",
"max_match_count": 30
}
]
}
}
},
"FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_INVALID_MAX_MATCH_COUNT": {
"sonic-vrf:sonic-vrf":{
"sonic-vrf:VRF": {
"VRF_LIST": [
{
"name":"Vrf1"
}
]
}
},
"sonic-flex_counter:sonic-flex_counter": {
"sonic-flex_counter:FLOW_COUNTER_ROUTE_PATTERN_TABLE": {
"PATTERN_LIST": [
{
"vrf_name": "Vrf1",
"ip_prefix": "1.1.1.0/24",
"max_match_count": 0
}
]
}
}
}
}
43 changes: 43 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-flex_counter.yang
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,51 @@ module sonic-flex_counter {
}
}

container FLOW_CNT_ROUTE {
/* ROUTE_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

}
/* end of container FLEX_COUNTER_TABLE */

container FLOW_COUNTER_ROUTE_PATTERN_TABLE {
description "Flow counter route pattern of config_db.json";

list PATTERN_LIST {

key "vrf_name ip_prefix";

leaf vrf_name {
type string {
length 0..16;
}
}

leaf ip_prefix {
type union {
type stypes:sonic-ip4-prefix;
type stypes:sonic-ip6-prefix;
}
}

leaf max_match_count {
type uint32 {
range 1..50;
}
}

}
}
/* end of container FLOW_COUNTER_ROUTE_PATTERN_TABLE */
}
/* end of top level container */
}
Expand Down

0 comments on commit 3091693

Please sign in to comment.