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
1 change: 1 addition & 0 deletions scripts/perf-tests/test/test_run_perf_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 =="
Expand Down
6 changes: 5 additions & 1 deletion scripts/perf-tests/trex/run_tcp_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from trex.astf.api import ASTFClient, ASTFProfile
from trex.astf.trex_astf_profile import (
ASTFIPGenDist,
ASTFIPGenGlobal,
ASTFIPGen,
ASTFTCPClientTemplate,
ASTFTCPServerTemplate,
Expand All @@ -54,15 +55,18 @@ 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,
)

template = ASTFTemplate(
client_template=ASTFTCPClientTemplate(
program=prog_c,
ip_gen=ip_gen,
port=dst_port,
),
server_template=ASTFTCPServerTemplate(
Expand Down
Loading