Skip to content

Commit b0f06ba

Browse files
[DPB][YANG] Add POLL_INTERVAL in flex_counter yang model (#9276)
#### 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](#9075)) that fix another bug in SONiC should be merged to master.
1 parent 27a6641 commit b0f06ba

File tree

4 files changed

+147
-40
lines changed

4 files changed

+147
-40
lines changed

src/sonic-yang-models/tests/files/sample_config_db.json

+36-30
Original file line numberDiff line numberDiff line change
@@ -921,25 +921,31 @@
921921
"FLEX_COUNTER_STATUS": "enable"
922922
},
923923
"PG_WATERMARK": {
924-
"FLEX_COUNTER_STATUS": "enable"
924+
"FLEX_COUNTER_STATUS": "enable",
925+
"POLL_INTERVAL": "10000"
925926
},
926927
"PORT": {
927-
"FLEX_COUNTER_STATUS": "enable"
928+
"FLEX_COUNTER_STATUS": "enable",
929+
"POLL_INTERVAL": "1000"
928930
},
929931
"PORT_RATES": {
930932
"FLEX_COUNTER_STATUS": "enable"
931933
},
932934
"PORT_BUFFER_DROP": {
933-
"FLEX_COUNTER_STATUS": "enable"
935+
"FLEX_COUNTER_STATUS": "enable",
936+
"POLL_INTERVAL": "60000"
934937
},
935938
"BUFFER_POOL_WATERMARK": {
936-
"FLEX_COUNTER_STATUS": "enable"
939+
"FLEX_COUNTER_STATUS": "enable",
940+
"POLL_INTERVAL": "10000"
937941
},
938942
"QUEUE": {
939-
"FLEX_COUNTER_STATUS": "enable"
943+
"FLEX_COUNTER_STATUS": "enable",
944+
"POLL_INTERVAL": "10000"
940945
},
941946
"QUEUE_WATERMARK": {
942-
"FLEX_COUNTER_STATUS": "enable"
947+
"FLEX_COUNTER_STATUS": "enable",
948+
"POLL_INTERVAL": "10000"
943949
},
944950
"DEBUG_COUNTER": {
945951
"FLEX_COUNTER_STATUS": "enable"
@@ -1008,13 +1014,13 @@
10081014
},
10091015
"AAA": {
10101016
"authentication": {
1011-
"login": "local"
1017+
"login": "local"
10121018
},
10131019
"authorization": {
1014-
"login": "local"
1020+
"login": "local"
10151021
},
10161022
"accounting": {
1017-
"login": "local"
1023+
"login": "local"
10181024
}
10191025
},
10201026
"TACPLUS": {
@@ -1340,82 +1346,82 @@
13401346
},
13411347

13421348
"DSCP_TO_TC_MAP": {
1343-
"Dscp_to_tc_map1": {
1349+
"Dscp_to_tc_map1": {
13441350
"1": "1",
13451351
"2": "2"
1346-
},
1347-
"Dscp_to_tc_map2": {
1352+
},
1353+
"Dscp_to_tc_map2": {
13481354
"3": "3",
13491355
"4": "4"
13501356
}
13511357
},
13521358

13531359
"DOT1P_TO_TC_MAP": {
1354-
"Dot1p_to_tc_map1": {
1360+
"Dot1p_to_tc_map1": {
13551361
"1": "1",
13561362
"2": "2"
1357-
},
1358-
"Dot1p_to_tc_map2": {
1363+
},
1364+
"Dot1p_to_tc_map2": {
13591365
"3": "3",
13601366
"4": "4"
13611367
}
13621368
},
13631369

13641370
"TC_TO_PRIORITY_GROUP_MAP": {
1365-
"tc_to_pg_map1": {
1371+
"tc_to_pg_map1": {
13661372
"1": "1",
13671373
"2": "2"
1368-
},
1369-
"tc_to_pg_map2": {
1374+
},
1375+
"tc_to_pg_map2": {
13701376
"3": "3",
13711377
"4": "4"
13721378
}
13731379
},
13741380

13751381
"TC_TO_QUEUE_MAP": {
1376-
"tc_to_q_map1": {
1382+
"tc_to_q_map1": {
13771383
"1": "1",
13781384
"2": "2"
1379-
},
1380-
"tc_to_q_map2": {
1385+
},
1386+
"tc_to_q_map2": {
13811387
"3": "3",
13821388
"4": "4"
13831389
}
13841390
},
13851391

13861392
"MAP_PFC_PRIORITY_TO_QUEUE": {
1387-
"pfc_prio_to_q_map1": {
1393+
"pfc_prio_to_q_map1": {
13881394
"1": "1",
13891395
"2": "2"
1390-
},
1391-
"pfc_prio_to_q_map2": {
1396+
},
1397+
"pfc_prio_to_q_map2": {
13921398
"3": "3",
13931399
"4": "4"
13941400
}
13951401
},
13961402

13971403
"PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": {
1398-
"pfc_prio_to_pg_map1": {
1404+
"pfc_prio_to_pg_map1": {
13991405
"1": "1",
14001406
"2": "2"
1401-
},
1402-
"pfc_prio_to_pg_map2": {
1407+
},
1408+
"pfc_prio_to_pg_map2": {
14031409
"3": "3",
14041410
"4": "4"
14051411
}
14061412
},
14071413

14081414
"PORT_QOS_MAP": {
1409-
"Ethernet0": {
1415+
"Ethernet0": {
14101416
"dot1p_to_tc_map" : "Dot1p_to_tc_map1",
14111417
"dscp_to_tc_map": "Dscp_to_tc_map1",
14121418
"tc_to_queue_map": "tc_to_q_map1",
14131419
"tc_to_pg_map": "tc_to_pg_map1",
14141420
"pfc_to_queue_map": "pfc_prio_to_q_map1",
14151421
"pfc_to_pg_map" : "pfc_prio_to_pg_map1",
14161422
"pfc_enable" : "3,4"
1417-
},
1418-
"Ethernet4": {
1423+
},
1424+
"Ethernet4": {
14191425
"dot1p_to_tc_map" : "Dot1p_to_tc_map2",
14201426
"dscp_to_tc_map": "Dscp_to_tc_map2",
14211427
"tc_to_queue_map": "tc_to_q_map2",
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE": {
3-
"desc": "FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE no failure."
3+
"desc": "FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE no failure."
4+
},
5+
"FLEX_COUNTER_TABLE_WITH_INVALID_POLL_INTERVAL": {
6+
"desc": "Out of range poll interval.",
7+
"eStrKey": "Range",
8+
"eStr": "100..4294967295"
49
}
510
}

src/sonic-yang-models/tests/yang_model_tests/tests_config/flex_counter.json

+68-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"sonic-flex_counter:sonic-flex_counter": {
44
"sonic-flex_counter:FLEX_COUNTER_TABLE": {
55
"BUFFER_POOL_WATERMARK": {
6-
"FLEX_COUNTER_STATUS": "enable"
6+
"FLEX_COUNTER_STATUS": "enable",
7+
"POLL_INTERVAL": 10000
78
},
89
"DEBUG_COUNTER": {
910
"FLEX_COUNTER_STATUS": "enable"
@@ -12,31 +13,90 @@
1213
"FLEX_COUNTER_STATUS": "enable"
1314
},
1415
"PG_DROP": {
15-
"FLEX_COUNTER_STATUS": "enable"
16+
"FLEX_COUNTER_STATUS": "enable",
17+
"POLL_INTERVAL": 10000
1618
},
1719
"PG_WATERMARK": {
18-
"FLEX_COUNTER_STATUS": "enable"
20+
"FLEX_COUNTER_STATUS": "enable",
21+
"POLL_INTERVAL": 10000
1922
},
2023
"PORT": {
21-
"FLEX_COUNTER_STATUS": "enable"
24+
"FLEX_COUNTER_STATUS": "enable",
25+
"POLL_INTERVAL": 1000
2226
},
2327
"PORT_BUFFER_DROP": {
24-
"FLEX_COUNTER_STATUS": "enable"
28+
"FLEX_COUNTER_STATUS": "enable",
29+
"POLL_INTERVAL": 60000
2530
},
2631
"PORT_RATES": {
2732
"FLEX_COUNTER_STATUS": "enable"
2833
},
2934
"QUEUE": {
30-
"FLEX_COUNTER_STATUS": "enable"
35+
"FLEX_COUNTER_STATUS": "enable",
36+
"POLL_INTERVAL": 10000
3137
},
3238
"QUEUE_WATERMARK": {
33-
"FLEX_COUNTER_STATUS": "enable"
39+
"FLEX_COUNTER_STATUS": "enable",
40+
"POLL_INTERVAL": 10000
3441
},
3542
"ACL": {
36-
"FLEX_COUNTER_STATUS": "enable"
43+
"FLEX_COUNTER_STATUS": "enable",
44+
"POLL_INTERVAL": 10000
3745
},
3846
"FLOW_CNT_TRAP": {
47+
"FLEX_COUNTER_STATUS": "enable",
48+
"POLL_INTERVAL": 10000
49+
}
50+
}
51+
}
52+
},
53+
"FLEX_COUNTER_TABLE_WITH_INVALID_POLL_INTERVAL": {
54+
"sonic-flex_counter:sonic-flex_counter": {
55+
"sonic-flex_counter:FLEX_COUNTER_TABLE": {
56+
"BUFFER_POOL_WATERMARK": {
57+
"FLEX_COUNTER_STATUS": "enable",
58+
"POLL_INTERVAL": 99
59+
},
60+
"DEBUG_COUNTER": {
61+
"FLEX_COUNTER_STATUS": "enable"
62+
},
63+
"PFCWD": {
3964
"FLEX_COUNTER_STATUS": "enable"
65+
},
66+
"PG_DROP": {
67+
"FLEX_COUNTER_STATUS": "enable",
68+
"POLL_INTERVAL": 99
69+
},
70+
"PG_WATERMARK": {
71+
"FLEX_COUNTER_STATUS": "enable",
72+
"POLL_INTERVAL": 99
73+
},
74+
"PORT": {
75+
"FLEX_COUNTER_STATUS": "enable",
76+
"POLL_INTERVAL": 99
77+
},
78+
"PORT_BUFFER_DROP": {
79+
"FLEX_COUNTER_STATUS": "enable",
80+
"POLL_INTERVAL": 99
81+
},
82+
"PORT_RATES": {
83+
"FLEX_COUNTER_STATUS": "enable"
84+
},
85+
"QUEUE": {
86+
"FLEX_COUNTER_STATUS": "enable",
87+
"POLL_INTERVAL": 99
88+
},
89+
"QUEUE_WATERMARK": {
90+
"FLEX_COUNTER_STATUS": "enable",
91+
"POLL_INTERVAL": 99
92+
},
93+
"ACL": {
94+
"FLEX_COUNTER_STATUS": "enable",
95+
"POLL_INTERVAL": 99
96+
},
97+
"FLOW_CNT_TRAP": {
98+
"FLEX_COUNTER_STATUS": "enable",
99+
"POLL_INTERVAL": 99
40100
}
41101
}
42102
}

src/sonic-yang-models/yang-models/sonic-flex_counter.yang

+37-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ module sonic-flex_counter {
2727
type boolean;
2828
}
2929

30+
typedef poll_interval {
31+
type uint32 {
32+
range 100..4294967295;
33+
}
34+
}
35+
3036
description "FLEX_COUNTER_TABLE part of config_db.json";
3137

3238
/* below are in alphabetical order */
@@ -39,6 +45,9 @@ module sonic-flex_counter {
3945
leaf FLEX_COUNTER_DELAY_STATUS {
4046
type flex_delay_status;
4147
}
48+
leaf POLL_INTERVAL {
49+
type poll_interval;
50+
}
4251
}
4352

4453
container DEBUG_COUNTER {
@@ -69,6 +78,9 @@ module sonic-flex_counter {
6978
leaf FLEX_COUNTER_DELAY_STATUS {
7079
type flex_delay_status;
7180
}
81+
leaf POLL_INTERVAL {
82+
type poll_interval;
83+
}
7284
}
7385

7486
container PG_WATERMARK {
@@ -79,6 +91,9 @@ module sonic-flex_counter {
7991
leaf FLEX_COUNTER_DELAY_STATUS {
8092
type flex_delay_status;
8193
}
94+
leaf POLL_INTERVAL {
95+
type poll_interval;
96+
}
8297
}
8398

8499
container PORT {
@@ -89,10 +104,13 @@ module sonic-flex_counter {
89104
leaf FLEX_COUNTER_DELAY_STATUS {
90105
type flex_delay_status;
91106
}
107+
leaf POLL_INTERVAL {
108+
type poll_interval;
109+
}
92110
}
93111

94112
container PORT_RATES {
95-
/* PORT_BUFFER_DROP_COUNTER_FLEX_COUNTER_GROUP */
113+
/* PORT_RATES_COUNTER_FLEX_COUNTER_GROUP */
96114
leaf FLEX_COUNTER_STATUS {
97115
type flex_status;
98116
}
@@ -109,6 +127,9 @@ module sonic-flex_counter {
109127
leaf FLEX_COUNTER_DELAY_STATUS {
110128
type flex_delay_status;
111129
}
130+
leaf POLL_INTERVAL {
131+
type poll_interval;
132+
}
112133
}
113134

114135
container QUEUE {
@@ -119,6 +140,9 @@ module sonic-flex_counter {
119140
leaf FLEX_COUNTER_DELAY_STATUS {
120141
type flex_delay_status;
121142
}
143+
leaf POLL_INTERVAL {
144+
type poll_interval;
145+
}
122146
}
123147

124148
container QUEUE_WATERMARK {
@@ -129,6 +153,9 @@ module sonic-flex_counter {
129153
leaf FLEX_COUNTER_DELAY_STATUS {
130154
type flex_delay_status;
131155
}
156+
leaf POLL_INTERVAL {
157+
type poll_interval;
158+
}
132159
}
133160

134161
container RIF {
@@ -139,6 +166,9 @@ module sonic-flex_counter {
139166
leaf FLEX_COUNTER_DELAY_STATUS {
140167
type flex_delay_status;
141168
}
169+
leaf POLL_INTERVAL {
170+
type poll_interval;
171+
}
142172
}
143173

144174
container RIF_RATES {
@@ -159,6 +189,9 @@ module sonic-flex_counter {
159189
leaf FLEX_COUNTER_DELAY_STATUS {
160190
type flex_delay_status;
161191
}
192+
leaf POLL_INTERVAL {
193+
type poll_interval;
194+
}
162195
}
163196

164197
container FLOW_CNT_TRAP {
@@ -169,6 +202,9 @@ module sonic-flex_counter {
169202
leaf FLEX_COUNTER_DELAY_STATUS {
170203
type flex_delay_status;
171204
}
205+
leaf POLL_INTERVAL {
206+
type poll_interval;
207+
}
172208
}
173209

174210
}

0 commit comments

Comments
 (0)