diff --git a/tests/qos/files/qos_params.th5.yaml b/tests/qos/files/qos_params.th5.yaml new file mode 100644 index 0000000000..15af357899 --- /dev/null +++ b/tests/qos/files/qos_params.th5.yaml @@ -0,0 +1,203 @@ +qos_params: + th5: + topo-t0-standalone: &topo-t0-standalone + cell_size: 254 + hdrm_pool_wm_multiplier: 1 + 200000_5m: + hdrm_pool_size: + dscps: + - 3 + - 4 + dst_port_id: 0 + ecn: 1 + margin: 2 + pgs: + - 3 + - 4 + pgs_num: 50 + pkts_num_hdrm_full: 1185 + pkts_num_hdrm_partial: 47 + pkts_num_trig_pfc: 120117 + pkts_num_trig_pfc_multi: + - 120117 + - 60096 + - 30085 + - 15079 + - 7577 + - 3825 + - 1950 + - 1012 + - 543 + - 308 + - 191 + - 133 + - 103 + - 89 + - 81 + - 78 + - 76 + - 75 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + - 74 + src_port_ids: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + - 10 + - 11 + - 12 + - 13 + - 14 + - 15 + - 16 + - 17 + - 18 + - 19 + - 20 + - 21 + - 22 + - 23 + - 24 + - 25 + lossy_queue_1: + dscp: 8 + ecn: 1 + pg: 0 + pkts_num_margin: 2 + pkts_num_trig_egr_drp: 120051 + pkts_num_egr_mem: 238 + pkts_num_leak_out: 0 + wm_pg_headroom: + cell_size: 254 + dscp: 3 + ecn: 1 + pg: 3 + pkts_num_margin: 2 + pkts_num_trig_ingr_drp: 121302 + pkts_num_trig_pfc: 120117 + wm_pg_shared_lossless: + cell_size: 254 + dscp: 3 + ecn: 1 + packet_size: 64 + pg: 3 + pkts_num_fill_min: 74 + pkts_num_margin: 2 + pkts_num_trig_pfc: 120117 + wm_pg_shared_lossy: + cell_size: 254 + dscp: 8 + ecn: 1 + packet_size: 64 + pg: 0 + pkts_num_fill_min: 7 + pkts_num_margin: 2 + pkts_num_trig_egr_drp: 120051 + wm_q_shared_lossless: + cell_size: 254 + dscp: 3 + ecn: 1 + pkts_num_fill_min: 0 + pkts_num_margin: 2 + pkts_num_trig_ingr_drp: 121302 + queue: 3 + wm_q_shared_lossy: + cell_size: 254 + dscp: 8 + ecn: 1 + pkts_num_fill_min: 7 + pkts_num_margin: 2 + pkts_num_trig_egr_drp: 120051 + queue: 0 + xoff_1: + dscp: 3 + ecn: 1 + pg: 3 + pkts_num_margin: 2 + pkts_num_trig_ingr_drp: 121302 + pkts_num_trig_pfc: 120117 + xoff_2: + dscp: 4 + ecn: 1 + pg: 4 + pkts_num_margin: 2 + pkts_num_trig_ingr_drp: 121302 + pkts_num_trig_pfc: 120117 + xon_1: + dscp: 3 + ecn: 1 + pg: 3 + pkts_num_dismiss_pfc: 14 + pkts_num_margin: 2 + pkts_num_trig_pfc: 120117 + xon_2: + dscp: 4 + ecn: 1 + pg: 4 + pkts_num_dismiss_pfc: 14 + pkts_num_margin: 2 + pkts_num_trig_pfc: 120117 + wrr: + ecn: 1 + q0_num_of_pkts: 140 + q1_num_of_pkts: 140 + q2_num_of_pkts: 140 + q3_num_of_pkts: 150 + q4_num_of_pkts: 150 + q5_num_of_pkts: 140 + q6_num_of_pkts: 140 + q7_num_of_pkts: 140 + limit: 80 + packet_size: 64 + wrr_chg: + ecn: 1 + q0_num_of_pkts: 80 + q1_num_of_pkts: 80 + q2_num_of_pkts: 80 + q3_num_of_pkts: 300 + q4_num_of_pkts: 300 + q5_num_of_pkts: 80 + q6_num_of_pkts: 80 + q7_num_of_pkts: 80 + limit: 80 + lossy_weight: 8 + lossless_weight: 30 + packet_size: 64 + topo-t0-standalone-256: *topo-t0-standalone + topo-t0-standalone-32: *topo-t0-standalone diff --git a/tests/qos/qos_sai_base.py b/tests/qos/qos_sai_base.py index 7e599f8c6e..7a7cf4bb0b 100644 --- a/tests/qos/qos_sai_base.py +++ b/tests/qos/qos_sai_base.py @@ -146,7 +146,7 @@ def runPtfTest(self, ptfhost, testCase='', testParams={}, relax=False, pdb=False qlen=10000, is_python3=True, relax=relax, - timeout=1200, + timeout=1850, socket_recv_size=16384, custom_options=custom_options, pdb=pdb @@ -1576,6 +1576,9 @@ def dutQosConfig( if 'platform_asic' in duthost.facts and duthost.facts['platform_asic'] == 'broadcom-dnx': logger.info("THDI_BUFFER_CELL_LIMIT_SP is not valid for broadcom DNX - ignore dynamic buffer config") qosParams = qosConfigs['qos_params'][dutAsic][dutTopo] + elif dutAsic == 'th5': + logger.info("Generator script not implemented for TH5") + qosParams = qosConfigs['qos_params'][dutAsic][dutTopo] else: bufferConfig = self.dutBufferConfig(duthost, dut_asic) pytest_assert(len(bufferConfig) == 4, diff --git a/tests/qos/test_qos_sai.py b/tests/qos/test_qos_sai.py index d93bc360b2..fd7ea4c973 100644 --- a/tests/qos/test_qos_sai.py +++ b/tests/qos/test_qos_sai.py @@ -1557,6 +1557,12 @@ def testQosSaiDwrr( else: testParams["ecn"] = qosConfig["lossy_queue_1"]["ecn"] + if "pkts_num_egr_mem" in list(qosConfig[portSpeedCableLength].keys()): + testParams["pkts_num_egr_mem"] = qosConfig[portSpeedCableLength]["pkts_num_egr_mem"] + + if "packet_size" in qosConfigWrr: + testParams["packet_size"] = qosConfigWrr["packet_size"] + # To overcome this case: # When the previous test case just sends a large of packets only by one queue such as queue1, # then Dwrr test might fail, because queue1 has got much chance to send packets before, @@ -2088,6 +2094,12 @@ def testQosSaiDwrrWeightChange( else: testParams["platform_asic"] = None + if "pkts_num_egr_mem" in list(qosConfig[portSpeedCableLength].keys()): + testParams["pkts_num_egr_mem"] = qosConfig[portSpeedCableLength]["pkts_num_egr_mem"] + + if "packet_size" in qosConfigWrrChg: + testParams["packet_size"] = qosConfigWrrChg["packet_size"] + self.runPtfTest( ptfhost, testCase="sai_qos_tests.WRRtest", testParams=testParams ) diff --git a/tests/saitests/py3/sai_qos_tests.py b/tests/saitests/py3/sai_qos_tests.py index 5b5ae81173..f6e7b9365d 100755 --- a/tests/saitests/py3/sai_qos_tests.py +++ b/tests/saitests/py3/sai_qos_tests.py @@ -1763,7 +1763,7 @@ def runTest(self): pkts_num_leak_out = 0 # send packets short of triggering pfc - if hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32': + if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'): # send packets short of triggering pfc send_packet(self, src_port_id, pkt, (pkts_num_egr_mem + pkts_num_leak_out + @@ -2561,7 +2561,7 @@ def runTest(self): if check_leackout_compensation_support(asic_type, hwsku): pkts_num_leak_out = 0 - if hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32': + if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'): send_packet( self, src_port_id, pkt, (pkts_num_egr_mem + pkts_num_leak_out + pkts_num_trig_pfc - @@ -2603,7 +2603,7 @@ def runTest(self): xmit_2_counters_base, _ = sai_thrift_read_port_counters( self.dst_client, asic_type, port_list['dst'][dst_port_2_id] ) - if hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32': + if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'): send_packet( self, src_port_id, pkt2, (pkts_num_egr_mem + pkts_num_leak_out + pkts_num_dismiss_pfc + @@ -2652,7 +2652,7 @@ def runTest(self): log_message('step {}: {}\n'.format(step_id, step_desc), to_stderr=True) xmit_3_counters_base, _ = sai_thrift_read_port_counters( self.dst_client, asic_type, port_list['dst'][dst_port_3_id]) - if hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32': + if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'): send_packet(self, src_port_id, pkt3, pkts_num_egr_mem + pkts_num_leak_out + 1) elif 'cisco-8000' in asic_type: @@ -3030,7 +3030,7 @@ def runTest(self): ip_ttl=64) hwsku = self.test_params['hwsku'] - if (hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32'): + if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'): send_packet( self, self.src_port_ids[sidx], pkt, pkts_num_egr_mem + self.pkts_num_leak_out) else: @@ -3671,6 +3671,7 @@ def runTest(self): queue_7_num_of_pkts = int(self.test_params.get('q7_num_of_pkts', 0)) limit = int(self.test_params['limit']) pkts_num_leak_out = int(self.test_params['pkts_num_leak_out']) + pkts_num_egr_mem = int(self.test_params.get('pkts_num_egr_mem', 0)) topo = self.test_params['topo'] platform_asic = self.test_params['platform_asic'] prio_list = self.test_params.get('dscp_list', []) @@ -3746,6 +3747,19 @@ def runTest(self): send_packet(self, src_port_id, pkt, pkts_num_leak_out) + if 'hwsku' in self.test_params and self.test_params['hwsku'] in ('Arista-7060X6-64PE-256x200G'): + pkt = construct_ip_pkt(default_packet_length, + pkt_dst_mac, + src_port_mac, + src_port_ip, + dst_port_ip, + 9, + src_port_vlan, + ip_id=exp_ip_id, + ecn=ecn, + ttl=64) + send_packet(self, src_port_id, pkt, pkts_num_egr_mem) + # Get a snapshot of counter values port_counters_base, queue_counters_base = sai_thrift_read_port_counters( self.dst_client, asic_type, port_list['dst'][dst_port_id]) @@ -3800,7 +3814,7 @@ def runTest(self): try: if recv_pkt[scapy.IP].src == src_port_ip and recv_pkt[scapy.IP].dst == dst_port_ip and \ - recv_pkt[scapy.IP].id == exp_ip_id: + recv_pkt[scapy.IP].id == exp_ip_id and recv_pkt.payload.tos >> 2 in prio_list: cnt += 1 pkts.append(recv_pkt) except AttributeError: @@ -3972,7 +3986,7 @@ def runTest(self): pkts_num_leak_out = 0 # send packets short of triggering egress drop - if hwsku == 'DellEMC-Z9332f-O32' or hwsku == 'DellEMC-Z9332f-M-O16C64': + if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'): # send packets short of triggering egress drop send_packet(self, src_port_id, pkt, pkts_num_egr_mem + pkts_num_leak_out + pkts_num_trig_egr_drp - 1 - margin) @@ -4437,6 +4451,9 @@ def runTest(self): pg_min_pkts_num = pkts_num_egr_mem + \ pkts_num_leak_out + pkts_num_fill_min + margin send_packet(self, src_port_id, pkt, pg_min_pkts_num) + elif hwsku == 'Arista-7060X6-64PE-256x200G': + pg_min_pkts_num = pkts_num_egr_mem + pkts_num_fill_min + send_packet(self, src_port_id, pkt, pg_min_pkts_num) elif 'cisco-8000' in asic_type: fill_leakout_plus_one( self, src_port_id, dst_port_id, pkt, pg, asic_type, pkts_num_egr_mem) @@ -4472,6 +4489,8 @@ def runTest(self): if platform_asic and platform_asic == "broadcom-dnx": assert (pg_shared_wm_res[pg] <= ((pkts_num_leak_out + pkts_num_fill_min) * (packet_length + internal_hdr_size))) + elif hwsku == 'Arista-7060X6-64PE-256x200G': + assert (pg_shared_wm_res[pg] <= margin * cell_size) else: assert (pg_shared_wm_res[pg] == 0) else: @@ -4673,7 +4692,7 @@ def runTest(self): pkts_num_leak_out = 0 # send packets to trigger pfc but not trek into headroom - if hwsku == 'DellEMC-Z9332f-O32' or hwsku == 'DellEMC-Z9332f-M-O16C64': + if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'): send_packet(self, src_port_id, pkt, (pkts_num_egr_mem + pkts_num_leak_out + pkts_num_trig_pfc) // cell_occupancy - margin) else: @@ -5048,7 +5067,7 @@ def runTest(self): # so if queue min is zero, it will directly trek into shared pool by 1 # TH2 uses scheduler-based TX enable, this does not require sending packets # to leak out - if hwsku == 'DellEMC-Z9332f-O32' or hwsku == 'DellEMC-Z9332f-M-O16C64': + if hwsku in ('DellEMC-Z9332f-O32', 'DellEMC-Z9332f-M-O16C64', 'Arista-7060X6-64PE-256x200G'): que_min_pkts_num = pkts_num_egr_mem + pkts_num_leak_out + pkts_num_fill_min send_packet(self, src_port_id, pkt, que_min_pkts_num) else: @@ -5080,7 +5099,9 @@ def runTest(self): None, pg_cntrs, None, None, None, None, None, pg_shared_wm_res, pg_headroom_wm_res, q_wm_res) - if pkts_num_fill_min: + if hwsku == 'Arista-7060X6-64PE-256x200G': + assert (q_wm_res[queue] <= (margin + 1) * cell_size) + elif pkts_num_fill_min: assert (q_wm_res[queue] == 0) elif 'cisco-8000' in asic_type or "SN5600" in hwsku: assert (q_wm_res[queue] <= (margin + 1) * cell_size)