aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2017-01-11 15:00:52 -0500
committerChristian Trautman <ctrautma@redhat.com>2017-01-13 17:57:37 -0500
commit3ea19952db315e88263437ed41b0c31bd3bdbdf4 (patch)
tree9499954b7606bd7f54678898e9b3dcf139116de4 /tools
parent5bd06d3527c2ade600cab62764aed06f344986bc (diff)
testpmd_pvp: Adds pkt_fwd to allow pvp topology testing
Requires DPDK 16.11 or greater to support vdev flags. Initial support for TestPMD to support guests. Allows vsperf to execute TestPMD as a switch for pvp test scenarios. Can be increased in functionality later to support multiple guest configs. JIRA: VSPERF-406 Change-Id: I67a5a355c990ca6cfcbb5845a2beaf1c1f21f5f0 Signed-off-by: Christian Trautman <ctrautma@redhat.com>
Diffstat (limited to 'tools')
-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