diff --git a/tests/qos/files/mellanox/qos_param_generator.py b/tests/qos/files/mellanox/qos_param_generator.py index 5f7fc6cade3..3399d511214 100644 --- a/tests/qos/files/mellanox/qos_param_generator.py +++ b/tests/qos/files/mellanox/qos_param_generator.py @@ -102,11 +102,11 @@ def calculate_parameters(self): xon = {} xon['pkts_num_trig_pfc'] = pkts_num_trig_pfc xon['pkts_num_dismiss_pfc'] = pkts_num_dismiss_pfc - xon['pkts_num_hysteresis'] = pkts_num_hysteresis + xon['pkts_num_hysteresis'] = pkts_num_hysteresis + 16 if self.asic_type == 'spc2': xon['pkts_num_margin'] = 2 elif self.asic_type == 'spc3': - xon['pkts_num_margin'] = 0 + xon['pkts_num_margin'] = 3 self.qos_params_mlnx['xon_1'].update(xon) self.qos_params_mlnx['xon_2'].update(xon) @@ -114,8 +114,8 @@ def calculate_parameters(self): wm_pg_headroom['pkts_num_trig_pfc'] = pkts_num_trig_pfc wm_pg_headroom['pkts_num_trig_ingr_drp'] = pkts_num_trig_ingr_drp wm_pg_headroom['cell_size'] = self.cell_size - if self.asic_type == 'spc1': - wm_pg_headroom['pkts_num_margin'] = 1 + if self.asic_type == 'spc3': + wm_pg_headroom['pkts_num_margin'] = 3 else: wm_pg_headroom['pkts_num_margin'] = 2 diff --git a/tests/saitests/sai_qos_tests.py b/tests/saitests/sai_qos_tests.py index afd9b828027..d09e172babe 100644 --- a/tests/saitests/sai_qos_tests.py +++ b/tests/saitests/sai_qos_tests.py @@ -1578,11 +1578,13 @@ def runTest(self): # send packets try: # send packets to trigger pfc but not trek into headroom - send_packet(self, src_port_id, pkt, pkts_num_leak_out + pkts_num_trig_pfc) + send_packet(self, src_port_id, pkt, pkts_num_leak_out + pkts_num_trig_pfc - margin) time.sleep(8) q_wm_res, pg_shared_wm_res, pg_headroom_wm_res = sai_thrift_read_port_watermarks(self.client, port_list[src_port_id]) assert(pg_headroom_wm_res[pg] == 0) + send_packet(self, src_port_id, pkt, margin) + # send packet batch of fixed packet numbers to fill pg headroom # first round sends only 1 packet expected_wm = 0