From 3ea19952db315e88263437ed41b0c31bd3bdbdf4 Mon Sep 17 00:00:00 2001 From: Christian Trautman Date: Wed, 11 Jan 2017 15:00:52 -0500 Subject: 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 --- core/pktfwd_controller.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'core') 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 -- cgit 1.2.3-korg