aboutsummaryrefslogtreecommitdiffstats
path: root/GPL/tools/trex
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2022-04-25 10:22:05 +0200
committerVratko Polak <vrpolak@cisco.com>2022-05-03 15:23:47 +0000
commit1daa6fdc0bae284dee1b61f34534e59b60b7526a (patch)
tree6314e011a8f029c4332586d5fd05b51d1a69a89c /GPL/tools/trex
parentcd417be7f836eb9346fad4f87bd4f75dc1d9a429 (diff)
feat(astf): Support framesizes for ASTF
- No support for IMIX. + Fix a bad bug in padding (most ASTF profiles had wrong frame sizes). + Fix a big typo in TCP PPS profiles (s->c was not data, just RST). + Control transaction size via ASTF_N_DATA_FRAMES env variable. - Default value 5 leads to transactions smaller than before. + It ensures transaction is one burst (per direction) even for jumbo. + Edit autogen to set supported frame sizes based on suite id. + Both TCP and UDP use the same values: + 64B for CPS (exact for UDP, nominal for TCP). + 100B, 1518B and 9000B for TPUT and PPS. - TCP TPUT achievable minimum is 70B. + Used 100B to leave room for possible IPv6 ASTF tests. + Separate function for code reused by vpp and trex tests. - I do not really like the new "copy and edit" approach added here. + But it is a quick edit, better autogen refactor is low priority. + Consider both established and transitory sessions as valid. - Mostly for compatibility with 2202 behavior and to avoid ramp-ups. - Assuming both session states have similar enough VPP CPU overhead. + Added a TODO to investigate and maybe reconsider later. + Update the state timeout value to 240s. + That is the default for TCP (for transitory state). - UDP could keep using 300s. + But I prefer UDP and TCP to behave as similarly as possible. + Use TRex tunables to get the exact frame size (for data packets). - It is not clear why the recipe for MSS has to be this complicated. + Move code away from profile init, as frame size is not known there. + Change internal profile API, so values related to MSS are passed. + Lower ramp-up rate for TCP TPUT tests. + Because without lower rate, jumbo fails on packet loss in ramp-up. + UDP TPUT ramp-up rate also lowered (just to keep suites more similar). + Distinguish one-direction and aggregated average frame size. + Update keyword documentation where the distiction matters. + One-direction is needed for turning bandwidth limit to TPS limit. + Aggregated is needed for correct NDRPDR bandwidth result value. - TCP TPUT will always be few percent below bidirectional maximum. + That is unavoidable, as one direction sends more control packets. + Add runtime consistency checks so future refactors are safer. + Fail if padding requested would be negative. + Fail if suite claims unexpected values for packets per transaction. + Edit the 4 types of ASTF profiles to keep them similar to each other. + Move UDP TPUT limit value from a field back to direct argument. + Stop pretending first UDP packet is not data. + Apply small improvements where convenient. + Replace "aggregate" with "aggregated" where possible. + To lower probability of any future typos in variable names. + Avoid calling Set Numeric Frame Sizes twice. + Code formatting, keyword documentation, code comments, ... + Add TODOs for less important code quality improvements. - Postpone updating of methodology pages to a subsequent change. Change-Id: I4b381e5210e69669f972326202fdcc5a2c9c923b Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'GPL/tools/trex')
-rw-r--r--GPL/tools/trex/trex_astf_profile.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/GPL/tools/trex/trex_astf_profile.py b/GPL/tools/trex/trex_astf_profile.py
index 193ff21185..a2d177fdea 100644
--- a/GPL/tools/trex/trex_astf_profile.py
+++ b/GPL/tools/trex/trex_astf_profile.py
@@ -1,6 +1,6 @@
#!/usr/bin/python3
-# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2022 Cisco and/or its affiliates.
#
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
@@ -73,6 +73,7 @@ def simple_burst(
profile_file,
duration,
framesize,
+ n_data_frames,
multiplier,
port_0,
port_1,
@@ -115,6 +116,7 @@ def simple_burst(
:param duration: Expected duration for all transactions to finish,
without any TRex related delays, without even latency.
:param framesize: Frame size.
+ :param n_data_frames: Controls "size" of transaction for TPUT tests.
:param multiplier: Multiplier of profile CPS.
:param port_0: Port 0 on the traffic generator.
:param port_1: Port 1 on the traffic generator.
@@ -125,6 +127,7 @@ def simple_burst(
:type profile_file: str
:type duration: float
:type framesize: int or str
+ :type n_data_frames: int
:type multiplier: int
:type port_0: int
:type port_1: int
@@ -151,7 +154,11 @@ def simple_burst(
# TODO: key-values pairs to the profile file
# - ips ?
print(f"### Profile file:\n{profile_file}")
- profile = ASTFProfile.load(profile_file, framesize=framesize)
+ profile = ASTFProfile.load(
+ profile_file,
+ framesize=framesize,
+ n_data_frames=n_data_frames,
+ )
except TRexError:
print(f"Error while loading profile '{profile_file}'!")
raise
@@ -416,6 +423,10 @@ def main():
help=u"Size of a Frame without padding and IPG."
)
parser.add_argument(
+ u"--n_data_frames", type=int, default=5,
+ help=u"Use this many data frames per transaction and direction (TPUT)."
+ )
+ parser.add_argument(
u"-m", u"--multiplier", required=True, type=float,
help=u"Multiplier of profile CPS."
)
@@ -455,6 +466,7 @@ def main():
profile_file=args.profile,
duration=args.duration,
framesize=framesize,
+ n_data_frames=args.n_data_frames,
multiplier=args.multiplier,
port_0=args.port_0,
port_1=args.port_1,