Skip to content

Commit f988eb6

Browse files
rraghav-ciscomssonicbld
authored andcommitted
Minor changes for snappi_tests for T2-ixia, change udp port calculations. (#15906)
Description of PR Currently the traffic for RDMA tests use randomly selected udp ports. This sometimes ends up sending traffic in a non-load-balanced way, and causes the tests to fail. In this PR: For multiple scripts that use udp: We serialize the UDP port numbers instead of randomly picking the numbers. This allows for more uniform load-balancing spread, and allows tests to pass more. in multi_lossless helper: We reduce the background traffic rate, and raise the rate for lossless traffic, thus keeping the overall rate still same. This allows for accounting the speed of backplane. co-authorized by: [email protected]
1 parent 79584c8 commit f988eb6

File tree

4 files changed

+24
-14
lines changed

4 files changed

+24
-14
lines changed

tests/snappi_tests/multidut/pfc/files/m2o_fluctuating_lossless_helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,9 @@ def __gen_data_flow(testbed_config,
341341
elif 'Test Flow 2 -> 0' in flow.name:
342342
eth.pfc_queue.value = pfcQueueValueDict[flow_prio[1]]
343343

344-
src_port = UDP_PORT_START + eth.pfc_queue.value
344+
global UDP_PORT_START
345+
src_port = UDP_PORT_START
346+
UDP_PORT_START += 1
345347
udp.src_port.increment.start = src_port
346348
udp.src_port.increment.step = 1
347349
udp.src_port.increment.count = 1

tests/snappi_tests/multidut/pfc/files/m2o_oversubscribe_lossless_helper.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# Compiled at: 2023-02-10 09:15:26
66
from math import ceil # noqa: F401
77
import logging # noqa: F401
8-
import random
98
from tests.common.helpers.assertions import pytest_assert, pytest_require # noqa: F401
109
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa: F401
1110
from tests.common.snappi_tests.snappi_helpers import get_dut_port_id # noqa: F401
@@ -20,14 +19,15 @@
2019

2120
PAUSE_FLOW_NAME = 'Pause Storm'
2221
TEST_FLOW_NAME = 'Test Flow'
23-
TEST_FLOW_AGGR_RATE_PERCENT = 30
22+
TEST_FLOW_AGGR_RATE_PERCENT = 35
2423
BG_FLOW_NAME = 'Background Flow'
25-
BG_FLOW_AGGR_RATE_PERCENT = 25
24+
BG_FLOW_AGGR_RATE_PERCENT = 22.5
2625
DATA_PKT_SIZE = 1024
2726
DATA_FLOW_DURATION_SEC = 10
2827
DATA_FLOW_DELAY_SEC = 5
2928
SNAPPI_POLL_DELAY_SEC = 2
3029
TOLERANCE_THRESHOLD = 0.05
30+
UDP_PORT_START = 5000
3131

3232

3333
def run_m2o_oversubscribe_lossless_test(api,
@@ -297,10 +297,6 @@ def __gen_data_flow(testbed_config,
297297
flow.tx_rx.port.tx_name = testbed_config.ports[src_port_id].name
298298
flow.tx_rx.port.rx_name = testbed_config.ports[dst_port_id].name
299299
eth, ipv4, udp = flow.packet.ethernet().ipv4().udp()
300-
src_port = random.randint(5000, 6000)
301-
udp.src_port.increment.start = src_port
302-
udp.src_port.increment.step = 1
303-
udp.src_port.increment.count = 1
304300

305301
eth.src.value = tx_mac
306302
eth.dst.value = rx_mac
@@ -320,6 +316,13 @@ def __gen_data_flow(testbed_config,
320316
elif 'Test Flow 2 -> 0' in flow.name:
321317
eth.pfc_queue.value = pfcQueueValueDict[flow_prio[1]]
322318

319+
global UDP_PORT_START
320+
src_port = UDP_PORT_START
321+
UDP_PORT_START += 1
322+
udp.src_port.increment.start = src_port
323+
udp.src_port.increment.step = 1
324+
udp.src_port.increment.count = 1
325+
323326
ipv4.src.value = tx_port_config.ip
324327
ipv4.dst.value = rx_port_config.ip
325328
ipv4.priority.choice = ipv4.priority.DSCP

tests/snappi_tests/multidut/pfc/files/m2o_oversubscribe_lossy_helper.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# Compiled at: 2023-02-10 09:15:26
66
from math import ceil # noqa: F401
77
import logging # noqa: F401
8-
import random
98
from tests.common.helpers.assertions import pytest_assert, pytest_require # noqa: F401
109
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa: F401
1110
from tests.common.snappi_tests.snappi_helpers import get_dut_port_id # noqa: F401
@@ -28,6 +27,7 @@
2827
DATA_FLOW_DELAY_SEC = 5
2928
SNAPPI_POLL_DELAY_SEC = 2
3029
TOLERANCE_THRESHOLD = 0.05
30+
UDP_PORT_START = 5000
3131

3232

3333
def run_pfc_m2o_oversubscribe_lossy_test(api,
@@ -319,10 +319,6 @@ def __gen_data_flow(testbed_config,
319319
flow.tx_rx.port.tx_name = testbed_config.ports[src_port_id].name
320320
flow.tx_rx.port.rx_name = testbed_config.ports[dst_port_id].name
321321
eth, ipv4, udp = flow.packet.ethernet().ipv4().udp()
322-
src_port = random.randint(5000, 6000)
323-
udp.src_port.increment.start = src_port
324-
udp.src_port.increment.step = 1
325-
udp.src_port.increment.count = 1
326322

327323
eth.src.value = tx_mac
328324
eth.dst.value = rx_mac
@@ -342,6 +338,13 @@ def __gen_data_flow(testbed_config,
342338
elif 'Background Flow 2 -> 0' in flow.name:
343339
eth.pfc_queue.value = pfcQueueValueDict[flow_prio[1]]
344340

341+
global UDP_PORT_START
342+
src_port = UDP_PORT_START
343+
UDP_PORT_START += 1
344+
udp.src_port.increment.start = src_port
345+
udp.src_port.increment.step = 1
346+
udp.src_port.increment.count = 1
347+
345348
ipv4.src.value = tx_port_config.ip
346349
ipv4.dst.value = rx_port_config.ip
347350
ipv4.priority.choice = ipv4.priority.DSCP

tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_basic_helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ def __gen_traffic(testbed_config,
321321
else:
322322
eth.pfc_queue.value = pfcQueueValueDict[prio]
323323

324-
src_port = UDP_PORT_START + eth.pfc_queue.value * number_of_streams
324+
global UDP_PORT_START
325+
src_port = UDP_PORT_START
326+
UDP_PORT_START += number_of_streams
325327
udp.src_port.increment.start = src_port
326328
udp.src_port.increment.step = 1
327329
udp.src_port.increment.count = number_of_streams

0 commit comments

Comments
 (0)