Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qos SAI test restructure #1682

Merged
merged 2 commits into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ansible/group_vars/sonic/vars
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ sonic_version: "v2"

broadcom_hwskus: [ "Force10-S6000", "Accton-AS7712-32X", "Celestica-DX010-C32", "Seastone-DX010", "Celestica-E1031-T48S4"]

broadcom_td2_hwskus: ['Force10-S6000', 'Force10-S6000-Q24S32', 'Arista-7050-QX32', 'Arista-7050-QX-32S']
broadcom_th_hwskus: ['Force10-S6100', 'Arista-7060CX-32S-C32', 'Arista-7060CX-32S-C32-T1', 'Arista-7060CX-32S-D48C8', 'Celestica-DX010-C32', "Seastone-DX010" ]
broadcom_th2_hwskus: ['Arista-7260CX3-D108C8', 'Arista-7260CX3-C64', 'Arista-7260CX3-Q64']

mellanox_spc1_hwskus: [ 'ACS-MSN2700', 'ACS-MSN2740', 'ACS-MSN2100', 'ACS-MSN2410', 'ACS-MSN2010', 'Mellanox-SN2700', 'Mellanox-SN2700-D48C8' ]
mellanox_spc2_hwskus: [ 'ACS-MSN3700', 'ACS-MSN3700C', 'ACS-MSN3800', 'Mellanox-SN3800-D112C8' ]
mellanox_spc3_hwskus: [ 'ACS-MSN4700' ]
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/test/tasks/qos_get_ports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@
target_pg: '3-4'
target_buffer_profile_type: 'ingress lossless'

- name: Set lossless buffer profile
set_fact:
lossless_buffer_profile: "{{ buffer_profile }}"

- name: Set lossless MAX buffer size
set_fact:
lossless_buffer_max_size: "{{buffer_headroom.stdout|int}}"
Expand Down
144 changes: 83 additions & 61 deletions ansible/roles/test/tasks/qos_sai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,36 @@
minigraph_facts: host={{inventory_hostname}}
become: no

- name: Get ports info.
include_tasks: roles/test/tasks/qos_get_ports.yml

- name: Check if lossless buffer profile is derived
fail: msg="Lossless Buffer profile could not be retreived"
when: lossless_buffer_profile is not defined or minigraph_hwsku is not defined

- set_fact:
defined_asic_list: ['td2', 'th', 'th2', 'spc1', 'spc2', 'spc3']
speed_cablelen: "{{ lossless_buffer_profile }}"

- set_fact: speed_cablelen="{{speed_cablelen | regex_replace('BUFFER_PROFILE\|pg_lossless_(.*)_profile', '\\1')}}"

- name: Get asic type
set_fact: asic_type="{{ item }}"
when:
- hostvars[inventory_hostname][sonic_asic_type + '_' + item + '_hwskus'] is defined
- minigraph_hwsku in hostvars[inventory_hostname][sonic_asic_type + '_' + item + '_hwskus']
with_items: "{{ defined_asic_list }}"

- debug: msg="asic type is {{ asic_type }}, portspeed_cablelen is {{ speed_cablelen }}"

- name: check if the device has configured qos parameters
fail: msg="device doesn't have configured qos parameters"
when: minigraph_hwsku is not defined or qos_params[minigraph_hwsku] is not defined
when: qos_params[asic_type] is not defined or qos_params[asic_type][speed_cablelen] is not defined

- name: set qos parameters for the device
set_fact: qp={{qos_params[minigraph_hwsku]}}
set_fact:
qp: "{{qos_params[asic_type]}}"
qp_sc: "{{qos_params[asic_type][speed_cablelen]}}"

- name: Ensure LLDP Daemon stopped
become: yes
Expand All @@ -52,14 +76,15 @@

- meta: flush_handlers

- block:
- name: Deploy script to DUT/syncd
copy: src=roles/test/files/mlnx/packets_aging.py dest=/root/packets_aging.py
- name: Deploy script to DUT/syncd
copy: src=roles/test/files/mlnx/packets_aging.py dest=/root/packets_aging.py
delegate_to: "{{ ansible_host }}_syncd"
when: minigraph_hwsku is defined and minigraph_hwsku in mellanox_hwskus

- name: Disable Mellanox packet aging
shell: python /root/packets_aging.py disable
register: result
failed_when: result.stderr != ''
- name: Disable Mellanox packet aging
shell: python /root/packets_aging.py disable
register: result
failed_when: result.stderr != ''
delegate_to: "{{ ansible_host }}_syncd"
when: minigraph_hwsku is defined and minigraph_hwsku in mellanox_hwskus

Expand All @@ -83,9 +108,6 @@
- port_map_file='/root/{{ptf_portmap | basename}}'
- sonic_asic_type='{{sonic_asic_type}}'

- name: Get ports info.
include_tasks: roles/test/tasks/qos_get_ports.yml

# Unpause all paused port
- include_tasks: qos_sai_ptf.yml
vars:
Expand Down Expand Up @@ -120,39 +142,39 @@
# XOFF limit
- include_tasks: qos_sai_ptf.yml
vars:
test_name: xoff limit ptf test dscp = {{qp.xoff_1.dscp}}, ecn = {{qp.xoff_1.ecn}}
test_name: xoff limit ptf test dscp = {{qp_sc.xoff_1.dscp}}, ecn = {{qp_sc.xoff_1.ecn}}
test_path: sai_qos_tests.PFCtest
test_params:
- dscp='{{qp.xoff_1.dscp}}'
- ecn='{{qp.xoff_1.ecn}}'
- pg='{{qp.xoff_1.pg}}'
- dscp='{{qp_sc.xoff_1.dscp}}'
- ecn='{{qp_sc.xoff_1.ecn}}'
- pg='{{qp_sc.xoff_1.pg}}'
- buffer_max_size='{{lossless_buffer_max_size|int}}'
- queue_max_size='{{lossless_queue_max_size|int}}'
- dst_port_id='{{dst_port_id}}'
- dst_port_ip='{{dst_port_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
- pkts_num_leak_out='{{qp.xoff_1.pkts_num_leak_out}}'
- pkts_num_trig_pfc='{{qp.xoff_1.pkts_num_trig_pfc}}'
- pkts_num_trig_ingr_drp='{{qp.xoff_1.pkts_num_trig_ingr_drp}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- pkts_num_trig_pfc='{{qp_sc.xoff_1.pkts_num_trig_pfc}}'
- pkts_num_trig_ingr_drp='{{qp_sc.xoff_1.pkts_num_trig_ingr_drp}}'

- include_tasks: qos_sai_ptf.yml
vars:
test_name: xoff limit ptf test dscp = {{qp.xoff_2.dscp}}, ecn = {{qp.xoff_2.ecn}}
test_name: xoff limit ptf test dscp = {{qp_sc.xoff_2.dscp}}, ecn = {{qp_sc.xoff_2.ecn}}
test_path: sai_qos_tests.PFCtest
test_params:
- dscp='{{qp.xoff_2.dscp}}'
- ecn='{{qp.xoff_2.ecn}}'
- pg='{{qp.xoff_2.pg}}'
- dscp='{{qp_sc.xoff_2.dscp}}'
- ecn='{{qp_sc.xoff_2.ecn}}'
- pg='{{qp_sc.xoff_2.pg}}'
- buffer_max_size='{{lossless_buffer_max_size|int}}'
- queue_max_size='{{lossless_queue_max_size|int}}'
- dst_port_id='{{dst_port_id}}'
- dst_port_ip='{{dst_port_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
- pkts_num_leak_out='{{qp.xoff_2.pkts_num_leak_out}}'
- pkts_num_trig_pfc='{{qp.xoff_2.pkts_num_trig_pfc}}'
- pkts_num_trig_ingr_drp='{{qp.xoff_2.pkts_num_trig_ingr_drp}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- pkts_num_trig_pfc='{{qp_sc.xoff_2.pkts_num_trig_pfc}}'
- pkts_num_trig_ingr_drp='{{qp_sc.xoff_2.pkts_num_trig_ingr_drp}}'

# XON limit
- include_tasks: qos_sai_ptf.yml
Expand All @@ -172,7 +194,7 @@
- dst_port_3_ip='{{dst_port_3_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
- pkts_num_leak_out='{{qp.xon_1.pkts_num_leak_out}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- pkts_num_trig_pfc='{{qp.xon_1.pkts_num_trig_pfc}}'
- pkts_num_dismiss_pfc='{{qp.xon_1.pkts_num_dismiss_pfc}}'

Expand All @@ -193,29 +215,29 @@
- dst_port_3_ip='{{dst_port_3_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
- pkts_num_leak_out='{{qp.xon_2.pkts_num_leak_out}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- pkts_num_trig_pfc='{{qp.xon_2.pkts_num_trig_pfc}}'
- pkts_num_dismiss_pfc='{{qp.xon_2.pkts_num_dismiss_pfc}}'

# Headroom pool size
- include_tasks: qos_sai_ptf.yml
vars:
test_name: headroom pool size ptf test ecn = {{qp.hdrm_pool_size.ecn}}
test_name: headroom pool size ptf test ecn = {{qp_sc.hdrm_pool_size.ecn}}
test_path: sai_qos_tests.HdrmPoolSizeTest
test_params:
- testbed_type='{{testbed_type}}'
- dscps={{qp.hdrm_pool_size.dscps}}
- ecn={{qp.hdrm_pool_size.ecn}}
- pgs={{qp.hdrm_pool_size.pgs}}
- src_port_ids={{qp.hdrm_pool_size.src_port_ids}}
- 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 %}]
- dst_port_id={{qp.hdrm_pool_size.dst_port_id}}
- dst_port_ip='{{testing_ports_ip[qp.hdrm_pool_size.dst_port_id|string]}}'
- pgs_num={{qp.hdrm_pool_size.pgs_num }}
- pkts_num_leak_out={{qp.hdrm_pool_size.pkts_num_leak_out}}
- pkts_num_trig_pfc={{qp.hdrm_pool_size.pkts_num_trig_pfc}}
- pkts_num_hdrm_full={{qp.hdrm_pool_size.pkts_num_hdrm_full}}
- pkts_num_hdrm_partial={{qp.hdrm_pool_size.pkts_num_hdrm_partial}}
- dscps={{qp_sc.hdrm_pool_size.dscps}}
- ecn={{qp_sc.hdrm_pool_size.ecn}}
- pgs={{qp_sc.hdrm_pool_size.pgs}}
- src_port_ids={{qp_sc.hdrm_pool_size.src_port_ids}}
- 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 %}]
- dst_port_id={{qp_sc.hdrm_pool_size.dst_port_id}}
- dst_port_ip='{{testing_ports_ip[qp_sc.hdrm_pool_size.dst_port_id|string]}}'
- pgs_num={{qp_sc.hdrm_pool_size.pgs_num }}
- pkts_num_leak_out={{qp_sc.pkts_num_leak_out}}
- pkts_num_trig_pfc={{qp_sc.hdrm_pool_size.pkts_num_trig_pfc}}
- pkts_num_hdrm_full={{qp_sc.hdrm_pool_size.pkts_num_hdrm_full}}
- pkts_num_hdrm_partial={{qp_sc.hdrm_pool_size.pkts_num_hdrm_partial}}
when: minigraph_hwsku is defined and
minigraph_hwsku in ['Arista-7060CX-32S-C32', 'Celestica-DX010-C32', 'Arista-7260CX3-D108C8', 'Force10-S6100', 'Arista-7260CX3-Q64']

Expand All @@ -236,7 +258,7 @@
- dst_port_2_ip='{{dst_port_2_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
- pkts_num_leak_out='{{qp.lossy_queue_1.pkts_num_leak_out}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- pkts_num_trig_egr_drp='{{qp.lossy_queue_1.pkts_num_trig_egr_drp}}'

# DSCP to queue mapping
Expand Down Expand Up @@ -269,7 +291,7 @@
- q5_num_of_pkts='{{qp.wrr.q5_num_of_pkts}}'
- q6_num_of_pkts='{{qp.wrr.q6_num_of_pkts}}'
- limit='{{qp.wrr.limit}}'
- pkts_num_leak_out='{{qp.wrr.pkts_num_leak_out}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- debug:
var: out.stdout_lines

Expand All @@ -291,7 +313,7 @@
- dst_port_ip='{{dst_port_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
- pkts_num_leak_out='{{qp.wm_pg_shared_lossless.pkts_num_leak_out}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- pkts_num_fill_min='{{qp.wm_pg_shared_lossless.pkts_num_fill_min}}'
- pkts_num_fill_shared='{{qp.wm_pg_shared_lossless.pkts_num_trig_pfc}}'
- cell_size='{{qp.wm_pg_shared_lossless.cell_size}}'
Expand Down Expand Up @@ -320,7 +342,7 @@
- dst_port_ip='{{dst_port_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
- pkts_num_leak_out='{{qp.wm_pg_shared_lossy.pkts_num_leak_out}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- pkts_num_fill_min='{{qp.wm_pg_shared_lossy.pkts_num_fill_min}}'
- pkts_num_fill_shared='{{qp.wm_pg_shared_lossy.pkts_num_trig_egr_drp|int - 1}}'
- cell_size='{{qp.wm_pg_shared_lossy.cell_size}}'
Expand All @@ -342,17 +364,17 @@
test_name: PG headroom watermark test
test_path: sai_qos_tests.PGHeadroomWatermarkTest
test_params:
- dscp='{{qp.wm_pg_headroom.dscp}}'
- ecn='{{qp.wm_pg_headroom.ecn}}'
- pg='{{qp.wm_pg_headroom.pg}}'
- dscp='{{qp_sc.wm_pg_headroom.dscp}}'
- ecn='{{qp_sc.wm_pg_headroom.ecn}}'
- pg='{{qp_sc.wm_pg_headroom.pg}}'
- dst_port_id='{{dst_port_id}}'
- dst_port_ip='{{dst_port_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
- pkts_num_leak_out='{{qp.wm_pg_headroom.pkts_num_leak_out}}'
- pkts_num_trig_pfc='{{qp.wm_pg_headroom.pkts_num_trig_pfc}}'
- pkts_num_trig_ingr_drp='{{qp.wm_pg_headroom.pkts_num_trig_ingr_drp}}'
- cell_size='{{qp.wm_pg_headroom.cell_size}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- pkts_num_trig_pfc='{{qp_sc.wm_pg_headroom.pkts_num_trig_pfc}}'
- pkts_num_trig_ingr_drp='{{qp_sc.wm_pg_headroom.pkts_num_trig_ingr_drp}}'
- cell_size='{{qp_sc.wm_pg_headroom.cell_size}}'
- debug:
var: out.stdout_lines

Expand All @@ -367,17 +389,17 @@
test_name: Queue shared watermark test, lossless traffic
test_path: sai_qos_tests.QSharedWatermarkTest
test_params:
- dscp='{{qp.wm_q_shared_lossless.dscp}}'
- ecn='{{qp.wm_q_shared_lossless.ecn}}'
- queue='{{qp.wm_q_shared_lossless.queue}}'
- dscp='{{qp_sc.wm_q_shared_lossless.dscp}}'
- ecn='{{qp_sc.wm_q_shared_lossless.ecn}}'
- queue='{{qp_sc.wm_q_shared_lossless.queue}}'
- dst_port_id='{{dst_port_id}}'
- dst_port_ip='{{dst_port_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
- pkts_num_leak_out='{{qp.wm_q_shared_lossless.pkts_num_leak_out}}'
- pkts_num_fill_min='{{qp.wm_q_shared_lossless.pkts_num_fill_min}}'
- pkts_num_trig_drp='{{qp.wm_q_shared_lossless.pkts_num_trig_ingr_drp}}'
- cell_size='{{qp.wm_q_shared_lossless.cell_size}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- pkts_num_fill_min='{{qp_sc.wm_q_shared_lossless.pkts_num_fill_min}}'
- pkts_num_trig_drp='{{qp_sc.wm_q_shared_lossless.pkts_num_trig_ingr_drp}}'
- cell_size='{{qp_sc.wm_q_shared_lossless.cell_size}}'
- debug:
var: out.stdout_lines

Expand All @@ -399,7 +421,7 @@
- dst_port_ip='{{dst_port_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
- pkts_num_leak_out='{{qp.wm_q_shared_lossy.pkts_num_leak_out}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- pkts_num_fill_min='{{qp.wm_q_shared_lossy.pkts_num_fill_min}}'
- pkts_num_trig_drp='{{qp.wm_q_shared_lossy.pkts_num_trig_egr_drp}}'
- cell_size='{{qp.wm_q_shared_lossy.cell_size}}'
Expand Down Expand Up @@ -451,7 +473,7 @@
- q5_num_of_pkts='{{qp.wrr_chg.q5_num_of_pkts}}'
- q6_num_of_pkts='{{qp.wrr_chg.q6_num_of_pkts}}'
- limit='{{qp.wrr_chg.limit}}'
- pkts_num_leak_out='{{qp.wrr_chg.pkts_num_leak_out}}'
- pkts_num_leak_out='{{qp_sc.pkts_num_leak_out}}'
- debug:
var: out.stdout_lines

Expand Down
Loading