bugfix: Trafficgen Ixia does not work 77/23977/1
authorMartin Klozik <martinx.klozik@intel.com>
Thu, 3 Nov 2016 15:57:10 +0000 (15:57 +0000)
committerMartin Klozik <martinx.klozik@intel.com>
Fri, 4 Nov 2016 13:08:53 +0000 (13:08 +0000)
IXIA traffic generator can be controlled by two different
VSPERF's wrappers IxNet (preferred) and Ixia (legacy and
outdated). It has been found, that Ixia wrapper can't be used
because of missing "packetsize" traffic item. Also only
IXIA OS 6.60 was supported and never IXIA OS versions
were not working. Both limitations were fixed.
Also reported results were fixed to show correct values
for MBPS items.

JIRA: VSPERF-417

Change-Id: I191aa9fee2683877ce373b6aa7cd1c72e9847568
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: Christo Kleu <christo.kleu@netronome.com>
3rd_party/ixia/pass_fail.tcl
conf/10_custom.conf
tools/pkt_gen/ixia/ixia.py
tools/systeminfo.py

index 79b7f10..0a5a767 100755 (executable)
@@ -422,7 +422,11 @@ proc sendTraffic { flowSpec trafficSpec } {
         udp setDefault
         udp config -sourcePort                            $srcPort
         udp config -destPort                              $dstPort
-        set packetSize               [dict get $trafficSpec_l3 packetsize]
+        if {[dict exists $trafficSpec_l3 packetsize]} {
+            set packetSize               [dict get $trafficSpec_l3 packetsize]
+        } else {
+            set packetSize               $frameSize
+        }
         stream config -framesize                          $packetSize
         if {[udp set $::chassis $::card $::port1]} {
             errorMsg "Error setting udp on port $::chassis.$::card.$::port1"
index b370714..25e3478 100644 (file)
@@ -47,7 +47,7 @@ TRAFFICGEN_STC_WEST_INTF_GATEWAY_ADDR = "192.85.1.3"
 TRAFFICGEN_IXIA_CARD = ''
 TRAFFICGEN_IXIA_PORT1 = ''
 TRAFFICGEN_IXIA_PORT2 = ''
-TRAFFICGEN_IXIA_LIB_PATH = '/opt/ixos/lib/ixTcl1.0'
+TRAFFICGEN_IXIA_ROOT_DIR = '/opt/ixos'
 TRAFFICGEN_IXNET_LIB_PATH = '/opt/ixnet/IxTclNetwork'
 
 # Ixia traffic generator
index e36517d..5c5fb3d 100755 (executable)
@@ -19,7 +19,7 @@ lifting".
 
 This requires the following settings in your config file:
 
-* TRAFFICGEN_IXIA_LIB_PATH
+* TRAFFICGEN_IXIA_ROOT_DIR
     IXIA libraries path
 * TRAFFICGEN_IXIA_HOST
     IXIA chassis IP address
@@ -39,6 +39,7 @@ import logging
 import os
 
 from collections import OrderedDict
+from tools import systeminfo
 from tools.pkt_gen import trafficgen
 from conf import settings
 from core.results.results_constants import ResultsConstants
@@ -76,7 +77,7 @@ def configure_env():
     os.environ['IXIA_LOGS_DIR'] = '/tmp/Ixia/Logs'
     os.environ['IXIA_TCL_DIR'] = os.path.expandvars('$IxiaLibPath')
     os.environ['IXIA_SAMPLES'] = os.path.expandvars('$IxiaLibPath/ixTcl1.0')
-    os.environ['IXIA_VERSION'] = '6.60.1000.11'
+    os.environ['IXIA_VERSION'] = systeminfo.get_version('Ixia')['version']
 
 
 def _build_set_cmds(values, prefix='dict set'):
@@ -299,8 +300,8 @@ class Ixia(trafficgen.ITrafficGenerator):
         # metrics so we have to return dummy values for these metrics
         result_dict[ResultsConstants.THROUGHPUT_RX_FPS] = result[4]
         result_dict[ResultsConstants.TX_RATE_FPS] = result[5]
-        result_dict[ResultsConstants.THROUGHPUT_RX_MBPS] = result[6]
-        result_dict[ResultsConstants.TX_RATE_MBPS] = result[7]
+        result_dict[ResultsConstants.THROUGHPUT_RX_MBPS] = str(round(int(result[6]) / 1000000, 3))
+        result_dict[ResultsConstants.TX_RATE_MBPS] = str(round(int(result[7]) / 1000000, 3))
         result_dict[ResultsConstants.FRAME_LOSS_PERCENT] = loss_rate
         result_dict[ResultsConstants.TX_RATE_PERCENT] = \
                                             ResultsConstants.UNKNOWN_VALUE
index fb1616d..1d19315 100644 (file)
@@ -228,6 +228,7 @@ def get_version(app_name):
         'loopback_testpmd' : os.path.join(S.getValue('TOOLS')['dpdk_src'],
                                           'lib/librte_eal/common/include/rte_version.h'),
         'ixnet' : os.path.join(S.getValue('TRAFFICGEN_IXNET_LIB_PATH'), 'pkgIndex.tcl'),
+        'ixia' : os.path.join(S.getValue('TRAFFICGEN_IXIA_ROOT_DIR'), 'lib/ixTcl1.0/ixTclHal.tcl'),
     }
 
 
@@ -301,6 +302,10 @@ def get_version(app_name):
         app_version = match_line(app_version_file['ixnet'], 'package provide IxTclNetwork')
         if app_version:
             app_version = app_version.split(' ')[3]
+    elif app_name.lower() == 'ixia':
+        app_version = match_line(app_version_file['ixia'], 'package provide IxTclHal')
+        if app_version:
+            app_version = app_version.split(' ')[3]
     elif app_name.lower() == 'xena':
         try:
             app_version = S.getValue('XENA_VERSION')