multistream: Support huge number of streams 31/30731/4
authorMartin Klozik <martinx.klozik@intel.com>
Tue, 14 Mar 2017 12:54:39 +0000 (12:54 +0000)
committerMartin Klozik <martinx.klozik@intel.com>
Fri, 24 Mar 2017 08:06:45 +0000 (08:06 +0000)
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>
3rd_party/ixia/ixnetrfc2544.tcl
3rd_party/ixia/ixnetrfc2544v2.tcl
conf/01_testcases.conf
conf/03_traffic.conf
core/vswitch_controller_p2p.py
docs/testing/developer/design/vswitchperf_design.rst
testcases/testcase.py
tools/functions.py
vsperf

index faab5a6..5dccae3 100644 (file)
@@ -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} {
index cc5a694..5758f0e 100755 (executable)
@@ -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
index 4851b04..2d5ab93 100755 (executable)
@@ -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,
             },
         },
     },
index ccc98e3..baded62 100644 (file)
@@ -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
index de3fcc0..0d41b14 100644 (file)
@@ -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')
index 34f2b22..aa7fb34 100644 (file)
@@ -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
index 4fbf9c0..d17abb6 100644 (file)
@@ -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'
 
index d00200d..05bde54 100644 (file)
@@ -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 fea7997..da6d15e 100755 (executable)
--- 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())