aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/qemu/qemu_dpdk.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2015-12-02 10:04:19 +0000
committerMaryam Tahhan <maryam.tahhan@intel.com>2015-12-02 13:48:37 +0000
commit5f98dededf101ce7ee3c11bd41d84ae61cce7feb (patch)
treec8c821f18036dcbcfd4c36ad7c03e4d9f74ab7e4 /vnfs/qemu/qemu_dpdk.py
parent0c292cdcf82ca1d5a71a93c1e1f91cb061a2c6f2 (diff)
vnfs: configurable loopback application support inside VM
For PVP and PVVP deployments, traffic inside virtual machines must be forwarded between its interfaces. There are several forwarding options supported by VSPERF, including DPDK testpmd, Huawei l2fwd kernel module and linux bridge. Another option is, that VM image has built in forwarding functionality and vsperf doesn't configure it itself. User can select VM loopback application by configuration option GUEST_LOOPBACK (per VM) or by SCALAR cli option guest_loopback (global settings). Selected guest loopback application(s) will be written into test results CSV file and test report MD file. Default wildcarded guest login prompt was added. Guest startup guarding timer can be configured. Path to OVS kernel module has been fixed. Change-Id: If738da1ea09112f9cf2267afcbc99a6797f3a03a JIRA: VSPERF-130 Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Diffstat (limited to 'vnfs/qemu/qemu_dpdk.py')
-rw-r--r--vnfs/qemu/qemu_dpdk.py112
1 files changed, 0 insertions, 112 deletions
diff --git a/vnfs/qemu/qemu_dpdk.py b/vnfs/qemu/qemu_dpdk.py
deleted file mode 100644
index 02d720f3..00000000
--- a/vnfs/qemu/qemu_dpdk.py
+++ /dev/null
@@ -1,112 +0,0 @@
-# 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.
-
-"""Automation of QEMU hypervisor for launching vhost-cuse enabled guests.
-"""
-
-from vnfs.qemu.qemu import IVnfQemu
-from conf import settings as S
-
-class IVnfQemuDpdk(IVnfQemu):
- """
- An abstract class for controling an instance of QEMU with DPDK vHost support
- """
-
- def __init__(self):
- """
- Initialisation function.
- """
- super(IVnfQemuDpdk, self).__init__()
- self._cmd += ['-drive',
- 'if=scsi,file=fat:rw:%s,snapshot=off' %
- S.getValue('GUEST_SHARE_DIR')[self._number],
- ]
-
- def _modify_dpdk_makefile(self):
- """
- Modifies DPDK makefile in Guest before compilation
- """
- pass
-
- def _config_guest_loopback(self):
- """
- Configure VM to run testpmd
-
- Configure performs the following:
- * Mount hugepages
- * mount shared directory for copying DPDK
- * Disable firewall
- * Compile DPDK
- * DPDK NIC bind
- * Run testpmd
- """
-
- # Guest images _should_ have 1024 hugepages by default,
- # but just in case:'''
- self.execute_and_wait('sysctl vm.nr_hugepages=1024')
-
- # Mount hugepages
- self.execute_and_wait('mkdir -p /dev/hugepages')
- self.execute_and_wait(
- 'mount -t hugetlbfs hugetlbfs /dev/hugepages')
-
- # mount shared directory
- self.execute_and_wait('umount ' + S.getValue('OVS_DPDK_SHARE'))
- self.execute_and_wait('rm -rf ' + S.getValue('GUEST_OVS_DPDK_DIR'))
- self.execute_and_wait('mkdir -p ' + S.getValue('OVS_DPDK_SHARE'))
- self.execute_and_wait('mount -o iocharset=utf8 /dev/sdb1 ' +
- S.getValue('OVS_DPDK_SHARE'))
- self.execute_and_wait('mkdir -p ' + S.getValue('GUEST_OVS_DPDK_DIR'))
- self.execute_and_wait('cp -a ' + S.getValue('OVS_DPDK_SHARE') + '/* ' +
- S.getValue('GUEST_OVS_DPDK_DIR'))
- # Get VM info
- self.execute_and_wait('cat /etc/default/grub')
-
- # Disable services (F16)
- self.execute_and_wait('systemctl status iptables.service')
- self.execute_and_wait('systemctl stop iptables.service')
-
- # build and configure system for dpdk
- self.execute_and_wait('cd ' + S.getValue('GUEST_OVS_DPDK_DIR') +
- '/DPDK')
- self.execute_and_wait('export CC=gcc')
- self.execute_and_wait('export RTE_SDK=' +
- S.getValue('GUEST_OVS_DPDK_DIR') + '/DPDK')
- self.execute_and_wait('export RTE_TARGET=%s' % S.getValue('RTE_TARGET'))
-
- # modify makefile if needed
- self._modify_dpdk_makefile()
-
- self.execute_and_wait('make RTE_OUTPUT=$RTE_SDK/$RTE_TARGET -C '
- '$RTE_SDK/lib/librte_eal/linuxapp/igb_uio')
- self.execute_and_wait('modprobe uio')
- self.execute_and_wait('insmod %s/kmod/igb_uio.ko' %
- S.getValue('RTE_TARGET'))
- self.execute_and_wait('./tools/dpdk_nic_bind.py --status')
- self.execute_and_wait(
- './tools/dpdk_nic_bind.py -b igb_uio' ' ' +
- S.getValue('GUEST_NET1_PCI_ADDRESS')[self._number] + ' ' +
- S.getValue('GUEST_NET2_PCI_ADDRESS')[self._number])
-
- # build and run 'test-pmd'
- self.execute_and_wait('cd ' + S.getValue('GUEST_OVS_DPDK_DIR') +
- '/DPDK/app/test-pmd')
- self.execute_and_wait('make clean')
- self.execute_and_wait('make')
- self.execute_and_wait('./testpmd -c 0x3 -n 4 --socket-mem 512 --'
- ' --burst=64 -i --txqflags=0xf00 ' +
- '--disable-hw-vlan', 60, "Done")
- self.execute('set fwd mac_retry', 1)
- self.execute_and_wait('start', 20,
- 'TX RS bit threshold=0 - TXQ flags=0xf00')