Skip to content

Commit

Permalink
Changes to testQosSaiPfcXonLimit for cisco-8000 (#5537)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanghra authored May 16, 2022
1 parent 7d3e46e commit cea823a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
3 changes: 3 additions & 0 deletions tests/qos/test_qos_sai.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ def testQosSaiPfcXonLimit(
if "pkts_num_margin" in qosConfig[xonProfile].keys():
testParams["pkts_num_margin"] = qosConfig[xonProfile]["pkts_num_margin"]

if "packet_size" in qosConfig[xonProfile].keys():
testParams["packet_size"] = qosConfig[xonProfile]["packet_size"]

self.runPtfTest(
ptfhost, testCase="sai_qos_tests.PFCXonTest", testParams=testParams
)
Expand Down
27 changes: 23 additions & 4 deletions tests/saitests/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,6 @@ def runTest(self):
hysteresis = int(self.test_params['pkts_num_hysteresis'])
else:
hysteresis = 0
default_packet_length = 64
hwsku = self.test_params['hwsku']

# get a snapshot of counter values at recv and transmit ports
Expand All @@ -926,7 +925,12 @@ def runTest(self):

# create packet
pkt_dst_mac = router_mac if router_mac != '' else dst_port_mac
pkt = construct_ip_pkt(default_packet_length,
if 'packet_size' in self.test_params:
packet_length = self.test_params['packet_size']
else:
packet_length = 64

pkt = construct_ip_pkt(packet_length,
pkt_dst_mac,
src_port_mac,
src_port_ip,
Expand All @@ -941,7 +945,7 @@ def runTest(self):

# create packet
pkt_dst_mac2 = router_mac if router_mac != '' else dst_port_2_mac
pkt2 = construct_ip_pkt(default_packet_length,
pkt2 = construct_ip_pkt(packet_length,
pkt_dst_mac2,
src_port_mac,
src_port_ip,
Expand All @@ -956,7 +960,7 @@ def runTest(self):

# create packet
pkt_dst_mac3 = router_mac if router_mac != '' else dst_port_3_mac
pkt3 = construct_ip_pkt(default_packet_length,
pkt3 = construct_ip_pkt(packet_length,
pkt_dst_mac3,
src_port_mac,
src_port_ip,
Expand Down Expand Up @@ -992,6 +996,12 @@ def runTest(self):
self, src_port_id, pkt,
pkts_num_egr_mem + pkts_num_leak_out + pkts_num_trig_pfc - pkts_num_dismiss_pfc - hysteresis
)
elif 'cisco-8000' in asic_type:
assert(fill_leakout_plus_one(self, src_port_id, dst_port_id, pkt, int(self.test_params['pg']), asic_type))
send_packet(
self, src_port_id, pkt,
pkts_num_leak_out + pkts_num_trig_pfc - pkts_num_dismiss_pfc - hysteresis - 1
)
else:
send_packet(
self, src_port_id, pkt,
Expand All @@ -1012,6 +1022,12 @@ def runTest(self):
self, src_port_id, pkt2,
pkts_num_egr_mem + pkts_num_leak_out + margin + pkts_num_dismiss_pfc - 1 + hysteresis
)
elif 'cisco-8000' in asic_type:
assert(fill_leakout_plus_one(self, src_port_id, dst_port_2_id, pkt2, int(self.test_params['pg']), asic_type))
send_packet(
self, src_port_id, pkt2,
pkts_num_leak_out + margin + pkts_num_dismiss_pfc - 2 + hysteresis
)
else:
send_packet(
self, src_port_id, pkt2,
Expand All @@ -1027,6 +1043,9 @@ def runTest(self):
)
if hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32':
send_packet(self, src_port_id, pkt3, pkts_num_egr_mem + pkts_num_leak_out + 1)
elif 'cisco-8000' in asic_type:
assert(fill_leakout_plus_one(self, src_port_id, dst_port_3_id, pkt3, int(self.test_params['pg']), asic_type))
send_packet(self, src_port_id, pkt3, pkts_num_leak_out)
else:
send_packet(self, src_port_id, pkt3, pkts_num_leak_out + 1)

Expand Down

0 comments on commit cea823a

Please sign in to comment.