Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion tests/common/helpers/pfc_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def main():
packet = packet + b"\x00\x00"

pre_str = 'GLOBAL_PF' if options.global_pf else 'PFC'
logger.debug(pre_str + '_STORM_START')
logger.debug(pre_str + '_STORM_DEBUG')

# Start sending PFC pause frames
senders = []
Expand All @@ -186,6 +186,7 @@ def main():
s.start()
senders.append(s)

logger.debug(pre_str + '_STORM_START')
# Wait PFC packets to be sent
for sender in senders:
sender.stop()
Expand Down
24 changes: 17 additions & 7 deletions tests/pfcwd/test_pfcwd_timer_accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,19 +227,29 @@ def verify_pfcwd_timers(self):
logger.info("all restore time {}".format(self.all_restore_time))

check_point = ITERATION_NUM // 2 - 1
config_detect_time = self.timers['pfc_wd_detect_time'] + self.timers['pfc_wd_poll_time']
# Loose the check if two conditions are met
# 1. Device is Mellanox plaform
# 2. Leaf-fanout is Non-Onyx or non-Mellanox SONiC devices
# 1. Leaf-fanout is Non-Onyx or non-Mellanox SONiC devices
# 2. Device is Mellanox plaform, Loose the check
# 3. Device is broadcom plaform, add half of polling time as compensation for the detect config time
# It's because the pfc_gen.py running on leaf-fanout can't guarantee the PFCWD is triggered consistently
if self.dut.facts['asic_type'] == "mellanox":
for fanouthost in list(self.fanout.values()):
if fanouthost.get_fanout_os() != "onyx" or \
fanouthost.get_fanout_os() == "sonic" and fanouthost.facts['asic_type'] != "mellanox":
logger.debug("dut asic_type {}".format(self.dut.facts['asic_type']))
for fanouthost in list(self.fanout.values()):
if fanouthost.get_fanout_os() != "onyx" or \
fanouthost.get_fanout_os() == "sonic" and fanouthost.facts['asic_type'] != "mellanox":
if self.dut.facts['asic_type'] == "mellanox":
logger.info("Loose the check for non-Onyx or non-Mellanox leaf-fanout testbed")
check_point = ITERATION_NUM // 3 - 1
break
elif self.dut.facts['asic_type'] == "broadcom":
logger.info("Configuring detect time for broadcom DUT")
config_detect_time = (
self.timers['pfc_wd_detect_time'] +
self.timers['pfc_wd_poll_time'] +
(self.timers['pfc_wd_poll_time'] // 2)
)
break

config_detect_time = self.timers['pfc_wd_detect_time'] + self.timers['pfc_wd_poll_time']
err_msg = ("Real detection time is greater than configured: Real detect time: {} "
"Expected: {} (wd_detect_time + wd_poll_time)".format(self.all_detect_time[check_point],
config_detect_time))
Expand Down