summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-08-18 14:25:57 +0300
committerimarom <imarom@cisco.com>2016-08-18 14:25:57 +0300
commitd455190c32093cab25c0de5d078cb96defab48a2 (patch)
treed44fddb15df828158e5b6a3d5df39d1632e0c843
parentb8353aa9eb017f66166da9ee03ad7cd09abda175 (diff)
previous commit was missing a file change
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py21
-rwxr-xr-xsrc/os_time.h2
2 files changed, 13 insertions, 10 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
index ee8e84cf..7101b8a2 100755
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
@@ -923,30 +923,32 @@ class STLClient(object):
def __decode_core_mask (self, ports, core_mask):
- validate_type('core_mask', core_mask, (int, list))
-
# predefined modes
if isinstance(core_mask, int):
if core_mask not in [self.CORE_MASK_PIN, self.CORE_MASK_SPLIT]:
raise STLError("'core_mask' can be either CORE_MASK_PIN, CORE_MASK_SPLIT or a list of masks")
- mask = {}
+ decoded_mask = {}
for port in ports:
# a pin mode was requested and we have
# the second port from the group in the start list
if (core_mask == self.CORE_MASK_PIN) and ( (port ^ 0x1) in ports ):
- mask[port] = 0x55555555 if( port % 2) == 0 else 0xAAAAAAAA
+ decoded_mask[port] = 0x55555555 if( port % 2) == 0 else 0xAAAAAAAA
else:
- mask[port] = None
+ decoded_mask[port] = None
- return mask
+ return decoded_mask
# list of masks
elif isinstance(core_mask, list):
if len(ports) != len(core_mask):
raise STLError("'core_mask' list must be the same length as 'ports' list")
+
+ decoded_mask = {}
+ for i, port in enumerate(ports):
+ decoded_mask[port] = core_mask[i]
- return core_mask
+ return decoded_mask
@@ -1990,10 +1992,11 @@ class STLClient(object):
validate_type('force', force, bool)
validate_type('duration', duration, (int, float))
validate_type('total', total, bool)
+ validate_type('core_mask', core_mask, (int, list))
#########################
# decode core mask argument
- core_mask = self.__decode_core_mask(ports, core_mask)
+ decoded_mask = self.__decode_core_mask(ports, core_mask)
#######################
# verify multiplier
@@ -2017,7 +2020,7 @@ class STLClient(object):
# start traffic
self.logger.pre_cmd("Starting traffic on port(s) {0}:".format(ports))
- rc = self.__start(mult_obj, duration, ports, force, core_mask)
+ rc = self.__start(mult_obj, duration, ports, force, decoded_mask)
self.logger.post_cmd(rc)
if not rc:
diff --git a/src/os_time.h b/src/os_time.h
index 4f10e2b5..a9bfa848 100755
--- a/src/os_time.h
+++ b/src/os_time.h
@@ -23,7 +23,7 @@ limitations under the License.
#include <stdint.h>
#include <time.h>
-
+#include "pal_utl.h"
uint32_t os_get_time_msec();
uint32_t os_get_time_freq();