From 58fd21d27cc0070f0bfce17ade8156636d6b6e80 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 1 Jul 2026 09:08:46 -0400 Subject: [PATCH] fix(perf): TRex ASTFIPGenDist needs a [start,end] IP range, not a single IP Run 28518413002 (post-#104) got TRex ASTF fully up (LRO fix worked, RPC serving, DUT tcp-echo bound) but every config failed at profile-build: Bad IP range "10.0.1.246" for parameter ip_range to function ASTFIPGenDist - Range should contain two IPs ASTFIPGenDist requires a 2-element [start, end] range even for a single host. Pass [ip, ip] for client/server/glob gens. Add a regression check (no TRex needed) asserting every ASTFIPGenDist ip_range is a list. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/perf-tests/test/test_run_perf_tests.sh | 9 +++++++++ scripts/perf-tests/trex/run_tcp_benchmark.py | 9 ++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/perf-tests/test/test_run_perf_tests.sh b/scripts/perf-tests/test/test_run_perf_tests.sh index 6531563..cce59e2 100755 --- a/scripts/perf-tests/test/test_run_perf_tests.sh +++ b/scripts/perf-tests/test/test_run_perf_tests.sh @@ -81,6 +81,15 @@ if [[ "$ACMD" == *"--lro-disable"* ]]; then ok "astf launch includes --lro-disab if [[ "$SCMD" == *"--lro-disable"* ]]; then ok "stl launch includes --lro-disable"; else bad "stl launch includes --lro-disable"; fi if [[ "$SCMD" != *"--astf"* ]]; then ok "stl mode omits --astf"; else bad "stl mode omits --astf"; fi +echo "== run_tcp_benchmark.py: ASTFIPGenDist ip_range must be a [start,end] list ==" +TCP_PY="$TEST_DIR/../trex/run_tcp_benchmark.py" +if grep -nE 'ASTFIPGenDist\(ip_range=' "$TCP_PY" | grep -qvE 'ip_range=\['; then + bad "ASTFIPGenDist uses a single-IP ip_range (TRex needs [start,end]):" + grep -nE 'ASTFIPGenDist\(ip_range=' "$TCP_PY" | grep -vE 'ip_range=\[' +else + ok "all ASTFIPGenDist ip_range args are lists" +fi + # ── 3. TRex mode selection: stl for UDP, astf for any *-tcp ─────────────────── echo "== TRex STL/ASTF mode selection ==" for c in "rust-dpdk-tcp,tokio-dpdk-tcp,plain-rust-tcp" "rust-dpdk-tcp"; do diff --git a/scripts/perf-tests/trex/run_tcp_benchmark.py b/scripts/perf-tests/trex/run_tcp_benchmark.py index bc1efa5..9c8888f 100644 --- a/scripts/perf-tests/trex/run_tcp_benchmark.py +++ b/scripts/perf-tests/trex/run_tcp_benchmark.py @@ -49,10 +49,13 @@ def build_tcp_profile(payload_size, src_ip, dst_ip, dst_port): prog_s.recv(payload_size) prog_s.send(payload) - ip_gen_c = ASTFIPGenDist(ip_range=src_ip, distribution="seq") - ip_gen_s = ASTFIPGenDist(ip_range=dst_ip, distribution="seq") + # TRex ASTFIPGenDist requires a 2-element [start, end] range, even for a + # single host — pass [ip, ip]. A bare string fails ArgVerify with + # "Bad IP range ... Range should contain two IPs". + ip_gen_c = ASTFIPGenDist(ip_range=[src_ip, src_ip], distribution="seq") + ip_gen_s = ASTFIPGenDist(ip_range=[dst_ip, dst_ip], distribution="seq") ip_gen = ASTFIPGen( - glob=ASTFIPGenDist(ip_range="0.0.0.0", distribution="seq"), + glob=ASTFIPGenDist(ip_range=["0.0.0.0", "0.0.0.0"], distribution="seq"), dist_client=ip_gen_c, dist_server=ip_gen_s, )