Skip to content

Commit

Permalink
Add qos_params.th5.yaml (sonic-net#14250)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
Adds a baseline of parameters, which fixes the headroom pool size test.

How did you do it?
Values were generated by updated version of the generator script.

How did you verify/test it?
Manual test runs.
  • Loading branch information
rick-arista authored Dec 3, 2024
1 parent d299786 commit 1b12cd0
Show file tree
Hide file tree
Showing 4 changed files with 255 additions and 10 deletions.
201 changes: 201 additions & 0 deletions tests/qos/files/qos_params.th5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
qos_params:
th5:
topo-t0-standalone: &topo-t0-standalone
cell_size: 254
hdrm_pool_wm_multiplier: 1
200000_5m:
hdrm_pool_size:
dscps:
- 3
- 4
dst_port_id: 0
ecn: 1
margin: 2
pgs:
- 3
- 4
pgs_num: 50
pkts_num_hdrm_full: 1185
pkts_num_hdrm_partial: 47
pkts_num_trig_pfc: 120117
pkts_num_trig_pfc_multi:
- 120117
- 60096
- 30085
- 15079
- 7577
- 3825
- 1950
- 1012
- 543
- 308
- 191
- 133
- 103
- 89
- 81
- 78
- 76
- 75
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
- 74
src_port_ids:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
lossy_queue_1:
dscp: 8
ecn: 1
pg: 0
pkts_num_margin: 2
pkts_num_trig_egr_drp: 120051
pkts_num_egr_mem: 238
pkts_num_leak_out: 0
wm_pg_headroom:
cell_size: 254
dscp: 3
ecn: 1
pg: 3
pkts_num_margin: 2
pkts_num_trig_ingr_drp: 121302
pkts_num_trig_pfc: 120117
wm_pg_shared_lossless:
cell_size: 254
dscp: 3
ecn: 1
packet_size: 64
pg: 3
pkts_num_fill_min: 74
pkts_num_margin: 2
pkts_num_trig_pfc: 120117
wm_pg_shared_lossy:
cell_size: 254
dscp: 8
ecn: 1
packet_size: 64
pg: 0
pkts_num_fill_min: 7
pkts_num_margin: 2
pkts_num_trig_egr_drp: 120051
wm_q_shared_lossless:
cell_size: 254
dscp: 3
ecn: 1
pkts_num_fill_min: 0
pkts_num_margin: 2
pkts_num_trig_ingr_drp: 121302
queue: 3
wm_q_shared_lossy:
cell_size: 254
dscp: 8
ecn: 1
pkts_num_fill_min: 7
pkts_num_margin: 2
pkts_num_trig_egr_drp: 120051
queue: 0
xoff_1:
dscp: 3
ecn: 1
pg: 3
pkts_num_margin: 2
pkts_num_trig_ingr_drp: 121302
pkts_num_trig_pfc: 120117
xoff_2:
dscp: 4
ecn: 1
pg: 4
pkts_num_margin: 2
pkts_num_trig_ingr_drp: 121302
pkts_num_trig_pfc: 120117
xon_1:
dscp: 3
ecn: 1
pg: 3
pkts_num_dismiss_pfc: 14
pkts_num_margin: 2
pkts_num_trig_pfc: 120117
xon_2:
dscp: 4
ecn: 1
pg: 4
pkts_num_dismiss_pfc: 14
pkts_num_margin: 2
pkts_num_trig_pfc: 120117
wrr:
ecn: 1
q0_num_of_pkts: 140
q1_num_of_pkts: 140
q2_num_of_pkts: 140
q3_num_of_pkts: 150
q4_num_of_pkts: 150
q5_num_of_pkts: 140
q6_num_of_pkts: 140
q7_num_of_pkts: 140
limit: 80
wrr_chg:
ecn: 1
q0_num_of_pkts: 80
q1_num_of_pkts: 80
q2_num_of_pkts: 80
q3_num_of_pkts: 300
q4_num_of_pkts: 300
q5_num_of_pkts: 80
q6_num_of_pkts: 80
q7_num_of_pkts: 80
limit: 80
lossy_weight: 8
lossless_weight: 30
topo-t0-standalone-256: *topo-t0-standalone
topo-t0-standalone-32: *topo-t0-standalone
5 changes: 4 additions & 1 deletion tests/qos/qos_sai_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def runPtfTest(self, ptfhost, testCase='', testParams={}, relax=False, pdb=False
qlen=10000,
is_python3=True,
relax=relax,
timeout=1200,
timeout=1850,
socket_recv_size=16384,
custom_options=custom_options,
pdb=pdb
Expand Down Expand Up @@ -1624,6 +1624,9 @@ def dutQosConfig(
if 'platform_asic' in duthost.facts and duthost.facts['platform_asic'] == 'broadcom-dnx':
logger.info("THDI_BUFFER_CELL_LIMIT_SP is not valid for broadcom DNX - ignore dynamic buffer config")
qosParams = qosConfigs['qos_params'][dutAsic][dutTopo]
elif dutAsic == 'th5':
logger.info("Generator script not implemented for TH5")
qosParams = qosConfigs['qos_params'][dutAsic][dutTopo]
else:
bufferConfig = self.dutBufferConfig(duthost, dut_asic)
pytest_assert(len(bufferConfig) == 4,
Expand Down
6 changes: 6 additions & 0 deletions tests/qos/test_qos_sai.py
Original file line number Diff line number Diff line change
Expand Up @@ -1572,6 +1572,9 @@ def testQosSaiDwrr(
else:
testParams["ecn"] = qosConfig["lossy_queue_1"]["ecn"]

if "pkts_num_egr_mem" in list(qosConfig[portSpeedCableLength].keys()):
testParams["pkts_num_egr_mem"] = qosConfig[portSpeedCableLength]["pkts_num_egr_mem"]

# To overcome this case:
# When the previous test case just sends a large of packets only by one queue such as queue1,
# then Dwrr test might fail, because queue1 has got much chance to send packets before,
Expand Down Expand Up @@ -2111,6 +2114,9 @@ def testQosSaiDwrrWeightChange(
else:
testParams["platform_asic"] = None

if "pkts_num_egr_mem" in list(qosConfig[portSpeedCableLength].keys()):
testParams["pkts_num_egr_mem"] = qosConfig[portSpeedCableLength]["pkts_num_egr_mem"]

self.runPtfTest(
ptfhost, testCase="sai_qos_tests.WRRtest", testParams=testParams
)
Expand Down
53 changes: 44 additions & 9 deletions tests/saitests/py3/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ def runTest(self):
pkts_num_leak_out = 0

# send packets short of triggering pfc
if hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32':
if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'):
# send packets short of triggering pfc
send_packet(self, src_port_id, pkt, (pkts_num_egr_mem +
pkts_num_leak_out +
Expand Down Expand Up @@ -2576,7 +2576,7 @@ def runTest(self):
if check_leackout_compensation_support(asic_type, hwsku):
pkts_num_leak_out = 0

if hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32':
if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'):
send_packet(
self, src_port_id, pkt,
(pkts_num_egr_mem + pkts_num_leak_out + pkts_num_trig_pfc -
Expand Down Expand Up @@ -2618,7 +2618,7 @@ def runTest(self):
xmit_2_counters_base, _ = sai_thrift_read_port_counters(
self.dst_client, asic_type, port_list['dst'][dst_port_2_id]
)
if hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32':
if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'):
send_packet(
self, src_port_id, pkt2,
(pkts_num_egr_mem + pkts_num_leak_out + pkts_num_dismiss_pfc +
Expand Down Expand Up @@ -2667,7 +2667,7 @@ def runTest(self):
log_message('step {}: {}\n'.format(step_id, step_desc), to_stderr=True)
xmit_3_counters_base, _ = sai_thrift_read_port_counters(
self.dst_client, asic_type, port_list['dst'][dst_port_3_id])
if hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32':
if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'):
send_packet(self, src_port_id, pkt3,
pkts_num_egr_mem + pkts_num_leak_out + 1)
elif 'cisco-8000' in asic_type:
Expand Down Expand Up @@ -3046,7 +3046,7 @@ def runTest(self):
ip_ttl=64)

hwsku = self.test_params['hwsku']
if (hwsku == 'DellEMC-Z9332f-M-O16C64' or hwsku == 'DellEMC-Z9332f-O32'):
if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'):
send_packet(
self, self.src_port_ids[sidx], pkt, pkts_num_egr_mem + self.pkts_num_leak_out)
else:
Expand Down Expand Up @@ -3706,6 +3706,9 @@ def runTest(self):
queue_7_num_of_pkts = int(self.test_params.get('q7_num_of_pkts', 0))
limit = int(self.test_params['limit'])
pkts_num_leak_out = int(self.test_params['pkts_num_leak_out'])
pkts_num_egr_mem = int(self.test_params.get('pkts_num_egr_mem', 0))
lossless_weight = int(self.test_params.get('lossless_weight', 1))
lossy_weight = int(self.test_params.get('lossy_weight', 1))
topo = self.test_params['topo']
platform_asic = self.test_params['platform_asic']
prio_list = self.test_params.get('dscp_list', [])
Expand Down Expand Up @@ -3781,6 +3784,31 @@ def runTest(self):

send_packet(self, src_port_id, pkt, pkts_num_leak_out)

if 'hwsku' in self.test_params and self.test_params['hwsku'] in ('Arista-7060X6-64PE-256x200G'):

prio_lossless = (3, 4)
prio_lossy = tuple(set(prio_list) - set(prio_lossless))
pkts_egr_lossless = int(pkts_num_egr_mem * (lossless_weight / (lossless_weight + lossy_weight)))
pkts_egr_lossy = int(pkts_num_egr_mem - pkts_egr_lossless)
pkts_egr_lossless, mod_lossless = divmod(pkts_egr_lossless, len(prio_lossless))
pkts_egr_lossy, mod_lossy = divmod(pkts_egr_lossy, len(prio_lossy))
pkts_egr = {prio: pkts_egr_lossless if prio in prio_lossless else pkts_egr_lossy for prio in prio_list}
for prio in prio_lossless[:mod_lossless] + prio_lossy[:mod_lossy]:
pkts_egr[prio] += 1

for prio in prio_list:
pkt = construct_ip_pkt(64,
pkt_dst_mac,
src_port_mac,
src_port_ip,
dst_port_ip,
prio,
src_port_vlan,
ip_id=exp_ip_id + 1,
ecn=ecn,
ttl=64)
send_packet(self, src_port_id, pkt, pkts_egr[prio])

# Get a snapshot of counter values
port_counters_base, queue_counters_base = sai_thrift_read_port_counters(
self.dst_client, asic_type, port_list['dst'][dst_port_id])
Expand Down Expand Up @@ -4007,7 +4035,7 @@ def runTest(self):
pkts_num_leak_out = 0

# send packets short of triggering egress drop
if hwsku == 'DellEMC-Z9332f-O32' or hwsku == 'DellEMC-Z9332f-M-O16C64':
if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'):
# send packets short of triggering egress drop
send_packet(self, src_port_id, pkt, pkts_num_egr_mem +
pkts_num_leak_out + pkts_num_trig_egr_drp - 1 - margin)
Expand Down Expand Up @@ -4472,6 +4500,9 @@ def runTest(self):
pg_min_pkts_num = pkts_num_egr_mem + \
pkts_num_leak_out + pkts_num_fill_min + margin
send_packet(self, src_port_id, pkt, pg_min_pkts_num)
elif hwsku == 'Arista-7060X6-64PE-256x200G':
pg_min_pkts_num = pkts_num_egr_mem + pkts_num_fill_min
send_packet(self, src_port_id, pkt, pg_min_pkts_num)
elif 'cisco-8000' in asic_type:
fill_leakout_plus_one(
self, src_port_id, dst_port_id, pkt, pg, asic_type, pkts_num_egr_mem)
Expand Down Expand Up @@ -4507,6 +4538,8 @@ def runTest(self):
if platform_asic and platform_asic == "broadcom-dnx":
assert (pg_shared_wm_res[pg] <=
((pkts_num_leak_out + pkts_num_fill_min) * (packet_length + internal_hdr_size)))
elif hwsku == 'Arista-7060X6-64PE-256x200G':
assert (pg_shared_wm_res[pg] <= margin * cell_size)
else:
assert (pg_shared_wm_res[pg] == 0)
else:
Expand Down Expand Up @@ -4708,7 +4741,7 @@ def runTest(self):
pkts_num_leak_out = 0

# send packets to trigger pfc but not trek into headroom
if hwsku == 'DellEMC-Z9332f-O32' or hwsku == 'DellEMC-Z9332f-M-O16C64':
if hwsku in ('DellEMC-Z9332f-M-O16C64', 'DellEMC-Z9332f-O32', 'Arista-7060X6-64PE-256x200G'):
send_packet(self, src_port_id, pkt, (pkts_num_egr_mem +
pkts_num_leak_out + pkts_num_trig_pfc) // cell_occupancy - margin)
elif 'cisco-8000' in asic_type:
Expand Down Expand Up @@ -5092,7 +5125,7 @@ def runTest(self):
# so if queue min is zero, it will directly trek into shared pool by 1
# TH2 uses scheduler-based TX enable, this does not require sending packets
# to leak out
if hwsku == 'DellEMC-Z9332f-O32' or hwsku == 'DellEMC-Z9332f-M-O16C64':
if hwsku in ('DellEMC-Z9332f-O32', 'DellEMC-Z9332f-M-O16C64', 'Arista-7060X6-64PE-256x200G'):
que_min_pkts_num = pkts_num_egr_mem + pkts_num_leak_out + pkts_num_fill_min
send_packet(self, src_port_id, pkt, que_min_pkts_num)
else:
Expand Down Expand Up @@ -5124,7 +5157,9 @@ def runTest(self):
None, pg_cntrs, None, None, None,
None, None, pg_shared_wm_res, pg_headroom_wm_res, q_wm_res)

if pkts_num_fill_min:
if hwsku == 'Arista-7060X6-64PE-256x200G':
assert (q_wm_res[queue] <= (margin + 1) * cell_size)
elif pkts_num_fill_min:
assert (q_wm_res[queue] == 0)
elif 'cisco-8000' in asic_type or "SN5600" in hwsku or "SN5400" in hwsku:
assert (q_wm_res[queue] <= (margin + 1) * cell_size)
Expand Down

0 comments on commit 1b12cd0

Please sign in to comment.