Skip to content

Commit

Permalink
Rename drop-checking iterative variables. (#15571) (#16046)
Browse files Browse the repository at this point in the history
Co-authored-by: rbpittman <[email protected]>
  • Loading branch information
mssonicbld and rbpittman authored Dec 12, 2024
1 parent e7a16b8 commit 6d7bd3c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tests/saitests/py3/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3448,22 +3448,23 @@ def get_pfc_tx_cnt(src_port_id, pg_cntr_idx):
# Verify no ingress/egress drops for all ports
pg_drop_counters = {port_id: sai_thrift_read_pg_drop_counters(
self.src_client, port_list['src'][port_id]) for port_id in uniq_srcs}
for src_port_id in uniq_srcs:
for pg in range(len(pg_drop_counters[src_port_id])):
drops = pg_drop_counters[src_port_id][pg] - pg_drop_counters_bases[src_port_id][pg]
for uniq_src_port_id in uniq_srcs:
for pg in range(len(pg_drop_counters[uniq_src_port_id])):
drops = pg_drop_counters[uniq_src_port_id][pg] - pg_drop_counters_bases[uniq_src_port_id][pg]
if pg in [3, 4]:
assert drops == 0, "Detected %d lossless drops on PG %d src port %d" % (drops, pg, src_port_id)
assert drops == 0, \
"Detected %d lossless drops on PG %d src port %d" % (drops, pg, uniq_src_port_id)
elif drops > 0:
# When memory is full, any new lossy background traffic is dropped.
print("Observed lossy drops %d on PG %d src port %d, expected." %
(drops, pg, src_port_id), file=sys.stderr)
(drops, pg, uniq_src_port_id), file=sys.stderr)
xmit_counters_list = {port_id: sai_thrift_read_port_counters(
self.dst_client, self.asic_type, port_list['dst'][port_id])[0] for port_id in uniq_dsts}
for dst_port_id in uniq_dsts:
for uniq_dst_port_id in uniq_dsts:
for cntr in self.egress_counters:
drops = xmit_counters_list[dst_port_id][cntr] - \
xmit_counters_bases[dst_port_id][cntr]
assert drops == 0, "Detected %d egress drops on dst port id %d" % (drops, dst_port_id)
drops = xmit_counters_list[uniq_dst_port_id][cntr] - \
xmit_counters_bases[uniq_dst_port_id][cntr]
assert drops == 0, "Detected %d egress drops on dst port id %d" % (drops, uniq_dst_port_id)

first_port_id = self.dst_port_ids[0]
last_port_id = self.dst_port_ids[-1]
Expand Down

0 comments on commit 6d7bd3c

Please sign in to comment.