aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-03-14 12:54:39 +0000
committerMartin Klozik <martinx.klozik@intel.com>2017-03-24 08:06:45 +0000
commit725033715118bc318fdd6aa3745c2c07ca714086 (patch)
treebae5202a755c6a21d59cb17277b469167e35baeb
parent0ccb44ca1f90200a2e41f25fcf499074c819002d (diff)
multistream: Support huge number of streams
Restriction of 64K streams was limited only to L4 stream type. In case of L3 and L2 stream type, it is possible to define unlimited number of streams to be simulated by traffic generator. JIRA: VSPERF-498 Change-Id: I4ce3253299473127d135c01543999a8593b9556f Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Bill Michalowski <bmichalo@redhat.com> Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com> Reviewed-by: Trevor Cooper <trevor.cooper@intel.com>
-rw-r--r--3rd_party/ixia/ixnetrfc2544.tcl4
-rwxr-xr-x3rd_party/ixia/ixnetrfc2544v2.tcl8
-rwxr-xr-xconf/01_testcases.conf4
-rw-r--r--conf/03_traffic.conf5
-rw-r--r--core/vswitch_controller_p2p.py8
-rw-r--r--docs/testing/developer/design/vswitchperf_design.rst3
-rw-r--r--testcases/testcase.py2
-rw-r--r--tools/functions.py14
-rwxr-xr-xvsperf2
9 files changed, 32 insertions, 18 deletions
diff --git a/3rd_party/ixia/ixnetrfc2544.tcl b/3rd_party/ixia/ixnetrfc2544.tcl
index faab5a68..5dccae3f 100644
--- a/3rd_party/ixia/ixnetrfc2544.tcl
+++ b/3rd_party/ixia/ixnetrfc2544.tcl
@@ -1,7 +1,7 @@
#!/usr/bin/env tclsh
# Copyright (c) 2014, Ixia
-# Copyright (c) 2015-2016, Intel Corporation
+# Copyright (c) 2015-2017, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -120,8 +120,6 @@ proc startRfc2544Test { testSpec trafficSpec } {
if {($multipleStreams < 0)} {
set multipleStreams 0
- } elseif {($multipleStreams > 65535)} {
- set multipleStreams 65535
}
if {$multipleStreams} {
diff --git a/3rd_party/ixia/ixnetrfc2544v2.tcl b/3rd_party/ixia/ixnetrfc2544v2.tcl
index cc5a6946..5758f0e4 100755
--- a/3rd_party/ixia/ixnetrfc2544v2.tcl
+++ b/3rd_party/ixia/ixnetrfc2544v2.tcl
@@ -1,7 +1,7 @@
#!/usr/bin/env tclsh
# Copyright (c) 2014, Ixia
-# Copyright (c) 2015-2016, Intel Corporation
+# Copyright (c) 2015-2017, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -115,11 +115,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
set numflows 64000
if {$multipleStreams} {
- if {($multipleStreams > 65535)} {
- set numflows 65535
- } else {
- set numflows $multipleStreams
- }
+ set numflows $multipleStreams
set multipleStreams increment
} else {
set multipleStreams singleValue
diff --git a/conf/01_testcases.conf b/conf/01_testcases.conf
index 4851b043..2d5ab93e 100755
--- a/conf/01_testcases.conf
+++ b/conf/01_testcases.conf
@@ -1,4 +1,4 @@
-# Copyright 2015-2016 Intel Corporation.
+# Copyright 2015-2017 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -270,7 +270,7 @@ PERFORMANCE_TESTS = [
"Parameters" : {
"TRAFFIC" : {
"traffic_type" : "rfc2544_throughput",
- "multistream" : "8000",
+ "multistream" : 8000,
},
},
},
diff --git a/conf/03_traffic.conf b/conf/03_traffic.conf
index ccc98e3b..baded627 100644
--- a/conf/03_traffic.conf
+++ b/conf/03_traffic.conf
@@ -1,4 +1,4 @@
-# Copyright 2015 Intel Corporation.
+# Copyright 2015-2017 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -39,7 +39,8 @@ LOG_FILE_TRAFFIC_GEN = 'traffic-gen.log'
# 'multistream' - Defines number of flows simulated by traffic generator.
# Value 0 disables multistream feature
# Data type: int
-# Supported values: 0-65535
+# Supported values: 0-65536 for 'L4' stream type
+# unlimited for 'L2' and 'L3' stream types
# Default value: 0.
# 'stream_type' - Stream type is an extension of the "multistream" feature.
# If multistream is disabled, then stream type will be
diff --git a/core/vswitch_controller_p2p.py b/core/vswitch_controller_p2p.py
index de3fcc0d..0d41b145 100644
--- a/core/vswitch_controller_p2p.py
+++ b/core/vswitch_controller_p2p.py
@@ -1,4 +1,4 @@
-# Copyright 2015 Intel Corporation.
+# Copyright 2015-2017 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -147,7 +147,7 @@ class VswitchControllerP2P(IVswitchController):
if self._traffic['stream_type'] == 'L2':
# iterate through destimation MAC address
dst_mac_value = netaddr.EUI(self._traffic['l2']['dstmac']).value
- for i in range(int(self._traffic['multistream'])):
+ for i in range(self._traffic['multistream']):
tmp_mac = netaddr.EUI(dst_mac_value + i)
tmp_mac.dialect = netaddr.mac_unix_expanded
flow_template.update({'dl_dst':tmp_mac})
@@ -156,7 +156,7 @@ class VswitchControllerP2P(IVswitchController):
elif self._traffic['stream_type'] == 'L3':
# iterate through destimation IP address
dst_ip_value = netaddr.IPAddress(self._traffic['l3']['dstip']).value
- for i in range(int(self._traffic['multistream'])):
+ for i in range(self._traffic['multistream']):
tmp_ip = netaddr.IPAddress(dst_ip_value + i)
flow_template.update({'dl_type':'0x0800', 'nw_dst':tmp_ip})
# optimize flow insertion by usage of cache
@@ -164,7 +164,7 @@ class VswitchControllerP2P(IVswitchController):
elif self._traffic['stream_type'] == 'L4':
# read transport protocol from configuration and iterate through its destination port
proto = _PROTO_TCP if self._traffic['l3']['proto'].lower() == 'tcp' else _PROTO_UDP
- for i in range(int(self._traffic['multistream'])):
+ for i in range(self._traffic['multistream']):
flow_template.update({'dl_type':'0x0800', 'nw_proto':proto, 'tp_dst':i})
# optimize flow insertion by usage of cache
self._vswitch.add_flow(bridge, flow_template, cache='on')
diff --git a/docs/testing/developer/design/vswitchperf_design.rst b/docs/testing/developer/design/vswitchperf_design.rst
index 34f2b227..aa7fb342 100644
--- a/docs/testing/developer/design/vswitchperf_design.rst
+++ b/docs/testing/developer/design/vswitchperf_design.rst
@@ -305,7 +305,8 @@ Detailed description of ``TRAFFIC`` dictionary items follows:
'multistream' - Defines number of flows simulated by traffic generator.
Value 0 disables multistream feature
Data type: int
- Supported values: 0-65535
+ Supported values: 0-65536 for 'L4' stream type
+ unlimited for 'L2' and 'L3' stream types
Default value: 0.
'stream_type' - Stream type is an extension of the "multistream" feature.
If multistream is disabled, then stream type will be
diff --git a/testcases/testcase.py b/testcases/testcase.py
index 4fbf9c04..d17abb61 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -139,6 +139,8 @@ class TestCase(object):
self._traffic.update({'bidir': bidirectional,
'tunnel_type': self._tunnel_type,})
+ self._traffic = functions.check_traffic(self._traffic)
+
# Packet Forwarding mode
self._vswitch_none = S.getValue('VSWITCH').strip().lower() == 'none'
diff --git a/tools/functions.py b/tools/functions.py
index d00200d9..05bde54f 100644
--- a/tools/functions.py
+++ b/tools/functions.py
@@ -21,6 +21,8 @@ import glob
import shutil
from conf import settings as S
+MAX_L4_FLOWS = 65536
+
#
# Support functions
#
@@ -139,3 +141,15 @@ def settings_update_paths():
tools['dpdk_src'] = S.getValue('PATHS')['dpdk']['src']['path']
S.setValue('TOOLS', tools)
+
+def check_traffic(traffic):
+ """Check traffic definition and correct it if needed.
+ """
+ # in case of UDP ports we have only 65536 (0-65535) unique options
+ if traffic['multistream'] > MAX_L4_FLOWS and \
+ traffic['stream_type'] == 'L4':
+ logging.getLogger().warning('Requested amount of L4 flows %s is bigger than '
+ 'number of transport protocol ports. It was set '
+ 'to %s.', traffic['multistream'], MAX_L4_FLOWS)
+ traffic['multistream'] = MAX_L4_FLOWS
+ return traffic
diff --git a/vsperf b/vsperf
index fea7997b..da6d15e4 100755
--- a/vsperf
+++ b/vsperf
@@ -626,6 +626,8 @@ def main():
# set traffic details, so they can be passed to traffic ctl
traffic = copy.deepcopy(settings.getValue('TRAFFIC'))
+ traffic = functions.check_traffic(traffic)
+
traffic_ctl = component_factory.create_traffic(
traffic['traffic_type'],
loader.get_trafficgen_class())