summaryrefslogtreecommitdiffstats
path: root/tools/pkt_fwd
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-01-16 07:56:57 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-01-16 07:56:57 +0000
commitcafcb9f24b422a4b3a0b19ba00c83fe2819dcbaa (patch)
tree4a5f946ef9da8d81f1d74d7bac90130ba2464f82 /tools/pkt_fwd
parent0b202e7c4f4d88ba32570d245a4d4f7371f5fa3a (diff)
parent3ea19952db315e88263437ed41b0c31bd3bdbdf4 (diff)
Merge "testpmd_pvp: Adds pkt_fwd to allow pvp topology testing"
Diffstat (limited to 'tools/pkt_fwd')
-rw-r--r--tools/pkt_fwd/pkt_fwd.py6
-rw-r--r--tools/pkt_fwd/testpmd.py19
2 files changed, 24 insertions, 1 deletions
diff --git a/tools/pkt_fwd/pkt_fwd.py b/tools/pkt_fwd/pkt_fwd.py
index 2580ee1f..a080b5a2 100644
--- a/tools/pkt_fwd/pkt_fwd.py
+++ b/tools/pkt_fwd/pkt_fwd.py
@@ -44,6 +44,12 @@ class IPktFwd(object):
"""
raise NotImplementedError('Please call an implementation.')
+ def start_for_guest(self):
+ """Start the packet forward for guest config
+
+ :returns: None
+ """
+
def stop(self):
"""Stop the packet forwarder.
diff --git a/tools/pkt_fwd/testpmd.py b/tools/pkt_fwd/testpmd.py
index e1b987bc..30e80386 100644
--- a/tools/pkt_fwd/testpmd.py
+++ b/tools/pkt_fwd/testpmd.py
@@ -24,6 +24,8 @@ from tools.pkt_fwd.pkt_fwd import IPktFwd
_LOGGER = logging.getLogger(__name__)
_VSWITCHD_CONST_ARGS = ['--', '-i']
+_TESTPMD_PVP_CONST_ARGS = ['--vdev', 'net_vhost0,iface=/tmp/dpdkvhostuser0',
+ '--vdev', 'net_vhost1,iface=/tmp/dpdkvhostuser1',]
class TestPMD(IPktFwd):
"""TestPMD implementation (only phy2phy deployment is supported)
@@ -37,8 +39,10 @@ class TestPMD(IPktFwd):
_logger = logging.getLogger()
- def __init__(self):
+ def __init__(self, guest=False):
vswitchd_args = settings.getValue('VSWITCHD_DPDK_ARGS')
+ if guest:
+ vswitchd_args += _TESTPMD_PVP_CONST_ARGS
vswitchd_args += _VSWITCHD_CONST_ARGS
vswitchd_args += settings.getValue('TESTPMD_ARGS')
@@ -70,6 +74,19 @@ class TestPMD(IPktFwd):
self._testpmd.send('start', 1)
+ def start_for_guest(self):
+ """See IPktFwd for general description
+
+ Activates testpmd for guest config
+ """
+ self._logger.info("Starting TestPMD for one guest...")
+ dpdk.init()
+ self._testpmd.start()
+ self._logger.info("TestPMD...Started.")
+ self._testpmd.send('set portlist 0,2,1,3')
+
+ self._testpmd.send('start', 1)
+
def stop(self):
"""See IPktFwd for general description