@@ -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