Skip to content

Commit ec46a23

Browse files
mykolaxgerasymenkojudyjoseph
authored andcommitted
[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 546818f commit ec46a23

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
@@ -916,25 +916,31 @@
916916
"FLEX_COUNTER_STATUS": "enable"
917917
},
918918
"PG_WATERMARK": {
919-
"FLEX_COUNTER_STATUS": "enable"
919+
"FLEX_COUNTER_STATUS": "enable",
920+
"POLL_INTERVAL": "10000"
920921
},
921922
"PORT": {
922-
"FLEX_COUNTER_STATUS": "enable"
923+
"FLEX_COUNTER_STATUS": "enable",
924+
"POLL_INTERVAL": "1000"
923925
},
924926
"PORT_RATES": {
925927
"FLEX_COUNTER_STATUS": "enable"
926928
},
927929
"PORT_BUFFER_DROP": {
928-
"FLEX_COUNTER_STATUS": "enable"
930+
"FLEX_COUNTER_STATUS": "enable",
931+
"POLL_INTERVAL": "60000"
929932
},
930933
"BUFFER_POOL_WATERMARK": {
931-
"FLEX_COUNTER_STATUS": "enable"
934+
"FLEX_COUNTER_STATUS": "enable",
935+
"POLL_INTERVAL": "10000"
932936
},
933937
"QUEUE": {
934-
"FLEX_COUNTER_STATUS": "enable"
938+
"FLEX_COUNTER_STATUS": "enable",
939+
"POLL_INTERVAL": "10000"
935940
},
936941
"QUEUE_WATERMARK": {
937-
"FLEX_COUNTER_STATUS": "enable"
942+
"FLEX_COUNTER_STATUS": "enable",
943+
"POLL_INTERVAL": "10000"
938944
},
939945
"DEBUG_COUNTER": {
940946
"FLEX_COUNTER_STATUS": "enable"
@@ -1003,13 +1009,13 @@
10031009
},
10041010
"AAA": {
10051011
"authentication": {
1006-
"login": "local"
1012+
"login": "local"
10071013
},
10081014
"authorization": {
1009-
"login": "local"
1015+
"login": "local"
10101016
},
10111017
"accounting": {
1012-
"login": "local"
1018+
"login": "local"
10131019
}
10141020
},
10151021
"TACPLUS": {
@@ -1313,82 +1319,82 @@
13131319
},
13141320

13151321
"DSCP_TO_TC_MAP": {
1316-
"Dscp_to_tc_map1": {
1322+
"Dscp_to_tc_map1": {
13171323
"1": "1",
13181324
"2": "2"
1319-
},
1320-
"Dscp_to_tc_map2": {
1325+
},
1326+
"Dscp_to_tc_map2": {
13211327
"3": "3",
13221328
"4": "4"
13231329
}
13241330
},
13251331

13261332
"DOT1P_TO_TC_MAP": {
1327-
"Dot1p_to_tc_map1": {
1333+
"Dot1p_to_tc_map1": {
13281334
"1": "1",
13291335
"2": "2"
1330-
},
1331-
"Dot1p_to_tc_map2": {
1336+
},
1337+
"Dot1p_to_tc_map2": {
13321338
"3": "3",
13331339
"4": "4"
13341340
}
13351341
},
13361342

13371343
"TC_TO_PRIORITY_GROUP_MAP": {
1338-
"tc_to_pg_map1": {
1344+
"tc_to_pg_map1": {
13391345
"1": "1",
13401346
"2": "2"
1341-
},
1342-
"tc_to_pg_map2": {
1347+
},
1348+
"tc_to_pg_map2": {
13431349
"3": "3",
13441350
"4": "4"
13451351
}
13461352
},
13471353

13481354
"TC_TO_QUEUE_MAP": {
1349-
"tc_to_q_map1": {
1355+
"tc_to_q_map1": {
13501356
"1": "1",
13511357
"2": "2"
1352-
},
1353-
"tc_to_q_map2": {
1358+
},
1359+
"tc_to_q_map2": {
13541360
"3": "3",
13551361
"4": "4"
13561362
}
13571363
},
13581364

13591365
"MAP_PFC_PRIORITY_TO_QUEUE": {
1360-
"pfc_prio_to_q_map1": {
1366+
"pfc_prio_to_q_map1": {
13611367
"1": "1",
13621368
"2": "2"
1363-
},
1364-
"pfc_prio_to_q_map2": {
1369+
},
1370+
"pfc_prio_to_q_map2": {
13651371
"3": "3",
13661372
"4": "4"
13671373
}
13681374
},
13691375

13701376
"PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": {
1371-
"pfc_prio_to_pg_map1": {
1377+
"pfc_prio_to_pg_map1": {
13721378
"1": "1",
13731379
"2": "2"
1374-
},
1375-
"pfc_prio_to_pg_map2": {
1380+
},
1381+
"pfc_prio_to_pg_map2": {
13761382
"3": "3",
13771383
"4": "4"
13781384
}
13791385
},
13801386

13811387
"PORT_QOS_MAP": {
1382-
"Ethernet0": {
1388+
"Ethernet0": {
13831389
"dot1p_to_tc_map" : "Dot1p_to_tc_map1",
13841390
"dscp_to_tc_map": "Dscp_to_tc_map1",
13851391
"tc_to_queue_map": "tc_to_q_map1",
13861392
"tc_to_pg_map": "tc_to_pg_map1",
13871393
"pfc_to_queue_map": "pfc_prio_to_q_map1",
13881394
"pfc_to_pg_map" : "pfc_prio_to_pg_map1",
13891395
"pfc_enable" : "3,4"
1390-
},
1391-
"Ethernet4": {
1396+
},
1397+
"Ethernet4": {
13921398
"dot1p_to_tc_map" : "Dot1p_to_tc_map2",
13931399
"dscp_to_tc_map": "Dscp_to_tc_map2",
13941400
"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)