Skip to content
Merged
Changes from 2 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
20 changes: 14 additions & 6 deletions tests/saitests/py3/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2720,6 +2720,12 @@ def runTest(self):
assert (len(sidx_dscp_pg_tuples) >= self.pgs_num)
print(sidx_dscp_pg_tuples, file=sys.stderr)
sys.stderr.flush()
# Collect destination ports that may be in a lag
pkt_dst_mac = self.router_mac if self.router_mac != '' else self.dst_port_mac
dst_port_ids = []
for i in range(len(self.src_port_ids)):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please clarify why dst ports and dependent on src_port_id ? Should we check if destination port is part of the lag then disable all ports under that lag ?

dst_port_ids.append(get_rx_port(self, 0, self.src_port_ids[i], pkt_dst_mac,
self.dst_port_ip, self.src_port_ips[i]))

# get a snapshot of counter values at recv and transmit ports
# queue_counters value is not of our interest here
Expand All @@ -2733,7 +2739,9 @@ def runTest(self):
pkts_num_egr_mem = int(self.test_params['pkts_num_egr_mem'])

# Pause egress of dut xmit port
self.sai_thrift_port_tx_disable(self.dst_client, self.asic_type, [self.dst_port_id])
# Disable all dst ports
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, Can we have this specific to dnx chassis ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

uniq_dst_ports = list(set(dst_port_ids))
self.sai_thrift_port_tx_disable(self.dst_client, self.asic_type, uniq_dst_ports)

try:
# send packets to leak out
Expand Down Expand Up @@ -2841,10 +2849,10 @@ def runTest(self):
.format(pkt_cnt, sidx_dscp_pg_tuples[i][1], sidx_dscp_pg_tuples[i][2], sidx_dscp_pg_tuples[i][0]))

if pkt_cnt == 10:
sys.exit("Too many pkts needed to trigger pfc: %d" %
(pkt_cnt))
assert (recv_counters[sidx_dscp_pg_tuples[i][2]] >
recv_counters_bases[sidx_dscp_pg_tuples[i][0]][sidx_dscp_pg_tuples[i][2]])
self.sai_thrift_port_tx_enable(self.dst_client, self.asic_type, uniq_dst_ports)
sys.exit("Too many pkts needed to trigger pfc: %d" % (pkt_cnt))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

assert(recv_counters[sidx_dscp_pg_tuples[i][2]] >
recv_counters_bases[sidx_dscp_pg_tuples[i][0]][sidx_dscp_pg_tuples[i][2]])
print("%d packets for sid: %d, pg: %d to trigger pfc" % (
pkt_cnt, self.src_port_ids[sidx_dscp_pg_tuples[i][0]], sidx_dscp_pg_tuples[i][2] - 2),
file=sys.stderr)
Expand Down Expand Up @@ -2990,7 +2998,7 @@ def runTest(self):
sys.stderr.flush()

finally:
self.sai_thrift_port_tx_enable(self.dst_client, self.asic_type, [self.dst_port_id])
self.sai_thrift_port_tx_enable(self.dst_client, self.asic_type, uniq_dst_ports)


class SharedResSizeTest(sai_base_test.ThriftInterfaceDataPlane):
Expand Down