From 9b1af783ec53050129239102355e1a5c3ceb1d97 Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Fri, 26 Aug 2016 15:39:29 +0100 Subject: paths: Support binary packages Currently VSPERF supports OVS, DPDK and QEMU built from the source code only. In some cases it is required to support installation of these tools from binary packages available for given linux distribution. Thus VSPERF configuration and code was modified to suport both source and binary versions of tools. This can be configured perf tool, so various combinations of source and binary version are supported. Together with new configuration also a handling of kernel modules was modified to automatically detect and load module dependencies. JIRA: VSPERF-340 JIRA: VSPERF-339 Change-Id: I855cb438cbd8998bdc499613ea5e7de2526299d7 Signed-off-by: Martin Klozik Reviewed-by: Maryam Tahhan Reviewed-by: Al Morton Reviewed-by: Christian Trautman Reviewed-by: Bill Michalowski Reviewed-by: Otto Sabart --- vnfs/qemu/qemu.py | 2 +- vnfs/qemu/qemu_dpdk_vhost_user.py | 2 +- vnfs/qemu/qemu_pci_passthrough.py | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'vnfs') diff --git a/vnfs/qemu/qemu.py b/vnfs/qemu/qemu.py index c9569ae6..01c16a0f 100644 --- a/vnfs/qemu/qemu.py +++ b/vnfs/qemu/qemu.py @@ -85,7 +85,7 @@ class IVnfQemu(IVnf): vnc = ':%d' % self._number # don't use taskset to affinize main qemu process; It causes hangup # of 2nd VM in case of DPDK. It also slows down VM responsivnes. - self._cmd = ['sudo', '-E', S.getValue('QEMU_BIN'), + self._cmd = ['sudo', '-E', S.getValue('TOOLS')['qemu-system'], '-m', S.getValue('GUEST_MEMORY')[self._number], '-smp', str(S.getValue('GUEST_SMP')[self._number]), '-cpu', 'host,migratable=off', diff --git a/vnfs/qemu/qemu_dpdk_vhost_user.py b/vnfs/qemu/qemu_dpdk_vhost_user.py index fc46aba1..7e418e18 100644 --- a/vnfs/qemu/qemu_dpdk_vhost_user.py +++ b/vnfs/qemu/qemu_dpdk_vhost_user.py @@ -52,7 +52,7 @@ class QemuDpdkVhostUser(IVnfQemu): self._cmd += ['-chardev', 'socket,id=char' + ifi + - ',path=' + S.getValue('OVS_VAR_DIR') + + ',path=' + S.getValue('TOOLS')['ovs_var_tmp'] + 'dpdkvhostuser' + ifi, '-netdev', 'type=vhost-user,id=' + net + diff --git a/vnfs/qemu/qemu_pci_passthrough.py b/vnfs/qemu/qemu_pci_passthrough.py index ba1f1010..f32f33d3 100644 --- a/vnfs/qemu/qemu_pci_passthrough.py +++ b/vnfs/qemu/qemu_pci_passthrough.py @@ -19,7 +19,6 @@ import logging import subprocess import os -import glob from conf import settings as S from vnfs.qemu.qemu import IVnfQemu @@ -27,7 +26,6 @@ from tools import tasks from tools.module_manager import ModuleManager _MODULE_MANAGER = ModuleManager() -_RTE_PCI_TOOL = glob.glob(os.path.join(S.getValue('RTE_SDK'), 'tools', 'dpdk*bind.py'))[0] class QemuPciPassthrough(IVnfQemu): """ @@ -60,7 +58,7 @@ class QemuPciPassthrough(IVnfQemu): # bind every interface to vfio-pci driver try: nics_list = list(tmp_nic['pci'] for tmp_nic in self._host_nics) - tasks.run_task(['sudo', _RTE_PCI_TOOL, '--bind=vfio-pci'] + nics_list, + tasks.run_task(['sudo', S.getValue('TOOLS')['bind-tool'], '--bind=vfio-pci'] + nics_list, self._logger, 'Binding NICs %s...' % nics_list, True) except subprocess.CalledProcessError: @@ -78,7 +76,7 @@ class QemuPciPassthrough(IVnfQemu): for nic in self._host_nics: if nic['driver']: try: - tasks.run_task(['sudo', _RTE_PCI_TOOL, '--bind=' + nic['driver'], nic['pci']], + tasks.run_task(['sudo', S.getValue('TOOLS')['bind-tool'], '--bind=' + nic['driver'], nic['pci']], self._logger, 'Binding NIC %s...' % nic['pci'], True) except subprocess.CalledProcessError: -- cgit 1.2.3-korg