bugfix: SRIOV used wrong device names 53/20653/2
authorMartin Klozik <martinx.klozik@intel.com>
Thu, 8 Sep 2016 08:41:10 +0000 (09:41 +0100)
committerMaryam Tahhan <maryam.tahhan@intel.com>
Thu, 8 Sep 2016 14:10:07 +0000 (14:10 +0000)
QemuPciPassthrough class responsible for SRIOV testing
used wrong device names for GUEST configuration. Details
of HOST interfaces connected to the traffic generator were
used to initialize forwarding applications inside the guest.
Code was fixed to use correct device configuration.
As part of this fix, old bug in VNF type detection was fixed.

JIRA: VSPERF-389

Change-Id: I269c9232012980c600c171571e90beb11e7b72cd
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Christian Trautman <ctrautma@redhat.com>
Reviewed-by: Bill Michalowski <bmichalo@redhat.com>
vnfs/qemu/qemu_pci_passthrough.py
vsperf

index 951d608..ba1f101 100644 (file)
@@ -39,7 +39,7 @@ class QemuPciPassthrough(IVnfQemu):
         """
         super(QemuPciPassthrough, self).__init__()
         self._logger = logging.getLogger(__name__)
-        self._nics = S.getValue('NICS')
+        self._host_nics = S.getValue('NICS')
 
         # in case of SRIOV and PCI passthrough we must ensure, that MAC addresses are swapped
         if S.getValue('SRIOV_ENABLED') and not self._testpmd_fwd_mode.startswith('mac'):
@@ -47,7 +47,7 @@ class QemuPciPassthrough(IVnfQemu):
                               self._testpmd_fwd_mode, 'mac')
             self._testpmd_fwd_mode = 'mac'
 
-        for nic in self._nics:
+        for nic in self._host_nics:
             self._cmd += ['-device', 'vfio-pci,host=' + nic['pci']]
 
     def start(self):
@@ -59,12 +59,12 @@ class QemuPciPassthrough(IVnfQemu):
 
         # bind every interface to vfio-pci driver
         try:
-            nics_list = list(tmp_nic['pci'] for tmp_nic in self._nics)
+            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,
                            self._logger, 'Binding NICs %s...' % nics_list, True)
 
         except subprocess.CalledProcessError:
-            self._logger.error('Unable to bind NICs %s', self._nics)
+            self._logger.error('Unable to bind NICs %s', self._host_nics)
 
         super(QemuPciPassthrough, self).start()
 
@@ -75,7 +75,7 @@ class QemuPciPassthrough(IVnfQemu):
         super(QemuPciPassthrough, self).stop()
 
         # bind original driver to every interface
-        for nic in self._nics:
+        for nic in self._host_nics:
             if nic['driver']:
                 try:
                     tasks.run_task(['sudo', _RTE_PCI_TOOL, '--bind=' + nic['driver'], nic['pci']],
diff --git a/vsperf b/vsperf
index e942b84..a12560d 100755 (executable)
--- a/vsperf
+++ b/vsperf
@@ -550,7 +550,7 @@ def main():
         if args['vnf'] not in vnfs:
             _LOGGER.error('there are no vnfs matching \'%s\' found in'
                           ' \'%s\'. exiting...', args['vnf'],
-                          settings.getValue('vnf_dir'))
+                          settings.getValue('VNF_DIR'))
             sys.exit(1)
 
     if args['exact_test_name'] and args['tests']: