[dts] [PATCH V1]tests/TestSuite_vm_hotplug: optimize test case load vfio-pci in vm
Tu, Lijuan
lijuan.tu at intel.com
Thu Jul 2 09:17:37 CEST 2020
Applied, thanks
> -----Original Message-----
> From: dts <dts-bounces at dpdk.org> On Behalf Of Xiao Qimai
> Sent: 2020年7月1日 15:37
> To: dts at dpdk.org
> Cc: Xiao, QimaiX <qimaix.xiao at intel.com>
> Subject: [dts] [PATCH V1]tests/TestSuite_vm_hotplug: optimize test case load
> vfio-pci in vm
>
> *. vfio-pci has been loaded by default in framework
>
> Signed-off-by: Xiao Qimai <qimaix.xiao at intel.com>
> ---
> tests/TestSuite_vm_hotplug.py | 15 ++-------------
> 1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/tests/TestSuite_vm_hotplug.py b/tests/TestSuite_vm_hotplug.py
> index 45cfc89..2dfd835 100644
> --- a/tests/TestSuite_vm_hotplug.py
> +++ b/tests/TestSuite_vm_hotplug.py
> @@ -96,18 +96,6 @@ class TestVmHotplug(TestCase):
> self.vm0_dut = self.connect_vm()
> self.verify(self.vm0_dut is not None, 'vm start fail')
> self.setup_pf_1vm_env_flag = 1
> - # load vfio
> - self.vm0_dut.send_expect('modprobe -r vfio_iommu_type1', '#')
> - self.vm0_dut.send_expect('modprobe -r vfio', '#')
> - self.vm0_dut.send_expect('modprobe vfio
> enable_unsafe_noiommu_mode=1', '#')
> - self.vm0_dut.send_expect('modprobe vfio-pci', '#')
> - # bind device to vfio
> - netdev = self.vm0_dut.ports_info[0]['port']
> - netdev.bind_driver(driver='vfio-pci')
> - if device == 2:
> - netdev = self.vm0_dut.ports_info[1]['port']
> - netdev.bind_driver(driver='vfio-pci')
> -
> self.vm_session = self.vm0_dut.new_session(suite="vm_session")
> self.vf_pci0 = self.vm0_dut.ports_info[0]['pci']
> if device == 2:
> @@ -119,7 +107,8 @@ class TestVmHotplug(TestCase):
> self.vm0 = QEMUKvm(self.dut, 'vm0', 'vm_hotplug')
> self.vm0.net_type = 'hostfwd'
> self.vm0.hostfwd_addr = '%s:6000' % self.dut.get_ip_address()
> - self.vm0.def_driver = 'igb_uio'
> + self.vm0.def_driver = 'vfio-pci'
> + self.vm0.driver_mode = 'noiommu'
> self.wait_vm_net_ready()
> vm_dut = self.vm0.instantiate_vm_dut(autodetect_topo=False)
> if vm_dut:
> --
> 1.8.3.1
More information about the dts
mailing list