X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=GPL%2Ftools%2Ftrex%2Ftrex_astf_profile.py;h=a2d177fdeaa734e4df0882a72ceb1c05940aaf4c;hp=193ff21185831a7c1d0be8588629164f6216a57c;hb=1daa6fdc0bae284dee1b61f34534e59b60b7526a;hpb=cd417be7f836eb9346fad4f87bd4f75dc1d9a429 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 @@ -415,6 +422,10 @@ def main(): u"-s", u"--frame_size", required=True, 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,