From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 5A6CAA05D3 for ; Thu, 23 May 2019 08:16:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 512CE2B9E; Thu, 23 May 2019 08:16:54 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 355419E4 for ; Thu, 23 May 2019 08:16:53 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2019 23:16:52 -0700 X-ExtLoop1: 1 Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 22 May 2019 23:16:52 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 22 May 2019 23:16:51 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 22 May 2019 23:16:51 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by shsmsx102.ccr.corp.intel.com ([169.254.2.249]) with mapi id 14.03.0415.000; Thu, 23 May 2019 14:16:49 +0800 From: "Tu, Lijuan" To: "Zhao, MeijuanX" , "dts@dpdk.org" CC: "Zhao, MeijuanX" Thread-Topic: [dts] [PATCH V1] tests/sriov_kvm Thread-Index: AQHVCiU09+QCazqUwUWtM7ywzDElP6Z4SeYA Date: Thu, 23 May 2019 06:16:49 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BA84780@SHSMSX101.ccr.corp.intel.com> References: <20190514151759.24268-1-meijuanx.zhao@intel.com> In-Reply-To: <20190514151759.24268-1-meijuanx.zhao@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2U1NTg0NWYtZWE2Zi00ZmE1LWJkYjQtNGYyYWFlYjYzZDc2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVHVnMHhmQkI4NXdwdlhcL211TW9qWCtLdDI2OWl4OXdHNDY0RzhTNXhkR3M4b0FYQU5cLytLK2YzcFRnUEJodTVXIn0= x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] tests/sriov_kvm 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhaomeijuan > Sent: Tuesday, May 14, 2019 11:18 PM > To: dts@dpdk.org > Cc: Zhao, MeijuanX > Subject: [dts] [PATCH V1] tests/sriov_kvm >=20 > change code structure to cut running time resume vlan status after set vl= an > everytime >=20 > Signed-off-by: zhaomeijuan > --- > tests/TestSuite_sriov_kvm.py | 69 ++++++++++-------------------------- > 1 file changed, 19 insertions(+), 50 deletions(-) >=20 > diff --git a/tests/TestSuite_sriov_kvm.py b/tests/TestSuite_sriov_kvm.py > index 43ed1b5..eadeb05 100644 > --- a/tests/TestSuite_sriov_kvm.py > +++ b/tests/TestSuite_sriov_kvm.py > @@ -51,15 +51,16 @@ class TestSriovKvm(TestCase): > else: > self.vf_assign_method =3D 'vfio-pci' > self.dut.send_expect('modprobe vfio-pci', '#') > - > - def set_up(self): > self.setup_2vm_2pf_env_flag =3D 0 > - > self.setup_2vm_2vf_env_flag =3D 0 > self.setup_2vm_prerequisite_flag =3D 0 > - > self.setup_4vm_4vf_env_flag =3D 0 > self.setup_4vm_prerequisite_flag =3D 0 > + self.setup_2vm_2vf_env() > + > + def set_up(self): > + > + self.setup_two_vm_common_prerequisite() >=20 > def get_stats(self, dut, portid, rx_tx): > """ > @@ -637,13 +638,9 @@ class TestSriovKvm(TestCase): > self.setup_2vm_prerequisite_flag =3D 1 >=20 > def destroy_two_vm_common_prerequisite(self): > - self.vm0_testpmd.execute_cmd('stop') > - self.vm0_testpmd.execute_cmd('quit', '# ') > self.vm0_testpmd =3D None > self.vm0_dut_ports =3D None >=20 > - self.vm1_testpmd.execute_cmd('stop') > - self.vm1_testpmd.execute_cmd('quit', '# ') > self.vm0_testpmd =3D None > self.vm1_dut_ports =3D None >=20 > @@ -667,8 +664,9 @@ class TestSriovKvm(TestCase): > self.destroy_2vm_2pf_env() >=20 > def test_two_vms_intervm_communication(self): > - self.setup_2vm_2vf_env() > - > + if self.setup_2vm_prerequisite_flag =3D=3D 1: > + self.vm0_testpmd.execute_cmd('quit', '# ') > + self.vm1_testpmd.execute_cmd('quit', '# ') > self.vm0_dut_ports =3D self.vm_dut_0.get_ports('any') > self.vm1_dut_ports =3D self.vm_dut_1.get_ports('any') > port_id_0 =3D 0 > @@ -712,9 +710,6 @@ class TestSriovKvm(TestCase): > return ret_stats >=20 > def test_two_vms_pool_mirror(self): > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() > - > port_id_0 =3D 0 > packet_num =3D 10 >=20 > @@ -733,9 +728,6 @@ class TestSriovKvm(TestCase): > self.reset_port_mirror_rule(port_id_0, rule_id) >=20 > def test_two_vms_uplink_mirror(self): > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() > - > port_id_0 =3D 0 > packet_num =3D 10 >=20 > @@ -754,9 +746,6 @@ class TestSriovKvm(TestCase): > self.reset_port_mirror_rule(port_id_0, rule_id) >=20 > def test_two_vms_downlink_mirror(self): > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() > - > self.vm0_testpmd.execute_cmd('stop') > self.vm1_testpmd.execute_cmd('stop') >=20 > @@ -781,8 +770,6 @@ class TestSriovKvm(TestCase): > self.reset_port_mirror_rule(port_id_0, rule_id) >=20 > def test_two_vms_vlan_mirror(self): > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() > self.vm1_testpmd.execute_cmd('vlan set strip on 0') > port_id_0 =3D 0 > vlan_id =3D 0 > @@ -809,12 +796,11 @@ class TestSriovKvm(TestCase): > self.verify(vm1_ret_stats['RX-packets'] =3D=3D packet_num and > vm1_ret_stats['TX-packets'] =3D=3D packet_num, > "Vlan mirror failed between VM0 and VM1!") > - > + self.host_testpmd.execute_cmd( > + 'rx_vlan rm %d port %d vf %s' % (vlan_id, port_id_0, > + vf_mask)) > self.reset_port_mirror_rule(port_id_0, rule_id) >=20 > def test_two_vms_vlan_and_pool_mirror(self): > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() > self.vm0_testpmd.execute_cmd('vlan set strip on 0') > self.vm1_testpmd.execute_cmd('vlan set strip on 0') > port_id_0 =3D 0 > @@ -857,13 +843,11 @@ class TestSriovKvm(TestCase): >=20 > self.verify(self.vm0_testpmd.check_tx_bytes(vm0_ret_stats['RX- > packets'], 10 * packet_num), > "Vlan mirror failed between VM0 and VM1 when set vla= n and > pool mirror!") > - > + self.host_testpmd.execute_cmd( > + 'rx_vlan rm %d port %d vf %s' % (vlan_id, port_id_0, > + vf_mask)) > self.reset_port_all_mirror_rule(port_id_0) >=20 > def test_two_vms_uplink_and_downlink_mirror(self): > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() > - > self.vm0_testpmd.execute_cmd('stop') > self.vm1_testpmd.execute_cmd('stop') >=20 > @@ -909,8 +893,6 @@ class TestSriovKvm(TestCase): > self.reset_port_all_mirror_rule(port_id_0) >=20 > def test_two_vms_vlan_and_pool_and_uplink_and_downlink(self): > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() > self.vm0_testpmd.execute_cmd('vlan set strip on 0') > self.vm1_testpmd.execute_cmd('vlan set strip on 0') > self.vm0_testpmd.execute_cmd('stop') > @@ -990,13 +972,11 @@ class TestSriovKvm(TestCase): > vm1_ret_stats['RX-packets'] =3D=3D 2 * packet_num, > "Vlan and downlink mirror failed between VM0 and VM1= " + > "when set vlan, pool, uplink and downlink mirror!") > - > + self.host_testpmd.execute_cmd("rx_vlan rm %d port %d vf %s" % > + (vlan_id, port_id_0, vf_mask)) > self.reset_port_all_mirror_rule(port_id_0) >=20 > def test_two_vms_add_multi_exact_mac_on_vf(self): > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() > - > port_id_0 =3D 0 > vf_num =3D 0 > packet_num =3D 10 > @@ -1031,8 +1011,6 @@ class TestSriovKvm(TestCase): > if self.nic.startswith('fortville'): > self.dut.logger.warning("NIC is [%s], skip this case" %self.= nic) > return > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() >=20 > port_id_0 =3D 0 > vf_mac =3D "00:11:22:33:44:55" > @@ -1081,8 +1059,6 @@ class TestSriovKvm(TestCase): > if self.nic.startswith('fortville'): > self.dut.logger.warning("NIC is [%s], skip this case" %self.= nic) > return > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() >=20 > port_id_0 =3D 0 > packet_num =3D 10 > @@ -1113,8 +1089,6 @@ class TestSriovKvm(TestCase): > if self.nic.startswith('fortville'): > self.dut.logger.warning("NIC is [%s], skip this case" %self.= nic) > return > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() >=20 > port_id_0 =3D 0 > vf_mac =3D "00:55:44:33:22:11" > @@ -1152,8 +1126,6 @@ class TestSriovKvm(TestCase): > if self.nic.startswith('fortville'): > self.dut.logger.warning("NIC is [%s], skip this case" %self.= nic) > return > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() >=20 > port_id_0 =3D 0 > packet_num =3D 10 > @@ -1188,8 +1160,6 @@ class TestSriovKvm(TestCase): > if self.nic.startswith('fortville'): > self.dut.logger.warning("NIC is [%s], skip this case" %self.= nic) > return > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() >=20 > self.vm0_testpmd.execute_cmd("stop") > self.vm0_testpmd.execute_cmd("set fwd mac") @@ -1227,8 +1197,6 > @@ class TestSriovKvm(TestCase): > if self.nic.startswith('fortville'): > self.dut.logger.warning("NIC is [%s], skip this case" %self.= nic) > return > - self.setup_2vm_2vf_env() > - self.setup_two_vm_common_prerequisite() >=20 > port_id_0 =3D 0 > vf_mac =3D "FF:FF:FF:FF:FF:FF" > @@ -1262,8 +1230,6 @@ class TestSriovKvm(TestCase): > "when enable or pause TX queues on VF!") >=20 > 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", @@ -1291,6 +1257,11 = @@ class > TestSriovKvm(TestCase): > error, "Execute command '%s' successfully, it should be = failed!" % > command) >=20 > def tear_down(self): > + self.vm0_testpmd.execute_cmd('quit', '# ') > + self.vm1_testpmd.execute_cmd('quit', '# ') > + time.sleep(1) > + > + def tear_down_all(self): > if self.setup_2vm_prerequisite_flag =3D=3D 1: > self.destroy_two_vm_common_prerequisite() > if self.setup_2vm_2vf_env_flag =3D=3D 1: > @@ -1303,8 +1274,6 @@ class TestSriovKvm(TestCase): > self.destroy_four_vm_common_prerequisite() > if self.setup_4vm_4vf_env_flag =3D=3D 1: > self.destroy_4vm_4vf_env() > - > - def tear_down_all(self): > if getattr(self, 'vm0', None): > self.vm0.stop() > if getattr(self, 'vm1', None): > -- > 2.17.1