|
22 | 22 | minigraph_facts: host={{inventory_hostname}} |
23 | 23 | become: no |
24 | 24 |
|
| 25 | + - name: Get ports info. |
| 26 | + include_tasks: roles/test/tasks/qos_get_ports.yml |
| 27 | + |
| 28 | + - name: Check if lossless buffer profile is derived |
| 29 | + fail: msg="Lossless Buffer profile could not be retreived" |
| 30 | + when: lossless_buffer_profile is not defined or minigraph_hwsku is not defined |
| 31 | + |
| 32 | + - set_fact: |
| 33 | + defined_asic_list: ['td2', 'th', 'th2', 'spc1', 'spc2', 'spc3'] |
| 34 | + speed_cablelen: "{{ lossless_buffer_profile }}" |
| 35 | + |
| 36 | + - set_fact: speed_cablelen="{{speed_cablelen | regex_replace('BUFFER_PROFILE\|pg_lossless_(.*)_profile', '\\1')}}" |
| 37 | + |
| 38 | + - name: Get asic type |
| 39 | + set_fact: asic_type="{{ item }}" |
| 40 | + when: |
| 41 | + - hostvars[inventory_hostname][sonic_asic_type + '_' + item + '_hwskus'] is defined |
| 42 | + - minigraph_hwsku in hostvars[inventory_hostname][sonic_asic_type + '_' + item + '_hwskus'] |
| 43 | + with_items: "{{ defined_asic_list }}" |
| 44 | + |
| 45 | + - debug: msg="asic type is {{ asic_type }}, portspeed_cablelen is {{ speed_cablelen }}" |
| 46 | + |
25 | 47 | - name: check if the device has configured qos parameters |
26 | 48 | fail: msg="device doesn't have configured qos parameters" |
27 | | - when: minigraph_hwsku is not defined or qos_params[minigraph_hwsku] is not defined |
| 49 | + when: qos_params[asic_type] is not defined or qos_params[asic_type][speed_cablelen] is not defined |
28 | 50 |
|
29 | 51 | - name: set qos parameters for the device |
30 | | - set_fact: qp={{qos_params[minigraph_hwsku]}} |
| 52 | + set_fact: |
| 53 | + qp: "{{qos_params[asic_type]}}" |
| 54 | + qp_sc: "{{qos_params[asic_type][speed_cablelen]}}" |
31 | 55 |
|
32 | 56 | - name: Ensure LLDP Daemon stopped |
33 | 57 | become: yes |
|
52 | 76 |
|
53 | 77 | - meta: flush_handlers |
54 | 78 |
|
55 | | - - block: |
56 | | - - name: Deploy script to DUT/syncd |
57 | | - copy: src=roles/test/files/mlnx/packets_aging.py dest=/root/packets_aging.py |
| 79 | + - name: Deploy script to DUT/syncd |
| 80 | + copy: src=roles/test/files/mlnx/packets_aging.py dest=/root/packets_aging.py |
| 81 | + delegate_to: "{{ ansible_host }}_syncd" |
| 82 | + when: minigraph_hwsku is defined and minigraph_hwsku in mellanox_hwskus |
58 | 83 |
|
59 | | - - name: Disable Mellanox packet aging |
60 | | - shell: python /root/packets_aging.py disable |
61 | | - register: result |
62 | | - failed_when: result.stderr != '' |
| 84 | + - name: Disable Mellanox packet aging |
| 85 | + shell: python /root/packets_aging.py disable |
| 86 | + register: result |
| 87 | + failed_when: result.stderr != '' |
63 | 88 | delegate_to: "{{ ansible_host }}_syncd" |
64 | 89 | when: minigraph_hwsku is defined and minigraph_hwsku in mellanox_hwskus |
65 | 90 |
|
|
83 | 108 | - port_map_file='/root/{{ptf_portmap | basename}}' |
84 | 109 | - sonic_asic_type='{{sonic_asic_type}}' |
85 | 110 |
|
86 | | - - name: Get ports info. |
87 | | - include_tasks: roles/test/tasks/qos_get_ports.yml |
88 | | - |
89 | 111 | # Unpause all paused port |
90 | 112 | - include_tasks: qos_sai_ptf.yml |
91 | 113 | vars: |
|
135 | 157 | # XOFF limit |
136 | 158 | - include_tasks: qos_sai_ptf.yml |
137 | 159 | vars: |
138 | | - test_name: xoff limit ptf test dscp = {{qp.xoff_1.dscp}}, ecn = {{qp.xoff_1.ecn}} |
| 160 | + test_name: xoff limit ptf test dscp = {{qp_sc.xoff_1.dscp}}, ecn = {{qp_sc.xoff_1.ecn}} |
139 | 161 | test_path: sai_qos_tests.PFCtest |
140 | 162 | test_params: |
141 | | - - dscp='{{qp.xoff_1.dscp}}' |
142 | | - - ecn='{{qp.xoff_1.ecn}}' |
143 | | - - pg='{{qp.xoff_1.pg}}' |
| 163 | + - dscp='{{qp_sc.xoff_1.dscp}}' |
| 164 | + - ecn='{{qp_sc.xoff_1.ecn}}' |
| 165 | + - pg='{{qp_sc.xoff_1.pg}}' |
144 | 166 | - buffer_max_size='{{lossless_buffer_max_size|int}}' |
145 | 167 | - queue_max_size='{{lossless_queue_max_size|int}}' |
146 | 168 | - dst_port_id='{{dst_port_id}}' |
147 | 169 | - dst_port_ip='{{dst_port_ip}}' |
148 | 170 | - src_port_id='{{src_port_id}}' |
149 | 171 | - src_port_ip='{{src_port_ip}}' |
150 | | - - pkts_num_leak_out='{{qp.xoff_1.pkts_num_leak_out}}' |
151 | | - - pkts_num_trig_pfc='{{qp.xoff_1.pkts_num_trig_pfc}}' |
152 | | - - pkts_num_trig_ingr_drp='{{qp.xoff_1.pkts_num_trig_ingr_drp}}' |
| 172 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
| 173 | + - pkts_num_trig_pfc='{{qp_sc.xoff_1.pkts_num_trig_pfc}}' |
| 174 | + - pkts_num_trig_ingr_drp='{{qp_sc.xoff_1.pkts_num_trig_ingr_drp}}' |
153 | 175 |
|
154 | 176 | - include_tasks: qos_sai_ptf.yml |
155 | 177 | vars: |
156 | | - test_name: xoff limit ptf test dscp = {{qp.xoff_2.dscp}}, ecn = {{qp.xoff_2.ecn}} |
| 178 | + test_name: xoff limit ptf test dscp = {{qp_sc.xoff_2.dscp}}, ecn = {{qp_sc.xoff_2.ecn}} |
157 | 179 | test_path: sai_qos_tests.PFCtest |
158 | 180 | test_params: |
159 | | - - dscp='{{qp.xoff_2.dscp}}' |
160 | | - - ecn='{{qp.xoff_2.ecn}}' |
161 | | - - pg='{{qp.xoff_2.pg}}' |
| 181 | + - dscp='{{qp_sc.xoff_2.dscp}}' |
| 182 | + - ecn='{{qp_sc.xoff_2.ecn}}' |
| 183 | + - pg='{{qp_sc.xoff_2.pg}}' |
162 | 184 | - buffer_max_size='{{lossless_buffer_max_size|int}}' |
163 | 185 | - queue_max_size='{{lossless_queue_max_size|int}}' |
164 | 186 | - dst_port_id='{{dst_port_id}}' |
165 | 187 | - dst_port_ip='{{dst_port_ip}}' |
166 | 188 | - src_port_id='{{src_port_id}}' |
167 | 189 | - src_port_ip='{{src_port_ip}}' |
168 | | - - pkts_num_leak_out='{{qp.xoff_2.pkts_num_leak_out}}' |
169 | | - - pkts_num_trig_pfc='{{qp.xoff_2.pkts_num_trig_pfc}}' |
170 | | - - pkts_num_trig_ingr_drp='{{qp.xoff_2.pkts_num_trig_ingr_drp}}' |
| 190 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
| 191 | + - pkts_num_trig_pfc='{{qp_sc.xoff_2.pkts_num_trig_pfc}}' |
| 192 | + - pkts_num_trig_ingr_drp='{{qp_sc.xoff_2.pkts_num_trig_ingr_drp}}' |
171 | 193 |
|
172 | 194 | # XON limit |
173 | 195 | - include_tasks: qos_sai_ptf.yml |
|
187 | 209 | - dst_port_3_ip='{{dst_port_3_ip}}' |
188 | 210 | - src_port_id='{{src_port_id}}' |
189 | 211 | - src_port_ip='{{src_port_ip}}' |
190 | | - - pkts_num_leak_out='{{qp.xon_1.pkts_num_leak_out}}' |
| 212 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
191 | 213 | - pkts_num_trig_pfc='{{qp.xon_1.pkts_num_trig_pfc}}' |
192 | 214 | - pkts_num_dismiss_pfc='{{qp.xon_1.pkts_num_dismiss_pfc}}' |
193 | 215 |
|
|
208 | 230 | - dst_port_3_ip='{{dst_port_3_ip}}' |
209 | 231 | - src_port_id='{{src_port_id}}' |
210 | 232 | - src_port_ip='{{src_port_ip}}' |
211 | | - - pkts_num_leak_out='{{qp.xon_2.pkts_num_leak_out}}' |
| 233 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
212 | 234 | - pkts_num_trig_pfc='{{qp.xon_2.pkts_num_trig_pfc}}' |
213 | 235 | - pkts_num_dismiss_pfc='{{qp.xon_2.pkts_num_dismiss_pfc}}' |
214 | 236 |
|
215 | 237 | # Headroom pool size |
216 | 238 | - include_tasks: qos_sai_ptf.yml |
217 | 239 | vars: |
218 | | - test_name: headroom pool size ptf test ecn = {{qp.hdrm_pool_size.ecn}} |
| 240 | + test_name: headroom pool size ptf test ecn = {{qp_sc.hdrm_pool_size.ecn}} |
219 | 241 | test_path: sai_qos_tests.HdrmPoolSizeTest |
220 | 242 | test_params: |
221 | 243 | - testbed_type='{{testbed_type}}' |
222 | | - - dscps={{qp.hdrm_pool_size.dscps}} |
223 | | - - ecn={{qp.hdrm_pool_size.ecn}} |
224 | | - - pgs={{qp.hdrm_pool_size.pgs}} |
225 | | - - src_port_ids={{qp.hdrm_pool_size.src_port_ids}} |
226 | | - - src_port_ips=[{% for pid in qp.hdrm_pool_size.src_port_ids %}{% if not loop.last %}'{{testing_ports_ip[pid|string]}}', {% else %}'{{testing_ports_ip[pid|string]}}'{% endif %}{% endfor %}] |
227 | | - - dst_port_id={{qp.hdrm_pool_size.dst_port_id}} |
228 | | - - dst_port_ip='{{testing_ports_ip[qp.hdrm_pool_size.dst_port_id|string]}}' |
229 | | - - pgs_num={{qp.hdrm_pool_size.pgs_num }} |
230 | | - - pkts_num_leak_out={{qp.hdrm_pool_size.pkts_num_leak_out}} |
231 | | - - pkts_num_trig_pfc={{qp.hdrm_pool_size.pkts_num_trig_pfc}} |
232 | | - - pkts_num_hdrm_full={{qp.hdrm_pool_size.pkts_num_hdrm_full}} |
233 | | - - pkts_num_hdrm_partial={{qp.hdrm_pool_size.pkts_num_hdrm_partial}} |
| 244 | + - dscps={{qp_sc.hdrm_pool_size.dscps}} |
| 245 | + - ecn={{qp_sc.hdrm_pool_size.ecn}} |
| 246 | + - pgs={{qp_sc.hdrm_pool_size.pgs}} |
| 247 | + - src_port_ids={{qp_sc.hdrm_pool_size.src_port_ids}} |
| 248 | + - src_port_ips=[{% for pid in qp_sc.hdrm_pool_size.src_port_ids %}{% if not loop.last %}'{{testing_ports_ip[pid|string]}}', {% else %}'{{testing_ports_ip[pid|string]}}'{% endif %}{% endfor %}] |
| 249 | + - dst_port_id={{qp_sc.hdrm_pool_size.dst_port_id}} |
| 250 | + - dst_port_ip='{{testing_ports_ip[qp_sc.hdrm_pool_size.dst_port_id|string]}}' |
| 251 | + - pgs_num={{qp_sc.hdrm_pool_size.pgs_num }} |
| 252 | + - pkts_num_leak_out={{qp_sc.pkts_num_leak_out}} |
| 253 | + - pkts_num_trig_pfc={{qp_sc.hdrm_pool_size.pkts_num_trig_pfc}} |
| 254 | + - pkts_num_hdrm_full={{qp_sc.hdrm_pool_size.pkts_num_hdrm_full}} |
| 255 | + - pkts_num_hdrm_partial={{qp_sc.hdrm_pool_size.pkts_num_hdrm_partial}} |
234 | 256 | when: minigraph_hwsku is defined and |
235 | 257 | minigraph_hwsku in ['Arista-7060CX-32S-C32', 'Celestica-DX010-C32', 'Arista-7260CX3-D108C8', 'Force10-S6100', 'Arista-7260CX3-Q64'] |
236 | 258 |
|
|
251 | 273 | - dst_port_2_ip='{{dst_port_2_ip}}' |
252 | 274 | - src_port_id='{{src_port_id}}' |
253 | 275 | - src_port_ip='{{src_port_ip}}' |
254 | | - - pkts_num_leak_out='{{qp.lossy_queue_1.pkts_num_leak_out}}' |
| 276 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
255 | 277 | - pkts_num_trig_egr_drp='{{qp.lossy_queue_1.pkts_num_trig_egr_drp}}' |
256 | 278 |
|
257 | 279 | # DSCP to queue mapping |
|
284 | 306 | - q5_num_of_pkts='{{qp.wrr.q5_num_of_pkts}}' |
285 | 307 | - q6_num_of_pkts='{{qp.wrr.q6_num_of_pkts}}' |
286 | 308 | - limit='{{qp.wrr.limit}}' |
287 | | - - pkts_num_leak_out='{{qp.wrr.pkts_num_leak_out}}' |
| 309 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
288 | 310 | - debug: |
289 | 311 | var: out.stdout_lines |
290 | 312 |
|
|
306 | 328 | - dst_port_ip='{{dst_port_ip}}' |
307 | 329 | - src_port_id='{{src_port_id}}' |
308 | 330 | - src_port_ip='{{src_port_ip}}' |
309 | | - - pkts_num_leak_out='{{qp.wm_pg_shared_lossless.pkts_num_leak_out}}' |
| 331 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
310 | 332 | - pkts_num_fill_min='{{qp.wm_pg_shared_lossless.pkts_num_fill_min}}' |
311 | 333 | - pkts_num_fill_shared='{{qp.wm_pg_shared_lossless.pkts_num_trig_pfc}}' |
312 | 334 | - cell_size='{{qp.wm_pg_shared_lossless.cell_size}}' |
|
335 | 357 | - dst_port_ip='{{dst_port_ip}}' |
336 | 358 | - src_port_id='{{src_port_id}}' |
337 | 359 | - src_port_ip='{{src_port_ip}}' |
338 | | - - pkts_num_leak_out='{{qp.wm_pg_shared_lossy.pkts_num_leak_out}}' |
| 360 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
339 | 361 | - pkts_num_fill_min='{{qp.wm_pg_shared_lossy.pkts_num_fill_min}}' |
340 | 362 | - pkts_num_fill_shared='{{qp.wm_pg_shared_lossy.pkts_num_trig_egr_drp|int - 1}}' |
341 | 363 | - cell_size='{{qp.wm_pg_shared_lossy.cell_size}}' |
|
357 | 379 | test_name: PG headroom watermark test |
358 | 380 | test_path: sai_qos_tests.PGHeadroomWatermarkTest |
359 | 381 | test_params: |
360 | | - - dscp='{{qp.wm_pg_headroom.dscp}}' |
361 | | - - ecn='{{qp.wm_pg_headroom.ecn}}' |
362 | | - - pg='{{qp.wm_pg_headroom.pg}}' |
| 382 | + - dscp='{{qp_sc.wm_pg_headroom.dscp}}' |
| 383 | + - ecn='{{qp_sc.wm_pg_headroom.ecn}}' |
| 384 | + - pg='{{qp_sc.wm_pg_headroom.pg}}' |
363 | 385 | - dst_port_id='{{dst_port_id}}' |
364 | 386 | - dst_port_ip='{{dst_port_ip}}' |
365 | 387 | - src_port_id='{{src_port_id}}' |
366 | 388 | - src_port_ip='{{src_port_ip}}' |
367 | | - - pkts_num_leak_out='{{qp.wm_pg_headroom.pkts_num_leak_out}}' |
368 | | - - pkts_num_trig_pfc='{{qp.wm_pg_headroom.pkts_num_trig_pfc}}' |
369 | | - - pkts_num_trig_ingr_drp='{{qp.wm_pg_headroom.pkts_num_trig_ingr_drp}}' |
370 | | - - cell_size='{{qp.wm_pg_headroom.cell_size}}' |
| 389 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
| 390 | + - pkts_num_trig_pfc='{{qp_sc.wm_pg_headroom.pkts_num_trig_pfc}}' |
| 391 | + - pkts_num_trig_ingr_drp='{{qp_sc.wm_pg_headroom.pkts_num_trig_ingr_drp}}' |
| 392 | + - cell_size='{{qp_sc.wm_pg_headroom.cell_size}}' |
371 | 393 | - debug: |
372 | 394 | var: out.stdout_lines |
373 | 395 |
|
|
382 | 404 | test_name: Queue shared watermark test, lossless traffic |
383 | 405 | test_path: sai_qos_tests.QSharedWatermarkTest |
384 | 406 | test_params: |
385 | | - - dscp='{{qp.wm_q_shared_lossless.dscp}}' |
386 | | - - ecn='{{qp.wm_q_shared_lossless.ecn}}' |
387 | | - - queue='{{qp.wm_q_shared_lossless.queue}}' |
| 407 | + - dscp='{{qp_sc.wm_q_shared_lossless.dscp}}' |
| 408 | + - ecn='{{qp_sc.wm_q_shared_lossless.ecn}}' |
| 409 | + - queue='{{qp_sc.wm_q_shared_lossless.queue}}' |
388 | 410 | - dst_port_id='{{dst_port_id}}' |
389 | 411 | - dst_port_ip='{{dst_port_ip}}' |
390 | 412 | - src_port_id='{{src_port_id}}' |
391 | 413 | - src_port_ip='{{src_port_ip}}' |
392 | | - - pkts_num_leak_out='{{qp.wm_q_shared_lossless.pkts_num_leak_out}}' |
393 | | - - pkts_num_fill_min='{{qp.wm_q_shared_lossless.pkts_num_fill_min}}' |
394 | | - - pkts_num_trig_drp='{{qp.wm_q_shared_lossless.pkts_num_trig_ingr_drp}}' |
395 | | - - cell_size='{{qp.wm_q_shared_lossless.cell_size}}' |
| 414 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
| 415 | + - pkts_num_fill_min='{{qp_sc.wm_q_shared_lossless.pkts_num_fill_min}}' |
| 416 | + - pkts_num_trig_drp='{{qp_sc.wm_q_shared_lossless.pkts_num_trig_ingr_drp}}' |
| 417 | + - cell_size='{{qp_sc.wm_q_shared_lossless.cell_size}}' |
396 | 418 | - debug: |
397 | 419 | var: out.stdout_lines |
398 | 420 |
|
|
414 | 436 | - dst_port_ip='{{dst_port_ip}}' |
415 | 437 | - src_port_id='{{src_port_id}}' |
416 | 438 | - src_port_ip='{{src_port_ip}}' |
417 | | - - pkts_num_leak_out='{{qp.wm_q_shared_lossy.pkts_num_leak_out}}' |
| 439 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
418 | 440 | - pkts_num_fill_min='{{qp.wm_q_shared_lossy.pkts_num_fill_min}}' |
419 | 441 | - pkts_num_trig_drp='{{qp.wm_q_shared_lossy.pkts_num_trig_egr_drp}}' |
420 | 442 | - cell_size='{{qp.wm_q_shared_lossy.cell_size}}' |
|
466 | 488 | - q5_num_of_pkts='{{qp.wrr_chg.q5_num_of_pkts}}' |
467 | 489 | - q6_num_of_pkts='{{qp.wrr_chg.q6_num_of_pkts}}' |
468 | 490 | - limit='{{qp.wrr_chg.limit}}' |
469 | | - - pkts_num_leak_out='{{qp.wrr_chg.pkts_num_leak_out}}' |
| 491 | + - pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}' |
470 | 492 | - debug: |
471 | 493 | var: out.stdout_lines |
472 | 494 |
|
|
0 commit comments