From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C3C895A32 for ; Mon, 23 May 2016 22:46:31 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 23 May 2016 13:46:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,357,1459839600"; d="scan'208";a="987131080" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 23 May 2016 13:46:29 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 23 May 2016 13:46:29 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 23 May 2016 13:46:28 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.58]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.148]) with mapi id 14.03.0248.002; Tue, 24 May 2016 04:46:26 +0800 From: "Liu, Yong" To: "Tu, LijuanX A" , "Xu, Qian Q" , "dts@dpdk.org" CC: "Tu, LijuanX A" Thread-Topic: [dts] [PATCH]sriov-mirror: merge it from DTF to dts Thread-Index: AQHRp0QLDMnp4e2tHki2oSvjm+9qO5/HF2bQ Date: Mon, 23 May 2016 20:46:26 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E2221B879@SHSMSX103.ccr.corp.intel.com> References: <1462503569-15581-1-git-send-email-lijuanx.a.tu@intel.com> In-Reply-To: <1462503569-15581-1-git-send-email-lijuanx.a.tu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDAyZjQyNzQtODY2OC00MGVhLTlkM2MtNDE5MjUwZjY1Y2M2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkJKTXhJbFlMNDczeFNJU2hETXNnSmU5ZGV3dzRSdEpzNG5keFhSVkJHdHc9In0= x-ctpclassification: CTP_IC 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]sriov-mirror: merge it from DTF to dts 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, 23 May 2016 20:46:33 -0000 Lijuan, few comments. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu > Sent: Thursday, May 05, 2016 7:59 PM > To: Xu, Qian Q; dts@dpdk.org > Cc: Tu, LijuanX A > Subject: [dts] [PATCH]sriov-mirror: merge it from DTF to dts >=20 > Signed-off-by: Lijuan Tu > --- > tests/TestSuite_sriov_kvm.py | 183 +++++++++++++++++++++++++++++++++----= - > ----- > 1 file changed, 142 insertions(+), 41 deletions(-) >=20 > diff --git a/tests/TestSuite_sriov_kvm.py b/tests/TestSuite_sriov_kvm.py > index cd3d9c3..cc63804 100644 > --- a/tests/TestSuite_sriov_kvm.py > +++ b/tests/TestSuite_sriov_kvm.py > @@ -9,15 +9,14 @@ Test userland 10Gb PMD. > """ >=20 > import re > -import pdb > import time > +from functools import wraps >=20 > import dts > from qemu_kvm import QEMUKvm > from test_case import TestCase >=20 > from pmd_output import PmdOutput > - > FRAME_SIZE_64 =3D 64 > VM_CORES_MASK =3D 'all' >=20 > @@ -106,10 +105,14 @@ class TestSriovKvm(TestCase): > tester_port =3D dut.ports_map[dut_dest_port] > if not ether_ip.get('ether'): > ether['dest_mac'] =3D dut.get_mac_address(dut_dest_port) > + if not re.match(r'([0-9A-F]{2}:){5}[0-9A-F]{2}', > ether['dest_mac']): > + ether['dest_mac'] =3D dut.testpmd.get_port_mac(dest_port= ) > ether['src_mac'] =3D dut.tester.get_mac(tester_port) > else: > if not ether_ip['ether'].get('dest_mac'): > ether['dest_mac'] =3D dut.get_mac_address(dut_dest_port) > + if not re.match(r'([0-9A-F]{2}:){5}[0-9A-F]{2}', > ether['dest_mac']): > + ether['dest_mac'] =3D > dut.testpmd.get_port_mac(dest_port) > else: > ether['dest_mac'] =3D ether_ip['ether']['dest_mac'] > if not ether_ip['ether'].get('src_mac'): > @@ -210,7 +213,7 @@ class TestSriovKvm(TestCase): > for _ in self.get_stats(du= t, > dest_port, "rx")] > if not src_port: > itf =3D self.tester.get_interface( > - dut.ports_map[dut_ports[dest_port]]) > + self.dut.ports_map[dut_ports[dest_port]]) > else: > itf =3D src_port >=20 > @@ -291,8 +294,8 @@ class TestSriovKvm(TestCase): > self.port1.unbind_driver() > self.port1_pci =3D self.dut.ports_info[p1]['pci'] >=20 > - vf0_prop =3D {'prop_host': self.port0_pci} > - vf1_prop =3D {'prop_host': self.port1_pci} > + vf0_prop =3D {'opt_host': self.port0_pci} > + vf1_prop =3D {'opt_host': self.port1_pci} >=20 > # set up VM0 ENV > self.vm0 =3D QEMUKvm(self.dut, 'vm0', 'sriov_kvm') > @@ -307,10 +310,14 @@ class TestSriovKvm(TestCase): > self.setup_2vm_2vf_env_flag =3D 1 >=20 > def destroy_2vm_2pf_env(self): > + self.vm_dut_0.close() > + self.vm_dut_0.logger.logger_exit() > self.vm0.stop() > self.port0.bind_driver('igb_uio') > self.vm0 =3D None >=20 > + self.vm_dut_1.close() > + self.vm_dut_1.logger.logger_exit() > self.vm1.stop() > self.port1.bind_driver('igb_uio') > self.vm1 =3D None > @@ -332,8 +339,8 @@ class TestSriovKvm(TestCase): >=20 > time.sleep(1) >=20 > - vf0_prop =3D {'prop_host': self.sriov_vfs_port[0].pci} > - vf1_prop =3D {'prop_host': self.sriov_vfs_port[1].pci} > + vf0_prop =3D {'opt_host': self.sriov_vfs_port[0].pci} > + vf1_prop =3D {'opt_host': self.sriov_vfs_port[1].pci} >=20 > for port_id in self.dut_ports: > if port_id =3D=3D self.used_dut_port: > @@ -369,10 +376,16 @@ class TestSriovKvm(TestCase): > raise Exception(e) >=20 > def destroy_2vm_2vf_env(self): > + if getattr(self, 'vm_dut_0', None): > + self.vm_dut_0.close() > + self.vm_dut_0.logger.logger_exit() > if getattr(self, 'vm0', None): > self.vm0.stop() > self.vm0 =3D None >=20 > + if getattr(self, 'vm_dut_1', None): > + self.vm_dut_1.close() > + self.vm_dut_1.logger.logger_exit() > if getattr(self, 'vm1', None): > self.vm1.stop() > self.vm1 =3D None > @@ -406,10 +419,10 @@ class TestSriovKvm(TestCase): >=20 > time.sleep(1) >=20 > - vf0_prop =3D {'prop_host': self.sriov_vfs_port[0].pci} > - vf1_prop =3D {'prop_host': self.sriov_vfs_port[1].pci} > - vf2_prop =3D {'prop_host': self.sriov_vfs_port[2].pci} > - vf3_prop =3D {'prop_host': self.sriov_vfs_port[3].pci} > + vf0_prop =3D {'opt_host': self.sriov_vfs_port[0].pci} > + vf1_prop =3D {'opt_host': self.sriov_vfs_port[1].pci} > + vf2_prop =3D {'opt_host': self.sriov_vfs_port[2].pci} > + vf3_prop =3D {'opt_host': self.sriov_vfs_port[3].pci} >=20 > for port_id in self.dut_ports: > if port_id =3D=3D self.used_dut_port: > @@ -458,18 +471,30 @@ class TestSriovKvm(TestCase): > raise Exception(e) >=20 > def destroy_4vm_4vf_env(self): > + if getattr(self, 'vm_dut_0', None): > + self.vm_dut_0.close() > + self.vm_dut_0.logger.logger_exit() > if getattr(self, 'vm0', None): > self.vm0.stop() > self.vm0 =3D None >=20 > + if getattr(self, 'vm_dut_1', None): > + self.vm_dut_1.close() > + self.vm_dut_1.logger.logger_exit() > if getattr(self, 'vm1', None): > self.vm1.stop() > self.vm1 =3D None >=20 > + if getattr(self, 'vm_dut_2', None): > + self.vm_dut_2.close() > + self.vm_dut_2.logger.logger_exit() > if getattr(self, 'vm2', None): > self.vm2.stop() > self.vm2 =3D None >=20 > + if getattr(self, 'vm_dut_3', None): > + self.vm_dut_3.close() > + self.vm_dut_3.logger.logger_exit() > if getattr(slef, 'vm3', None): > self.vm3.stop() > self.vm3 =3D None > @@ -584,8 +609,9 @@ class TestSriovKvm(TestCase): >=20 > mirror_rule_cmd =3D "reset port %d mirror-rule %d" % (port, rule= _id) > out =3D self.dut.send_expect("%s" % mirror_rule_cmd, "testpmd> "= ) > - self.verify("Bad arguments" not in out, > - "Reset port %d mirror rule failed!") > + self.verify( > + "Bad arguments" not in out, > + "Reset port %d mirror rule failed!") >=20 > self.remove_port_ruleid(port, rule_id) >=20 > @@ -629,7 +655,22 @@ class TestSriovKvm(TestCase): >=20 > self.setup_2vm_prerequisite_flag =3D 0 >=20 > - def stop_test_setup_two_vm_pf_env(self): > + def skip_func(func): Not sure why use wrap function here, we used to skip unsupported NIC by che= cklist excel file. =20 > + @wraps(func) > + def skip_nic(*args, **kwargs): > + self =3D args[0] > + if func.__name__ =3D=3D "test_setup_two_vm_pf_env": > + self.dut.logger.info("This func is just for internal > test!") > + return func > + if self.nic.startswith('fortville'): > + self.dut.logger.info("NIC is [ %s ], skip this case > [ %s ]" % > + (self.nic, func.__name__)) > + return func > + return func(*args, **kwargs) > + return skip_nic > + > + @skip_func > + def test_setup_two_vm_pf_env(self): > self.setup_2vm_2pf_env() >=20 > out =3D self.vm_dut_0.send_expect("ifconfig", '# ') > @@ -644,6 +685,7 @@ class TestSriovKvm(TestCase): >=20 > self.destroy_2vm_2pf_env() >=20 > + @skip_func > def test_two_vms_intervm_communication(self): > self.setup_2vm_2vf_env() >=20 > @@ -697,12 +739,18 @@ class TestSriovKvm(TestCase): > packet_num =3D 10 >=20 > rule_id =3D self.set_port_pool_mirror(port_id_0, '0x1 dst-pool 1 > on') > + host_start_stats =3D self.host_testpmd.get_pmd_stats(port_id_0) > + vm0_start_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) > vm1_start_stats =3D self.vm1_testpmd.get_pmd_stats(port_id_0) > self.send_packet( > self.vm_dut_0, self.vm0_dut_ports, port_id_0, > count=3Dpacket_num) > vm1_end_stats =3D self.vm1_testpmd.get_pmd_stats(port_id_0) > + vm0_end_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) > + host_end_stats =3D self.host_testpmd.get_pmd_stats(port_id_0) >=20 > vm1_ret_stats =3D self.calculate_stats(vm1_start_stats, > vm1_end_stats) > + vm0_ret_stats =3D self.calculate_stats(vm0_start_stats, > vm0_end_stats) > + host_ret_stats =3D self.calculate_stats(host_start_stats, > host_end_stats) >=20 > self.verify(vm1_ret_stats['RX-packets'] =3D=3D packet_num and > vm1_ret_stats['TX-packets'] =3D=3D packet_num, > @@ -744,12 +792,15 @@ class TestSriovKvm(TestCase): >=20 > self.vm1_testpmd.execute_cmd('set fwd rxonly') > self.vm1_testpmd.execute_cmd('start') > + host_start_stats =3D self.host_testpmd.get_pmd_stats(port_id_0) > vm1_start_stats =3D self.vm1_testpmd.get_pmd_stats(port_id_0) > vm0_start_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) > self.vm0_testpmd.execute_cmd('start tx_first') > + host_end_stats =3D self.host_testpmd.get_pmd_stats(port_id_0) > vm0_end_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) > vm1_end_stats =3D self.vm1_testpmd.get_pmd_stats(port_id_0) >=20 > + host_ret_stats =3D self.calculate_stats(host_start_stats, > host_end_stats) > vm0_ret_stats =3D self.calculate_stats(vm0_start_stats, > vm0_end_stats) > vm1_ret_stats =3D self.calculate_stats(vm1_start_stats, > vm1_end_stats) >=20 > @@ -758,6 +809,10 @@ class TestSriovKvm(TestCase): >=20 > self.reset_port_mirror_rule(port_id_0, rule_id) >=20 > + def get_vm_testpmd_by_mask(self, mask): > + vm_id =3D int(mask, base=3D16) - 1 > + return getattr(self, "vm%d_testpmd" % vm_id) > + > def test_two_vms_vlan_mirror(self): > self.setup_2vm_2vf_env() > self.setup_two_vm_common_prerequisite() > @@ -767,10 +822,15 @@ class TestSriovKvm(TestCase): > vf_mask =3D '0x1' > packet_num =3D 10 >=20 > - self.host_testpmd.execute_cmd( > - 'rx_vlan add %d port %d vf %s' % (vlan_id, port_id_0, > vf_mask)) > + if self.nic.startswith('fortville'): > + vm_testpmd =3D self.get_vm_testpmd_by_mask(vf_mask) > + vm_testpmd.execute_cmd('rx_vlan add %d %d' % (vlan_id, > port_id_0)) > + else: > + self.host_testpmd.execute_cmd( > + 'rx_vlan add %d port %d vf %s' % (vlan_id, port_id_0, > vf_mask)) > rule_id =3D self.set_port_vlan_mirror(port_id_0, '0 dst-pool 1 o= n') >=20 > + vm0_start_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) > vm1_start_stats =3D self.vm1_testpmd.get_pmd_stats(port_id_0) > ether_ip =3D {} > ether_ip['dot1q'] =3D {'vlan': '%d' % vlan_id} > @@ -781,8 +841,10 @@ class TestSriovKvm(TestCase): > count=3Dpacket_num, > **ether_ip) > vm1_end_stats =3D self.vm1_testpmd.get_pmd_stats(port_id_0) > + vm0_end_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) >=20 > vm1_ret_stats =3D self.calculate_stats(vm1_start_stats, > vm1_end_stats) > + vm0_ret_stats =3D self.calculate_stats(vm0_start_stats, > vm0_end_stats) >=20 > self.verify(vm1_ret_stats['RX-packets'] =3D=3D packet_num and > vm1_ret_stats['TX-packets'] =3D=3D packet_num, > @@ -799,8 +861,12 @@ class TestSriovKvm(TestCase): > vf_mask =3D '0x2' > packet_num =3D 10 >=20 > - self.host_testpmd.execute_cmd( > - 'rx_vlan add %d port %d vf %s' % (vlan_id, port_id_0, > vf_mask)) > + if self.nic.startswith("fortville"): > + vm_testpmd =3D self.get_vm_testpmd_by_mask(vf_mask) > + vm_testpmd.execute_cmd('rx_vlan add %d %d' % (vlan_id, > port_id_0)) > + else: > + self.host_testpmd.execute_cmd( > + 'rx_vlan add %d port %d vf %s' % (vlan_id, port_id_0, > vf_mask)) > self.set_port_pool_mirror(port_id_0, '0x1 dst-pool 1 on') > self.set_port_vlan_mirror(port_id_0, '%d dst-pool 0 on' % vlan_i= d) >=20 > @@ -897,12 +963,13 @@ class TestSriovKvm(TestCase): > vf_mask =3D '0x2' > packet_num =3D 1 >=20 > + if self.nic.startswith('fortville'): > + vm_testpmd =3D self.get_vm_testpmd_by_mask(vf_mask) > + else: > + self.host_testpmd.execute_cmd("rx_vlan add %d port %d vf %s"= % > + (vlan_id, port_id_0, vf_mask)) > self.set_port_downlink_mirror(port_id_0, 'dst-pool 1 on') > self.set_port_uplink_mirror(port_id_0, 'dst-pool 1 on') > - self.host_testpmd.execute_cmd("rx_vlan add %d port %d vf %s" % > - (vlan_id, port_id_0, vf_mask)) > - self.set_port_vlan_mirror(port_id_0, '%d dst-pool 0 on' % vlan_i= d) > - self.set_port_pool_mirror(port_id_0, '0x1 dst-pool 1 on') >=20 > self.vm1_testpmd.execute_cmd('set fwd rxonly') > self.vm1_testpmd.execute_cmd('start') > @@ -924,6 +991,7 @@ class TestSriovKvm(TestCase): > self.vm0_testpmd.execute_cmd('start') > vm0_start_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) > vm1_start_stats =3D self.vm1_testpmd.get_pmd_stats(port_id_0) > + host_start_stats =3D self.host_testpmd.get_pmd_stats(port_id_0) > self.send_packet( > self.vm_dut_0, > self.vm0_dut_ports, > @@ -931,9 +999,11 @@ class TestSriovKvm(TestCase): > count=3Dpacket_num) > vm0_end_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) > vm1_end_stats =3D self.vm1_testpmd.get_pmd_stats(port_id_0) > + host_end_stats =3D self.host_testpmd.get_pmd_stats(port_id_0) >=20 > vm0_ret_stats =3D self.calculate_stats(vm0_start_stats, > vm0_end_stats) > vm1_ret_stats =3D self.calculate_stats(vm1_start_stats, > vm1_end_stats) > + host_ret_stats =3D self.calculate_stats(host_start_stats, > host_end_stats) >=20 > self.verify(vm0_ret_stats['RX-packets'] =3D=3D packet_num and > vm0_ret_stats['TX-packets'] =3D=3D packet_num and > @@ -978,8 +1048,11 @@ class TestSriovKvm(TestCase): > packet_num =3D 10 >=20 > for vf_mac in ["00:11:22:33:44:55", "00:55:44:33:22:11"]: > - self.host_testpmd.execute_cmd("mac_addr add port %d > vf %d %s" % > - (port_id_0, vf_num, vf_mac)) > + if self.nic.startswith('niantic'): > + set_mac_cmd =3D "mac_addr add port %d vf %d %s" > + elif self.nic.startswith('fortville'): > + set_mac_cmd =3D "set port %d vf %d %s exact-mac-vlan on" Only two logical judgments can't cover all cases. Just for an example, one = nic like sageville won't cover by the logic. I think the better way is to abstract mac setting function in dedicated mod= ule. > + self.host_testpmd.execute_cmd(set_mac_cmd % (port_id_0, > vf_num, vf_mac)) >=20 > vm0_start_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0= ) > ether_ip =3D {} > @@ -999,6 +1072,7 @@ class TestSriovKvm(TestCase): > "Add exact MAC %s failed btween VF0 and VF1" % > vf_mac + > "when add multi exact MAC address on VF!") >=20 > + @skip_func > def test_two_vms_enalbe_or_disable_one_uta_mac_on_vf(self): > self.setup_2vm_2vf_env() > self.setup_two_vm_common_prerequisite() > @@ -1045,6 +1119,7 @@ class TestSriovKvm(TestCase): > "Disable one uta MAC failed between VM0 and VM1 " + > "when enable or disable one uta MAC address on VF!") >=20 > + @skip_func > def test_two_vms_add_multi_uta_mac_on_vf(self): > self.setup_2vm_2vf_env() > self.setup_two_vm_common_prerequisite() > @@ -1073,15 +1148,22 @@ class TestSriovKvm(TestCase): > "Add MULTI uta MAC %s failed between VM0 and VM1 > " % vf_mac + > "when add multi uta MAC address on VF!") >=20 > + @skip_func > def test_two_vms_add_or_remove_uta_mac_on_vf(self): > 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" > packet_num =3D 10 > + on_time =3D 0 >=20 > for switch in ['on', 'off', 'on']: > + if switch =3D=3D 'on': > + if on_time =3D=3D 0: > + vf_mac =3D "00:55:44:33:22:11" > + on_time +=3D 1 > + else: > + vf_mac =3D "00:11:22:33:44:55" > self.host_testpmd.execute_cmd("set port %d uta %s %s" % > (port_id_0, vf_mac, switch)) >=20 > @@ -1108,6 +1190,7 @@ class TestSriovKvm(TestCase): > "Remove MULTI uta MAC %s failed between VM0 > and VM1 " % vf_mac + > "when add or remove multi uta MAC address on > VF!") >=20 > + @skip_func > def test_two_vms_pause_rx_queues(self): > self.setup_2vm_2vf_env() > self.setup_two_vm_common_prerequisite() > @@ -1140,6 +1223,7 @@ class TestSriovKvm(TestCase): > "Pause RX queues failed between VM0 and VM1 = " > + > "when enable or pause RX queues on VF!") >=20 > + @skip_func > def test_two_vms_pause_tx_queuse(self): > self.setup_2vm_2vf_env() > self.setup_two_vm_common_prerequisite() > @@ -1175,6 +1259,7 @@ class TestSriovKvm(TestCase): > "Pause TX queues failed between VM0 and VM1 = " > + > "when enable or pause TX queues on VF!") >=20 > + @skip_func > def test_two_vms_prevent_rx_broadcast_on_vf(self): > self.setup_2vm_2vf_env() > self.setup_two_vm_common_prerequisite() > @@ -1214,24 +1299,40 @@ class TestSriovKvm(TestCase): > self.setup_2vm_2vf_env() > self.setup_two_vm_common_prerequisite() >=20 > - for command in ["set port 0 vf 65 tx on", > - "set port 2 vf -1 tx off", > - "set port 0 vf 0 rx oneee", > - "set port 0 vf 0 rx offdd", > - "set port 0 vf 64 rxmode BAM on", > - "set port 0 vf 64 rxmode BAM off", > - "set port 0 uta 00:11:22:33:44 on", > - "set port 7 uta 00:55:44:33:22:11 off", > - "set port 0 vf 34 rxmode ROPE on", > - "mac_addr add port 0 vf 65 00:55:44:33:22:11", > - "mac_addr add port 5 vf 0 00:55:44:88:22:11", > - "set port 0 mirror-rule 0xf uplink-mirror dst- > pool 1 on", > - "set port 0 mirror-rule 2 vlan-mirror 9 dst-pool > 1 on", > - "set port 0 mirror-rule 0 downlink-mirror 0xf > dst-pool 2 off", > - "reset port 0 mirror-rule 4", > - "reset port 0xff mirror-rule 0"]: > + public_commands =3D ["set port 0 vf 65 tx on", > + "set port 2 vf -1 tx off", > + "set port 0 vf 0 rx oneee", > + "set port 0 vf 0 rx offdd", > + "set port 0 vf 64 rxmode BAM on", > + "set port 0 vf 64 rxmode BAM off", > + "set port 0 uta 00:11:22:33:44 on", > + "set port 7 uta 00:55:44:33:22:11 off", > + "set port 0 vf 34 rxmode ROPE on", > + "mac_addr add port 0 vf 65 00:55:44:33:22:11= ", > + "mac_addr add port 5 vf 0 00:55:44:88:22:11"= , > + "set port 0 mirror-rule 0 downlink-mirror 0x= f > dst-pool 2 off", > + "reset port 0xff mirror-rule 0"] > + niantic_specify_commands =3D ["set port 0 mirror-rule 0xf uplink= - > mirror dst-pool 1 on", > + "set port 0 mirror-rule 2 vlan-mirro= r > 9 dst-pool 1 on", > + "reset port 0 mirror-rule 4"] > + fortville_specify_commands =3D ["set port 0 mirror-rule 2 vlan- > mirror 65 dst-pool 1 on"] > + These commands look like hard code, please add more comments. > + if self.nic.startswith('nantic'): > + verify_commands =3D public_commands + \ > + niantic_specify_commands > + elif self.nic.startswith('fortville'): > + verify_commands =3D public_commands + \ > + fortville_specify_commands > + else: > + verify_commands =3D public_commands > + > + for command in verify_commands: > output =3D self.host_testpmd.execute_cmd(command) > + print output > error =3D False >=20 > for error_regx in [r'Bad', r'bad', r'failed', r'-[0-9]+', > r'error', r'Invalid']: > ret_regx =3D re.search(error_regx, output) > -- > 1.9.3