aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dpdk/dpdk.py51
-rw-r--r--src/dpdk/testpmd_proc.py6
-rw-r--r--src/ovs/dpctl.py5
-rw-r--r--src/ovs/ofctl.py22
-rw-r--r--src/package-list.mk6
5 files changed, 22 insertions, 68 deletions
diff --git a/src/dpdk/dpdk.py b/src/dpdk/dpdk.py
index bd9bb9cf..16223915 100644
--- a/src/dpdk/dpdk.py
+++ b/src/dpdk/dpdk.py
@@ -25,13 +25,11 @@ import subprocess
import logging
import glob
-from conf import settings
+from conf import settings as S
from tools import tasks
from tools.module_manager import ModuleManager
_LOGGER = logging.getLogger(__name__)
-RTE_PCI_TOOL = glob.glob(os.path.join(
- settings.getValue('RTE_SDK_USER'), 'tools', 'dpdk*bind.py'))[0]
_DPDK_MODULE_MANAGER = ModuleManager()
@@ -48,7 +46,7 @@ def init():
"""
global _NICS
global _NICS_PCI
- _NICS = settings.getValue('NICS')
+ _NICS = S.getValue('NICS')
_NICS_PCI = list(nic['pci'] for nic in _NICS)
if not _is_linux():
_LOGGER.error('Not running on a compatible Linux version. Exiting...')
@@ -91,18 +89,7 @@ def _insert_modules():
"""Ensure required modules are inserted on system.
"""
- _DPDK_MODULE_MANAGER.insert_modules(settings.getValue('SYS_MODULES'))
-
- mod_path_prefix = settings.getValue('OVS_DIR')
- _DPDK_MODULE_MANAGER.insert_module_group(settings.getValue('OVS_MODULES'),
- mod_path_prefix)
- if 'vfio-pci' not in settings.getValue('DPDK_MODULES'):
- mod_path_prefix = os.path.join(settings.getValue('RTE_SDK'),
- settings.getValue('RTE_TARGET'))
- _DPDK_MODULE_MANAGER.insert_module_group(settings.getValue('DPDK_MODULES'),
- mod_path_prefix)
- else:
- _DPDK_MODULE_MANAGER.insert_modules(settings.getValue('DPDK_MODULES'))
+ _DPDK_MODULE_MANAGER.insert_modules(S.getValue('TOOLS')['dpdk_modules'])
def _remove_modules():
"""Ensure required modules are removed from system.
@@ -110,26 +97,6 @@ def _remove_modules():
_DPDK_MODULE_MANAGER.remove_modules()
#
-# vhost specific modules management
-#
-
-def insert_vhost_modules():
- """Inserts VHOST related kernel modules
- """
- mod_path_prefix = os.path.join(settings.getValue('RTE_SDK'),
- 'lib',
- 'librte_vhost')
- _DPDK_MODULE_MANAGER.insert_module_group(settings.getValue('VHOST_MODULE'), mod_path_prefix)
-
-
-def remove_vhost_modules():
- """Removes all VHOST related kernel modules
- """
- # all modules are removed automatically by _remove_modules() method
- pass
-
-
-#
# 'vhost-net' module cleanup
#
@@ -150,7 +117,8 @@ def _remove_vhost_net():
def _vhost_user_cleanup():
"""Remove files created by vhost-user tests.
"""
- for sock in glob.glob(settings.getValue('VHOST_USER_SOCKS')):
+ for sock in glob.glob(os.path.join(S.getValue('TOOLS')['ovs_var_tmp'],
+ S.getValue('VHOST_USER_SOCKS'))):
if os.path.exists(sock):
try:
tasks.run_task(['sudo', 'rm', sock],
@@ -173,7 +141,7 @@ def _bind_nics():
"""
try:
_driver = 'igb_uio'
- if 'vfio-pci' in settings.getValue('DPDK_MODULES'):
+ if 'vfio-pci' in S.getValue('TOOLS')['dpdk_modules']:
_driver = 'vfio-pci'
tasks.run_task(['sudo', 'chmod', 'a+x', '/dev/vfio'],
_LOGGER, 'Setting VFIO permissions .. a+x',
@@ -182,7 +150,8 @@ def _bind_nics():
_LOGGER, 'Setting VFIO permissions .. 0666',
True)
- tasks.run_task(['sudo', RTE_PCI_TOOL, '--bind=' + _driver] +
+ tasks.run_task(['sudo', S.getValue('TOOLS')['bind-tool'],
+ '--bind=' + _driver] +
_NICS_PCI, _LOGGER,
'Binding NICs %s...' % _NICS_PCI,
True)
@@ -193,7 +162,7 @@ def _unbind_nics():
"""Unbind NICs using the Intel DPDK ``dpdk*bind.py`` tool.
"""
try:
- tasks.run_task(['sudo', RTE_PCI_TOOL, '--unbind'] +
+ tasks.run_task(['sudo', S.getValue('TOOLS')['bind-tool'], '--unbind'] +
_NICS_PCI, _LOGGER,
'Unbinding NICs %s...' % str(_NICS_PCI),
True)
@@ -204,7 +173,7 @@ def _unbind_nics():
for nic in _NICS:
try:
if nic['driver']:
- tasks.run_task(['sudo', RTE_PCI_TOOL, '--bind',
+ tasks.run_task(['sudo', S.getValue('TOOLS')['bind-tool'], '--bind',
nic['driver'], nic['pci']],
_LOGGER, 'Binding NIC %s to %s...' %
(nic['pci'], nic['driver']),
diff --git a/src/dpdk/testpmd_proc.py b/src/dpdk/testpmd_proc.py
index 990ef8da..a8fa8eee 100644
--- a/src/dpdk/testpmd_proc.py
+++ b/src/dpdk/testpmd_proc.py
@@ -27,10 +27,6 @@ from tools import tasks
_TESTPMD_PROMPT = 'Done'
-_TESTPMD_BIN = os.path.join(
- settings.getValue('RTE_SDK'), settings.getValue('RTE_TARGET'),
- 'app', 'testpmd')
-
_LOG_FILE_VSWITCHD = os.path.join(
settings.getValue('LOG_DIR'), settings.getValue('LOG_FILE_VSWITCHD'))
@@ -57,7 +53,7 @@ class TestPMDProcess(tasks.Process):
if not self._expect:
self._expect = _TESTPMD_PROMPT
testpmd_args = testpmd_args or []
- self._cmd = ['sudo', '-E', _TESTPMD_BIN] + testpmd_args
+ self._cmd = ['sudo', '-E', settings.getValue('TOOLS')['testpmd']] + testpmd_args
# startup/shutdown
diff --git a/src/ovs/dpctl.py b/src/ovs/dpctl.py
index 8ecac6dc..44a4ec9b 100644
--- a/src/ovs/dpctl.py
+++ b/src/ovs/dpctl.py
@@ -23,9 +23,6 @@ import string
from tools import tasks
from conf import settings
-_OVS_DPCTL_BIN = os.path.join(settings.getValue('OVS_DIR'), 'utilities',
- 'ovs-dpctl')
-
_OVS_LOCAL_DATAPATH = 'ovs-system'
class DPCtl(object):
@@ -51,7 +48,7 @@ class DPCtl(object):
:return: None
"""
- cmd = ['sudo', _OVS_DPCTL_BIN,
+ cmd = ['sudo', settings.getValue('TOOLS')['ovs-dpctl'],
'--timeout',
str(self.timeout)] + args
return tasks.run_task(
diff --git a/src/ovs/ofctl.py b/src/ovs/ofctl.py
index a75d0be2..e9b86127 100644
--- a/src/ovs/ofctl.py
+++ b/src/ovs/ofctl.py
@@ -28,21 +28,15 @@ import re
from tools import tasks
from conf import settings
-_OVS_VSCTL_BIN = os.path.join(settings.getValue('OVS_DIR'), 'utilities',
- 'ovs-vsctl')
-_OVS_OFCTL_BIN = os.path.join(settings.getValue('OVS_DIR'), 'utilities',
- 'ovs-ofctl')
-_OVS_APPCTL_BIN = os.path.join(settings.getValue('OVS_DIR'), 'utilities',
- 'ovs-appctl')
-
_OVS_BRIDGE_NAME = settings.getValue('VSWITCH_BRIDGE_NAME')
+_OVS_CMD_TIMEOUT = settings.getValue('OVS_CMD_TIMEOUT')
_CACHE_FILE_NAME = '/tmp/vsperf_flows_cache'
class OFBase(object):
"""Add/remove/show datapaths using ``ovs-ofctl``.
"""
- def __init__(self, timeout=10):
+ def __init__(self, timeout=_OVS_CMD_TIMEOUT):
"""Initialise logger.
:param timeout: Timeout to be used for each command
@@ -66,9 +60,9 @@ class OFBase(object):
:return: None
"""
if self.timeout == -1:
- cmd = ['sudo', _OVS_VSCTL_BIN, '--no-wait'] + args
+ cmd = ['sudo', settings.getValue('TOOLS')['ovs-vsctl'], '--no-wait'] + args
else:
- cmd = ['sudo', _OVS_VSCTL_BIN, '--timeout', str(self.timeout)] + args
+ cmd = ['sudo', settings.getValue('TOOLS')['ovs-vsctl'], '--timeout', str(self.timeout)] + args
return tasks.run_task(
cmd, self.logger, 'Running ovs-vsctl...', check_error)
@@ -81,7 +75,7 @@ class OFBase(object):
:return: None
"""
- cmd = ['sudo', _OVS_APPCTL_BIN,
+ cmd = ['sudo', settings.getValue('TOOLS')['ovs-appctl'],
'--timeout',
str(self.timeout)] + args
return tasks.run_task(
@@ -145,7 +139,7 @@ class OFBase(object):
class OFBridge(OFBase):
"""Control a bridge instance using ``ovs-vsctl`` and ``ovs-ofctl``.
"""
- def __init__(self, br_name=_OVS_BRIDGE_NAME, timeout=10):
+ def __init__(self, br_name=_OVS_BRIDGE_NAME, timeout=_OVS_CMD_TIMEOUT):
"""Initialise bridge.
:param br_name: Bridge name
@@ -184,8 +178,8 @@ class OFBridge(OFBase):
:return: None
"""
tmp_timeout = self.timeout if timeout == None else timeout
- cmd = ['sudo', _OVS_OFCTL_BIN, '-O', 'OpenFlow13', '--timeout',
- str(tmp_timeout)] + args
+ cmd = ['sudo', settings.getValue('TOOLS')['ovs-ofctl'], '-O',
+ 'OpenFlow13', '--timeout', str(tmp_timeout)] + args
return tasks.run_task(
cmd, self.logger, 'Running ovs-ofctl...', check_error)
diff --git a/src/package-list.mk b/src/package-list.mk
index 5aa40bd2..6eb43b8b 100644
--- a/src/package-list.mk
+++ b/src/package-list.mk
@@ -6,13 +6,11 @@
# dpdk section
# DPDK_URL ?= git://dpdk.org/dpdk
DPDK_URL ?= http://dpdk.org/git/dpdk
-DPDK_TAG ?= v16.04
+DPDK_TAG ?= v16.07
# OVS section
OVS_URL ?= https://github.com/openvswitch/ovs
-#The Tag below is for OVS v2.5.0 with backwards compatibility support for Qemu
-#versions < 2.5.
-OVS_TAG ?= 31871ee3839c35e6878debfc7926afa471dbdec6
+OVS_TAG ?= ed26e3ea9995ba632e681d5990af5ee9814f650e
# QEMU section
QEMU_URL ?= https://github.com/qemu/qemu.git