From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id E54653DC for ; Wed, 14 Dec 2016 09:15:11 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP; 14 Dec 2016 00:15:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,345,1477983600"; d="scan'208";a="39824533" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 14 Dec 2016 00:15:05 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 14 Dec 2016 00:14:34 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 14 Dec 2016 00:14:31 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.11]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.77]) with mapi id 14.03.0248.002; Wed, 14 Dec 2016 16:12:15 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" CC: "Xu, HuilongX" Thread-Topic: [dts] [PATCH V1] try to fix sometime dut port rx packets error Thread-Index: AQHSUFkjh0ZWOWS9Ak25TD2et1SbTKEHIecw Date: Wed, 14 Dec 2016 08:12:14 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62D166CB@SHSMSX103.ccr.corp.intel.com> References: <1481094722-24921-1-git-send-email-huilongx.xu@intel.com> In-Reply-To: <1481094722-24921-1-git-send-email-huilongx.xu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGYyZTNmOGMtMjE2OS00MDVjLWI0MjYtZmQwYzY5OThiOGZlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkFFc1Vxb0VwRTFXRGNKR05Ebk92cjFrVHFGRmVKaXFLN0NXdUhkMUNWbUE9In0= x-ctpclassification: CTP_IC 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] try to fix sometime dut port rx packets error 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: Wed, 14 Dec 2016 08:15:12 -0000 Huilong, Packet transmission should be reliable in DTS, otherwise all cases can't tr= ust with the result. If send packet by scapy console is not so reliable, please try with packet = module. We plan to replace scapy command with packet module later. Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong > Sent: Wednesday, December 07, 2016 3:12 PM > To: dts@dpdk.org > Cc: Xu, HuilongX > Subject: [dts] [PATCH V1] try to fix sometime dut port rx packets error >=20 > some time dut rx packet error, we guess the root case about scapy send > packets. > so we try send packets again when check dut not rx packets. >=20 > Signed-off-by: xu,huilong > --- > tests/TestSuite_pmd.py | 30 +++++++++++++++++------------- > 1 file changed, 17 insertions(+), 13 deletions(-) >=20 > diff --git a/tests/TestSuite_pmd.py b/tests/TestSuite_pmd.py > index 7b9e6b5..e8a65e5 100644 > --- a/tests/TestSuite_pmd.py > +++ b/tests/TestSuite_pmd.py > @@ -342,19 +342,23 @@ class TestPmd(TestCase,IxiaPacketGenerator): > checksum =3D '' > if checksum_test: > checksum =3D 'chksum=3D0x1' > - > - self.tester.scapy_foreground() > - self.tester.scapy_append('nutmac=3D"%s"' % mac) > - self.tester.scapy_append('sendp([Ether(dst=3Dnutmac, > src=3D"52:00:00:00:00:00")/IP(len=3D%s)/UDP(%s)/Raw(load=3D"\x50"*%s)], > iface=3D"%s")' % ( > - load_size, checksum, padding, interface)) > - > - out =3D self.tester.scapy_execute() > - time.sleep(.5) > - > - port0_stats =3D self.get_stats(self.dut_ports[0]) > - p0tx_pkts, p0tx_bytes =3D [port0_stats['TX-packets'], > port0_stats['TX-bytes']] > - port1_stats =3D self.get_stats(self.dut_ports[1]) > - p1rx_pkts, p1rx_err, p1rx_bytes =3D [port1_stats['RX-packets'], > port1_stats['RX-errors'], port1_stats['RX-bytes']] > + for i in range(3): > + self.tester.scapy_foreground() > + self.tester.scapy_append('nutmac=3D"%s"' % mac) > + self.tester.scapy_append('sendp([Ether(dst=3Dnutmac, > src=3D"52:00:00:00:00:00")/IP(len=3D%s)/UDP(%s)/Raw(load=3D"\x50"*%s)], > iface=3D"%s")' % ( > + load_size, checksum, padding, interface)) > + > + out =3D self.tester.scapy_execute() > + time.sleep((i + 1) * 0.5) > + > + port0_stats =3D self.get_stats(self.dut_ports[0]) > + p0tx_pkts, p0tx_bytes =3D [port0_stats['TX-packets'], > port0_stats['TX-bytes']] > + port1_stats =3D self.get_stats(self.dut_ports[1]) > + p1rx_pkts, p1rx_err, p1rx_bytes =3D [port1_stats['RX-packets= '], > port1_stats['RX-errors'], port1_stats['RX-bytes']] > + #dut port rx packets already > + if (p1rx_pkts - gp1rx_pkts): > + break > + time.sleep(i) >=20 > p0tx_pkts -=3D gp0tx_pkts > p0tx_bytes -=3D gp0tx_bytes > -- > 1.9.3