Skip to content

Commit

Permalink
[DPB][YANG] Add POLL_INTERVAL in flex_counter yang model (sonic-net#9276
Browse files Browse the repository at this point in the history
)

#### Why I did it
DPB falls due to missing POLL_INTERVAL in sonic-flex_counter yang model.

#### How I did it
Added POLL_INTERVAL leaf to ACL container in sonic-flex_counter yang model.

#### How to verify it
Run the command config interface breakout <interface> <breakout_mode>

**NOTE:**
To verify this fix, a PR ([add set_owner to feature yang](sonic-net#9075)) that fix another bug in SONiC should be merged to master.
  • Loading branch information
mykolaxgerasymenko authored Dec 8, 2021
1 parent 27a6641 commit b0f06ba
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 40 deletions.
66 changes: 36 additions & 30 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -921,25 +921,31 @@
"FLEX_COUNTER_STATUS": "enable"
},
"PG_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": "10000"
},
"PORT": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": "1000"
},
"PORT_RATES": {
"FLEX_COUNTER_STATUS": "enable"
},
"PORT_BUFFER_DROP": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": "60000"
},
"BUFFER_POOL_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": "10000"
},
"QUEUE": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": "10000"
},
"QUEUE_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": "10000"
},
"DEBUG_COUNTER": {
"FLEX_COUNTER_STATUS": "enable"
Expand Down Expand Up @@ -1008,13 +1014,13 @@
},
"AAA": {
"authentication": {
"login": "local"
"login": "local"
},
"authorization": {
"login": "local"
"login": "local"
},
"accounting": {
"login": "local"
"login": "local"
}
},
"TACPLUS": {
Expand Down Expand Up @@ -1340,82 +1346,82 @@
},

"DSCP_TO_TC_MAP": {
"Dscp_to_tc_map1": {
"Dscp_to_tc_map1": {
"1": "1",
"2": "2"
},
"Dscp_to_tc_map2": {
},
"Dscp_to_tc_map2": {
"3": "3",
"4": "4"
}
},

"DOT1P_TO_TC_MAP": {
"Dot1p_to_tc_map1": {
"Dot1p_to_tc_map1": {
"1": "1",
"2": "2"
},
"Dot1p_to_tc_map2": {
},
"Dot1p_to_tc_map2": {
"3": "3",
"4": "4"
}
},

"TC_TO_PRIORITY_GROUP_MAP": {
"tc_to_pg_map1": {
"tc_to_pg_map1": {
"1": "1",
"2": "2"
},
"tc_to_pg_map2": {
},
"tc_to_pg_map2": {
"3": "3",
"4": "4"
}
},

"TC_TO_QUEUE_MAP": {
"tc_to_q_map1": {
"tc_to_q_map1": {
"1": "1",
"2": "2"
},
"tc_to_q_map2": {
},
"tc_to_q_map2": {
"3": "3",
"4": "4"
}
},

"MAP_PFC_PRIORITY_TO_QUEUE": {
"pfc_prio_to_q_map1": {
"pfc_prio_to_q_map1": {
"1": "1",
"2": "2"
},
"pfc_prio_to_q_map2": {
},
"pfc_prio_to_q_map2": {
"3": "3",
"4": "4"
}
},

"PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": {
"pfc_prio_to_pg_map1": {
"pfc_prio_to_pg_map1": {
"1": "1",
"2": "2"
},
"pfc_prio_to_pg_map2": {
},
"pfc_prio_to_pg_map2": {
"3": "3",
"4": "4"
}
},

"PORT_QOS_MAP": {
"Ethernet0": {
"Ethernet0": {
"dot1p_to_tc_map" : "Dot1p_to_tc_map1",
"dscp_to_tc_map": "Dscp_to_tc_map1",
"tc_to_queue_map": "tc_to_q_map1",
"tc_to_pg_map": "tc_to_pg_map1",
"pfc_to_queue_map": "pfc_prio_to_q_map1",
"pfc_to_pg_map" : "pfc_prio_to_pg_map1",
"pfc_enable" : "3,4"
},
"Ethernet4": {
},
"Ethernet4": {
"dot1p_to_tc_map" : "Dot1p_to_tc_map2",
"dscp_to_tc_map": "Dscp_to_tc_map2",
"tc_to_queue_map": "tc_to_q_map2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE": {
"desc": "FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE no failure."
"desc": "FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE no failure."
},
"FLEX_COUNTER_TABLE_WITH_INVALID_POLL_INTERVAL": {
"desc": "Out of range poll interval.",
"eStrKey": "Range",
"eStr": "100..4294967295"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"sonic-flex_counter:sonic-flex_counter": {
"sonic-flex_counter:FLEX_COUNTER_TABLE": {
"BUFFER_POOL_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"DEBUG_COUNTER": {
"FLEX_COUNTER_STATUS": "enable"
Expand All @@ -12,31 +13,90 @@
"FLEX_COUNTER_STATUS": "enable"
},
"PG_DROP": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"PG_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"PORT": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 1000
},
"PORT_BUFFER_DROP": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 60000
},
"PORT_RATES": {
"FLEX_COUNTER_STATUS": "enable"
},
"QUEUE": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"QUEUE_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"ACL": {
"FLEX_COUNTER_STATUS": "enable"
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"FLOW_CNT_TRAP": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
}
}
}
},
"FLEX_COUNTER_TABLE_WITH_INVALID_POLL_INTERVAL": {
"sonic-flex_counter:sonic-flex_counter": {
"sonic-flex_counter:FLEX_COUNTER_TABLE": {
"BUFFER_POOL_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
},
"DEBUG_COUNTER": {
"FLEX_COUNTER_STATUS": "enable"
},
"PFCWD": {
"FLEX_COUNTER_STATUS": "enable"
},
"PG_DROP": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
},
"PG_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
},
"PORT": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
},
"PORT_BUFFER_DROP": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
},
"PORT_RATES": {
"FLEX_COUNTER_STATUS": "enable"
},
"QUEUE": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
},
"QUEUE_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
},
"ACL": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
},
"FLOW_CNT_TRAP": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 99
}
}
}
Expand Down
38 changes: 37 additions & 1 deletion src/sonic-yang-models/yang-models/sonic-flex_counter.yang
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ module sonic-flex_counter {
type boolean;
}

typedef poll_interval {
type uint32 {
range 100..4294967295;
}
}

description "FLEX_COUNTER_TABLE part of config_db.json";

/* below are in alphabetical order */
Expand All @@ -39,6 +45,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

container DEBUG_COUNTER {
Expand Down Expand Up @@ -69,6 +78,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

container PG_WATERMARK {
Expand All @@ -79,6 +91,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

container PORT {
Expand All @@ -89,10 +104,13 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

container PORT_RATES {
/* PORT_BUFFER_DROP_COUNTER_FLEX_COUNTER_GROUP */
/* PORT_RATES_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
Expand All @@ -109,6 +127,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

container QUEUE {
Expand All @@ -119,6 +140,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

container QUEUE_WATERMARK {
Expand All @@ -129,6 +153,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

container RIF {
Expand All @@ -139,6 +166,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

container RIF_RATES {
Expand All @@ -159,6 +189,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

container FLOW_CNT_TRAP {
Expand All @@ -169,6 +202,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

}
Expand Down

0 comments on commit b0f06ba

Please sign in to comment.