diff options
author | 2020-12-03 16:22:41 +0100 | |
---|---|---|
committer | 2021-01-09 07:44:12 +0100 | |
commit | b0ce00a62a7d10e8d1c68dd013f449345f43883e (patch) | |
tree | 2713d73b1e9e8ffe5dcad2d17e5a656eba4deaa0 /GPL/traffic_profiles/trex/profile_trex_stateless_base_class.py | |
parent | 7cb9c10b83b19aa68b5bd6486e269d570c2cbd01 (diff) |
perf: GENEVE tunnel test, l3 mode
Jira: CSIT-1768
Change-Id: I888ae1a5754fa07297d4cdf65c2be0e3e49d89a5
Signed-off-by: Jan Gelety <jgelety@cisco.com>
(cherry picked from commit 6962831a1f1905e50a3d663c0cf3ce8c2873ecc9)
Change-Id: I6496ae773b176b2abfedab843110d6f870c62888
Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'GPL/traffic_profiles/trex/profile_trex_stateless_base_class.py')
-rw-r--r-- | GPL/traffic_profiles/trex/profile_trex_stateless_base_class.py | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/GPL/traffic_profiles/trex/profile_trex_stateless_base_class.py b/GPL/traffic_profiles/trex/profile_trex_stateless_base_class.py index 9a81083092..7ded986d96 100644 --- a/GPL/traffic_profiles/trex/profile_trex_stateless_base_class.py +++ b/GPL/traffic_profiles/trex/profile_trex_stateless_base_class.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # @@ -23,7 +23,6 @@ """Base class for stream profiles for T-rex traffic generator. """ -import sys import socket import struct @@ -128,35 +127,39 @@ class TrafficStreamsBaseClass: # Frame size is defined as an integer, e.g. 64, 1518: if isinstance(self.framesize, int): - # Create a base packet and pad it to size - payload_len = max(0, self.framesize - len(base_pkt_a) - 4) # No FCS + # Create a base packet and pad it to size; deduct FCS + payload_len_a = max(0, self.framesize - len(base_pkt_a) - 4) + payload_len_b = max(0, self.framesize - len(base_pkt_b) - 4) # Direction 0 --> 1 pkt_a = STLPktBuilder( - pkt=base_pkt_a / self._gen_payload(payload_len), vm=vm1 + pkt=base_pkt_a / self._gen_payload(payload_len_a), vm=vm1 ) # Direction 1 --> 0 pkt_b = STLPktBuilder( - pkt=base_pkt_b / self._gen_payload(payload_len), vm=vm2 + pkt=base_pkt_b / self._gen_payload(payload_len_b), vm=vm2 ) # Packets for latency measurement: # Direction 0 --> 1 pkt_lat_a = STLPktBuilder( - pkt=base_pkt_a / self._gen_payload(payload_len), vm=vm1 + pkt=base_pkt_a / self._gen_payload(payload_len_a), vm=vm1 ) # Direction 1 --> 0 pkt_lat_b = STLPktBuilder( - pkt=base_pkt_b / self._gen_payload(payload_len), vm=vm2 + pkt=base_pkt_b / self._gen_payload(payload_len_b), vm=vm2 ) # Create the streams: # Direction 0 --> 1 - stream1 = STLStream(packet=pkt_a, mode=STLTXCont(pps=9000)) + stream1 = STLStream( + packet=pkt_a, mode=STLTXCont(pps=9000) + ) # Direction 1 --> 0 # second traffic stream with a phase of 10ns (inter-stream gap) - stream2 = STLStream(packet=pkt_b, isg=10.0, - mode=STLTXCont(pps=9000)) + stream2 = STLStream( + packet=pkt_b, isg=10.0, mode=STLTXCont(pps=9000) + ) # Streams for latency measurement: # Direction 0 --> 1 @@ -188,10 +191,12 @@ class TrafficStreamsBaseClass: # Create a base packet and pad it to size pkt_a = STLPktBuilder( pkt=base_pkt_a / self._gen_payload(payload_len_a), - vm=vm1) + vm=vm1 + ) pkt_b = STLPktBuilder( pkt=base_pkt_b / self._gen_payload(payload_len_b), - vm=vm2) + vm=vm2 + ) # Create the streams: stream1.append(STLStream( |