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 9497DA3160 for ; Sat, 12 Oct 2019 07:52:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7CB321EB83; Sat, 12 Oct 2019 07:52:36 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 89DB11EB82 for ; Sat, 12 Oct 2019 07:52:34 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2019 22:52:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,286,1566889200"; d="scan'208";a="346237476" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 11 Oct 2019 22:52:33 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 11 Oct 2019 22:52:32 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 11 Oct 2019 22:52:31 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.165]) with mapi id 14.03.0439.000; Sat, 12 Oct 2019 13:52:30 +0800 From: "Tu, Lijuan" To: "Zhu, ShuaiX" , "dts@dpdk.org" CC: "Zhu, ShuaiX" Thread-Topic: [dts] [PATCH V3] tests/tso:Verify the chksum value. Thread-Index: AQHVdqlix4nIoO6Jz0eugLc1ywSrJKdWlRYQ Date: Sat, 12 Oct 2019 05:52:29 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB3EB61@SHSMSX101.ccr.corp.intel.com> References: <1569750045-22860-1-git-send-email-shuaix.zhu@intel.com> In-Reply-To: <1569750045-22860-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.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmMwMTJjNjQtYzQ2ZC00ZDBkLTgyZDItNzhlZGUyMTAwMTQ4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicmZDOHhEZllzYTBybE1nc1J5R29TXC9oTWdrYVk4Nzg1VHI5b21EeSsxTXZneDZpc2JPYU5memo3bnErcjFyY0EifQ== 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 V3] tests/tso:Verify the chksum value. 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: Sunday, September 29, 2019 5:41 PM > To: dts@dpdk.org > Cc: Zhu, ShuaiX > Subject: [dts] [PATCH V3] tests/tso:Verify the chksum value. >=20 > Add a new verification method. >=20 > Signed-off-by: zhu,shuai > --- > tests/TestSuite_tso.py | 57 ++++++++++++++++++++++++++++++++++++------ > 1 file changed, 49 insertions(+), 8 deletions(-) >=20 > diff --git a/tests/TestSuite_tso.py b/tests/TestSuite_tso.py index > 36e00fe..99f4e59 100644 > --- a/tests/TestSuite_tso.py > +++ b/tests/TestSuite_tso.py > @@ -44,6 +44,7 @@ import os > from test_case import TestCase > from settings import HEADER_SIZE > from pktgen import PacketGeneratorHelper > +from packet import load_pcapfile, save_packets >=20 > DEFAULT_MUT =3D 1500 > TSO_MTU =3D 9000 > @@ -116,8 +117,8 @@ class TestTSO(TestCase): > """ >=20 > for iface in ifaces: > - command =3D ('tcpdump -w tcpdump_{0}.pcap -i {0} 2>tcpdump_{= 0}.out > &').format(iface) > - del_cmd =3D ('rm -f tcpdump_{0}.pcap').format(iface) > + command =3D ('tcpdump -w /tmp/tcpdump_{0}.pcap -i {0} > 2>tcpdump_{0}.out &').format(iface) > + del_cmd =3D ('rm -f /tmp/tcpdump_{0}.pcap').format(iface) > self.tester.send_expect(del_cmd, '#') > self.tester.send_expect(command, '#') >=20 > @@ -145,7 +146,7 @@ class TestTSO(TestCase): > will add a known MAC address for the test to look for. > """ >=20 > - command =3D ('tcpdump -A -nn -e -v -r tcpdump_{iface}.pcap 2>/de= v/null > | ' + > + command =3D ('tcpdump -A -nn -e -v -r /tmp/tcpdump_{iface}.pcap > + 2>/dev/null | ' + > 'grep -c "seq"') > return self.tcpdump_command(command.format(**locals())) >=20 > @@ -161,9 +162,35 @@ class TestTSO(TestCase): > """ > Get the length of loading_sizes > """ > - scanner =3D ('tcpdump -vv -r tcpdump_{iface}.pcap 2>/dev/null |= grep > "seq" | grep "length"') > + scanner =3D ('tcpdump -vv -r /tmp/tcpdump_{iface}.pcap > + 2>/dev/null | grep "seq" | grep "length"') > return self.tcpdump_scanner(scanner.format(**locals())) >=20 > + def get_chksum_value_and_verify(self, dump_pcap, save_file, Nic_list= ): > + self.pks =3D load_pcapfile(dump_pcap) > + for i in range(len(self.pks)): > + self.pks =3D load_pcapfile(dump_pcap) > + pks =3D self.pks[i] > + out =3D pks.pktgen.pkt.show > + chksum_list =3D re.findall(r'chksum=3D(0x\w+)', str(out)) > + pks.pktgen.pkt['IP'].chksum=3DNone > + if "VXLAN" in str(out): > + pks.pktgen.pkt['UDP'].chksum=3DNone > + pks.pktgen.pkt['VXLAN']['IP'].chksum=3DNone > + pks.pktgen.pkt['VXLAN']['TCP'].chksum=3DNone > + elif "GRE" in str(out): > + pks.pktgen.pkt['GRE']['IP'].chksum=3DNone > + pks.pktgen.pkt['GRE']['TCP'].chksum=3DNone > + save_packets(self.pks, save_file) > + self.pks1 =3D load_pcapfile(save_file) > + out1 =3D self.pks1[i].pktgen.pkt.show > + chksum_list1 =3D re.findall(r'chksum=3D(0x\w+)', str(out1)) > + self.tester.send_expect("rm -rf %s" % save_file, "#") > + if self.nic in Nic_list and "VXLAN" in str(out): > + self.verify(chksum_list[0] =3D=3D chksum_list1[0] and ch= ksum_list[2] =3D=3D > chksum_list1[2] and chksum_list[3] =3D=3D chksum_list1[3], \ > + "The obtained chksum value is incorrect.") > + else: > + self.verify(chksum_list =3D=3D chksum_list1, "The obtain= ed > + chksum value is incorrect.") > + > def test_tso(self): > """ > TSO IPv4 TCP, IPv6 TCP, VXLan testing @@ -210,7 +237,7 @@ class > TestTSO(TestCase): > for loading_size in self.loading_sizes: > # IPv4 tcp test > self.tcpdump_start_sniffing([tx_interface, rx_interface]) > - out =3D self.dut.send_expect("clear port info all", "testpmd= > ", 120) > + out =3D self.dut.send_expect("clear port stats all", > + "testpmd> ", 120) >=20 > 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.dut.send_expect("show port stats all", "testpmd= > ", 120) > @@ -232,7 +259,7 @@ class TestTSO(TestCase): > for loading_size in self.loading_sizes: > # IPv6 tcp test > self.tcpdump_start_sniffing([tx_interface, rx_interface]) > - out =3D self.dut.send_expect("clear port info all", "testpmd= > ", 120) > + out =3D self.dut.send_expect("clear port stats all", > + "testpmd> ", 120) > 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= =3D10 > 21)/("X"*%s)], iface=3D"%s")' % (mac, loading_size, tx_interface)) > out =3D self.tester.scapy_execute() > out =3D self.dut.send_expect("show port stats all", "testpmd= > ", 120) > @@ -258,6 +285,10 @@ class TestTSO(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 > + Nic_list =3D ["fortville_eagle", "fortville_spirit", "fortville_= spirit_single", > "fortville_25g"] > + save_file =3D "/tmp/save.pcap" > + dump_pcap =3D "/tmp/tcpdump_%s.pcap" % rx_interface > + > mac =3D self.dut.get_mac_address(self.dut_ports[0]) >=20 > cores =3D self.dut.get_core_list("1S/2C/2T") > @@ -276,6 +307,10 @@ class TestTSO(TestCase): > self.dut.send_expect("csum set tcp hw %d" % self.dut_ports[0], > "testpmd> ", 120) > self.dut.send_expect("csum set sctp hw %d" % self.dut_ports[0], > "testpmd> ", 120) > self.dut.send_expect("csum set outer-ip hw %d" % self.dut_ports[= 0], > "testpmd> ", 120) > + if self.nic in Nic_list: > + self.logger.warning("Warning: fvl serise not support outer u= dp.") > + else: > + self.dut.send_expect("csum set outer-udp hw %d" % > + self.dut_ports[0], "testpmd> ", 120) > self.dut.send_expect("csum parse-tunnel on %d" % self.dut_ports[= 0], > "testpmd> ", 120) >=20 > self.dut.send_expect("csum set ip hw %d" % self.dut_ports[1], "t= estpmd> > ", 120) @@ -283,6 +318,10 @@ class TestTSO(TestCase): > self.dut.send_expect("csum set tcp hw %d" % self.dut_ports[1], > "testpmd> ", 120) > self.dut.send_expect("csum set sctp hw %d" % self.dut_ports[1], > "testpmd> ", 120) > self.dut.send_expect("csum set outer-ip hw %d" % self.dut_ports[= 1], > "testpmd> ", 120) > + if self.nic in Nic_list: > + self.logger.warning("Warning: fvl serise not support outer u= dp.") > + else: > + self.dut.send_expect("csum set outer-udp hw %d" % > + self.dut_ports[1], "testpmd> ", 120) > self.dut.send_expect("csum parse-tunnel on %d" % self.dut_ports[= 1], > "testpmd> ", 120) >=20 > self.dut.send_expect("tunnel_tso set 800 %d" % self.dut_ports[1]= , > "testpmd> ", 120) @@ -299,7 +338,7 @@ class TestTSO(TestCase): > # Vxlan test > self.tcpdump_start_sniffing([tx_interface, rx_interface]) > self.load_module() > - out =3D self.dut.send_expect("clear port info all", "testpmd= > ", 120) > + out =3D self.dut.send_expect("clear port stats all", > + "testpmd> ", 120) >=20 > 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")/UDP(sport=3D1021,dport=3D4789)/= 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=3D1021,dport=3D1021)/("X"*%s)], iface=3D"%s")' % (mac, ma= c, > loading_size, tx_interface)) > out =3D self.tester.scapy_execute() > out =3D self.dut.send_expect("show port stats all", "testpmd= > ", 120) > @@ -317,12 +356,13 @@ class TestTSO(TestCase): > 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) > + self.get_chksum_value_and_verify(dump_pcap, save_file, > + Nic_list) >=20 > for loading_size in self.loading_sizes: > # Nvgre test > self.tcpdump_start_sniffing([tx_interface, rx_interface]) > self.load_module() > - out =3D self.dut.send_expect("clear port info all", "testpmd= > ", 120) > + out =3D self.dut.send_expect("clear port stats all", > + "testpmd> ", 120) >=20 > 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",proto=3D47)/NVGRE()/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(s= port=3D10 > 21,dport=3D1021)/("X"*%s)], iface=3D"%s")' % (mac, mac, loading_size, > tx_interface)) > out =3D self.tester.scapy_execute() > out =3D self.dut.send_expect("show port stats all", "testpmd= > ", 120) > @@ -340,6 +380,7 @@ class TestTSO(TestCase): > 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) > + self.get_chksum_value_and_verify(dump_pcap, save_file, > + Nic_list) >=20 > def test_perf_TSO_2ports(self): > """ > -- > 2.17.2