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 377C6A0613 for ; Mon, 23 Sep 2019 10:26:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2B6651BE8A; Mon, 23 Sep 2019 10:26:27 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 33F11493D for ; Mon, 23 Sep 2019 10:26:25 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Sep 2019 01:26:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,539,1559545200"; d="scan'208";a="182458563" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga008.jf.intel.com with ESMTP; 23 Sep 2019 01:26:24 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 23 Sep 2019 01:26:23 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 23 Sep 2019 01:26:23 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.140]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.53]) with mapi id 14.03.0439.000; Mon, 23 Sep 2019 16:26:21 +0800 From: "Zhu, ShuaiX" To: "Mo, YufengX" CC: "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1] tests/tso:Verify the chksum value. Thread-Index: AQHVcec+X0WedvSs60GP6wpFYmHNdKc47SAA Date: Mon, 23 Sep 2019 08:26:20 +0000 Message-ID: <4DC48DF9BDA3E54A836D2D3C057DEC6F0BB8EC04@SHSMSX103.ccr.corp.intel.com> References: <1569213182-79258-1-git-send-email-shuaix.zhu@intel.com> In-Reply-To: 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 V1] 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" Ok, thank you for your advice. I am going to modify it. > -----Original Message----- > From: Mo, YufengX > Sent: Monday, September 23, 2019 4:17 PM > To: Zhu, ShuaiX > Cc: dts@dpdk.org > Subject: RE: [dts] [PATCH V1] tests/tso:Verify the chksum value. >=20 > Hi, zhushuai >=20 > Your code self.logger.info("Warning: fvl serise not support outer udp.") >=20 > Since you want to display it as a warning, you can use self.logger.warnin= g. When > user run your script, he/she can see your message very clear. >=20 > BRs > Yufen, Mo >=20 > > -----Original Message----- > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhu,shuai > > Sent: Monday, September 23, 2019 12:33 PM > > To: dts@dpdk.org > > Cc: Zhu, ShuaiX > > Subject: [dts] [PATCH V1] tests/tso:Verify the chksum value. > > > > Add a new verification method. > > > > Signed-off-by: zhu,shuai > > --- > > tests/TestSuite_tso.py | 41 > +++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 41 insertions(+) > > > > diff --git a/tests/TestSuite_tso.py b/tests/TestSuite_tso.py index > > 36e00fe..537bc06 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 > > > > DEFAULT_MUT =3D 1500 > > TSO_MTU =3D 9000 > > @@ -164,6 +165,32 @@ class TestTSO(TestCase): > > scanner =3D ('tcpdump -vv -r tcpdump_{iface}.pcap 2>/dev/null= | > grep "seq" | grep "length"') > > return self.tcpdump_scanner(scanner.format(**locals())) > > > > + def get_chksum_value_and_verify(self, dump_pcap, save_file, Nic_li= st): > > + 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 > chksum_list[2] =3D=3D chksum_list1[2] and chksum_list[3] =3D=3D chksum_li= st1[3], \ > > + "The obtained chksum value is incorrect.") > > + else: > > + self.verify(chksum_list =3D=3D chksum_list1, "The > > + obtained chksum value is incorrect.") > > + > > def test_tso(self): > > """ > > TSO IPv4 TCP, IPv6 TCP, VXLan testing @@ -257,6 +284,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] > > )) > > + > > + Nic_list =3D ["fortville_eagle", "fortville_spirit", "fortvill= e_spirit_single", > "fortville_25g"] > > + save_file =3D "save.pcap" > > + dump_pcap =3D "/root/tcpdump_%s.pcap" % rx_interface > > > > mac =3D self.dut.get_mac_address(self.dut_ports[0]) > > > > @@ -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.info("Warning: fvl serise not support outer ud= p.") > > + 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) > > > > self.dut.send_expect("csum set ip hw %d" % self.dut_ports[1], > > "testpmd> ", 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.info("Warning: fvl serise not support outer ud= p.") > > + 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) > > > > self.dut.send_expect("tunnel_tso set 800 %d" % > > self.dut_ports[1], "testpmd> ", 120) @@ -317,6 +356,7 @@ class > TestTSO(TestCase): > > self.verify(int(tx_outlist[i]) =3D=3D 800, "the pa= cket > segmentation incorrect, %s" % tx_outlist) > > if loading_size% 800 !=3D 0: > > self.verify(int(tx_outlist[num]) =3D=3D loading_si= ze% > > 800, "the packet segmentation incorrect, %s" % tx_outlist) > > + self.get_chksum_value_and_verify(dump_pcap, save_file, > > + Nic_list) > > > > for loading_size in self.loading_sizes: > > # Nvgre test > > @@ -340,6 +380,7 @@ class TestTSO(TestCase): > > self.verify(int(tx_outlist[i]) =3D=3D 800, "the pa= cket > segmentation incorrect, %s" % tx_outlist) > > if loading_size% 800 !=3D 0: > > self.verify(int(tx_outlist[num]) =3D=3D loading_si= ze% > > 800, "the packet segmentation incorrect, %s" % tx_outlist) > > + self.get_chksum_value_and_verify(dump_pcap, save_file, > > + Nic_list) > > > > def test_perf_TSO_2ports(self): > > """ > > -- > > 2.17.2