|
7 | 7 | class QosParamCisco(object): |
8 | 8 | SMALL_SMS_PLATFORMS = ["x86_64-8102_64h_o-r0"] |
9 | 9 | 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 | + |
10 | 20 | LOG_PREFIX = "QosParamCisco: " |
11 | 21 |
|
12 | 22 | def __init__(self, qos_params, duthost, dutAsic, topo, bufferConfig, portSpeedCableLength): |
13 | 23 | ''' |
14 | 24 | Initialize parameters all tests will use |
15 | 25 | ''' |
16 | 26 | self.qos_params = qos_params |
| 27 | + self.duthost = duthost |
17 | 28 | self.dutAsic = dutAsic |
18 | 29 | self.bufferConfig = bufferConfig |
19 | 30 | self.portSpeedCableLength = portSpeedCableLength |
@@ -44,20 +55,21 @@ def __init__(self, qos_params, duthost, dutAsic, topo, bufferConfig, portSpeedCa |
44 | 55 | # 0: Max queue depth in bytes |
45 | 56 | # 1: Flow control configuration on this device, either 'separate' or 'shared'. |
46 | 57 | # 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)} |
50 | 61 | self.supports_autogen = dutAsic in asic_params and topo == "topo-any" |
51 | 62 | if self.supports_autogen: |
52 | 63 | # Asic dependent parameters |
53 | 64 | (max_queue_depth, |
54 | | - self.flow_config, |
55 | 65 | self.q_wmk_margin, |
56 | 66 | self.buffer_size, |
57 | 67 | self.preferred_packet_size, |
58 | 68 | self.lossless_pause_tuning_pkts, |
59 | 69 | self.lossless_drop_tuning_pkts) = asic_params[dutAsic] |
60 | 70 |
|
| 71 | + self.flow_config = self.get_expected_flow_config() |
| 72 | + |
61 | 73 | # Calculate attempted pause threshold |
62 | 74 | if "dynamic_th" in lossless_prof: |
63 | 75 | dynamic_th = int(lossless_prof["dynamic_th"]) |
@@ -159,6 +171,21 @@ def __init__(self, qos_params, duthost, dutAsic, topo, bufferConfig, portSpeedCa |
159 | 171 | # DSCP, queue, weight list |
160 | 172 | self.dscp_list, self.q_list, self.weight_list = self.get_dscp_q_weight_list() |
161 | 173 |
|
| 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 | + |
162 | 189 | def get_one_dscp_from_queue(self, queue): |
163 | 190 | ''' |
164 | 191 | Get one dscp value which is mapped to given queue |
|
0 commit comments