From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 55050A00E6 for ; Tue, 6 Aug 2019 11:59:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3723F1BE35; Tue, 6 Aug 2019 11:59:30 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 75F661B957 for ; Tue, 6 Aug 2019 11:59:28 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 02:59:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,353,1559545200"; d="scan'208";a="176590094" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 06 Aug 2019 02:59:27 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 02:59:26 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 02:59:26 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.249]) with mapi id 14.03.0439.000; Tue, 6 Aug 2019 17:59:24 +0800 From: "Tu, Lijuan" To: "Zhao, MeijuanX" , "dts@dpdk.org" CC: "Zhao, MeijuanX" Thread-Topic: [dts] [PATCH V1] tests/kernelpf_iavf fix some verify issue and change testpmd fwd mode Thread-Index: AQHVO6lOmknFDCRXgkKb279qzGxsrqbuA+dg Date: Tue, 6 Aug 2019 09:59:24 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BAFD559@SHSMSX101.ccr.corp.intel.com> References: <20190716153719.60783-1-meijuanx.zhao@intel.com> <20190716153719.60783-2-meijuanx.zhao@intel.com> In-Reply-To: <20190716153719.60783-2-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjRmNWUyZWUtMzBlNC00ODBiLWI3ZDYtZDVhNGZkM2Q0NGUwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoic3E0Z0s3aUpQZk1RMm1IK2dVSWZVRXNjYzVDUWlKQTdTWDNoZjY3NmJOM2NPQWtWeGpoTVBoYzQ3VWtGcDRCcCJ9 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/kernelpf_iavf fix some verify issue and change testpmd fwd mode 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, July 16, 2019 11:37 PM > To: dts@dpdk.org > Cc: Zhao, MeijuanX > Subject: [dts] [PATCH V1] tests/kernelpf_iavf fix some verify issue and c= hange > testpmd fwd mode >=20 > *.change verify way about vlan tag > *.change testpmd fwd mode > *.change rxtx verify way due to pkt drop *.add sleep time for tcpdump >=20 > Signed-off-by: zhaomeijuan > --- > tests/TestSuite_kernelpf_iavf.py | 65 ++++++++++++++++++++++---------- > 1 file changed, 46 insertions(+), 19 deletions(-) >=20 > diff --git a/tests/TestSuite_kernelpf_iavf.py > b/tests/TestSuite_kernelpf_iavf.py > index 2dcd717..13e7bde 100644 > --- a/tests/TestSuite_kernelpf_iavf.py > +++ b/tests/TestSuite_kernelpf_iavf.py > @@ -228,7 +228,7 @@ class TestKernelpfIavf(TestCase): > out =3D self.vm_dut.get_session_output() > self.verify(self.vf_mac in out, "vf receive packet fail") > stats =3D self.vm_testpmd.get_pmd_stats(0) > - self.verify(stats['RX-packets'] =3D=3D 100, 'vf receive packet n= um is not > match') > + self.verify(stats['RX-packets'] >=3D 100, 'vf receive packet num > + is not match') > ''' > Set txonly forward,check packets can be received by tester > ''' > @@ -244,7 +244,8 @@ class TestKernelpfIavf(TestCase): > cap_packet =3D self.tester.send_expect('cat tcpdump.out', '#', 3= 0) > stats =3D self.vm_testpmd.get_pmd_stats(0) > cap_tcp_num =3D re.findall('(\d+) packets', cap_packet) > - self.verify(stats['TX-packets'] <=3D int(cap_tcp_num[1]), 'vf se= nd packet > num is not match') > + nums =3D sum(map(int,cap_tcp_num)) > + self.verify(stats['TX-packets'] !=3D0 and nums > > + stats['TX-packets'], 'vf send packet num is not match') >=20 > def test_vf_mac_filter(self): > """ > @@ -377,11 +378,19 @@ class TestKernelpfIavf(TestCase): > self.vm_testpmd.execute_cmd("set fwd mac") > self.vm_testpmd.execute_cmd("set verbose 1") > self.vm_testpmd.execute_cmd("start") > + self.start_tcpdump(self.tester_intf) > out =3D self.send_and_getout(vlan=3Drandom_vlan, pkt_type=3D"VLA= N_UDP") > - self.verify("VLAN tci=3D%s" % hex(random_vlan) in out and self.v= f_mac in > out, "Failed to received vlan packet!!!") > + tcpdump_out =3D self.get_tcpdump_package() > + self.verify(self.vf_mac in out, "testpmd can't receive packet") > + receive_pkt =3D re.findall('vlan %s' % random_vlan, tcpdump_out) > + self.verify(len(receive_pkt) =3D=3D 2, 'Failed to received vlan > + packet!!!') > wrong_vlan =3D (random_vlan + 1) % 4096 > + self.start_tcpdump(self.tester_intf) > out =3D self.send_and_getout(vlan=3Dwrong_vlan, pkt_type=3D"VLAN= _UDP") > - self.verify("VLAN tci=3D%s" % hex(wrong_vlan) not in out and sel= f.vf_mac > not in out, "received wrong vlan packet!!!") > + tcpdump_out =3D self.get_tcpdump_package() > + self.verify(self.vf_mac not in out, 'received wrong vlan packet!= !!') > + receive_pkt =3D re.findall('vlan %s' % wrong_vlan, tcpdump_out) > + self.verify(len(receive_pkt) =3D=3D 1, "tester received wrong vl= an > + packet!!!") >=20 > # remove vlan > self.dut.send_expect("ip link set %s vf 0 vlan 0" % self.host_in= tf, "# ") > @@ -389,16 +398,20 @@ class TestKernelpfIavf(TestCase): > self.verify("vlan %d" % random_vlan not in out, "Failed to remov= e pvid > on VF0") > # send packet without vlan > out =3D self.send_and_getout(vlan=3D0, pkt_type=3D"UDP") > - self.verify(self.vf_mac in out and "VLAN tci=3D0x0" in out, "Not= received > packet without vlan!!!") > + self.verify(self.vf_mac in out, "Not received packet without > + vlan!!!") >=20 > # send packet with vlan 0 > out =3D self.send_and_getout(vlan=3D0, pkt_type=3D"VLAN_UDP") > self.verify( > - self.vf_mac in out and "VLAN tci=3D0x0" in out, "Not recevie= d packet > with vlan 0!!!") > + self.vf_mac in out, "Not recevied packet with vlan 0!!!") >=20 > # send random vlan packet > + self.start_tcpdump(self.tester_intf) > out =3D self.send_and_getout(vlan=3Drandom_vlan, pkt_type=3D"VLA= N_UDP") > - self.verify(self.vf_mac not in out and "VLAN tci=3D%s" % hex(ran= dom_vlan) > not in out, "Failed to received vlan packet!!!") > + tcpdump_out =3D self.get_tcpdump_package() > + receive_pkt =3D re.findall('vlan %s' % random_vlan, tcpdump_out) > + self.verify(len(receive_pkt) =3D=3D 2, "fail to tester received = vlan packet!!!") > + self.verify(self.vf_mac in out, "Failed to received vlan > + packet!!!") >=20 > def send_and_getout(self, vlan=3D0, pkt_type=3D"UDP"): >=20 > @@ -433,17 +446,21 @@ class TestKernelpfIavf(TestCase): > self.vm_testpmd.execute_cmd("rx_vlan add 1 0") >=20 > # send packet vlan 1, vf can receive packet > + self.start_tcpdump(self.tester_intf) > out =3D self.send_and_getout(vlan=3D1, pkt_type=3D"VLAN_UDP") > - self.verify("VLAN tci=3D%s" % hex(1) in out and self.vf_mac in o= ut, "Failed > to received vlan 1 packet!!!") > + tcpdump_out =3D self.get_tcpdump_package() > + receive_pkt =3D re.findall('vlan 1', tcpdump_out) > + self.verify(len(receive_pkt) =3D=3D 1 , 'Failed to received vlan= packet!!!') > + self.verify(self.vf_mac in out, "Failed to received vlan 1 > + packet!!!") >=20 > # send random vlan packet, vf can not receive packet > random_vlan =3D random.randint(1, MAX_VLAN) > out =3D self.send_and_getout(vlan=3Drandom_vlan, pkt_type=3D"VLA= N_UDP") > - self.verify("VLAN tci=3D%s" % hex(random_vlan) not in out and > self.vf_mac not in out, "received random vlan packet!!!") > + self.verify(self.vf_mac not in out, 'fail to vf receive pkt') >=20 > # send max vlan 4095, vf can not receive packet > out =3D self.send_and_getout(vlan=3DMAX_VLAN, pkt_type=3D"VLAN_U= DP") > - self.verify("VLAN tci=3D%s" % hex(MAX_VLAN) not in out and self.= vf_mac > not in out, "received max vlan packet!!!") > + self.verify(self.vf_mac not in out, "received max vlan > + packet!!!") >=20 > # remove vlan > self.vm_testpmd.execute_cmd("rx_vlan rm 1 0") @@ -456,9 +473,9 @= @ > class TestKernelpfIavf(TestCase): > out =3D self.send_and_getout(vlan=3D0, pkt_type=3D"VLAN_UDP") > self.verify(self.vf_mac in out, "Failed to received vlan 0 packe= t!!!") >=20 > - # send vlan 1 packet, vf can not receive packet > + # send vlan 1 packet, vf can receive packet > out =3D self.send_and_getout(vlan=3D1, pkt_type=3D"VLAN_UDP") > - self.verify(self.vf_mac not in out, "received vlan 1 packet!!!") > + self.verify(self.vf_mac in out, "received vlan 1 packet!!!") >=20 > def test_vf_vlan_insertion(self): > self.vm_testpmd.start_testpmd("all") > @@ -470,12 +487,13 @@ class TestKernelpfIavf(TestCase): > self.vm_testpmd.execute_cmd("set fwd mac") > self.vm_testpmd.execute_cmd("set verbose 1") > self.vm_testpmd.execute_cmd("start") > - > + > + self.start_tcpdump(self.tester_intf) > out =3D self.send_and_getout(pkt_type=3D"UDP") > + tcpdump_out =3D self.get_tcpdump_package() > + receive_pkt =3D re.findall('vlan %s' % random_vlan, tcpdump_out) > print out > - time.sleep(1) > - vlan_hex =3D hex(random_vlan) > - self.verify("VLAN tci=3D%s" % vlan_hex in out, 'add vlan tag fai= l !!') > + self.verify(len(receive_pkt) =3D=3D 1, 'Failed to received vlan > + packet!!!') >=20 > def test_vf_vlan_strip(self): > random_vlan =3D random.randint(1, MAX_VLAN) @@ -484,14 +502,19 > @@ class TestKernelpfIavf(TestCase): > self.vm_testpmd.execute_cmd("set fwd mac") > self.vm_testpmd.execute_cmd("set verbose 1") > self.vm_testpmd.execute_cmd("start") > + self.start_tcpdump(self.tester_intf) > out =3D self.send_and_getout(vlan=3Drandom_vlan, pkt_type=3D"VLA= N_UDP") > - self.verify('VLAN tci=3D' not in out and self.vf_mac not in out,= 'vlan tag in > out') > + tcpdump_out =3D self.get_tcpdump_package() > + receive_pkt =3D re.findall('vlan %s' % random_vlan, tcpdump_out) > + self.verify(len(receive_pkt) =3D=3D 1, 'Failed to received vlan > + packet!!!') >=20 > # disable strip > self.vm_testpmd.execute_cmd("vlan set strip off 0") > + self.start_tcpdump(self.tester_intf) > out =3D self.send_and_getout(vlan=3Drandom_vlan, pkt_type=3D"VLA= N_UDP") > - vlan_hex =3D hex(random_vlan) > - self.verify("VLAN tci=3D%s" % vlan_hex in out, 'vlan tag not in = out') > + tcpdump_out =3D self.get_tcpdump_package() > + receive_pkt =3D re.findall('vlan %s' % random_vlan, tcpdump_out) > + self.verify(len(receive_pkt) =3D=3D 2, 'Failed to received vlan > + packet!!!') >=20 > def test_vf_without_jumboframe(self): > self.tester.send_expect('ifconfig %s mtu %s' % (self.tester_intf= , > ETHER_JUMBO_FRAME_MTU), '#') @@ -508,6 +531,9 @@ class > TestKernelpfIavf(TestCase): > self.tester.send_expect('ifconfig %s mtu %d' % (self.tester_intf= , > ETHER_JUMBO_FRAME_MTU), '#') > conf_pkt_len =3D 3000 > self.vm_testpmd.start_testpmd("all", "--max-pkt-len=3D%d" % > conf_pkt_len) > + self.vm_testpmd.execute_cmd("set fwd mac") > + self.vm_testpmd.execute_cmd("set promisc all off") > + self.vm_testpmd.execute_cmd("start") > self.jumboframes_send_packet(conf_pkt_len - 1, True) > self.jumboframes_send_packet(conf_pkt_len + 1, False) > self.tester.send_expect("ifconfig %s mtu %d" % (self.tester_intf= , > ETHER_STANDARD_MTU)) @@ -707,6 +733,7 @@ class > TestKernelpfIavf(TestCase): > def start_tcpdump(self, rxItf): > self.tester.send_expect("rm -rf getPackageByTcpdump.cap", "#") > self.tester.send_expect("tcpdump -A -nn -e -vv -w > getPackageByTcpdump.cap -i %s 2> /dev/null& " % rxItf, "#") > + time.sleep(2) >=20 > def get_tcpdump_package(self): > self.tester.send_expect("killall tcpdump", "#") > -- > 2.17.1