Skip to content

Commit f33ad45

Browse files
authored
[Cherry-pick sonic-net#16885]HeadroomPoolSize test with dynamic_threshold based buffer allocation (sonic-net#236)
Cherry-pick (sonic-net#16885) What is the motivation for this PR? Verifying HeadroomPoolsize test for broadcom-dnx chassis How did you verify/test it? Executed qos test for headroomPool size and verify the results
2 parents 4abb4f2 + 20a5d13 commit f33ad45

File tree

4 files changed

+322
-18
lines changed

4 files changed

+322
-18
lines changed

tests/common/plugins/conditional_mark/tests_mark_conditions.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,6 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolSize:
19301930
and asic_type in ['cisco-8000']"
19311931
- "topo_type in ['m0', 'mx']"
19321932
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
1933-
- "'t2' in topo_name and asic_subtype in ['broadcom-dnx']"
19341933
- "asic_type in ['vs']"
19351934

19361935
qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolWatermark:

tests/qos/files/qos_params.j2c.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,10 @@ qos_params:
451451
src_port_ids: [ 0, 2, 4, 6, 8, 10, 12, 14, 16 ]
452452
dst_port_id: 18
453453
pgs_num: 18
454-
pkts_num_trig_pfc: 657523
455-
pkts_num_hdrm_full: 622850
456-
pkts_num_hdrm_partial: 622750
457-
margin: 300
454+
pkts_num_trig_pfc: 542448
455+
pkts_num_hdrm_full: 713397
456+
pkts_num_hdrm_partial: 713300
457+
margin: 100
458458
wm_pg_headroom:
459459
dscp: 3
460460
ecn: 1

tests/qos/test_qos_sai.py

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -836,8 +836,7 @@ def testQosSaiLosslessVoq(
836836

837837
def testQosSaiHeadroomPoolSize(
838838
self, get_src_dst_asic_and_duts, ptfhost, dutTestParams, dutConfig, dutQosConfig,
839-
ingressLosslessProfile
840-
):
839+
ingressLosslessProfile, change_lag_lacp_timer):
841840
# NOTE: cisco-8800 will skip this test since there are no headroom pool
842841
"""
843842
Test QoS SAI Headroom pool size
@@ -881,19 +880,28 @@ def testQosSaiHeadroomPoolSize(
881880

882881
if ('platform_asic' in dutTestParams["basicParams"] and
883882
dutTestParams["basicParams"]["platform_asic"] == "broadcom-dnx"):
883+
# for 100G port speed the number of ports required to fill headroom is huge,
884+
# hence skipping the test with speed 100G or cable length of 2k
885+
if portSpeedCableLength not in ['400000_120000m']:
886+
pytest.skip("Insufficient number of ports to fill the headroom")
884887
# Need to adjust hdrm_pool_size src_port_ids, dst_port_id and pgs_num based on how many source and dst ports
885888
# present
886889
src_ports = dutConfig['testPortIds'][src_dut_index][src_asic_index]
890+
if len(src_ports) < 5:
891+
pytest.skip("Insufficient number of src ports for testQosSaiHeadroomPoolSize")
892+
qosConfig["hdrm_pool_size"]["src_port_ids"] = src_ports[1:5]
893+
qosConfig["hdrm_pool_size"]["pgs_num"] = 2 * len(qosConfig["hdrm_pool_size"]["src_port_ids"])
894+
887895
if get_src_dst_asic_and_duts['src_asic'] == get_src_dst_asic_and_duts['dst_asic']:
888896
# Src and dst are the same asics, leave one for dst port and the rest for src ports
889-
qosConfig["hdrm_pool_size"]["src_port_ids"] = src_ports[:-1]
890-
qosConfig["hdrm_pool_size"]["dst_port_id"] = src_ports[-1]
891-
qosConfig["hdrm_pool_size"]["pgs_num"] = 2 * len(qosConfig["hdrm_pool_size"]["src_port_ids"])
897+
qosConfig["hdrm_pool_size"]["dst_port_id"] = src_ports[0]
898+
892899
else:
893-
qosConfig["hdrm_pool_size"]["src_port_ids"] = src_ports
894-
qosConfig["hdrm_pool_size"]["dst_port_id"] = dutConfig['testPortIds'][dst_dut_index][dst_asic_index][-1]
895-
qosConfig["hdrm_pool_size"]["pgs_num"] = 2 * len(qosConfig["hdrm_pool_size"]["src_port_ids"])
900+
qosConfig["hdrm_pool_size"]["dst_port_id"] = dutConfig['testPortIds'][dst_dut_index][dst_asic_index][0]
896901

902+
src_port_vlans = [testPortIps[src_dut_index][src_asic_index][port]['vlan_id']
903+
if 'vlan_id' in testPortIps[src_dut_index][src_asic_index][port]
904+
else None for port in qosConfig["hdrm_pool_size"]["src_port_ids"]]
897905
self.updateTestPortIdIp(dutConfig, get_src_dst_asic_and_duts, qosConfig["hdrm_pool_size"])
898906

899907
testParams = dict()
@@ -914,7 +922,8 @@ def testQosSaiHeadroomPoolSize(
914922
"pkts_num_leak_out": qosConfig["pkts_num_leak_out"],
915923
"pkts_num_hdrm_full": qosConfig["hdrm_pool_size"]["pkts_num_hdrm_full"],
916924
"pkts_num_hdrm_partial": qosConfig["hdrm_pool_size"]["pkts_num_hdrm_partial"],
917-
"hwsku": dutTestParams['hwsku']
925+
"hwsku": dutTestParams['hwsku'],
926+
"src_port_vlan": dutConfig["testPorts"]["src_port_vlan"]
918927
})
919928

920929
if "platform_asic" in dutTestParams["basicParams"]:
@@ -942,10 +951,16 @@ def testQosSaiHeadroomPoolSize(
942951
if "pkts_num_trig_pfc_multi" in qosConfig["hdrm_pool_size"]:
943952
testParams.update({"pkts_num_trig_pfc_multi": qosConfig["hdrm_pool_size"]["pkts_num_trig_pfc_multi"]})
944953

945-
self.runPtfTest(
946-
ptfhost, testCase="sai_qos_tests.HdrmPoolSizeTest",
947-
testParams=testParams
948-
)
954+
if ('platform_asic' in dutTestParams["basicParams"] and
955+
dutTestParams["basicParams"]["platform_asic"] == "broadcom-dnx"):
956+
testParams['src_port_vlan'] = src_port_vlans
957+
self.runPtfTest(
958+
ptfhost, testCase="sai_qos_tests.HdrmPoolSizeTest_withDynamicBufferCacl",
959+
testParams=testParams)
960+
else:
961+
self.runPtfTest(
962+
ptfhost, testCase="sai_qos_tests.HdrmPoolSizeTest",
963+
testParams=testParams)
949964

950965
@pytest.mark.parametrize("sharedResSizeKey", ["shared_res_size_1", "shared_res_size_2"])
951966
def testQosSaiSharedReservationSize(

0 commit comments

Comments
 (0)