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 BC491A2E1B for ; Wed, 4 Sep 2019 07:01:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ADB401EC91; Wed, 4 Sep 2019 07:01:19 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 883D61BF46 for ; Wed, 4 Sep 2019 07:01:17 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 22:01:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,465,1559545200"; d="scan'208";a="357975189" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 03 Sep 2019 22:01:16 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 3 Sep 2019 22:01:15 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 3 Sep 2019 22:01:15 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.53]) with mapi id 14.03.0439.000; Wed, 4 Sep 2019 13:01:14 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Ma, LihongX" CC: "Mo, YufengX" Thread-Topic: [dts] [PATCH V2]framework/pktgen_base: fix rfc2544 return value missing zero Thread-Index: AQHVW6wjY6TDGU3hYkqIxrIoSAalUacbBCqg Date: Wed, 4 Sep 2019 05:01:13 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB1BE15@SHSMSX101.ccr.corp.intel.com> References: <1566782333-153289-1-git-send-email-yufengx.mo@intel.com> <1566782333-153289-2-git-send-email-yufengx.mo@intel.com> In-Reply-To: <1566782333-153289-2-git-send-email-yufengx.mo@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmM2YWU5NjItMjdhZS00MWMxLWJiOTgtY2U5ODdlNDdkMjc1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUDVLYU9pZ2tWWnNMTkFKSXhPU09wTDBSamdaVFpOZjZNUGpDWEFhR2RhaDlkd24rU0ZiSDZibUlmbitSYktjcyJ9 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 V2]framework/pktgen_base: fix rfc2544 return value missing zero 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 yufengmx > Sent: Monday, August 26, 2019 9:19 AM > To: dts@dpdk.org; Ma, LihongX > Cc: Mo, YufengX > Subject: [dts] [PATCH V2]framework/pktgen_base: fix rfc2544 return value > missing zero >=20 > loss rate >=20 > fix rfc2544 return value missing zero loss rate. >=20 > Signed-off-by: yufengmx > --- > framework/pktgen_base.py | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) >=20 > diff --git a/framework/pktgen_base.py b/framework/pktgen_base.py index > e9d3fcb..06ad738 100644 > --- a/framework/pktgen_base.py > +++ b/framework/pktgen_base.py > @@ -256,20 +256,20 @@ class PacketGenerator(object): > def measure_rfc2544(self, stream_ids=3D[], options=3D{}): > """ check loss rate with rate percent dropping """ > loss_rate_table =3D [] > - rate_percent =3D float(100) > + rate_percent =3D options.get('rate') or float(100) > permit_loss_rate =3D options.get('pdr') or 0 > self.logger.info("allow loss rate: %f " % permit_loss_rate) > rate_step =3D options.get('drop_step') or 1 > result =3D self._measure_loss(stream_ids, options) > status =3D self._check_loss_rate(result, permit_loss_rate) > - loss_rate_table.append( > - [options.get('rate') or rate_percent, result]) > + loss_rate_table.append([rate_percent, result]) > # if first time loss rate is ok, ignore left flow > if status: > # return data is the same with dts/etgen format > # In fact, multiple link peer have multiple loss rate value, > # here only pick one > - return result.values()[0] > + tx_num, rx_num =3D result.values()[0][1:] > + return rate_percent, tx_num, rx_num > _options =3D deepcopy(options) > while not status and rate_percent > 0: > rate_percent =3D rate_percent - rate_step @@ -288,7 +288,10 = @@ > class PacketGenerator(object): > # use last result as return data to keep the same with dts/etgen= format > # In fact, multiple link peer have multiple loss rate value, > # here only pick one > - return loss_rate_table[-1][1].values()[0] > + last_result =3D loss_rate_table[-1] > + rate_percent =3D last_result[0] > + tx_num, rx_num =3D last_result[1].values()[0][1:] > + return rate_percent, tx_num, rx_num >=20 > def measure_rfc2544_with_pps(self, stream_ids=3D[], options=3D{}): > """ > -- > 1.9.3