Skip to content

Commit

Permalink
Cisco-8122 Q watermark test update (#15328)
Browse files Browse the repository at this point in the history
* Revise qsharedwatermark test for gr2 to no longer refill the queue as with other asics.
Add lower margin on final check on the q shared watermark test case.

* Remove extra dut_asic setting.
  • Loading branch information
rbpittman authored and mssonicbld committed Nov 5, 2024
1 parent 5cd9912 commit 08c6b03
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiLossyQueueVoqMultiSrc:
reason: "Lossy Queue Voq multiple source test is not supported / M0/MX topo does not support qos"
conditions_logical_operator: or
conditions:
- "asic_type not in ['cisco-8000']"
- "asic_type not in ['cisco-8000'] or platform in ['x86_64-8122_64eh_o-r0']"
- "topo_type in ['m0', 'mx']"

qos/test_qos_sai.py::TestQosSai::testQosSaiPGDrop:
Expand Down
3 changes: 2 additions & 1 deletion tests/qos/test_qos_sai.py
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,8 @@ def testQosSaiQSharedWatermark(
"pkts_num_fill_min": qosConfig[queueProfile]["pkts_num_fill_min"],
"pkts_num_trig_drp": triggerDrop,
"cell_size": qosConfig[queueProfile]["cell_size"],
"hwsku": dutTestParams['hwsku']
"hwsku": dutTestParams['hwsku'],
"dut_asic": dutConfig["dutAsic"]
})

if "platform_asic" in dutTestParams["basicParams"]:
Expand Down
17 changes: 11 additions & 6 deletions tests/saitests/py3/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5003,6 +5003,7 @@ def runTest(self):
cell_size = int(self.test_params['cell_size'])
hwsku = self.test_params['hwsku']
platform_asic = self.test_params['platform_asic']
dut_asic = self.test_params['dut_asic']

if 'packet_size' in list(self.test_params.keys()):
packet_length = int(self.test_params['packet_size'])
Expand Down Expand Up @@ -5056,6 +5057,9 @@ def runTest(self):
recv_counters_base, _ = sai_thrift_read_port_counters(self.src_client, asic_type, port_list['src'][src_port_id])
xmit_counters_base, _ = sai_thrift_read_port_counters(self.dst_client, asic_type, port_list['dst'][dst_port_id])
self.sai_thrift_port_tx_disable(self.dst_client, asic_type, [dst_port_id])
if 'cisco-8000' in asic_type:
fill_leakout_plus_one(self, src_port_id, dst_port_id, pkt, queue, asic_type)

pg_cntrs_base = sai_thrift_read_pg_counters(self.src_client, port_list['src'][src_port_id])
dst_pg_cntrs_base = sai_thrift_read_pg_counters(self.dst_client, port_list['dst'][dst_port_id])
q_wm_res_base, pg_shared_wm_res_base, pg_headroom_wm_res_base = sai_thrift_read_port_watermarks(
Expand Down Expand Up @@ -5133,6 +5137,7 @@ def runTest(self):
else:
pkts_num = 1 + margin
fragment = 0
refill_queue = 'cisco-8000' in asic_type and dut_asic != 'gr2'
while (expected_wm < total_shared - fragment):
expected_wm += pkts_num * cell_occupancy
if (expected_wm > total_shared):
Expand All @@ -5142,9 +5147,9 @@ def runTest(self):
expected_wm -= diff * cell_occupancy
fragment = total_shared - expected_wm

if 'cisco-8000' in asic_type:
if refill_queue:
self.sai_thrift_port_tx_disable(self.dst_client, asic_type, [dst_port_id])
assert (fill_leakout_plus_one(self, src_port_id, dst_port_id, pkt, queue, asic_type))
fill_leakout_plus_one(self, src_port_id, dst_port_id, pkt, queue, asic_type)
pkts_total += pkts_num
pkts_num = pkts_total - 1

Expand All @@ -5153,7 +5158,7 @@ def runTest(self):

send_packet(self, src_port_id, pkt, pkts_num)

if 'cisco-8000' in asic_type:
if refill_queue:
self.sai_thrift_port_tx_enable(
self.dst_client, asic_type, [dst_port_id])

Expand Down Expand Up @@ -5205,7 +5210,7 @@ def runTest(self):

pkts_num = pkts_inc

if 'cisco-8000' in asic_type:
if refill_queue:
self.sai_thrift_port_tx_disable(self.dst_client, asic_type, [dst_port_id])
fill_leakout_plus_one(
self, src_port_id, dst_port_id, pkt, queue, asic_type)
Expand All @@ -5215,7 +5220,7 @@ def runTest(self):
# overflow the shared pool
send_packet(self, src_port_id, pkt, pkts_num)

if 'cisco-8000' in asic_type:
if refill_queue:
self.sai_thrift_port_tx_enable(self.dst_client, asic_type, [dst_port_id])

time.sleep(8)
Expand Down Expand Up @@ -5243,7 +5248,7 @@ def runTest(self):
logging.info("On J2C+ don't support SAI_INGRESS_PRIORITY_GROUP_STAT_XOFF_ROOM_WATERMARK_BYTES " +
"stat - so ignoring this step for now")
else:
assert (expected_wm * cell_size <= q_wm_res[queue])
assert ((expected_wm - margin) * cell_size <= q_wm_res[queue])
assert (q_wm_res[queue] <= (expected_wm + margin) * cell_size)

finally:
Expand Down

0 comments on commit 08c6b03

Please sign in to comment.