From 725033715118bc318fdd6aa3745c2c07ca714086 Mon Sep 17 00:00:00 2001
From: Martin Klozik <martinx.klozik@intel.com>
Date: Tue, 14 Mar 2017 12:54:39 +0000
Subject: 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>
---
 tools/functions.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

(limited to 'tools')

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
-- 
cgit