bugfix of Vanilla OVS testing scenarios 85/2785/3
authorMartin Klozik <martinx.klozik@intel.com>
Mon, 19 Oct 2015 16:38:52 +0000 (17:38 +0100)
committerMartin Klozik <martinx.klozik@intel.com>
Tue, 3 Nov 2015 10:27:09 +0000 (10:27 +0000)
Automatic selection of OVS and DPDK directories must be performed
before initialization of modules is called. Otherwise modules will
use wrong values with unpredictable results.
Default directory values have been changed to point to sources build
by make.
Clean&sweep of directory usage was performed.
Configuration file for pylint has been renamed to follow pylint
naming convention.

Change-Id: I42c89f8890c021f0062b478a856ae0113f1245fb
JIRA: VSPERF-121
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Billy O Mahony <billy.o.mahony@intel.com>
Reviewed-by: Brian Castelli <brian.castelli@spirent.com>
Reviewed-by: Gene Snider <eugene.snider@huawei.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Tv Rao <tv.rao@freescale.com>
conf/00_common.conf
conf/02_vswitch.conf
conf/04_vnf.conf
conf/10_custom.conf
docs/to-be-reorganized/quickstart.rst
pylintrc [moved from pylint.rc with 95% similarity]
src/ovs/daemon.py
src/ovs/ofctl.py
vsperf
vswitches/ovs_dpdk_vhost.py

index f9782c6..225cf47 100644 (file)
@@ -27,6 +27,18 @@ ROOT_DIR = os.path.normpath(os.path.join(
 TRAFFICGEN_DIR = os.path.join(ROOT_DIR, 'tools/pkt_gen')
 SYSMETRICS_DIR = os.path.join(ROOT_DIR, 'tools/collectors')
 
+# deployment specific paths to OVS and DPDK
+OVS_DIR_VANILLA  = os.path.join(ROOT_DIR, 'src_vanilla/ovs/ovs/')
+
+RTE_SDK_CUSE  = os.path.join(ROOT_DIR, 'src_cuse/dpdk/dpdk/')
+OVS_DIR_CUSE  = os.path.join(ROOT_DIR, 'src_cuse/ovs/ovs/')
+
+RTE_SDK_USER  = os.path.join(ROOT_DIR, 'src/dpdk/dpdk/')
+OVS_DIR_USER  = os.path.join(ROOT_DIR, 'src/ovs/ovs/')
+
+# the same qemu version is used for vanilla, vHost User and Cuse
+QEMU_DIR = os.path.join(ROOT_DIR, 'src/qemu/qemu/')
+
 # ############################
 # Process configuration
 # ############################
index 32f4c0e..f56548f 100644 (file)
 # limitations under the License.
 
 # ############################
-# vswitch configuration
+# Directories
 # ############################
-RTE_SDK = '~/dpdk'
-OVS_DIR = '~/openvswitch'
+# use DPDK VHOST USER by default
+RTE_SDK = RTE_SDK_USER
+OVS_DIR = OVS_DIR_USER
+
+OVS_VAR_DIR = '/usr/local/var/run/openvswitch/'
+OVS_ETC_DIR = '/usr/local/etc/openvswitch/'
+
+VSWITCH_DIR = os.path.join(ROOT_DIR, 'vswitches')
 
 # ############################
 # DPDK configuration
@@ -34,13 +40,38 @@ WHITELIST_NICS = ['05:00.0', '05:00.1']
 BLACKLIST_NICS = ['0000:09:00.0', '0000:09:00.1', '0000:09:00.2',
                   '0000:09:00.3']
 
+# for DPDK_MODULES the path is in reference to the build directory
+DPDK_MODULES = [
+    ('kmod', 'igb_uio'),
+]
+
+VHOST_MODULE = [
+    ('eventfd_link', 'eventfd_link')
+]
+
+# list of modules that will be inserted using 'modprobe' on system init
+SYS_MODULES = ['uio', 'cuse']
+
+# vhost character device file used by dpdkvhostport QemuWrap cases
+VHOST_DEV_FILE = 'ovs-vhost-net'
+
+# location of vhost-user sockets
+VHOST_USER_SOCKS = ['/tmp/dpdkvhostuser0', '/tmp/dpdkvhostuser1',
+                    '/tmp/dpdkvhostuser2', '/tmp/dpdkvhostuser3',
+                    '/tmp/myport0', '/tmp/helloworld123', '/tmp/abcstuff0']
+
+# ############################
+# vswitch configuration
+# ############################
 # These are DPDK EAL parameters and they may need to be changed depending on
 # hardware configuration, like cpu numbering and NUMA.
 VSWITCHD_DPDK_ARGS = ['-c', '0x4', '-n', '4', '--socket-mem 1024,0']
 
 VSWITCHD_VANILLA_ARGS = ['--pidfile']
 VSWITCH_VANILLA_PHY_PORT_NAMES = ['', '']
-VSWITCH_VANILLA_KERNEL_MODULES = ['openvswitch']
+
+# use full module path to load module matching OVS version built from the source
+VSWITCH_VANILLA_KERNEL_MODULES = [os.path.join(ROOT_DIR, 'datapath/linux/openvswitch.ko')]
 
 # Bridge name to be used by VSWTICH
 VSWITCH_BRIDGE_NAME = 'br0'
@@ -60,35 +91,11 @@ VSWITCH_FLOW_TIMEOUT = '30000'
 # for OVS modules the path is in reference to the OVS directory.
 OVS_MODULES = []
 
-# for DPDK_MODULES the path is in reference to the build directory
-DPDK_MODULES = [
-    ('kmod', 'igb_uio'),
-]
-
-VHOST_MODULE = [
-    ('eventfd_link', 'eventfd_link')
-]
-
-# list of modules that will be inserted using 'modprobe' on system init
-SYS_MODULES = ['uio', 'cuse']
-
-# vhost character device file used by dpdkvhostport QemuWrap cases
-VHOST_DEV_FILE = 'ovs-vhost-net'
-
-# location of vhost-user sockets
-VHOST_USER_SOCKS = ['/tmp/dpdkvhostuser0', '/tmp/dpdkvhostuser1',
-                    '/tmp/dpdkvhostuser2', '/tmp/dpdkvhostuser3',
-                    '/tmp/myport0', '/tmp/helloworld123', '/tmp/abcstuff0']
-
 # log file for ovs-vswitchd
 LOG_FILE_VSWITCHD = 'vswitchd.log'
 
 # log file for ovs-dpdk
 LOG_FILE_OVS = 'ovs.log'
 
-VSWITCH_DIR = os.path.join(ROOT_DIR, 'vswitches')
+# default vswitch implementation
 VSWITCH = "OvsDpdkVhost"
-
-# Use vhost user or vhost cuse
-# Set to cuse if you want to test vhostcuse
-VHOST_METHOD = 'user'
index 52cc6ec..1059482 100644 (file)
@@ -57,9 +57,7 @@ LOG_FILE_GUEST_CMDS = 'guest-cmds.log'
 # Executables
 # ############################
 
-QEMU_BIN = 'qemu-system-x86_64'
-
-OVS_VAR_DIR = '/usr/local/var/run/openvswitch/'
+QEMU_BIN = os.path.join(QEMU_DIR, 'x86_64-softmmu/qemu-system-x86_64')
 
 # For 2 VNFs you may use ['00:00:00:00:00:01', '00:00:00:00:00:03']
 GUEST_NET1_MAC = ['00:00:00:00:00:01', '00:00:00:00:00:03']
index f42df2d..3f98d54 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Operational settings for various resources
-OVS_DIR_VANILLA  = '~/src_vanilla/ovs/'
-QEMU_DIR_VANILLA = '~/src_vanilla/qemu/'
-
-RTE_SDK_CUSE  = '~/src_cuse/dpdk/'
-OVS_DIR_CUSE  = '~/src_cuse/ovs/'
-QEMU_DIR_CUSE = '~/src_cuse/qemu/'
-
-RTE_SDK_USER  = '~/src/dpdk/'
-OVS_DIR_USER  = '~/src/ovs/'
-QEMU_DIR_USER = '~/src/qemu/'
 RTE_TARGET = '' # the relevant DPDK build target
 
 # traffic generator to use in tests
index bcf0f7c..2a071d4 100644 (file)
@@ -306,7 +306,7 @@ Example of manual pylint invocation:
 
   .. code-block:: console
 
-          pylint --rcfile ./pylint.rc ./vsperf
+          pylint --rcfile ./pylintrc ./vsperf
 
 GOTCHAs:
 --------
similarity index 95%
rename from pylint.rc
rename to pylintrc
index f748ada..cd9d65c 100644 (file)
--- a/pylint.rc
+++ b/pylintrc
@@ -1,3 +1,17 @@
+# Copyright 2015 Intel Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 [MASTER]
 
 # Specify a configuration file.
index 0d518ea..0973560 100644 (file)
@@ -31,8 +31,8 @@ _OVSDB_TOOL_BIN = os.path.join(
 _OVSDB_SERVER_BIN = os.path.join(
     settings.getValue('OVS_DIR'), 'ovsdb', 'ovsdb-server')
 
-_OVS_VAR_DIR = '/usr/local/var/run/openvswitch/'
-_OVS_ETC_DIR = '/usr/local/etc/openvswitch/'
+_OVS_VAR_DIR = settings.getValue('OVS_VAR_DIR')
+_OVS_ETC_DIR = settings.getValue('OVS_ETC_DIR')
 
 _LOG_FILE_VSWITCHD = os.path.join(
     settings.getValue('LOG_DIR'), settings.getValue('LOG_FILE_VSWITCHD'))
index 2aae1ec..c052f85 100644 (file)
@@ -32,8 +32,6 @@ _OVS_VSCTL_BIN = os.path.join(settings.getValue('OVS_DIR'), 'utilities',
 _OVS_OFCTL_BIN = os.path.join(settings.getValue('OVS_DIR'), 'utilities',
                               'ovs-ofctl')
 
-_OVS_VAR_DIR = '/usr/local/var/run/openvswitch/'
-
 _OVS_BRIDGE_NAME = settings.getValue('VSWITCH_BRIDGE_NAME')
 
 class OFBase(object):
diff --git a/vsperf b/vsperf
index 7a44265..e220e24 100755 (executable)
--- a/vsperf
+++ b/vsperf
@@ -286,6 +286,24 @@ def main():
     # than both a settings file and environment variables
     settings.load_from_dict(args)
 
+    # set dpdk and ovs paths accorfing to VNF and VSWITCH
+    if settings.getValue('VSWITCH').endswith('Vanilla'):
+        # settings paths for Vanilla
+        settings.setValue('OVS_DIR', (settings.getValue('OVS_DIR_VANILLA')))
+    elif settings.getValue('VSWITCH').endswith('Vhost'):
+        if settings.getValue('VNF').endswith('Cuse'):
+            # settings paths for Cuse
+            settings.setValue('RTE_SDK', (settings.getValue('RTE_SDK_CUSE')))
+            settings.setValue('OVS_DIR', (settings.getValue('OVS_DIR_CUSE')))
+        else:
+            # settings paths for VhostUser
+            settings.setValue('RTE_SDK', (settings.getValue('RTE_SDK_USER')))
+            settings.setValue('OVS_DIR', (settings.getValue('OVS_DIR_USER')))
+    else:
+        # default - set to VHOST USER but can be changed during enhancement
+        settings.setValue('RTE_SDK', (settings.getValue('RTE_SDK_USER')))
+        settings.setValue('OVS_DIR', (settings.getValue('OVS_DIR_USER')))
+
     configure_logging(settings.getValue('VERBOSITY'))
     logger = logging.getLogger()
 
@@ -388,28 +406,6 @@ def main():
         logger.error("No tests matched --test option or positional args. Done.")
         sys.exit(1)
 
-    # set dpdk, ovs and qemu paths accorfing to VNF and VSWITCH
-    if settings.getValue('VSWITCH').endswith('Vanilla'):
-        # settings paths for Vanilla
-        settings.setValue('OVS_DIR', (settings.getValue('OVS_DIR_VANILLA')))
-        settings.setValue('QEMU_DIR', (settings.getValue('QEMU_DIR_VANILLA')))
-    elif settings.getValue('VSWITCH').endswith('Vhost'):
-        if settings.getValue('VNF').endswith('Cuse'):
-            # settings paths for Cuse
-            settings.setValue('RTE_SDK', (settings.getValue('RTE_SDK_CUSE')))
-            settings.setValue('OVS_DIR', (settings.getValue('OVS_DIR_CUSE')))
-            settings.setValue('QEMU_DIR', (settings.getValue('QEMU_DIR_CUSE')))
-        else:
-            # settings paths for VhostUser
-            settings.setValue('RTE_SDK', (settings.getValue('RTE_SDK_USER')))
-            settings.setValue('OVS_DIR', (settings.getValue('OVS_DIR_USER')))
-            settings.setValue('QEMU_DIR', (settings.getValue('QEMU_DIR_USER')))
-    else:
-        # default - set to VHOST USER but can be changed during enhancement
-        settings.setValue('RTE_SDK', (settings.getValue('RTE_SDK_USER')))
-        settings.setValue('OVS_DIR', (settings.getValue('OVS_DIR_USER')))
-        settings.setValue('QEMU_DIR', (settings.getValue('QEMU_DIR_USER')))
-
     # create results directory
     if not os.path.exists(results_path):
         logger.info("Creating result directory: "  + results_path)
index 553915b..cf60a5e 100644 (file)
@@ -22,7 +22,6 @@ from src.ovs import VSwitchd, OFBridge
 from src.dpdk import dpdk
 
 _VSWITCHD_CONST_ARGS = ['--', '--log-file']
-_VHOST_METHOD = settings.getValue('VHOST_METHOD')
 
 class OvsDpdkVhost(IVSwitch):
     """VSwitch implementation using DPDK and vhost ports