testpmd_pvp_fix: Fix SR-IOV QemuPciPassthrough mode to not use vdev 27/27127/2
authorChristian Trautman <ctrautma@redhat.com>
Wed, 18 Jan 2017 01:12:31 +0000 (20:12 -0500)
committerChristian Trautman <ctrautma@redhat.com>
Wed, 18 Jan 2017 15:17:11 +0000 (10:17 -0500)
A recent patch introduced a bug where SR-IOV would use code designed
for use with testpmd_pvp scenarios. This is because this scenario
also calls for the vswitch=none flag. This patch resolves this issue
to stop the vdev devices from being added when the vnf is specified
as QemuPciPassthrough.

JIRA: VSPERF-460

Change-Id: Ie4522b046982ec5554c3deb6a507d86ca9798124
Signed-off-by: Christian Trautman <ctrautma@redhat.com>
core/pktfwd_controller.py

index a0e14d1..785c6f8 100644 (file)
@@ -16,6 +16,7 @@
 """
 
 import logging
+from conf import settings
 
 class PktFwdController(object):
     """Packet forwarder controller for P2P deployment scenario.
@@ -32,7 +33,8 @@ class PktFwdController(object):
         self._deployment = deployment
         self._logger = logging.getLogger(__name__)
         self._pktfwd_class = pktfwd_class
-        self._pktfwd = pktfwd_class(guest=True if deployment == "pvp" else False)
+        self._pktfwd = pktfwd_class(guest=True if deployment == "pvp" and
+                                    settings.getValue('VNF') != "QemuPciPassthrough" else False)
         self._logger.debug('Creation using ' + str(self._pktfwd_class))
 
     def setup(self):
@@ -66,13 +68,13 @@ class PktFwdController(object):
     def __enter__(self):
         if self._deployment.find("p2p") == 0:
             self.setup()
-        elif self._deployment == "pvp":
+        elif self._deployment == "pvp" and settings.getValue('VNF') != "QemuPciPassthrough":
             self.setup_for_guest()
 
     def __exit__(self, type_, value, traceback):
         if self._deployment.find("p2p") == 0:
             self.stop()
-        elif self._deployment == "pvp":
+        elif self._deployment == "pvp" and settings.getValue('VNF') != "QemuPciPassthrough":
             self.stop()
 
     def get_pktfwd(self):