Skip to content
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
2 changes: 2 additions & 0 deletions tests/common/devices/sonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,8 @@ def get_asic_name(self):
asic = "th3"
elif "Cisco Systems Inc Device a001" in output:
asic = "gb"
elif "Mellanox Technologies" in output:
asic = "spc"

return asic

Expand Down
35 changes: 35 additions & 0 deletions tests/qos/files/qos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,41 @@
# xoff_1 for 50G
# xoff_2 for 100G
qos_params:
# This block is only for dualtor pcbb xoff test on Nvidia platforms
spc3:
topo-dualtor:
100000_40m:
pkts_num_leak_out: 0
pcbb_xoff_1:
dscp: 3
ecn: 1
pg: 3
pkts_num_trig_pfc: 176064
pkts_num_trig_ingr_drp: 177916
pkts_num_margin: 4
pcbb_xoff_2:
dscp: 4
ecn: 1
pg: 4
pkts_num_trig_pfc: 176064
pkts_num_trig_ingr_drp: 177916
pkts_num_margin: 4
pcbb_xoff_3:
outer_dscp: 2
dscp: 3
ecn: 1
pg: 2
pkts_num_trig_pfc: 176064
pkts_num_trig_ingr_drp: 177916
pkts_num_margin: 4
pcbb_xoff_4:
outer_dscp: 6
dscp: 4
ecn: 1
pg: 6
pkts_num_trig_pfc: 176064
pkts_num_trig_ingr_drp: 177916
pkts_num_margin: 4
mellanox:
topo-any:
profile:
Expand Down
263 changes: 263 additions & 0 deletions tests/qos/files/tunnel_qos_map_nvidia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
{
"DSCP_TO_TC_MAP": {
"AZURE": {
"0": "1",
"1": "1",
"10": "1",
"11": "1",
"12": "1",
"13": "1",
"14": "1",
"15": "1",
"16": "1",
"17": "1",
"18": "1",
"19": "1",
"2": "1",
"20": "1",
"21": "1",
"22": "1",
"23": "1",
"24": "1",
"25": "1",
"26": "1",
"27": "1",
"28": "1",
"29": "1",
"3": "3",
"30": "1",
"31": "1",
"32": "1",
"33": "8",
"34": "1",
"35": "1",
"36": "1",
"37": "1",
"38": "1",
"39": "1",
"4": "4",
"40": "1",
"41": "1",
"42": "1",
"43": "1",
"44": "1",
"45": "1",
"46": "5",
"47": "1",
"48": "7",
"49": "1",
"5": "1",
"50": "1",
"51": "1",
"52": "1",
"53": "1",
"54": "1",
"55": "1",
"56": "1",
"57": "1",
"58": "1",
"59": "1",
"6": "1",
"60": "1",
"61": "1",
"62": "1",
"63": "1",
"7": "1",
"8": "0",
"9": "1"
},
"AZURE_TUNNEL": {
"0": "1",
"1": "1",
"10": "1",
"11": "1",
"12": "1",
"13": "1",
"14": "1",
"15": "1",
"16": "1",
"17": "1",
"18": "1",
"19": "1",
"2": "1",
"20": "1",
"21": "1",
"22": "1",
"23": "1",
"24": "1",
"25": "1",
"26": "1",
"27": "1",
"28": "1",
"29": "1",
"3": "3",
"30": "1",
"31": "1",
"32": "1",
"33": "8",
"34": "1",
"35": "1",
"36": "1",
"37": "1",
"38": "1",
"39": "1",
"4": "4",
"40": "1",
"41": "1",
"42": "1",
"43": "1",
"44": "1",
"45": "1",
"46": "5",
"47": "1",
"48": "7",
"49": "1",
"5": "1",
"50": "1",
"51": "1",
"52": "1",
"53": "1",
"54": "1",
"55": "1",
"56": "1",
"57": "1",
"58": "1",
"59": "1",
"6": "1",
"60": "1",
"61": "1",
"62": "1",
"63": "1",
"7": "1",
"8": "0",
"9": "1"
},
"AZURE_UPLINK": {
"0": "1",
"1": "1",
"10": "1",
"11": "1",
"12": "1",
"13": "1",
"14": "1",
"15": "1",
"16": "1",
"17": "1",
"18": "1",
"19": "1",
"2": "2",
"20": "1",
"21": "1",
"22": "1",
"23": "1",
"24": "1",
"25": "1",
"26": "1",
"27": "1",
"28": "1",
"29": "1",
"3": "3",
"30": "1",
"31": "1",
"32": "1",
"33": "8",
"34": "1",
"35": "1",
"36": "1",
"37": "1",
"38": "1",
"39": "1",
"4": "4",
"40": "1",
"41": "1",
"42": "1",
"43": "1",
"44": "1",
"45": "1",
"46": "5",
"47": "1",
"48": "7",
"49": "1",
"5": "1",
"50": "1",
"51": "1",
"52": "1",
"53": "1",
"54": "1",
"55": "1",
"56": "1",
"57": "1",
"58": "1",
"59": "1",
"6": "6",
"60": "1",
"61": "1",
"62": "1",
"63": "1",
"7": "1",
"8": "0",
"9": "1"
}
},
"TC_TO_PRIORITY_GROUP_MAP": {
"AZURE": {
"0": "0",
"1": "0",
"2": "2",
"3": "3",
"4": "4",
"5": "0",
"6": "6",
"7": "0",
"8": "0"
},
"AZURE_TUNNEL": {
"0": "0",
"1": "0",
"2": "0",
"3": "2",
"4": "6",
"5": "0",
"6": "0",
"7": "0",
"8": "0"
}
},
"TC_TO_DSCP_MAP": {
"AZURE_TUNNEL": {
"0": "8",
"1": "0",
"2": "2",
"3": "2",
"4": "6",
"5": "46",
"6": "6",
"7": "48",
"8": "33"
}
},
"TC_TO_QUEUE_MAP": {
"AZURE": {
"0": "0",
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5",
"6": "6",
"7": "7",
"8": "1"
},
"AZURE_TUNNEL": {
"0": "0",
"1": "1",
"2": "2",
"3": "2",
"4": "6",
"5": "5",
"6": "6",
"7": "7",
"8": "1"
}
}
}
21 changes: 15 additions & 6 deletions tests/qos/test_tunnel_qos_remap.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
from tests.common.fixtures.duthost_utils import dut_qos_maps_module # lgtm[py/unused-import]
from tests.common.fixtures.duthost_utils import separated_dscp_to_tc_map_on_uplink
from tests.common.helpers.assertions import pytest_require, pytest_assert
from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_lower_tor, toggle_all_simulator_ports_to_rand_selected_tor, toggle_all_simulator_ports_to_rand_unselected_tor # lgtm[py/unused-import]
from tests.common.dualtor.dual_tor_utils import upper_tor_host, lower_tor_host, dualtor_info, get_t1_active_ptf_ports, mux_cable_server_ip, is_tunnel_qos_remap_enabled
from tunnel_qos_remap_base import build_testing_packet, check_queue_counter, dut_config, qos_config, load_tunnel_qos_map, run_ptf_test, toggle_mux_to_host, setup_module, update_docker_services, swap_syncd, counter_poll_config # lgtm[py/unused-import]
from tunnel_qos_remap_base import leaf_fanout_peer_info, start_pfc_storm, stop_pfc_storm, get_queue_counter
from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_lower_tor,\
toggle_all_simulator_ports_to_rand_selected_tor, toggle_all_simulator_ports_to_rand_unselected_tor # noqa F401
from tests.common.dualtor.dual_tor_utils import upper_tor_host, lower_tor_host, dualtor_info,\
get_t1_active_ptf_ports, mux_cable_server_ip, is_tunnel_qos_remap_enabled # noqa F401
from .tunnel_qos_remap_base import build_testing_packet, check_queue_counter,\
dut_config, qos_config, load_tunnel_qos_map, run_ptf_test, toggle_mux_to_host,\
setup_module, update_docker_services, swap_syncd, counter_poll_config # noqa F401
from tunnel_qos_remap_base import leaf_fanout_peer_info, start_pfc_storm, \
stop_pfc_storm, get_queue_counter, disable_packet_aging # noqa F401
from ptf import testutils
from ptf.testutils import simple_tcp_packet
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts
Expand Down Expand Up @@ -466,10 +471,12 @@ def test_tunnel_decap_dscp_to_pg_mapping(rand_selected_dut, ptfhost, dut_config,
# TODO: Get the cell size for other ASIC
if asic == 'th2':
cell_size = 208
else:
elif 'spc' in asic:
cell_size = 144
else:
cell_size = 256

tunnel_qos_map = load_tunnel_qos_map()
tunnel_qos_map = load_tunnel_qos_map(asic_name=asic)
test_params = dict()
test_params.update({
"src_port_id": dut_config["lag_port_ptf_id"],
Expand Down Expand Up @@ -523,6 +530,8 @@ def test_xoff_for_pcbb(rand_selected_dut, ptfhost, dut_config, qos_config, xoff_
"platform_asic": dut_config["platform_asic"],
"sonic_asic_type": dut_config["asic_type"],
})
if dut_config["asic_type"] == 'mellanox':
test_params.update({'cell_size': 144, 'packet_size': 300})
# Update qos config into test_params
test_params.update(qos_config[xoff_profile])
# Run test on ptfhost
Expand Down
Loading