From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 5DBDB23D for ; Mon, 15 Oct 2018 07:18:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2018 22:18:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,383,1534834800"; d="scan'208";a="272430775" Received: from dts-maintain.sh.intel.com (HELO [10.67.119.110]) ([10.67.119.110]) by fmsmga006.fm.intel.com with ESMTP; 14 Oct 2018 22:18:31 -0700 To: "zhao,meijuan" , dts@dpdk.org References: <1539242376-11080-1-git-send-email-meijuanx.zhao@intel.com> From: Lijuan Tu Message-ID: Date: Mon, 15 Oct 2018 21:46:31 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1539242376-11080-1-git-send-email-meijuanx.zhao@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [dts] [PATCH V1] tests/sriov kvm : add support vfio X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2018 05:18:34 -0000 Applied with comments changed, thanks. On 2018年10月11日 15:19, zhao,meijuan wrote: > add support vfio > > Signed-off-by: zhao,meijuan > --- > tests/TestSuite_sriov_kvm.py | 32 +++++++++++++++++++++----------- > 1 file changed, 21 insertions(+), 11 deletions(-) > > diff --git a/tests/TestSuite_sriov_kvm.py b/tests/TestSuite_sriov_kvm.py > index 39e6af3..79d2989 100644 > --- a/tests/TestSuite_sriov_kvm.py > +++ b/tests/TestSuite_sriov_kvm.py > @@ -24,6 +24,8 @@ VM_CORES_MASK = 'all' > > class TestSriovKvm(TestCase): > > + supported_vf_driver = ['pci-stub', 'vfio-pci'] > + > def set_up_all(self): > # port_mirror_ref = {port_id: rule_id_list} > # rule_id should be integer, and should be increased based on > @@ -40,6 +42,16 @@ class TestSriovKvm(TestCase): > self.vm2 = None > self.vm3 = None > > + 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 = self.vf_assign_method > + else: > + self.vf_assign_method = 'vfio-pci' > + self.dut.send_expect('modprobe vfio-pci', '#') > + > def set_up(self): > self.setup_2vm_2pf_env_flag = 0 > > @@ -297,12 +309,12 @@ class TestSriovKvm(TestCase): > > # set up VM0 ENV > self.vm0 = VM(self.dut, 'vm0', 'sriov_kvm') > - self.vm0.set_vm_device(driver='pci-assign', **vf0_prop) > + self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop) > self.vm_dut_0 = self.vm0.start() > > # set up VM1 ENV > self.vm1 = VM(self.dut, 'vm1', 'sriov_kvm') > - self.vm1.set_vm_device(driver='pci-assign', **vf1_prop) > + self.vm1.set_vm_device(driver=self.vf_assign_method, **vf1_prop) > self.vm_dut_1 = self.vm1.start() > > self.setup_2vm_2vf_env_flag = 1 > @@ -327,11 +339,10 @@ class TestSriovKvm(TestCase): > self.used_dut_port, 2, driver=driver) > self.sriov_vfs_port = self.dut.ports_info[ > self.used_dut_port]['vfs_port'] > - > try: > > for port in self.sriov_vfs_port: > - port.bind_driver('pci-stub') > + port.bind_driver(self.vf_driver) > > time.sleep(1) > > @@ -356,14 +367,14 @@ class TestSriovKvm(TestCase): > > # set up VM0 ENV > self.vm0 = VM(self.dut, 'vm0', 'sriov_kvm') > - self.vm0.set_vm_device(driver='pci-assign', **vf0_prop) > + self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop) > self.vm_dut_0 = self.vm0.start() > if self.vm_dut_0 is None: > raise Exception("Set up VM0 ENV failed!") > > # set up VM1 ENV > self.vm1 = VM(self.dut, 'vm1', 'sriov_kvm') > - self.vm1.set_vm_device(driver='pci-assign', **vf1_prop) > + self.vm1.set_vm_device(driver=self.vf_assign_method, **vf1_prop) > self.vm_dut_1 = self.vm1.start() > if self.vm_dut_1 is None: > raise Exception("Set up VM1 ENV failed!") > @@ -436,25 +447,25 @@ class TestSriovKvm(TestCase): > "1S/2C/2T", eal_param=eal_param) > > self.vm0 = VM(self.dut, 'vm0', 'sriov_kvm') > - self.vm0.set_vm_device(driver='pci-assign', **vf0_prop) > + self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop) > self.vm_dut_0 = self.vm0.start() > if self.vm_dut_0 is None: > raise Exception("Set up VM0 ENV failed!") > > self.vm1 = VM(self.dut, 'vm1', 'sriov_kvm') > - self.vm1.set_vm_device(driver='pci-assign', **vf1_prop) > + self.vm1.set_vm_device(driver=self.vf_assign_method, **vf1_prop) > self.vm_dut_1 = self.vm1.start() > if self.vm_dut_1 is None: > raise Exception("Set up VM1 ENV failed!") > > self.vm2 = VM(self.dut, 'vm2', 'sriov_kvm') > - self.vm2.set_vm_device(driver='pci-assign', **vf2_prop) > + self.vm2.set_vm_device(driver=self.vf_assign_method, **vf2_prop) > self.vm_dut_2 = self.vm2.start() > if self.vm_dut_2 is None: > raise Exception("Set up VM2 ENV failed!") > > self.vm3 = VM(self.dut, 'vm3', 'sriov_kvm') > - self.vm3.set_vm_device(driver='pci-assign', **vf3_prop) > + self.vm3.set_vm_device(driver=self.vf_assign_method, **vf3_prop) > self.vm_dut_3 = self.vm3.start() > if self.vm_dut_3 is None: > raise Exception("Set up VM3 ENV failed!") > @@ -1253,7 +1264,6 @@ class TestSriovKvm(TestCase): > def test_two_vms_negative_input_commands(self): > self.setup_2vm_2vf_env() > self.setup_two_vm_common_prerequisite() > - > for command in ["set port 0 vf 65 tx on", > "set port 2 vf -1 tx off", > "set port 0 vf 0 rx oneee",