Skip to content

Commit b52e3bf

Browse files
congh-nvidiaparmarkj
authored andcommitted
[Mellanox] Update dscp remapping cases for Nvidia platforms (sonic-net#8317)
This PR contains the fix for two test cases in DSCP remapping test: test_tunnel_decap_dscp_to_pg_mapping and test_xoff_for_pcbb. The reason that we need this fix: Nvidia's implementation for DSCP remapping is different from Community. We need some additional mapping and the tunnel mode is pipe. For details please check the PR: [Mellanox] Support DSCP remapping in dual ToR topo on T0 switch sonic-buildimage#12605. Nvidia's cell size is 144. Need to stop packet aging in buffer. Need to add qos parameters for pcbb xoff test case.
1 parent a5c4a84 commit b52e3bf

File tree

6 files changed

+382
-29
lines changed

6 files changed

+382
-29
lines changed

tests/common/devices/sonic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,8 @@ def get_asic_name(self):
16631663
asic = "th3"
16641664
elif "Cisco Systems Inc Device a001" in output:
16651665
asic = "gb"
1666+
elif "Mellanox Technologies" in output:
1667+
asic = "spc"
16661668

16671669
return asic
16681670

tests/qos/files/qos.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,41 @@
1717
# xoff_1 for 50G
1818
# xoff_2 for 100G
1919
qos_params:
20+
# This block is only for dualtor pcbb xoff test on Nvidia platforms
21+
spc3:
22+
topo-dualtor:
23+
100000_40m:
24+
pkts_num_leak_out: 0
25+
pcbb_xoff_1:
26+
dscp: 3
27+
ecn: 1
28+
pg: 3
29+
pkts_num_trig_pfc: 176064
30+
pkts_num_trig_ingr_drp: 177916
31+
pkts_num_margin: 4
32+
pcbb_xoff_2:
33+
dscp: 4
34+
ecn: 1
35+
pg: 4
36+
pkts_num_trig_pfc: 176064
37+
pkts_num_trig_ingr_drp: 177916
38+
pkts_num_margin: 4
39+
pcbb_xoff_3:
40+
outer_dscp: 2
41+
dscp: 3
42+
ecn: 1
43+
pg: 2
44+
pkts_num_trig_pfc: 176064
45+
pkts_num_trig_ingr_drp: 177916
46+
pkts_num_margin: 4
47+
pcbb_xoff_4:
48+
outer_dscp: 6
49+
dscp: 4
50+
ecn: 1
51+
pg: 6
52+
pkts_num_trig_pfc: 176064
53+
pkts_num_trig_ingr_drp: 177916
54+
pkts_num_margin: 4
2055
mellanox:
2156
topo-any:
2257
profile:
Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
{
2+
"DSCP_TO_TC_MAP": {
3+
"AZURE": {
4+
"0": "1",
5+
"1": "1",
6+
"10": "1",
7+
"11": "1",
8+
"12": "1",
9+
"13": "1",
10+
"14": "1",
11+
"15": "1",
12+
"16": "1",
13+
"17": "1",
14+
"18": "1",
15+
"19": "1",
16+
"2": "1",
17+
"20": "1",
18+
"21": "1",
19+
"22": "1",
20+
"23": "1",
21+
"24": "1",
22+
"25": "1",
23+
"26": "1",
24+
"27": "1",
25+
"28": "1",
26+
"29": "1",
27+
"3": "3",
28+
"30": "1",
29+
"31": "1",
30+
"32": "1",
31+
"33": "8",
32+
"34": "1",
33+
"35": "1",
34+
"36": "1",
35+
"37": "1",
36+
"38": "1",
37+
"39": "1",
38+
"4": "4",
39+
"40": "1",
40+
"41": "1",
41+
"42": "1",
42+
"43": "1",
43+
"44": "1",
44+
"45": "1",
45+
"46": "5",
46+
"47": "1",
47+
"48": "7",
48+
"49": "1",
49+
"5": "1",
50+
"50": "1",
51+
"51": "1",
52+
"52": "1",
53+
"53": "1",
54+
"54": "1",
55+
"55": "1",
56+
"56": "1",
57+
"57": "1",
58+
"58": "1",
59+
"59": "1",
60+
"6": "1",
61+
"60": "1",
62+
"61": "1",
63+
"62": "1",
64+
"63": "1",
65+
"7": "1",
66+
"8": "0",
67+
"9": "1"
68+
},
69+
"AZURE_TUNNEL": {
70+
"0": "1",
71+
"1": "1",
72+
"10": "1",
73+
"11": "1",
74+
"12": "1",
75+
"13": "1",
76+
"14": "1",
77+
"15": "1",
78+
"16": "1",
79+
"17": "1",
80+
"18": "1",
81+
"19": "1",
82+
"2": "1",
83+
"20": "1",
84+
"21": "1",
85+
"22": "1",
86+
"23": "1",
87+
"24": "1",
88+
"25": "1",
89+
"26": "1",
90+
"27": "1",
91+
"28": "1",
92+
"29": "1",
93+
"3": "3",
94+
"30": "1",
95+
"31": "1",
96+
"32": "1",
97+
"33": "8",
98+
"34": "1",
99+
"35": "1",
100+
"36": "1",
101+
"37": "1",
102+
"38": "1",
103+
"39": "1",
104+
"4": "4",
105+
"40": "1",
106+
"41": "1",
107+
"42": "1",
108+
"43": "1",
109+
"44": "1",
110+
"45": "1",
111+
"46": "5",
112+
"47": "1",
113+
"48": "7",
114+
"49": "1",
115+
"5": "1",
116+
"50": "1",
117+
"51": "1",
118+
"52": "1",
119+
"53": "1",
120+
"54": "1",
121+
"55": "1",
122+
"56": "1",
123+
"57": "1",
124+
"58": "1",
125+
"59": "1",
126+
"6": "1",
127+
"60": "1",
128+
"61": "1",
129+
"62": "1",
130+
"63": "1",
131+
"7": "1",
132+
"8": "0",
133+
"9": "1"
134+
},
135+
"AZURE_UPLINK": {
136+
"0": "1",
137+
"1": "1",
138+
"10": "1",
139+
"11": "1",
140+
"12": "1",
141+
"13": "1",
142+
"14": "1",
143+
"15": "1",
144+
"16": "1",
145+
"17": "1",
146+
"18": "1",
147+
"19": "1",
148+
"2": "2",
149+
"20": "1",
150+
"21": "1",
151+
"22": "1",
152+
"23": "1",
153+
"24": "1",
154+
"25": "1",
155+
"26": "1",
156+
"27": "1",
157+
"28": "1",
158+
"29": "1",
159+
"3": "3",
160+
"30": "1",
161+
"31": "1",
162+
"32": "1",
163+
"33": "8",
164+
"34": "1",
165+
"35": "1",
166+
"36": "1",
167+
"37": "1",
168+
"38": "1",
169+
"39": "1",
170+
"4": "4",
171+
"40": "1",
172+
"41": "1",
173+
"42": "1",
174+
"43": "1",
175+
"44": "1",
176+
"45": "1",
177+
"46": "5",
178+
"47": "1",
179+
"48": "7",
180+
"49": "1",
181+
"5": "1",
182+
"50": "1",
183+
"51": "1",
184+
"52": "1",
185+
"53": "1",
186+
"54": "1",
187+
"55": "1",
188+
"56": "1",
189+
"57": "1",
190+
"58": "1",
191+
"59": "1",
192+
"6": "6",
193+
"60": "1",
194+
"61": "1",
195+
"62": "1",
196+
"63": "1",
197+
"7": "1",
198+
"8": "0",
199+
"9": "1"
200+
}
201+
},
202+
"TC_TO_PRIORITY_GROUP_MAP": {
203+
"AZURE": {
204+
"0": "0",
205+
"1": "0",
206+
"2": "2",
207+
"3": "3",
208+
"4": "4",
209+
"5": "0",
210+
"6": "6",
211+
"7": "0",
212+
"8": "0"
213+
},
214+
"AZURE_TUNNEL": {
215+
"0": "0",
216+
"1": "0",
217+
"2": "0",
218+
"3": "2",
219+
"4": "6",
220+
"5": "0",
221+
"6": "0",
222+
"7": "0",
223+
"8": "0"
224+
}
225+
},
226+
"TC_TO_DSCP_MAP": {
227+
"AZURE_TUNNEL": {
228+
"0": "8",
229+
"1": "0",
230+
"2": "2",
231+
"3": "2",
232+
"4": "6",
233+
"5": "46",
234+
"6": "6",
235+
"7": "48",
236+
"8": "33"
237+
}
238+
},
239+
"TC_TO_QUEUE_MAP": {
240+
"AZURE": {
241+
"0": "0",
242+
"1": "1",
243+
"2": "2",
244+
"3": "3",
245+
"4": "4",
246+
"5": "5",
247+
"6": "6",
248+
"7": "7",
249+
"8": "1"
250+
},
251+
"AZURE_TUNNEL": {
252+
"0": "0",
253+
"1": "1",
254+
"2": "2",
255+
"3": "2",
256+
"4": "6",
257+
"5": "5",
258+
"6": "6",
259+
"7": "7",
260+
"8": "1"
261+
}
262+
}
263+
}

tests/qos/test_tunnel_qos_remap.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
from .tunnel_qos_remap_base import build_testing_packet, check_queue_counter,\
2525
dut_config, qos_config, load_tunnel_qos_map, run_ptf_test, toggle_mux_to_host,\
2626
setup_module, update_docker_services, swap_syncd, counter_poll_config # noqa F401
27-
from .tunnel_qos_remap_base import leaf_fanout_peer_info, start_pfc_storm, stop_pfc_storm, get_queue_counter
27+
from tunnel_qos_remap_base import leaf_fanout_peer_info, start_pfc_storm, \
28+
stop_pfc_storm, get_queue_counter, disable_packet_aging # noqa F401
2829
from ptf import testutils
2930
from ptf.testutils import simple_tcp_packet
3031
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa F401
@@ -502,10 +503,12 @@ def test_tunnel_decap_dscp_to_pg_mapping(rand_selected_dut, ptfhost, dut_config,
502503
# TODO: Get the cell size for other ASIC
503504
if asic == 'th2':
504505
cell_size = 208
506+
elif 'spc' in asic:
507+
cell_size = 144
505508
else:
506509
cell_size = 256
507510

508-
tunnel_qos_map = load_tunnel_qos_map()
511+
tunnel_qos_map = load_tunnel_qos_map(asic_name=asic)
509512
test_params = dict()
510513
test_params.update({
511514
"src_port_id": dut_config["lag_port_ptf_id"],
@@ -559,6 +562,8 @@ def test_xoff_for_pcbb(rand_selected_dut, ptfhost, dut_config, qos_config, xoff_
559562
"platform_asic": dut_config["platform_asic"],
560563
"sonic_asic_type": dut_config["asic_type"],
561564
})
565+
if dut_config["asic_type"] == 'mellanox':
566+
test_params.update({'cell_size': 144, 'packet_size': 300})
562567
# Update qos config into test_params
563568
test_params.update(qos_config[xoff_profile])
564569
# Run test on ptfhost

0 commit comments

Comments
 (0)