Skip to content
Merged
Changes from all 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
28 changes: 17 additions & 11 deletions tests/saitests/py3/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@ def runTest(self):
dscp_to_pg_map = self.test_params.get('dscp_to_pg_map', None)
pkt_dst_mac = router_mac if router_mac != '' else dst_port_mac
asic_type = self.test_params.get("sonic_asic_type")
platform_asic = self.test_params['platform_asic']

print("dst_port_id: %d, src_port_id: %d" %
(dst_port_id, src_port_id), file=sys.stderr)
Expand Down Expand Up @@ -1028,21 +1029,26 @@ def runTest(self):
print(list(map(operator.sub, pg_cntrs, pg_cntrs_base)),
file=sys.stderr)
for i in range(0, PG_NUM):
if i == pg:
if i == 0 or i == 4:
assert (pg_cntrs[pg] >=
pg_cntrs_base[pg] + len(dscps))
# DNX/Chassis:
# pg = 0 => Some extra packets with unmarked TC
# pg = 4 => Extra packets for LACP/BGP packets
# pg = 7 => packets from cpu to front panel ports
if platform_asic and platform_asic == "broadcom-dnx":
if i == pg:
if i == 3:
assert (pg_cntrs[pg] == pg_cntrs_base[pg] + len(dscps))
else:
assert (pg_cntrs[pg] >= pg_cntrs_base[pg] + len(dscps))
else:
assert (pg_cntrs[pg] ==
pg_cntrs_base[pg] + len(dscps))
if i in [0, 4, 7]:
assert (pg_cntrs[i] >= pg_cntrs_base[i])
else:
assert (pg_cntrs[i] == pg_cntrs_base[i])
else:
# LACP packets are mapped to queue0 and tcp syn packets for BGP to queue4
# So for those queues the count could be more
if i == 0 or i == 4:
assert (pg_cntrs[i] >= pg_cntrs_base[i])
if i == pg:
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.

@ansrajpu-git Can you please keep non DNX check same ?

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.

@vmittal-msft , As per the discussion and notes taken, I have implemented the changes.
the non-chassis behavior is reverted back to how it was originally implemented PR #7079

@vmittal-msft vmittal-msft 2 weeks ago
As discussed, lets try this logic -

i => 0 -> 7
pg => 0,3,4
dscps => 62,1,1

DNX/Chassis:
pg = 0 => Some extra packets with unmarked
pg = 4 => Extra packets for LACP/BGP packets
pg = 7 => packets from cpu to front panel ports

if non chassis:
if i == pg:
assert(pg_cntrs[pg] == pg_cntrs_base[pg] + len(dscps))
else:
assert(pg_cntrs[i] == pg_cntrs_base[i])

else
i = {3}
assert(pg_cntrs[pg] == pg_cntrs_base[pg] + len(dscps))
i = {0,4,7}
assert(pg_cntrs[pg] >= pg_cntrs_base[pg] + len(dscps))
else {1,2,5,6}
assert(pg_cntrs[i] == pg_cntrs_base[i])

Please confirm if more changes are required..

Copy link
Copy Markdown
Contributor

@vmittal-msft vmittal-msft Mar 7, 2024

Choose a reason for hiding this comment

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

@ansrajpu-git i still see some difference from the logic we discussed. Can you please check ?

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.

@vmittal-msft, updated the logic. Please check.

assert (pg_cntrs[pg] == pg_cntrs_base[pg] + len(dscps))
else:
assert (pg_cntrs[i] == pg_cntrs_base[i])

# confirm that dscp pkts are received
total_recv_cnt = 0
dscp_recv_cnt = 0
Expand Down