From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 5AB325A36 for ; Tue, 17 Nov 2015 03:32:08 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 16 Nov 2015 18:32:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,305,1444719600"; d="scan'208";a="852539450" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 16 Nov 2015 18:32:07 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 16 Nov 2015 18:32:07 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 16 Nov 2015 18:32:06 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.83]) by shsmsx102.ccr.corp.intel.com ([169.254.2.42]) with mapi id 14.03.0248.002; Tue, 17 Nov 2015 10:32:04 +0800 From: "Qiu, Michael" To: "Ding, HengX" , "dts@dpdk.org" Thread-Topic: [PATCH] tests TSO: Add RRC support and some bug fix Thread-Index: AQHRIFDZaSUUHbeXZkyZlpvYrvwp+w== Date: Tue, 17 Nov 2015 02:32:03 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028621B82884@SHSMSX101.ccr.corp.intel.com> References: <1447665939-12229-1-git-send-email-hengx.ding@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] tests TSO: Add RRC support and some bug fix 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: Tue, 17 Nov 2015 02:32:09 -0000 On 2015/11/16 17:26, Ding, HengX wrote:=0A= > Add RRC support and some bug fix. Use testpmd output to verify the test r= esult=0A= > instead of tcpdump, in order to avoid wrong test result caused by it.=0A= >=0A= > Signed-off-by: Mihcael Qiu =0A= > Signed-off-by: Ding Heng =0A= >=0A= > diff --git a/tests/TestSuite_tso.py b/tests/TestSuite_tso.py=0A= > index 5bd8592..94f69df 100644=0A= > --- a/tests/TestSuite_tso.py=0A= > +++ b/tests/TestSuite_tso.py=0A= > @@ -83,7 +83,8 @@ class TestTSO(TestCase):=0A= > # this feature support Fortville, Niantic=0A= > self.verify(self.nic in ["kawela_2", "niantic", "bartonhills", "= 82545EM",=0A= > "82540EM", "springfountain", "fortville= _eagle",=0A= > - "fortville_spirit", "fortville_spirit_s= ingle"],=0A= > + "fortville_spirit", "fortville_spirit_s= ingle",=0A= > + "redrockcanyou"],=0A= > "NIC Unsupported: " + str(self.nic))=0A= > =0A= > # Based on h/w type, choose how many ports to use=0A= > @@ -98,6 +99,7 @@ class TestTSO(TestCase):=0A= > self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0])=0A= > =0A= > self.frame_sizes =3D [128, 1458]=0A= > + self.tso_size =3D [256, 500, 700, 900]=0A= > self.rxfreet_values =3D [0, 8, 16, 32, 64, 128]=0A= > =0A= > # self.test_cycles =3D [{'cores': '1S/1C/1T', 'Mpps': {}, 'pct':= {}},=0A= > @@ -116,7 +118,7 @@ class TestTSO(TestCase):=0A= > self.blacklist =3D ""=0A= > =0A= > # self.coreMask =3D dts.create_mask(cores)=0A= > -=0A= > + # This is for ipv4, for ipv6 need addtional 20=0A= > self.headers_size =3D HEADER_SIZE['eth'] + HEADER_SIZE[=0A= > 'ip'] + HEADER_SIZE['tcp']=0A= > =0A= > @@ -138,7 +140,7 @@ class TestTSO(TestCase):=0A= > =0A= > for iface in ifaces:=0A= > command =3D ('tcpdump -w tcpdump_{0}.pcap -i {0} 2>tcpdump_{= 0}.out &').format(iface)=0A= > - self.tester.send_expect('rm -f tcpdump_{0}.pcap', '#').forma= t(iface)=0A= > + self.tester.send_expect(('rm -f tcpdump_{0}.pcap').format(if= ace), '#')=0A= > self.tester.send_expect(command, '#')=0A= > =0A= > def tcpdump_stop_sniff(self):=0A= > @@ -182,7 +184,7 @@ class TestTSO(TestCase):=0A= > self.verify(cores is not None, "Insufficient cores for speed tes= ting")=0A= > self.coreMask =3D dts.create_mask(cores)=0A= > =0A= > - padding =3D self.frame_sizes[0] - self.headers_size=0A= > + padding =3D [(frame_size - self.headers_size) for frame_size in = self.frame_sizes]=0A= > =0A= > self.tester.send_expect("ethtool -K %s rx off tx off tso off gso= off gro off lro off" % tx_interface, "# ")=0A= > self.tester.send_expect("ip l set %s up" % tx_interface, "# ")= =0A= > @@ -204,41 +206,45 @@ class TestTSO(TestCase):=0A= > self.dut.send_expect("csum set outer-ip hw %d" % self.dut_ports[= 1], "testpmd> ", 120)=0A= > self.dut.send_expect("csum parse_tunnel on %d" % self.dut_ports[= 1], "testpmd> ", 120)=0A= > =0A= > - self.dut.send_expect("tso set 800 %d" % self.dut_ports[1], "test= pmd> ", 120)=0A= > - self.dut.send_expect("set fwd csum", "testpmd> ", 120)=0A= > - self.dut.send_expect("start", "testpmd> ")=0A= > =0A= > self.tester.scapy_foreground()=0A= > time.sleep(5)=0A= > + for tso_s in self.tso_size:=0A= > + self.dut.send_expect("tso set %d %d" % (tso_s, self.dut_port= s[1]), "testpmd> ", 120)=0A= > + self.dut.send_expect("set fwd csum", "testpmd> ", 120)=0A= > + self.dut.send_expect("set promisc all off", "testpmd> ", 120)=0A= =0A= Here needs replace 'tab' with white space. you need check other place=0A= also has this issue.=0A= =0A= Thanks,=0A= Michael=0A= =0A= > + self.dut.send_expect("start", "testpmd> ")=0A= > + self.dut.send_expect("clear port stats all", "testpmd> ")=0A= > +=0A= > + for padd in padding:=0A= > + expect_rx_stats =3D padd/tso_s + (1 if padd % tso_s else= 0)=0A= > + self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D= "52:00:00:00:00:00")/IP(src=3D"192.168.1.1", dst=3D"192.168.1.2")/TCP(sport= =3D1021,dport=3D1021)/("X"*%s)], iface=3D"%s")'% (mac, padd, tx_interface))= =0A= > + self.dut.send_expect("clear port stats all", "testpmd> ")= =0A= > + out =3D self.tester.scapy_execute()=0A= > + out =3D self.dut.send_expect("show port stats %s" % self= .dut_ports[1], "testpmd> ", 120)=0A= > + rx_stats =3D int(dts.regexp(out, "TX-packets: ([0-9]+)"))=0A= > + self.verify(rx_stats =3D=3D expect_rx_stats, "FAIL: For = TSO size %d and packet size %d, expect rx stats =3D %d, but actually receiv= ed %d" %(tso_s, self.headers_size + padd, expect_rx_stats, rx_stats))=0A= > +=0A= > + # IPv6 tcp test=0A= > + expect_rx_stats =3D (padd -20)/tso_s + (1 if (padd - 20)= % tso_s else 0)=0A= > + 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"35= 55:5555:6666:6666:7777:7777:8888:8888")/TCP(sport=3D1021,dport=3D1021)/("X"= *%s)], iface=3D"%s")' % (mac, padd - 20, tx_interface))=0A= > + self.dut.send_expect("clear port stats all", "testpmd> ")= =0A= > + out =3D self.tester.scapy_execute()=0A= > + out =3D self.dut.send_expect("show port stats %s" % self= .dut_ports[1], "testpmd> ", 120)=0A= > + rx_stats =3D int(dts.regexp(out, "TX-packets: ([0-9]+)"))=0A= > + self.verify(rx_stats =3D=3D expect_rx_stats, "FAIL: For = TSO size %d and packet size %d, expect rx stats =3D %d, but actually receiv= ed %d" %(tso_s, self.headers_size + padd, expect_rx_stats, rx_stats))=0A= > =0A= > - # IPv4 tcp test=0A= > -=0A= > - self.tcpdump_start_sniffing([tx_interface, rx_interface])=0A= > - self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00:0= 0:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2")/TCP(sport=3D1021,d= port=3D1021)/("X"*%s)], iface=3D"%s")' % (mac, padding, tx_interface))=0A= > - out =3D self.tester.scapy_execute()=0A= > - out =3D self.dut.send_expect("show port stats all", "testpmd> ",= 120)=0A= > - print out=0A= > - self.tcpdump_stop_sniff()=0A= > - rx_stats =3D self.number_of_packets(rx_interface)=0A= > - if (rx_stats =3D=3D 2):=0A= > - self.verify(1, "Pass")=0A= > -=0A= > - # IPv6 tcp test=0A= > -=0A= > - self.tcpdump_start_sniffing([tx_interface, rx_interface])=0A= > - 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:66= 66:6666:7777:7777:8888:8888")/TCP(sport=3D1021,dport=3D1021)/("X"*%s)], ifa= ce=3D"%s")' % (mac, padding, tx_interface))=0A= > - out =3D self.tester.scapy_execute()=0A= > - out =3D self.dut.send_expect("show port stats all", "testpmd> ",= 120)=0A= > - print out=0A= > - self.tcpdump_stop_sniff()=0A= > - rx_stats =3D self.number_of_packets(rx_interface)=0A= > - if (rx_stats =3D=3D 2):=0A= > - self.verify(1, "Pass")=0A= > + self.dut.send_expect("stop", "testpmd> ")=0A= > =0A= > def test_tso_tunneling(self):=0A= > """=0A= > TSO IPv4 TCP, IPv6 TCP, VXLan testing=0A= > """=0A= > + # RedRockCanyou does not support Tunneling in DPDK yet.=0A= > + if self.nic =3D=3D "redrockcanyou":=0A= > + print dts.RED("fm10k not support this case\n")=0A= > + return=0A= > +=0A= > tx_interface =3D self.tester.get_interface(self.tester.get_local= _port(self.dut_ports[0]))=0A= > rx_interface =3D self.tester.get_interface(self.tester.get_local= _port(self.dut_ports[1]))=0A= > =0A= > @@ -248,7 +254,10 @@ class TestTSO(TestCase):=0A= > self.verify(cores is not None, "Insufficient cores for speed tes= ting")=0A= > self.coreMask =3D dts.create_mask(cores)=0A= > =0A= > - padding =3D self.frame_sizes[0] - self.headers_size=0A= > + self.headers_size_vxlan =3D self.headers_size + HEADER_SIZE['et= h'] + HEADER_SIZE['ip'] + HEADER_SIZE['udp'] + HEADER_SIZE['vxlan']=0A= > + self.headers_size_nvgre =3D 2 * self.headers_size + HEADER_SIZE[= 'nvgre']=0A= > + padding_vxlan =3D [(frame_size - self.headers_size_vxlan) for fr= ame_size in self.frame_sizes]=0A= > + padding_nvgre =3D [(frame_size - self.headers_size_nvgre) for fr= ame_size in self.frame_sizes]=0A= > =0A= > self.tester.send_expect("ethtool -K %s rx off tx off tso off gso= off gro off lro off" % tx_interface, "# ")=0A= > self.tester.send_expect("ip l set %s up" % tx_interface, "# ")= =0A= > @@ -270,34 +279,39 @@ class TestTSO(TestCase):=0A= > self.dut.send_expect("csum set outer-ip hw %d" % self.dut_ports[= 1], "testpmd> ", 120)=0A= > self.dut.send_expect("csum parse_tunnel on %d" % self.dut_ports[= 1], "testpmd> ", 120)=0A= > =0A= > - self.dut.send_expect("tso set 800 %d" % self.dut_ports[1], "test= pmd> ", 120)=0A= > - self.dut.send_expect("set fwd csum", "testpmd> ", 120)=0A= > - self.dut.send_expect("start", "testpmd> ")=0A= > -=0A= > self.tester.scapy_foreground()=0A= > time.sleep(5)=0A= > =0A= > - # Vxlan test=0A= > - self.tcpdump_start_sniffing([tx_interface, rx_interface])=0A= > - self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00:0= 0:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2")/UDP(sport=3D"1021"= ,dport=3D"4789")/VXLAN()/Ether(dst=3D%s,src=3D"52:00:00:00:00:00")/IP(src= =3D"192.168.1.1",dst=3D"192.168.1.2")/TCP(sport=3D"1021",dport=3D"1021")/("= X"*%s)], iface=3D"%s")' % (mac, mac, padding, tx_interface))=0A= > - out =3D self.tester.scapy_execute()=0A= > - out =3D self.dut.send_expect("show port stats all", "testpmd> ",= 120)=0A= > - print out=0A= > - self.tcpdump_stop_sniff()=0A= > - rx_stats =3D self.number_of_packets(rx_interface)=0A= > - if (rx_stats =3D=3D 2):=0A= > - self.verify(1, "Pass")=0A= > -=0A= > - # Nvgre test=0A= > - self.tcpdump_start_sniffing([tx_interface, rx_interface])=0A= > - self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00:0= 0:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2",proto=3D47)/NVGRE()= /Ether(dst=3D%s,src=3D"52:00:00:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"19= 2.168.1.2")/TCP(sport=3D"1021",dport=3D"1021")/("X"*%s)], iface=3D"%s")' % = (mac, mac, padding, tx_interface))=0A= > - out =3D self.tester.scapy_execute()=0A= > - out =3D self.dut.send_expect("show port stats all", "testpmd> ",= 120)=0A= > - print out=0A= > - self.tcpdump_stop_sniff()=0A= > - rx_stats =3D self.number_of_packets(rx_interface)=0A= > - if (rx_stats =3D=3D 2):=0A= > - self.verify(1, "Pass")=0A= > + for tso_s in self.tso_size:=0A= > + self.dut.send_expect("tso set %d %d" % (tso_s, self.dut_port= s[1]), "testpmd> ", 120)=0A= > + self.dut.send_expect("set fwd csum", "testpmd> ", 120)=0A= > + self.dut.send_expect("set promisc all off", "testpmd> ", 120= )=0A= > + self.dut.send_expect("start", "testpmd> ")=0A= > +=0A= > + for padd in padding_vxlan:=0A= > + # Vxlan test=0A= > + expect_rx_stats =3D padd/tso_s + 0 if padd % tso_s else = 1=0A= > + self.tcpdump_start_sniffing([tx_interface, rx_interface]= )=0A= > + self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D= "52:00:00:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2")/UDP(sport= =3D"1021",dport=3D"4789")/VXLAN()/Ether(dst=3D%s,src=3D"52:00:00:00:00:00")= /IP(src=3D"192.168.1.1",dst=3D"192.168.1.2")/TCP(sport=3D"1021",dport=3D"10= 21")/("X"*%s)], iface=3D"%s")' % (mac, mac, padd, tx_interface))=0A= > + out =3D self.tester.scapy_execute()=0A= > + out =3D self.dut.send_expect("show port stats all", "tes= tpmd> ", 120)=0A= > + self.tcpdump_stop_sniff()=0A= > + rx_stats =3D self.number_of_packets(rx_interface)=0A= > + self.verify(rx_stats =3D=3D expect_rx_stats, "FAIL: For = TSO size %d and packet size %d, expect rx stats =3D %d, \=0A= > + but actually r= eceived %d" %(tso_s, self.headers_size_vxlan + padd, expect_rx_stats, rx_st= ats))=0A= > +=0A= > + for padd in padding_nvgre:=0A= > + # Nvgre test=0A= > + expect_rx_stats =3D padd/tso_s + 0 if padd % tso_s else = 1=0A= > + #self.tcpdump_start_sniffing([tx_interface, rx_interface= ])=0A= > + self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D= "52:00:00:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2",proto=3D47)= /NVGRE()/Ether(dst=3D%s,src=3D"52:00:00:00:00:00")/IP(src=3D"192.168.1.1",d= st=3D"192.168.1.2")/TCP(sport=3D"1021",dport=3D"1021")/("X"*%s)], iface=3D"= %s")' % (mac, mac, padd, tx_interface))=0A= > + out =3D self.tester.scapy_execute()=0A= > + out =3D self.dut.send_expect("show port stats all", "tes= tpmd> ", 120)=0A= > + self.tcpdump_stop_sniff()=0A= > + rx_stats =3D self.number_of_packets(rx_interface)=0A= > + self.verify(rx_stats =3D=3D expect_rx_stats, "FAIL: For = TSO size %d and packet size %d, expect rx stats =3D %d, \=0A= > + but actually r= eceived %d" %(tso_s, self.headers_size_nvgre + padd, expect_rx_stats, rx_st= ats))=0A= > + self.dut.send_expect("stop", "testpmd> ")=0A= > =0A= > def test_perf_TSO_2ports(self):=0A= > """=0A= > @@ -339,6 +353,7 @@ class TestTSO(TestCase):=0A= > self.dut.send_expect("csum parse_tunnel on %d" % self.dut_po= rts[1], "testpmd> ", 120)=0A= > self.dut.send_expect("tso set 800 %d" % self.dut_ports[1], "= testpmd> ", 120)=0A= > self.dut.send_expect("set fwd csum", "testpmd> ", 120)=0A= > + self.dut.send_expect("set promisc all off", "testpmd> ", 120= )=0A= > self.dut.send_expect("start", "testpmd> ")=0A= > for frame_size in self.frame_sizes:=0A= > wirespeed =3D self.wirespeed(self.nic, frame_size, 2)=0A= =0A=