Skip to content
Merged
4 changes: 2 additions & 2 deletions tests/qos/files/qos_params.j2c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ qos_params:
j2c+:
topo-any:
100000_300m:
pkts_num_leak_out: 51
pkts_num_leak_out: 5
internal_hdr_size: 48
xoff_1:
dscp: 3
Expand Down Expand Up @@ -55,7 +55,7 @@ qos_params:
ecn: 1
pg: 0
pkts_num_trig_egr_drp: 2396745
pkts_num_margin: 20
pkts_num_margin: 200
wm_pg_shared_lossless:
dscp: 3
ecn: 1
Expand Down
39 changes: 33 additions & 6 deletions tests/saitests/py3/sai_base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import ptf.testutils as testutils
import json
import socket
import time

################################################################
#
Expand Down Expand Up @@ -167,28 +168,54 @@ def exec_cmd_on_dut(self, hostname, username, password, cmd):
return stdOut, stdErr, retValue

def sai_thrift_port_tx_enable(self, client, asic_type, port_list, target='dst', last_port=True):
count = 0
sai_thrift_port_tx_enable(client, asic_type, port_list, target=target)
if self.platform_asic and self.platform_asic == "broadcom-dnx" and last_port:
# need to enable watchdog on the source asic using cint script
cmd = "bcmcmd -n {} \"BCMSAI credit-watchdog enable\"".format(self.src_asic_index)
stdOut, stdErr, retValue = self.exec_cmd_on_dut(self.src_server_ip,
self.test_params['dut_username'],
self.test_params['dut_password'],
cmd)
assert 'Success rv = 0' in stdOut[1], "enable wd failed '{}' on asic '{}' on '{}'".format(
cmd, self.src_asic_index, self.src_server_ip)

sai_thrift_port_tx_enable(client, asic_type, port_list, target=target)
if retValue != 0 or 'Success rv = 0' not in stdOut[1]:
# Retry credit-wd command max 3 times on failure
while count < 3:
print("Retrying credit_wd_enable")
time.sleep(5)
stdOut, stdErr, retValue = self.exec_cmd_on_dut(self.src_server_ip,
self.test_params['dut_username'],
self.test_params['dut_password'],
cmd)
if stdOut and 'Success rv = 0' in stdOut[1]:
break
count += 1
assert 'Success rv = 0' in stdOut[1] if stdOut else retValue == 0,\
"enable wd failed '{}' on asic '{}' on '{}'".format(cmd, self.src_asic_index, self.src_server_ip)

def sai_thrift_port_tx_disable(self, client, asic_type, port_list, target='dst'):
count = 0
if self.platform_asic and self.platform_asic == "broadcom-dnx":
# need to enable watchdog on the source asic using cint script
cmd = "bcmcmd -n {} \"BCMSAI credit-watchdog disable\"".format(self.src_asic_index)
stdOut, stdErr, retValue = self.exec_cmd_on_dut(self.src_server_ip,
self.test_params['dut_username'],
self.test_params['dut_password'],
cmd)
assert 'Success rv = 0' in stdOut[1], "disable wd failed '{}' on asic '{}' on '{}'".format(
cmd, self.src_asic_index, self.src_server_ip)
if retValue != 0 or 'Success rv = 0' not in stdOut[1]:
# Retry credit-wd command max 3 times on failure
while count < 3:
print("Retrying credit_wd_enable")
time.sleep(5)
stdOut, stdErr, retValue = self.exec_cmd_on_dut(self.src_server_ip,
self.test_params['dut_username'],
self.test_params['dut_password'],
cmd)
if stdOut and 'Success rv = 0' in stdOut[1]:
break
count += 1
assert 'Success rv = 0' in stdOut[1] if stdOut else retValue == 0, \
"disable wd failed '{}' on asic '{}' on '{}'".format(cmd, self.src_asic_index, self.src_server_ip)

sai_thrift_port_tx_disable(client, asic_type, port_list, target=target)


Expand Down
12 changes: 11 additions & 1 deletion tests/saitests/py3/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3082,6 +3082,15 @@ def runTest(self):
assert (fill_leakout_plus_one(self, src_port_id, dst_port_id,
pkt, int(self.test_params['pg']), asic_type))

if platform_asic and platform_asic == "broadcom-dnx":
if check_leackout_compensation_support(asic_type, hwsku):
send_packet(self, src_port_id, pkt, pkts_num_leak_out)
time.sleep(5)
dynamically_compensate_leakout(self.dst_client, asic_type, sai_thrift_read_port_counters,
port_list['dst'][dst_port_id], TRANSMITTED_PKTS,
xmit_counters_base, self, src_port_id, pkt, 10)
pkts_num_leak_out = 0

# send packets short of triggering egress drop
if hwsku == 'DellEMC-Z9332f-O32' or hwsku == 'DellEMC-Z9332f-M-O16C64':
# send packets short of triggering egress drop
Expand Down Expand Up @@ -3111,7 +3120,8 @@ def runTest(self):
assert (recv_counters[pg] == recv_counters_base[pg])
# recv port no ingress drop
for cntr in ingress_counters:
assert (recv_counters[cntr] == recv_counters_base[cntr])
if platform_asic and platform_asic == "broadcom-dnx" and cntr == 1:
assert(recv_counters[cntr] == recv_counters_base[cntr])
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.

what is the purpose of this change ? Can we have this applicable to chassis only ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Vineet, If i remember correctly the packet drops are counted as part of queue drop stats and not port drop stats , So the In Discards counter was not working and we had to bypass that counter check for dnx

# xmit port no egress drop
for cntr in egress_counters:
assert (xmit_counters[cntr] == xmit_counters_base[cntr])
Expand Down