test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests/ddp_gtp: choose the VF passthrough method by the config
@ 2019-03-11  3:33 michael.luo
  2019-03-15  7:10 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: michael.luo @ 2019-03-11  3:33 UTC (permalink / raw)
  To: dts

From: Luo Gaoliang <michael.luo@intel.com>

Choosing the VF passthrough method to create VMs by the config instead of
hardcoding it as pci-assign.

Signed-off-by: Luo Gaoliang <michael.luo@intel.com>
---
 tests/TestSuite_ddp_gtp.py | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_ddp_gtp.py b/tests/TestSuite_ddp_gtp.py
index 68de1a7..0e86c8d 100644
--- a/tests/TestSuite_ddp_gtp.py
+++ b/tests/TestSuite_ddp_gtp.py
@@ -15,6 +15,8 @@ VM_CORES_MASK = 'all'
 
 class TestDdpGtp(TestCase):
 
+    supported_vf_driver = ['pci-stub', 'vfio-pci']
+
     def set_up_all(self):
         self.verify('fortville' in self.nic,
                     'ddp gtp can not support %s nic' % self.nic)
@@ -32,6 +34,16 @@ class TestDdpGtp(TestCase):
         self.PF_QUEUE = self.search_queue_number(self.PF_Q_strip)
         self.VF_QUEUE = self.search_queue_number(self.VF_Q_strip)
 
+        self.vf_driver = self.get_suite_cfg()['vf_driver']
+        if self.vf_driver is None:
+            self.vf_driver = 'pci-stub'
+        self.verify(self.vf_driver in self.supported_vf_driver, "Unspported vf driver")
+        if self.vf_driver == 'pci-stub':
+            self.vf_assign_method = 'pci-assign'
+        else:
+            self.vf_assign_method = 'vfio-pci'
+            self.dut.send_expect('modprobe vfio-pci', '#')
+
     def set_up(self):
         self.setup_vm_env()
         self.load_profile()
@@ -88,14 +100,14 @@ class TestDdpGtp(TestCase):
             self.sriov_vfs_port = self.dut.ports_info[
                 self.used_dut_port]['vfs_port']
             for port in self.sriov_vfs_port:
-                    port.bind_driver('pci-stub')
+                    port.bind_driver(self.vf_driver)
             time.sleep(1)
             self.dut_testpmd = PmdOutput(self.dut)
             time.sleep(1)
             vf0_prop = {'opt_host': self.sriov_vfs_port[0].pci}
             # set up VM0 ENV
             self.vm0 = QEMUKvm(self.dut, 'vm0', 'ddp_gtp')
-            self.vm0.set_vm_device(driver='pci-assign', **vf0_prop)
+            self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop)
             try:
                 self.vm0_dut = self.vm0.start()
                 if self.vm0_dut is None:
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH] tests/ddp_gtp: choose the VF passthrough method by the config
  2019-03-11  3:33 [dts] [PATCH] tests/ddp_gtp: choose the VF passthrough method by the config michael.luo
@ 2019-03-15  7:10 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2019-03-15  7:10 UTC (permalink / raw)
  To: Luo, Michael, dts

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of michael.luo@intel.com
> Sent: Monday, March 11, 2019 11:33 AM
> To: dts@dpdk.org
> Subject: [dts] [PATCH] tests/ddp_gtp: choose the VF passthrough method by the
> config
> 
> From: Luo Gaoliang <michael.luo@intel.com>
> 
> Choosing the VF passthrough method to create VMs by the config instead of
> hardcoding it as pci-assign.
> 
> Signed-off-by: Luo Gaoliang <michael.luo@intel.com>
> ---
>  tests/TestSuite_ddp_gtp.py | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/TestSuite_ddp_gtp.py b/tests/TestSuite_ddp_gtp.py index
> 68de1a7..0e86c8d 100644
> --- a/tests/TestSuite_ddp_gtp.py
> +++ b/tests/TestSuite_ddp_gtp.py
> @@ -15,6 +15,8 @@ VM_CORES_MASK = 'all'
> 
>  class TestDdpGtp(TestCase):
> 
> +    supported_vf_driver = ['pci-stub', 'vfio-pci']
> +
>      def set_up_all(self):
>          self.verify('fortville' in self.nic,
>                      'ddp gtp can not support %s nic' % self.nic) @@ -32,6 +34,16 @@
> class TestDdpGtp(TestCase):
>          self.PF_QUEUE = self.search_queue_number(self.PF_Q_strip)
>          self.VF_QUEUE = self.search_queue_number(self.VF_Q_strip)
> 
> +        self.vf_driver = self.get_suite_cfg()['vf_driver']
> +        if self.vf_driver is None:
> +            self.vf_driver = 'pci-stub'
> +        self.verify(self.vf_driver in self.supported_vf_driver, "Unspported vf driver")
> +        if self.vf_driver == 'pci-stub':
> +            self.vf_assign_method = 'pci-assign'
> +        else:
> +            self.vf_assign_method = 'vfio-pci'
> +            self.dut.send_expect('modprobe vfio-pci', '#')
> +
>      def set_up(self):
>          self.setup_vm_env()
>          self.load_profile()
> @@ -88,14 +100,14 @@ class TestDdpGtp(TestCase):
>              self.sriov_vfs_port = self.dut.ports_info[
>                  self.used_dut_port]['vfs_port']
>              for port in self.sriov_vfs_port:
> -                    port.bind_driver('pci-stub')
> +                    port.bind_driver(self.vf_driver)
>              time.sleep(1)
>              self.dut_testpmd = PmdOutput(self.dut)
>              time.sleep(1)
>              vf0_prop = {'opt_host': self.sriov_vfs_port[0].pci}
>              # set up VM0 ENV
>              self.vm0 = QEMUKvm(self.dut, 'vm0', 'ddp_gtp')
> -            self.vm0.set_vm_device(driver='pci-assign', **vf0_prop)
> +            self.vm0.set_vm_device(driver=self.vf_assign_method,
> + **vf0_prop)
>              try:
>                  self.vm0_dut = self.vm0.start()
>                  if self.vm0_dut is None:
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-15  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11  3:33 [dts] [PATCH] tests/ddp_gtp: choose the VF passthrough method by the config michael.luo
2019-03-15  7:10 ` Tu, Lijuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).