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
23 changes: 19 additions & 4 deletions tests/snappi/pfcwd/files/pfcwd_multi_node_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ def run_pfcwd_multi_node_test(api,
speed_str = testbed_config.layer1[0].speed
speed_gbps = int(speed_str.split('_')[1])

""" Retrieve ASIC information for DUT """
asic_type = duthost.facts['asic_type']

__verify_results(rows=flow_stats,
speed_gbps=speed_gbps,
pause_flow_name=PAUSE_FLOW_NAME,
Expand All @@ -136,7 +139,8 @@ def run_pfcwd_multi_node_test(api,
data_pkt_size=DATA_PKT_SIZE,
trigger_pfcwd=trigger_pfcwd,
pause_port_id=port_id,
tolerance=TOLERANCE_THRESHOLD)
tolerance=TOLERANCE_THRESHOLD,
asic_type=asic_type)


def __data_flow_name(name_prefix, src_id, dst_id, prio):
Expand Down Expand Up @@ -517,7 +521,8 @@ def __verify_results(rows,
data_pkt_size,
trigger_pfcwd,
pause_port_id,
tolerance):
tolerance,
asic_type):
"""
Verify if we get expected experiment results

Expand All @@ -534,10 +539,15 @@ def __verify_results(rows,
trigger_pfcwd (bool): if PFC watchdog is expected to be triggered
pause_port_id (int): ID of the port to send PFC pause frames
tolerance (float): maximum allowable deviation
asic_type (str): asic_type information for DUT

Returns:
N/A
"""

""" Check for whether DUT is a Mellanox device """
is_mlnx_device = True if "mellanox" in asic_type.lower() else False

for row in rows:
flow_name = row.name
tx_frames = row.frames_tx
Expand Down Expand Up @@ -568,11 +578,16 @@ def __verify_results(rows,
exp_test_flow_rx_pkts = test_flow_rate_percent / 100.0 * speed_gbps \
* 1e9 * data_flow_dur_sec / 8.0 / data_pkt_size

if trigger_pfcwd and\
(src_port_id == pause_port_id or dst_port_id == pause_port_id):
if trigger_pfcwd and dst_port_id == pause_port_id:
""" Once PFC watchdog is triggered, it will impact bi-directional traffic """
pytest_assert(tx_frames > rx_frames,
'{} should have dropped packets'.format(flow_name))

elif trigger_pfcwd and src_port_id == pause_port_id:
if is_mlnx_device:
""" During a pfc storm with pfcwd triggered, Mellanox devices do not drop Rx packets """
pytest_assert(tx_frames == rx_frames,
'{} should not have dropped packets for Mellanox device'.format(flow_name))

elif not trigger_pfcwd and dst_port_id == pause_port_id:
""" This test flow is delayed by PFC storm """
Expand Down