Skip to content

Commit 6fc61aa

Browse files
authored
Make lossyqueuevoq check platform/hwskus. (sonic-net#17726)
Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
1 parent a23bc50 commit 6fc61aa

1 file changed

Lines changed: 31 additions & 4 deletions

File tree

tests/qos/files/cisco/qos_param_generator.py

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,24 @@
77
class QosParamCisco(object):
88
SMALL_SMS_PLATFORMS = ["x86_64-8102_64h_o-r0"]
99
DEEP_BUFFER_PLATFORMS = ["x86_64-8111_32eh_o-r0"]
10+
# Only specific platform/hwskus enable separate VOQs for Cisco-8000
11+
SEPARATE_VOQ_PLAT_SKUS = {"x86_64-8101_32fh_o-r0": ["Cisco-8101-O32",
12+
"Cisco-8101-C64",
13+
"Cisco-8101-O8C48",
14+
"Cisco-8101-O8V48"],
15+
"x86_64-8101_32fh_o_c01-r0": ["Cisco-8101-O32",
16+
"Cisco-8101-V64"],
17+
"x86_64-8102_64h_o-r0": ["Cisco-8102-C64"]}
18+
VOQ_ASICS = ["gb", "gr"]
19+
1020
LOG_PREFIX = "QosParamCisco: "
1121

1222
def __init__(self, qos_params, duthost, dutAsic, topo, bufferConfig, portSpeedCableLength):
1323
'''
1424
Initialize parameters all tests will use
1525
'''
1626
self.qos_params = qos_params
27+
self.duthost = duthost
1728
self.dutAsic = dutAsic
1829
self.bufferConfig = bufferConfig
1930
self.portSpeedCableLength = portSpeedCableLength
@@ -44,20 +55,21 @@ def __init__(self, qos_params, duthost, dutAsic, topo, bufferConfig, portSpeedCa
4455
# 0: Max queue depth in bytes
4556
# 1: Flow control configuration on this device, either 'separate' or 'shared'.
4657
# 2: Number of packets margin for the quantized queue watermark tests.
47-
asic_params = {"gb": (6144000, "separate", 3072, 384, 1350, 2, 3),
48-
"gr": (24576000, "shared", 18000, 384, 1350, 2, 3),
49-
"gr2": (None, None, 1, 512, 64, 1, 3)}
58+
asic_params = {"gb": (6144000, 3072, 384, 1350, 2, 3),
59+
"gr": (24576000, 18000, 384, 1350, 2, 3),
60+
"gr2": (None, 1, 512, 64, 1, 3)}
5061
self.supports_autogen = dutAsic in asic_params and topo == "topo-any"
5162
if self.supports_autogen:
5263
# Asic dependent parameters
5364
(max_queue_depth,
54-
self.flow_config,
5565
self.q_wmk_margin,
5666
self.buffer_size,
5767
self.preferred_packet_size,
5868
self.lossless_pause_tuning_pkts,
5969
self.lossless_drop_tuning_pkts) = asic_params[dutAsic]
6070

71+
self.flow_config = self.get_expected_flow_config()
72+
6173
# Calculate attempted pause threshold
6274
if "dynamic_th" in lossless_prof:
6375
dynamic_th = int(lossless_prof["dynamic_th"])
@@ -159,6 +171,21 @@ def __init__(self, qos_params, duthost, dutAsic, topo, bufferConfig, portSpeedCa
159171
# DSCP, queue, weight list
160172
self.dscp_list, self.q_list, self.weight_list = self.get_dscp_q_weight_list()
161173

174+
def get_expected_flow_config(self):
175+
'''
176+
Return the expected type of VOQs present based on the device info
177+
'''
178+
platform = self.duthost.facts['platform']
179+
hwsku = self.duthost.facts['hwsku']
180+
if self.dutAsic not in self.VOQ_ASICS:
181+
# Test should skip in this case
182+
flow_config = None
183+
elif platform in self.SEPARATE_VOQ_PLAT_SKUS and hwsku in self.SEPARATE_VOQ_PLAT_SKUS[platform]:
184+
flow_config = "separate"
185+
else:
186+
flow_config = "shared"
187+
return flow_config
188+
162189
def get_one_dscp_from_queue(self, queue):
163190
'''
164191
Get one dscp value which is mapped to given queue

0 commit comments

Comments
 (0)