From 06468e123bdcbf5930abdf9d5d9e2432a7159839 Mon Sep 17 00:00:00 2001 From: Michal Weglicki Date: Fri, 24 Jul 2015 10:42:38 +0100 Subject: Vanilla OVS support implementation JIRA: VSPERF-57 This patch implements Vanilla OVS support.It contains: * New IVswitch implementation: OvsVanilla, * New configuration contants, * New mandatory configuration variable: VSWITCH_VANILLA_PHY_PORT_NAMES for Vanilla OVS has been added, * Virtual ports are not yet implemented, * Some kernel modules wrapping methods has been moved from dpdk.py to tools. * Fixed bug where ovsdb hasn't been killed at the end of test case run on some platforms. Change-Id: I21a0d84dbc4004aae564d5547387a2563f2d1e5b Signed-off-by: Michal Weglicki Reviewed-by: Eugene Snider Reviewed-by: Gurpreet Singh Reviewed-by: Tv Rao Reviewed-by: Martin Klozik Reviewed-by: Billy O Mahony Reviewed-by: Maryam Tahhan --- src/dpdk/dpdk.py | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'src/dpdk/dpdk.py') diff --git a/src/dpdk/dpdk.py b/src/dpdk/dpdk.py index 9b3d1385..01e1fb61 100644 --- a/src/dpdk/dpdk.py +++ b/src/dpdk/dpdk.py @@ -27,11 +27,14 @@ import locale from tools import tasks from conf import settings +from tools.module_manager import ModuleManager, KernelModuleInsertMode _LOGGER = logging.getLogger(__name__) RTE_PCI_TOOL = os.path.join( settings.getValue('RTE_SDK'), 'tools', 'dpdk_nic_bind.py') +_DPDK_MODULE_MANAGER = ModuleManager(KernelModuleInsertMode.MODPROBE) + # # system management # @@ -192,16 +195,8 @@ def _is_module_inserted(module): def _insert_modules(): """Ensure required modules are inserted on system. """ - for module in settings.getValue('SYS_MODULES'): - if _is_module_inserted(module): - continue - try: - tasks.run_task(['sudo', 'modprobe', module], _LOGGER, - 'Inserting module \'%s\'...' % module, True) - except subprocess.CalledProcessError: - _LOGGER.error('Unable to insert module \'%s\'.', module) - raise # fail catastrophically + _DPDK_MODULE_MANAGER.insert_modules(settings.getValue('SYS_MODULES')) mod_path_prefix = settings.getValue('OVS_DIR') _insert_module_group('OVS_MODULES', mod_path_prefix) @@ -237,18 +232,7 @@ def _remove_modules(): _remove_module_group('OVS_MODULES') _remove_module_group('DPDK_MODULES') - for module in settings.getValue('SYS_MODULES'): - # first check if module is loaded - if not _is_module_inserted(module): - continue - - try: - tasks.run_task(['sudo', 'rmmod', module], _LOGGER, - 'Removing module \'%s\'...' % module, True) - except subprocess.CalledProcessError: - _LOGGER.error('Unable to remove module \'%s\'.', module) - continue - + _DPDK_MODULE_MANAGER.remove_modules() def _remove_module_group(module_group): """Ensure all modules in a group are removed from the system. -- cgit 1.2.3-korg