aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs
diff options
context:
space:
mode:
Diffstat (limited to 'vnfs')
-rw-r--r--vnfs/__init__.py1
-rw-r--r--vnfs/qemu/__init__.py1
-rw-r--r--vnfs/qemu/qemu.py10
-rw-r--r--vnfs/vnf/__init__.py2
-rw-r--r--vnfs/vnf/vnf.py4
5 files changed, 11 insertions, 7 deletions
diff --git a/vnfs/__init__.py b/vnfs/__init__.py
index 34cacf4f..1743faf8 100644
--- a/vnfs/__init__.py
+++ b/vnfs/__init__.py
@@ -17,4 +17,3 @@
This package contains an interface the VSPERF core uses for controlling
VNFs and VNF-specific implementation modules of this interface.
"""
-
diff --git a/vnfs/qemu/__init__.py b/vnfs/qemu/__init__.py
index 82f32eb9..6ed326dd 100644
--- a/vnfs/qemu/__init__.py
+++ b/vnfs/qemu/__init__.py
@@ -17,4 +17,3 @@
This package contains an implementation of the interface the VSPERF core
uses for controlling VNFs using QEMU and DPDK's testpmd application.
"""
-
diff --git a/vnfs/qemu/qemu.py b/vnfs/qemu/qemu.py
index 8e3d44de..7ba58c05 100644
--- a/vnfs/qemu/qemu.py
+++ b/vnfs/qemu/qemu.py
@@ -222,7 +222,13 @@ class IVnfQemu(IVnf):
stdin=proc.stdout)
proc.wait()
- for cpu in range(0, int(S.getValue('GUEST_SMP')[self._number])):
+ # calculate the number of CPUs in SMP topology specified by GUEST_SMP
+ # e.g. "sockets=2,cores=3", "4", etc.
+ cpu_nr = 1
+ for i in re.findall(r'\d', S.getValue('GUEST_SMP')[self._number]):
+ cpu_nr = cpu_nr * int(i)
+ # pin each GUEST's core to host core based on configured BINDING
+ for cpu in range(0, cpu_nr):
match = None
guest_thread_binding = S.getValue('GUEST_THREAD_BINDING')[self._number]
if guest_thread_binding is None:
@@ -280,7 +286,7 @@ class IVnfQemu(IVnf):
elif self._guest_loopback == 'linux_bridge':
self._configure_linux_bridge()
elif self._guest_loopback != 'clean':
- raise RuntimeError('Unsupported guest loopback method "%s" was specified.',
+ raise RuntimeError('Unsupported guest loopback method "%s" was specified.' %
self._guest_loopback)
def wait(self, prompt=None, timeout=30):
diff --git a/vnfs/vnf/__init__.py b/vnfs/vnf/__init__.py
index b7c43217..6a7a1547 100644
--- a/vnfs/vnf/__init__.py
+++ b/vnfs/vnf/__init__.py
@@ -15,4 +15,4 @@
"""VNF interface and helpers.
"""
-from vnfs import *
+import vnfs
diff --git a/vnfs/vnf/vnf.py b/vnfs/vnf/vnf.py
index 5ac2ada3..3ad1dcda 100644
--- a/vnfs/vnf/vnf.py
+++ b/vnfs/vnf/vnf.py
@@ -138,7 +138,7 @@ class IVnf(tasks.Process):
self.execute(cmd)
return self.wait(prompt=prompt, timeout=timeout)
- def validate_start(self, dummyresult):
+ def validate_start(self, _dummyresult):
""" Validate call of VNF start()
"""
if self._child and self._child.isalive():
@@ -152,7 +152,7 @@ class IVnf(tasks.Process):
return not self.validate_start(result)
@staticmethod
- def validate_execute_and_wait(result, dummy_cmd, dummy_timeout=30, dummy_prompt=''):
+ def validate_execute_and_wait(result, _dummy_cmd, _dummy_timeout=30, _dummy_prompt=''):
""" Validate command execution within VNF
"""
return len(result) > 0