From d9246dbce6649f55aba4f8554db32e99bfd4e083 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 1 Jul 2026 15:20:47 -0400 Subject: [PATCH] fix(perf): TRex ASTFIPGen.glob must be ASTFIPGenGlobal; add client ip_gen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run 28540393082 (post-#105) cleared the ip_range error and hit the next profile-build ArgVerify: ASTFIPGen 'glob' must be ASTFIPGenGlobal, not ASTFIPGenDist. Reviewed the whole build_tcp_profile against the TRex ASTF API and fixed two issues at once to avoid another EC2 round-trip: - glob=ASTFIPGenGlobal(ip_offset='1.0.0.0') (was ASTFIPGenDist) - ASTFTCPClientTemplate now passes ip_gen= (canonical form) Regression check asserts glob is not an ASTFIPGenDist. NOTE: this is the 4th TRex-profile API error found one-at-a-time on real hardware — the ASTF profile was never validated against TRex. Follow-up: validate build_tcp_profile offline (TRex control-plane ArgVerify is pure Python) so these are caught in <1s instead of a 30-min EC2 run. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/perf-tests/test/test_run_perf_tests.sh | 1 + scripts/perf-tests/trex/run_tcp_benchmark.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/perf-tests/test/test_run_perf_tests.sh b/scripts/perf-tests/test/test_run_perf_tests.sh index cce59e2..1c54230 100755 --- a/scripts/perf-tests/test/test_run_perf_tests.sh +++ b/scripts/perf-tests/test/test_run_perf_tests.sh @@ -89,6 +89,7 @@ if grep -nE 'ASTFIPGenDist\(ip_range=' "$TCP_PY" | grep -qvE 'ip_range=\['; then else ok "all ASTFIPGenDist ip_range args are lists" fi +if grep -qE 'glob=ASTFIPGenDist' "$TCP_PY"; then bad "ASTFIPGen glob must be ASTFIPGenGlobal, not ASTFIPGenDist"; else ok "ASTFIPGen glob is ASTFIPGenGlobal (not ASTFIPGenDist)"; fi # ── 3. TRex mode selection: stl for UDP, astf for any *-tcp ─────────────────── echo "== TRex STL/ASTF mode selection ==" diff --git a/scripts/perf-tests/trex/run_tcp_benchmark.py b/scripts/perf-tests/trex/run_tcp_benchmark.py index 9c8888f..fc6a0bd 100644 --- a/scripts/perf-tests/trex/run_tcp_benchmark.py +++ b/scripts/perf-tests/trex/run_tcp_benchmark.py @@ -28,6 +28,7 @@ from trex.astf.api import ASTFClient, ASTFProfile from trex.astf.trex_astf_profile import ( ASTFIPGenDist, + ASTFIPGenGlobal, ASTFIPGen, ASTFTCPClientTemplate, ASTFTCPServerTemplate, @@ -54,8 +55,10 @@ def build_tcp_profile(payload_size, src_ip, dst_ip, dst_port): # "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") + # ASTFIPGen.glob must be an ASTFIPGenGlobal (NOT an ASTFIPGenDist); dist_client + # / dist_server are the ASTFIPGenDist ranges above. ip_gen = ASTFIPGen( - glob=ASTFIPGenDist(ip_range=["0.0.0.0", "0.0.0.0"], distribution="seq"), + glob=ASTFIPGenGlobal(ip_offset="1.0.0.0"), dist_client=ip_gen_c, dist_server=ip_gen_s, ) @@ -63,6 +66,7 @@ def build_tcp_profile(payload_size, src_ip, dst_ip, dst_port): template = ASTFTemplate( client_template=ASTFTCPClientTemplate( program=prog_c, + ip_gen=ip_gen, port=dst_port, ), server_template=ASTFTCPServerTemplate(