Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions tests/qos/qos_sai_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,20 +1403,21 @@ def dutQosConfig(
if sub_folder_dir not in sys.path:
sys.path.append(sub_folder_dir)
import qos_param_generator
qpm = qos_param_generator.QosParamBroadcom(qosConfigs['qos_params'][dutAsic][dutTopo],
dutAsic,
portSpeedCableLength,
dutConfig,
ingressLosslessProfile,
ingressLossyProfile,
egressLosslessProfile,
egressLossyProfile,
sharedHeadroomPoolSize,
dutConfig["dualTor"],
dutTopo,
bufferConfig,
duthost,
tbinfo["topo"]["name"])
qpm = qos_param_generator.QosParamBroadcom({'qos_params': qosConfigs['qos_params'][dutAsic][dutTopo],
'asic_type': dutAsic,
'speed_cable_len': portSpeedCableLength,
'dutConfig': dutConfig,
'ingressLosslessProfile': ingressLosslessProfile,
'ingressLossyProfile': ingressLossyProfile,
'egressLosslessProfile': egressLosslessProfile,
'egressLossyProfile': egressLossyProfile,
'sharedHeadroomPoolSize': sharedHeadroomPoolSize,
'dualTor': dutConfig["dualTor"],
'dutTopo': dutTopo,
'bufferConfig': bufferConfig,
'dutHost': duthost,
'testbedTopologyName': tbinfo["topo"]["name"],
'selected_profile': profileName})
qosParams = qpm.run()
elif is_cisco_device(duthost):
bufferConfig = self.dutBufferConfig(duthost, dut_asic)
Expand Down
14 changes: 14 additions & 0 deletions tests/qos/test_qos_sai.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,10 @@ def testQosSaiHeadroomPoolSize(
if 'hdrm_pool_size' not in list(qosConfig.keys()):
pytest.skip("Headroom pool size is not enabled on this DUT")

# if no enough ports, src_port_ids is empty list, skip the test
if not qosConfig['hdrm_pool_size'].get('src_port_ids', None):
pytest.skip("No enough test ports on this DUT")

if not dutConfig['dualTor']:
qosConfig['hdrm_pool_size']['pgs'] = qosConfig['hdrm_pool_size']['pgs'][:2]
qosConfig['hdrm_pool_size']['dscps'] = qosConfig['hdrm_pool_size']['dscps'][:2]
Expand Down Expand Up @@ -708,6 +712,9 @@ def testQosSaiHeadroomPoolSize(
if "pkts_num_egr_mem" in list(qosConfig.keys()):
testParams["pkts_num_egr_mem"] = qosConfig["pkts_num_egr_mem"]

if "pkts_num_trig_pfc_multi" in qosConfig["hdrm_pool_size"]:
testParams.update({"pkts_num_trig_pfc_multi": qosConfig["hdrm_pool_size"]["pkts_num_trig_pfc_multi"]})

self.runPtfTest(
ptfhost, testCase="sai_qos_tests.HdrmPoolSizeTest",
testParams=testParams
Expand Down Expand Up @@ -829,6 +836,10 @@ def testQosSaiHeadroomPoolWatermark(
if 'hdrm_pool_size' not in list(qosConfig.keys()):
pytest.skip("Headroom pool size is not enabled on this DUT")

# if no enough ports, src_port_ids is empty list, skip the test
if not qosConfig['hdrm_pool_size'].get('src_port_ids', None):
pytest.skip("No enough test ports on this DUT")

src_dut_index = get_src_dst_asic_and_duts['src_dut_index']
dst_dut_index = get_src_dst_asic_and_duts['dst_dut_index']
src_asic_index = get_src_dst_asic_and_duts['src_asic_index']
Expand Down Expand Up @@ -888,6 +899,9 @@ def testQosSaiHeadroomPoolWatermark(
if "pkts_num_egr_mem" in list(qosConfig.keys()):
testParams["pkts_num_egr_mem"] = qosConfig["pkts_num_egr_mem"]

if "pkts_num_trig_pfc_multi" in qosConfig["hdrm_pool_size"]:
testParams.update({"pkts_num_trig_pfc_multi": qosConfig["hdrm_pool_size"]["pkts_num_trig_pfc_multi"]})

self.runPtfTest(
ptfhost, testCase="sai_qos_tests.HdrmPoolSizeTest",
testParams=testParams
Expand Down
11 changes: 7 additions & 4 deletions tests/saitests/py3/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2204,6 +2204,7 @@ def setUp(self):
if not self.pkts_num_trig_pfc:
self.pkts_num_trig_pfc_shp = self.test_params.get(
'pkts_num_trig_pfc_shp')
self.pkts_num_trig_pfc_multi = self.test_params.get('pkts_num_trig_pfc_multi', None)
self.pkts_num_hdrm_full = self.test_params['pkts_num_hdrm_full']
self.pkts_num_hdrm_partial = self.test_params['pkts_num_hdrm_partial']
packet_size = self.test_params.get('packet_size')
Expand All @@ -2217,9 +2218,10 @@ def setUp(self):
self.pkt_size_factor = 1

if self.pkts_num_trig_pfc:
print(("pkts num: leak_out: %d, trig_pfc: %d, hdrm_full: %d, hdrm_partial: %d, pkt_size %d" % (
self.pkts_num_leak_out, self.pkts_num_trig_pfc, self.pkts_num_hdrm_full,
self.pkts_num_hdrm_partial, self.pkt_size)), file=sys.stderr)
print("pkts num: leak_out: {}, trig_pfc: {}, hdrm_full: {}, hdrm_partial: {}, pkt_size {}".format(
self.pkts_num_leak_out,
self.pkts_num_trig_pfc_multi if self.pkts_num_trig_pfc_multi else self.pkts_num_trig_pfc,
self.pkts_num_hdrm_full, self.pkts_num_hdrm_partial, self.pkt_size), file=sys.stderr)
elif self.pkts_num_trig_pfc_shp:
print(("pkts num: leak_out: {}, trig_pfc: {}, hdrm_full: {}, hdrm_partial: {}, pkt_size {}".format(
self.pkts_num_leak_out, self.pkts_num_trig_pfc_shp, self.pkts_num_hdrm_full,
Expand Down Expand Up @@ -2364,7 +2366,8 @@ def runTest(self):
ip_tos=tos,
ip_ttl=ttl)
if self.pkts_num_trig_pfc:
pkts_num_trig_pfc = self.pkts_num_trig_pfc
pkts_num_trig_pfc = self.pkts_num_trig_pfc_multi[i] \
if self.pkts_num_trig_pfc_multi else self.pkts_num_trig_pfc
else:
pkts_num_trig_pfc = self.pkts_num_trig_pfc_shp[i]

Expand Down