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 01999A046B for ; Wed, 26 Jun 2019 09:11:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BB22D5398; Wed, 26 Jun 2019 09:11:05 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 341B54F94 for ; Wed, 26 Jun 2019 09:11:03 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 00:11:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,418,1557212400"; d="scan'208";a="184750864" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 26 Jun 2019 00:11:01 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 26 Jun 2019 00:10:57 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 26 Jun 2019 00:10:57 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 26 Jun 2019 00:10:56 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.87]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.246]) with mapi id 14.03.0439.000; Wed, 26 Jun 2019 15:10:55 +0800 From: "Tu, Lijuan" To: "Zhu, ShuaiX" , "dts@dpdk.org" CC: "Zhu, ShuaiX" Thread-Topic: [dts] [PATCH V1] tests/vf_offload:Modify the verification result of test. Thread-Index: AQHVJXW3BigQEYQOAUuR/1tb8JNdMKatkZ1w Date: Wed, 26 Jun 2019 07:10:54 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BAC5006@SHSMSX101.ccr.corp.intel.com> References: <1560821824-6051-1-git-send-email-shuaix.zhu@intel.com> In-Reply-To: <1560821824-6051-1-git-send-email-shuaix.zhu@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzI5NTFiMDAtOTcxNy00ZmJlLTk3OTUtZGUyZmNiZGFiY2ZjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidnViZmVpZVJTaHYrZGVzeVdSSUtCQlRvM21xbmF0a3lKYUk3MldsaEFYNkZvbk95QXhmZnpUZkxXcFJoczFVayJ9 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/vf_offload:Modify the verification result of test. 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 zhu,shuai > Sent: Tuesday, June 18, 2019 9:37 AM > To: dts@dpdk.org > Cc: Zhu, ShuaiX > Subject: [dts] [PATCH V1] tests/vf_offload:Modify the verification result= of > test. >=20 > Since the result verification method of the case has a problem, the resul= t > verification method is modified. >=20 > Signed-off-by: zhu,shuai > --- > tests/TestSuite_vf_offload.py | 117 ++++++++++++++++++++++++---------- > 1 file changed, 84 insertions(+), 33 deletions(-) >=20 > diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.p= y > index 8cb0dac..dc5cb30 100644 > --- a/tests/TestSuite_vf_offload.py > +++ b/tests/TestSuite_vf_offload.py > @@ -13,6 +13,8 @@ from net_device import NetDevice from crb import Crb > from settings import HEADER_SIZE VM_CORES_MASK =3D 'all' > +DEFAULT_MTU =3D 1500 > +TSO_MTU =3D 9000 >=20 > class TestVfOffload(TestCase): >=20 > @@ -39,6 +41,7 @@ class TestVfOffload(TestCase): > self.vm0_dut_ports =3D self.vm_dut_0.get_ports('any') > self.portMask =3D utils.create_mask([self.vm0_dut_ports[0]]) > self.vm0_testpmd =3D PmdOutput(self.vm_dut_0) > + self.tester.send_expect("ifconfig %s mtu %s" % > + (self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0 > + ])), TSO_MTU), "# ") >=20 >=20 > def set_up(self): > @@ -336,6 +339,21 @@ class TestVfOffload(TestCase): > 'grep -c "seq"') > return self.tcpdump_command(command.format(**locals())) >=20 > + def tcpdump_scanner(self, scanner): > + """ > + Execute scanner to return results > + """ > + scanner_result =3D self.tester.send_expect(scanner, '#') > + fially_result =3D re.findall(r'length( \d+)', scanner_result) > + return list(fially_result) > + > + def number_of_bytes(self, iface): > + """ > + Get the length of loading_sizes > + """ > + scanner =3D ('tcpdump -vv -r tcpdump_{iface}.pcap 2>/dev/null |= grep > "seq" | grep "length"') > + return self.tcpdump_scanner(scanner.format(**locals())) > + > def test_tso(self): > """ > TSO IPv4 TCP, IPv6 TCP testing. > @@ -343,59 +361,92 @@ class TestVfOffload(TestCase): > tx_interface =3D > self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0])) > rx_interface =3D > self.tester.get_interface(self.tester.get_local_port(self.dut_ports[1])) >=20 > - self.frame_sizes =3D [128, 1458] > - self.headers_size =3D HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + > HEADER_SIZE['tcp'] > - padding =3D self.frame_sizes[0] - self.headers_size > + self.loading_sizes =3D [128, 800, 801, 1700, 2500] >=20 > self.tester.send_expect("ethtool -K %s rx off tx off tso off gso= off gro off > lro off" % tx_interface, "# ") > self.tester.send_expect("ip l set %s up" % tx_interface, "# ") > + self.dut.send_expect("ifconfig %s mtu %s" % > + (self.dut.ports_info[0]['intf'], TSO_MTU), "# ") >=20 > self.portMask =3D utils.create_mask([self.vm0_dut_ports[0]]) > - self.vm0_testpmd.start_testpmd(VM_CORES_MASK, "--portmask=3D%s "= % > - (self.portMask) + "--enable-rx-cks= um " + > - "" + > - "--port-topology=3Dloop") > + self.vm0_testpmd.start_testpmd(VM_CORES_MASK, "--portmask=3D0x3 = " > + + "--enable-rx-cksum " + "--max-pkt-len=3D%s" % TSO_MTU) >=20 > mac =3D self.vm0_testpmd.get_port_mac(0) >=20 > - self.checksum_enablehw(0,self.vm_dut_0) > + self.vm0_testpmd.execute_cmd("set verbose 1", "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("port stop all", "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum set ip hw %d" % > self.dut_ports[0], "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum set udp hw %d" % > self.dut_ports[0], "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum set tcp hw %d" % > self.dut_ports[0], "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum set sctp hw %d" % > self.dut_ports[0], "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum set outer-ip hw %d" % > self.dut_ports[0], "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum parse-tunnel on %d" % > + self.dut_ports[0], "testpmd> ", 120) > + > + self.vm0_testpmd.execute_cmd("csum set ip hw %d" % > self.dut_ports[1], "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum set udp hw %d" % > self.dut_ports[1], "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum set tcp hw %d" % > self.dut_ports[1], "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum set sctp hw %d" % > self.dut_ports[1], "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum set outer-ip hw %d" % > self.dut_ports[1], "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("csum parse-tunnel on %d" % > + self.dut_ports[1], "testpmd> ", 120) > + > self.vm0_testpmd.execute_cmd("tso set 800 %d" % > self.vm0_dut_ports[1]) > self.vm0_testpmd.execute_cmd("set fwd csum") > + self.vm0_testpmd.execute_cmd("port start all", "testpmd> ", 120) > + self.vm0_testpmd.execute_cmd("set promisc all off", "testpmd> > + ", 120) > self.vm0_testpmd.execute_cmd("start") >=20 > self.tester.scapy_foreground() > time.sleep(5) >=20 > - # IPv4 tcp test > - > - self.tcpdump_start_sniffing([tx_interface, rx_interface]) > - > self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00:00:00:00:0= 0")/IP( > src=3D"192.168.1.1",dst=3D"192.168.1.2")/TCP(sport=3D1021,dport=3D1021)/(= "X"*%s)], > iface=3D"%s")' % (mac, padding, tx_interface)) > - out =3D self.tester.scapy_execute() > - out =3D self.vm0_testpmd.execute_cmd("show port stats all") > - print out > - self.tcpdump_stop_sniff() > - rx_stats =3D self.number_of_packets(rx_interface) > - if (rx_stats =3D=3D 2): > - self.verify(1, "Pass") > - > - # IPv6 tcp test > - > - self.tcpdump_start_sniffing([tx_interface, rx_interface]) > - self.tester.scapy_append('sendp([Ether(dst=3D"%s", > src=3D"52:00:00:00:00:00")/IPv6(src=3D"FE80:0:0:0:200:1FF:FE00:200", > dst=3D"3555:5555:6666:6666:7777:7777:8888:8888")/TCP(sport=3D1021,dport= =3D102 > 1)/("X"*%s)], iface=3D"%s")' % (mac, padding, tx_interface)) > - out =3D self.tester.scapy_execute() > - out =3D self.vm0_testpmd.execute_cmd("show port stats all") > - print out > - self.tcpdump_stop_sniff() > - rx_stats =3D self.number_of_packets(rx_interface) > - if (rx_stats =3D=3D 2): > - self.verify(1, "Pass") > - > + for loading_size in self.loading_sizes: > + # IPv4 tcp test > + out =3D self.vm0_testpmd.execute_cmd("clear port info all", = "testpmd> > ", 120) > + self.tcpdump_start_sniffing([tx_interface, rx_interface]) > + > self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00:00:00:00:0= 0")/IP( > src=3D"192.168.1.1",dst=3D"192.168.1.2")/TCP(sport=3D1021,dport=3D1021)/(= "X"*%s)], > iface=3D"%s")' % (mac, loading_size, tx_interface)) > + out =3D self.tester.scapy_execute() > + out =3D self.vm0_testpmd.execute_cmd("show port stats all") > + print out > + self.tcpdump_stop_sniff() > + rx_stats =3D self.number_of_packets(rx_interface) > + tx_stats =3D self.number_of_packets(tx_interface) > + tx_outlist =3D self.number_of_bytes(rx_interface) > + self.logger.info(tx_outlist) > + if (loading_size <=3D 800): > + self.verify(rx_stats =3D=3D tx_stats and int(tx_outlist[= 0]) =3D=3D > loading_size, "IPV4 RX or TX packet number not correct") > + else: > + num =3D loading_size/800 > + for i in range(num): > + self.verify(int(tx_outlist[i]) =3D=3D 800, "the pack= et segmentation > incorrect, %s" % tx_outlist) > + if loading_size% 800 !=3D 0: > + self.verify(int(tx_outlist[num]) =3D=3D loading_size= % > + 800, "the packet segmentation incorrect, %s" % tx_outlist) > + > + for loading_size in self.loading_sizes: > + # IPv6 tcp test > + out =3D self.vm0_testpmd.execute_cmd("clear port info all", = "testpmd> > ", 120) > + self.tcpdump_start_sniffing([tx_interface, rx_interface]) > + self.tester.scapy_append('sendp([Ether(dst=3D"%s", > src=3D"52:00:00:00:00:00")/IPv6(src=3D"FE80:0:0:0:200:1FF:FE00:200", > dst=3D"3555:5555:6666:6666:7777:7777:8888:8888")/TCP(sport=3D1021,dport= =3D102 > 1)/("X"*%s)], iface=3D"%s")' % (mac, loading_size, tx_interface)) > + out =3D self.tester.scapy_execute() > + out =3D self.vm0_testpmd.execute_cmd("show port stats all") > + print out > + self.tcpdump_stop_sniff() > + rx_stats =3D self.number_of_packets(rx_interface) > + tx_stats =3D self.number_of_packets(tx_interface) > + tx_outlist =3D self.number_of_bytes(rx_interface) > + self.logger.info(tx_outlist) > + if (loading_size <=3D 800): > + self.verify(rx_stats =3D=3D tx_stats and int(tx_outlist[= 0]) =3D=3D > loading_size, "IPV6 RX or TX packet number not correct") > + else: > + num =3D loading_size/800 > + for i in range(num): > + self.verify(int(tx_outlist[i]) =3D=3D 800, "the pack= et segmentation > incorrect, %s" % tx_outlist) > + if loading_size% 800 !=3D 0: > + self.verify(int(tx_outlist[num]) =3D=3D loading_size= % > + 800, "the packet segmentation incorrect, %s" % tx_outlist) >=20 > def tear_down(self): > self.vm0_testpmd.execute_cmd('quit', '# ') > - pass > + self.dut.send_expect("ifconfig %s mtu %s" % > + (self.dut.ports_info[0]['intf'], DEFAULT_MTU), "# ") >=20 > def tear_down_all(self): > print "tear_down_all" > if self.setup_2pf_2vf_1vm_env_flag =3D=3D 1: > self.destroy_2pf_2vf_1vm_env() > + self.tester.send_expect("ifconfig %s mtu %s" % > + (self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0 > + ])), DEFAULT_MTU), "# ") > -- > 2.17.2