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 8C20E567C for ; Mon, 18 Jan 2016 07:57:25 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 17 Jan 2016 22:57:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,311,1449561600"; d="scan'208";a="883703679" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 17 Jan 2016 22:57:25 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 17 Jan 2016 22:57:24 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 17 Jan 2016 22:57:24 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.218]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.117]) with mapi id 14.03.0248.002; Mon, 18 Jan 2016 14:57:22 +0800 From: "Liu, Yong" To: "Tu, LijuanX A" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH]framework/tester.py: create packets length with protocol type Thread-Index: AQHRUbwq8s7NAtHRR0qyPh3W40at/58A1lxg Date: Mon, 18 Jan 2016 06:57:21 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E13B0D978@SHSMSX103.ccr.corp.intel.com> References: <1453099389-21011-1-git-send-email-lijuanx.a.tu@intel.com> In-Reply-To: <1453099389-21011-1-git-send-email-lijuanx.a.tu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzQ0NmEzODYtYmY5My00ZmIxLWJhMWQtYmQxYzU2MmVkMTY0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiM0RNb2lmZVNFM21MUUFJYzJDZ2V5clRoaW1nWmhTbldmNmtoMU1YbW1Baz0ifQ== 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]framework/tester.py: create packets length with protocol type 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: Mon, 18 Jan 2016 06:57:26 -0000 Lijuan, few comments below. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu > Sent: Monday, January 18, 2016 2:43 PM > To: dts@dpdk.org > Subject: [dts] [PATCH]framework/tester.py: create packets length with > protocol type >=20 > Signed-off-by: Lijuan Tu > --- > framework/tester.py | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/framework/tester.py b/framework/tester.py > index c8cebd6..d3deb3b 100644 > --- a/framework/tester.py > +++ b/framework/tester.py > @@ -471,10 +471,11 @@ class Tester(Crb): > else: > return None >=20 > - def check_random_pkts(self, portList, pktnum=3D2000, interval=3D0.01= , > allow_miss=3DTrue, params=3DNone): > + def check_random_pkts(self, portList, pktnum=3D10000, interval=3D0.0= 1, > allow_miss=3DTrue, params=3DNone): > """ > Send several random packets and check rx packets matched > """ > +# allow_miss=3DTrue Meaningless code, please just remove it. > # load functions in packet module > module =3D __import__("packet") > pkt_c =3D getattr(module, "Packet") > @@ -485,6 +486,7 @@ class Tester(Crb): > pkts =3D [] > # packet type random between tcp/udp/ipv6 > random_type =3D ['TCP', 'UDP', 'IPv6_TCP', 'IPv6_UDP'] > + pkt_minlen =3D {'TCP': 64, 'UDP': 64, 'IPv6_TCP': 74, 'IPv6_UDP'= : > 64} > # at least wait 2 seconds > timeout =3D int(pktnum * (interval + 0.01)) + 2 > for txport, rxport in portList: > @@ -494,7 +496,7 @@ class Tester(Crb): > # chose random packet > pkt_type =3D random.choice(random_type) > pkt =3D pkt_c(pkt_type=3Dpkt_type, > - pkt_len=3Drandom.randint(64, 1514), > + pkt_len=3Drandom.randint(pkt_minlen[pkt_type= ], > 1514), > ran_payload=3DTrue) > # config packet if has parameters > if params and len(portList) =3D=3D len(params): > @@ -509,6 +511,7 @@ class Tester(Crb): > pkts.append(pkt) >=20 > # send and sniff packets > + sniff_f(intf=3DtxIntf, count=3Dpktnum, timeout=3Dtimeout) Why capture packets send to TX interface? It look like meaningless.=20 > inst =3D sniff_f(intf=3DrxIntf, count=3Dpktnum, timeout=3Dti= meout) > send_f(intf=3DtxIntf, pkts=3Dpkts, interval=3Dinterval) > recv_pkts =3D load_f(inst) > -- > 1.9.3