Skip to content

Commit

Permalink
[Mellanox] Fix qos issues on dualtor setup (#10527)
Browse files Browse the repository at this point in the history
Fix issue: #10526

When calling QosParamMellanox(), the argument dst_dut_index, dst_asic_index oder is not correct. we should exchange them.
The Fanout device doesn't match the duthost
When topo is not defined in qos_param['mellanox'], we should use the default one
  • Loading branch information
JibinBao authored Nov 14, 2023
1 parent da905b2 commit fe078a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/qos/files/mellanox/qos_param_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class QosParamMellanox(object):
def __init__(self, qos_params, asic_type, speed_cable_len, dutConfig, ingressLosslessProfile,
ingressLossyProfile, egressLosslessProfile, egressLossyProfile, sharedHeadroomPoolSize,
dualTor, src_dut_index, src_asic_index, dst_asic_index, dst_dut_index):
dualTor, src_dut_index, src_asic_index, dst_dut_index, dst_asic_index):
self.asic_param_dic = {
'spc1': {
'cell_size': 96,
Expand Down
3 changes: 2 additions & 1 deletion tests/qos/qos_sai_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,8 @@ def dutQosConfig(
if sub_folder_dir not in sys.path:
sys.path.append(sub_folder_dir)
import qos_param_generator
qpm = qos_param_generator.QosParamMellanox(qosConfigs['qos_params']['mellanox'][dutTopo], dutAsic,
dut_top = dutTopo if dutTopo in qosConfigs['qos_params']['mellanox'] else "topo-any"
qpm = qos_param_generator.QosParamMellanox(qosConfigs['qos_params']['mellanox'][dut_top], dutAsic,
portSpeedCableLength,
dutConfig,
ingressLosslessProfile,
Expand Down
8 changes: 4 additions & 4 deletions tests/qos/test_qos_sai.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import re
from tabulate import tabulate

from tests.common.fixtures.conn_graph_facts import fanout_graph_facts, conn_graph_facts # noqa F401
from tests.common.fixtures.conn_graph_facts import fanout_graph_facts, conn_graph_facts, get_graph_facts # noqa F401
from tests.common.fixtures.duthost_utils import dut_qos_maps, \
separated_dscp_to_tc_map_on_uplink, load_dscp_to_pg_map # noqa F401
from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401
Expand Down Expand Up @@ -278,7 +278,7 @@ def testQosSaiPfcXoffLimit(
@pytest.mark.parametrize("xonProfile", ["xon_1", "xon_2", "xon_3", "xon_4"])
def testPfcStormWithSharedHeadroomOccupancy(
self, xonProfile, ptfhost, fanouthosts, conn_graph_facts, fanout_graph_facts, # noqa F811
dutTestParams, dutConfig, dutQosConfig, sharedHeadroomPoolSize, ingressLosslessProfile
dutTestParams, dutConfig, dutQosConfig, sharedHeadroomPoolSize, ingressLosslessProfile, localhost
):
"""
Verify if the PFC Frames are not sent from the DUT after a PFC Storm from peer link.
Expand Down Expand Up @@ -356,12 +356,12 @@ def testPfcStormWithSharedHeadroomOccupancy(
fanout_neighbors = conn_graph_facts["device_conn"][duthost.hostname]
peerdevice = fanout_neighbors[pfcwd_test_port]["peerdevice"]
peerport = fanout_neighbors[pfcwd_test_port]["peerport"]
peerdevice_hwsku = get_graph_facts(duthost, localhost, peerdevice)["device_info"][peerdevice]["HwSku"]
peer_info = {
'peerdevice': peerdevice,
'hwsku': fanout_graph_facts[peerdevice]["device_info"]["HwSku"],
'hwsku': peerdevice_hwsku,
'pfc_fanout_interface': peerport
}

queue_index = qosConfig[xonProfile]["pg"]
frames_number = 100000000

Expand Down

0 comments on commit fe078a1

Please sign in to comment.