diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-05-10 11:36:55 +0300 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-05-10 11:36:55 +0300 |
commit | ba731d02eadc3c2f0c13493e518a167d199b41e7 (patch) | |
tree | 7072da51cadda5cec2f5c468f99aa417177a61e3 | |
parent | 5b412d097ac7f26e8504364758e1e0d3344de4c7 (diff) |
hltapi: use flow_stats only for ipv4 packets, add flag to disable flow_stats, add argument for custom flow_stat id for use in profiles.
-rwxr-xr-x | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py index 0afeff20..33a7b3af 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py @@ -23,7 +23,9 @@ traffic_config_kwargs = { 'split_by_cores': 'split', # ( split | duplicate | single ) TRex extention: split = split traffic by cores, duplicate = duplicate traffic for all cores, single = run only with sinle core (not implemented yet) 'load_profile': None, # TRex extention: path to filename with stream profile (stream builder parameters will be ignored, limitation: modify) 'consistent_random': False, # TRex extention: False (default) = random sequence will be different every run, True = random sequence will be same every run - 'ignore_macs': False, # TRex extention: True = use MACs from server configuration , no MAC VM (workaround on lack of ARP) + 'ignore_macs': False, # TRex extention: True = use MACs from server configuration, no MAC VM (workaround on lack of ARP) + 'disable_flow_stats': False, # TRex extention: True = don't use flow stats for this stream, (workaround for limitation on type of packet for flow_stats) + 'flow_stats_id': None, # TRex extention: uint, for use of STLHltStream, specifies id for flow stats (see stateless manual for flow_stats details) 'port_handle': None, 'port_handle2': None, 'bidirectional': False, @@ -446,7 +448,7 @@ class CTRexHltApi(object): kwargs = merge_kwargs(traffic_config_kwargs, user_kwargs) stream_id = kwargs['stream_id'] mode = kwargs['mode'] - pg_id = None + pg_id = kwargs['flow_stats_id'] port_handle = port_list = self._parse_port_list(kwargs['port_handle']) ALLOWED_MODES = ['create', 'modify', 'remove', 'enable', 'disable', 'reset'] @@ -864,7 +866,10 @@ def STLHltStream(**user_kwargs): raise STLError('Could not create transmit_mode object %s: %s' % (transmit_mode, e if isinstance(e, STLError) else traceback.format_exc())) try: - pg_id = kwargs.get('pg_id') + if kwargs['l3_protocol'] == 'ipv4' and not kwargs['disable_flow_stats']: + pg_id = kwargs.get('pg_id', kwargs.get('flow_stats_id')) + else: + pg_id = None stream = STLStream(packet = packet, random_seed = 1 if is_true(kwargs['consistent_random']) else 0, #enabled = True, |