Skip to content

Commit c710002

Browse files
authored
[Chassis][Voq]Update sonic-buffer-queue and sonic-queue for Voq Chassis (#18875)
Why I did it The configuration for QUEUE and BUFFER_QUEUE differs between a VOQ device and a Non-VOQ devices. For the Voq device: The queue and buffer queue is applied on the system port. The system port is a representation of every port in a chassis, the key for systemport consists of Linecard Name , Asic Name and portname On a Non voq device: the queue and buffer queue configuration is applied on the front panel port. Due to this differences the yang models sonic-queue.yang and sonic-buffer-queue.yang does not work for Voq devices This is address in this PR Microsoft ADO (27252773 and 27252696): How I did it Update the yang model to have different CONFIG_LIST with different keys based on the following condition when the switch_type is not present or switch_type is not voq, the yang LIST will have key of port and queue_index when the switch_type is present and switch_type is voqhe yang LIST will have key of Linecard name, asi name, port and queue_index How to verify it UT and incremental config push on chassis
1 parent 0a6160a commit c710002

File tree

7 files changed

+334
-107
lines changed

7 files changed

+334
-107
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@
362362
"region": "usfoo",
363363
"asic_name": "Asic0",
364364
"switch_id": "2",
365-
"switch_type": "voq",
366365
"max_cores": "8",
367366
"sub_role": "FrontEnd",
368367
"dhcp_server": "disabled",

src/sonic-yang-models/tests/yang_model_tests/tests/buffer_queue.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
"BUFFER_QUEUE_WRONG_PORT_VALUE": {
1414
"desc": "BUFFER_QUEUE_WRONG_PORT_VALUE pattern failure",
1515
"eStr": "wrong"
16+
},
17+
"VOQ_BUFFER_QUEUE_CONFIG": {
18+
"desc": "VOQ_BUFFER_QUEUE_CONFIG has no failure"
1619
}
1720
}

src/sonic-yang-models/tests/yang_model_tests/tests/qos.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,8 @@
8585
"QUEUE_WRED_NOT_EXIST": {
8686
"desc": "Referring non-existing WRED table.",
8787
"eStrKey" : "LeafRef"
88+
},
89+
"VOQ_QUEUE_CONFIG": {
90+
"desc": "Attach scheduler and wred profiles to VOQ."
8891
}
8992
}

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

Lines changed: 151 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,51 @@
33
"sonic-port:sonic-port": {
44
"sonic-port:PORT": {
55
"PORT_LIST": [
6-
{
7-
"admin_status": "up",
8-
"alias": "eth0",
9-
"description": "Ethernet0",
10-
"lanes": "65",
11-
"mtu": "9000",
12-
"name": "Ethernet4",
13-
"tpid": "0x8100",
14-
"speed": "25000"
15-
}
6+
{
7+
"admin_status": "up",
8+
"alias": "eth0",
9+
"description": "Ethernet0",
10+
"lanes": "65",
11+
"mtu": "9000",
12+
"name": "Ethernet4",
13+
"tpid": "0x8100",
14+
"speed": "25000"
15+
}
1616
]
1717
}
1818
},
1919
"sonic-buffer-pool:sonic-buffer-pool": {
2020
"sonic-buffer-pool:BUFFER_POOL": {
2121
"BUFFER_POOL_LIST": [
22-
{
23-
"name": "egress_lossless_pool",
24-
"mode": "static",
25-
"size": "12766208",
26-
"type": "ingress"
27-
}
22+
{
23+
"name": "egress_lossless_pool",
24+
"mode": "static",
25+
"size": "12766208",
26+
"type": "ingress"
27+
}
2828
]
2929
}
3030
},
3131
"sonic-buffer-profile:sonic-buffer-profile": {
3232
"sonic-buffer-profile:BUFFER_PROFILE": {
3333
"BUFFER_PROFILE_LIST": [
34-
{
35-
"name": "lossless_buffer_profile",
36-
"size": 1518,
37-
"dynamic_th": "2",
38-
"pool": "egress_lossless_pool"
39-
}
34+
{
35+
"name": "lossless_buffer_profile",
36+
"size": 1518,
37+
"dynamic_th": "2",
38+
"pool": "egress_lossless_pool"
39+
}
4040
]
4141
}
4242
},
4343
"sonic-buffer-queue:sonic-buffer-queue": {
4444
"sonic-buffer-queue:BUFFER_QUEUE": {
4545
"BUFFER_QUEUE_LIST": [
46-
{
47-
"port": "Ethernet4",
48-
"qindex": "15",
49-
"profile": "lossless_buffer_profile"
50-
}
46+
{
47+
"port": "Ethernet4",
48+
"qindex": "15",
49+
"profile": "lossless_buffer_profile"
50+
}
5151
]
5252
}
5353
}
@@ -56,50 +56,50 @@
5656
"sonic-port:sonic-port": {
5757
"sonic-port:PORT": {
5858
"PORT_LIST": [
59-
{
60-
"admin_status": "up",
61-
"alias": "eth0",
62-
"description": "Ethernet0",
63-
"lanes": "65",
64-
"mtu": "9000",
65-
"name": "Ethernet4",
66-
"tpid": "0x8100",
67-
"speed": "25000"
68-
}
59+
{
60+
"admin_status": "up",
61+
"alias": "eth0",
62+
"description": "Ethernet0",
63+
"lanes": "65",
64+
"mtu": "9000",
65+
"name": "Ethernet4",
66+
"tpid": "0x8100",
67+
"speed": "25000"
68+
}
6969
]
7070
}
7171
},
7272
"sonic-buffer-pool:sonic-buffer-pool": {
7373
"sonic-buffer-pool:BUFFER_POOL": {
7474
"BUFFER_POOL_LIST": [
75-
{
76-
"name": "egress_lossless_pool",
77-
"mode": "static",
78-
"size": "12766208",
79-
"type": "ingress"
80-
}
75+
{
76+
"name": "egress_lossless_pool",
77+
"mode": "static",
78+
"size": "12766208",
79+
"type": "ingress"
80+
}
8181
]
8282
}
8383
},
8484
"sonic-buffer-profile:sonic-buffer-profile": {
8585
"sonic-buffer-profile:BUFFER_PROFILE": {
8686
"BUFFER_PROFILE_LIST": [
87-
{
88-
"name": "lossless_buffer_profile",
89-
"size": "1518",
90-
"pool": "egress_lossless_pool"
91-
}
87+
{
88+
"name": "lossless_buffer_profile",
89+
"size": "1518",
90+
"pool": "egress_lossless_pool"
91+
}
9292
]
9393
}
9494
},
9595
"sonic-buffer-queue:sonic-buffer-queue": {
9696
"sonic-buffer-queue:BUFFER_QUEUE": {
9797
"BUFFER_QUEUE_LIST": [
98-
{
99-
"port": "Ethernet4",
100-
"qindex": "3",
101-
"profile": "wrong"
102-
}
98+
{
99+
"port": "Ethernet4",
100+
"qindex": "3",
101+
"profile": "wrong"
102+
}
103103
]
104104
}
105105
}
@@ -108,50 +108,50 @@
108108
"sonic-port:sonic-port": {
109109
"sonic-port:PORT": {
110110
"PORT_LIST": [
111-
{
112-
"admin_status": "up",
113-
"alias": "eth0",
114-
"description": "Ethernet0",
115-
"lanes": "65",
116-
"mtu": "9000",
117-
"name": "Ethernet4",
118-
"tpid": "0x8100",
119-
"speed": "25000"
120-
}
111+
{
112+
"admin_status": "up",
113+
"alias": "eth0",
114+
"description": "Ethernet0",
115+
"lanes": "65",
116+
"mtu": "9000",
117+
"name": "Ethernet4",
118+
"tpid": "0x8100",
119+
"speed": "25000"
120+
}
121121
]
122122
}
123123
},
124124
"sonic-buffer-pool:sonic-buffer-pool": {
125125
"sonic-buffer-pool:BUFFER_POOL": {
126126
"BUFFER_POOL_LIST": [
127-
{
128-
"name": "egress_lossless_pool",
129-
"mode": "static",
130-
"size": "12766208",
131-
"type": "ingress"
132-
}
127+
{
128+
"name": "egress_lossless_pool",
129+
"mode": "static",
130+
"size": "12766208",
131+
"type": "ingress"
132+
}
133133
]
134134
}
135135
},
136136
"sonic-buffer-profile:sonic-buffer-profile": {
137137
"sonic-buffer-profile:BUFFER_PROFILE": {
138138
"BUFFER_PROFILE_LIST": [
139-
{
140-
"name": "lossless_buffer_profile",
141-
"size": "1518",
142-
"pool": "egress_lossless_pool"
143-
}
139+
{
140+
"name": "lossless_buffer_profile",
141+
"size": "1518",
142+
"pool": "egress_lossless_pool"
143+
}
144144
]
145145
}
146146
},
147147
"sonic-buffer-queue:sonic-buffer-queue": {
148148
"sonic-buffer-queue:BUFFER_QUEUE": {
149149
"BUFFER_QUEUE_LIST": [
150-
{
151-
"port": "Ethernet4",
152-
"qindex": "16",
153-
"profile": "lossless_buffer_profile"
154-
}
150+
{
151+
"port": "Ethernet4",
152+
"qindex": "16",
153+
"profile": "lossless_buffer_profile"
154+
}
155155
]
156156
}
157157
}
@@ -160,52 +160,98 @@
160160
"sonic-port:sonic-port": {
161161
"sonic-port:PORT": {
162162
"PORT_LIST": [
163-
{
164-
"admin_status": "up",
165-
"alias": "eth0",
166-
"description": "Ethernet0",
167-
"lanes": "65",
168-
"mtu": "9000",
169-
"name": "Ethernet4",
170-
"tpid": "0x8100",
171-
"speed": "25000"
172-
}
163+
{
164+
"admin_status": "up",
165+
"alias": "eth0",
166+
"description": "Ethernet0",
167+
"lanes": "65",
168+
"mtu": "9000",
169+
"name": "Ethernet4",
170+
"tpid": "0x8100",
171+
"speed": "25000"
172+
}
173173
]
174174
}
175175
},
176176
"sonic-buffer-pool:sonic-buffer-pool": {
177177
"sonic-buffer-pool:BUFFER_POOL": {
178178
"BUFFER_POOL_LIST": [
179-
{
180-
"name": "egress_lossless_pool",
181-
"mode": "static",
182-
"size": "12766208",
183-
"type": "ingress"
184-
}
179+
{
180+
"name": "egress_lossless_pool",
181+
"mode": "static",
182+
"size": "12766208",
183+
"type": "ingress"
184+
}
185185
]
186186
}
187187
},
188188
"sonic-buffer-profile:sonic-buffer-profile": {
189189
"sonic-buffer-profile:BUFFER_PROFILE": {
190190
"BUFFER_PROFILE_LIST": [
191-
{
192-
"name": "lossless_buffer_profile",
193-
"size": "1518",
194-
"pool": "egress_lossless_pool"
195-
}
191+
{
192+
"name": "lossless_buffer_profile",
193+
"size": "1518",
194+
"pool": "egress_lossless_pool"
195+
}
196196
]
197197
}
198198
},
199199
"sonic-buffer-queue:sonic-buffer-queue": {
200200
"sonic-buffer-queue:BUFFER_QUEUE": {
201201
"BUFFER_QUEUE_LIST": [
202-
{
203-
"port": "wrong",
204-
"qindex": "4",
205-
"profile": "lossless_buffer_profile"
202+
{
203+
"port": "wrong",
204+
"qindex": "4",
205+
"profile": "lossless_buffer_profile"
206+
}
207+
]
208+
}
209+
}
210+
},
211+
"VOQ_BUFFER_QUEUE_CONFIG": {
212+
"sonic-device_metadata:sonic-device_metadata": {
213+
"sonic-device_metadata:DEVICE_METADATA": {
214+
"sonic-device_metadata:localhost": {
215+
"switch_type": "voq"
206216
}
217+
}
218+
},
219+
"sonic-buffer-pool:sonic-buffer-pool": {
220+
"sonic-buffer-pool:BUFFER_POOL": {
221+
"BUFFER_POOL_LIST": [
222+
{
223+
"name": "egress_lossless_pool",
224+
"mode": "static",
225+
"size": "12766208",
226+
"type": "ingress"
227+
}
228+
]
229+
}
230+
},
231+
"sonic-buffer-profile:sonic-buffer-profile": {
232+
"sonic-buffer-profile:BUFFER_PROFILE": {
233+
"BUFFER_PROFILE_LIST": [
234+
{
235+
"name": "lossless_buffer_profile",
236+
"size": 1518,
237+
"dynamic_th": "2",
238+
"pool": "egress_lossless_pool"
239+
}
240+
]
241+
}
242+
},
243+
"sonic-buffer-queue:sonic-buffer-queue": {
244+
"sonic-buffer-queue:BUFFER_QUEUE": {
245+
"VOQ_BUFFER_QUEUE_LIST": [
246+
{
247+
"hostname": "lc1",
248+
"asic_name": "asic0",
249+
"port": "Ethernet4",
250+
"qindex": "15",
251+
"profile": "lossless_buffer_profile"
252+
}
207253
]
208254
}
209255
}
210256
}
211-
}
257+
}

0 commit comments

Comments
 (0)