summaryrefslogtreecommitdiffstats
path: root/core/pktfwd_controller.py
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 /core/pktfwd_controller.py
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 'core/pktfwd_controller.py')
-rw-r--r--core/pktfwd_controller.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/pktfwd_controller.py b/core/pktfwd_controller.py
index b1e37f2e..a0e14d19 100644
--- a/core/pktfwd_controller.py
+++ b/core/pktfwd_controller.py
@@ -32,7 +32,7 @@ class PktFwdController(object):
self._deployment = deployment
self._logger = logging.getLogger(__name__)
self._pktfwd_class = pktfwd_class
- self._pktfwd = pktfwd_class()
+ self._pktfwd = pktfwd_class(guest=True if deployment == "pvp" else False)
self._logger.debug('Creation using ' + str(self._pktfwd_class))
def setup(self):
@@ -46,6 +46,17 @@ class PktFwdController(object):
self._pktfwd.stop()
raise
+ def setup_for_guest(self):
+ """Sets up the packet forwarder for pvp.
+ """
+ self._logger.debug('Setup using ' + str(self._pktfwd_class))
+
+ try:
+ self._pktfwd.start_for_guest()
+ except:
+ self._pktfwd.stop()
+ raise
+
def stop(self):
"""Tears down the packet forwarder created in setup().
"""
@@ -55,10 +66,14 @@ class PktFwdController(object):
def __enter__(self):
if self._deployment.find("p2p") == 0:
self.setup()
+ elif self._deployment == "pvp":
+ self.setup_for_guest()
def __exit__(self, type_, value, traceback):
if self._deployment.find("p2p") == 0:
self.stop()
+ elif self._deployment == "pvp":
+ self.stop()
def get_pktfwd(self):
"""Get the controlled packet forwarder