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 190C4A04F3; Fri, 3 Jan 2020 04:04:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E15EC1C1FC; Fri, 3 Jan 2020 04:04:31 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 893A91C1FB for ; Fri, 3 Jan 2020 04:04:30 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 19:04:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,389,1571727600"; d="scan'208";a="419900260" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 02 Jan 2020 19:04:29 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 19:04:29 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 19:04:29 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.30]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.210]) with mapi id 14.03.0439.000; Fri, 3 Jan 2020 11:04:27 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Wang, Yinan" , "Ma, LihongX" Thread-Topic: [dts][PATCH V1 1/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and Thread-Index: AQHVwUUrhtWQciAEwkm2hmwm5FVFp6fYQnRg Date: Fri, 3 Jan 2020 03:04:27 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBA16A3@SHSMSX101.ccr.corp.intel.com> References: <20200102082040.16175-1-yufengx.mo@intel.com> <20200102082040.16175-2-yufengx.mo@intel.com> In-Reply-To: <20200102082040.16175-2-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-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 1/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and 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 > -----Original Message----- > From: Mo, YufengX > Sent: Thursday, January 2, 2020 4:21 PM > To: dts@dpdk.org; Wang, Yinan ; Ma, LihongX > ; Tu, Lijuan > Cc: Mo, YufengX > Subject: [dts][PATCH V1 1/1] framework/pktgen_base: fix rfc2544 dichotomy > warm up and >=20 > return value >=20 > fix rfc2544 dichotomy warm up and return value. >=20 > Signed-off-by: yufengmx > --- > framework/pktgen_base.py | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) >=20 > diff --git a/framework/pktgen_base.py b/framework/pktgen_base.py index > 75c3036..5e51b1a 100644 > --- a/framework/pktgen_base.py > +++ b/framework/pktgen_base.py > @@ -167,7 +167,6 @@ class PacketGenerator(object): > self._start_transmission(stream_ids, options) > time.sleep(delay) > self._stop_transmission(stream_ids) > - self._clear_streams() >=20 > def __get_single_throughput_statistic(self, stream_ids): > bps_rx =3D [] > @@ -495,7 +494,10 @@ class PacketGenerator(object): > # start warm up traffic > delay =3D options.get('delay') > _options =3D {'duration': duration} > - self.__warm_up_pktgen(stream_ids, _options, delay) > + if delay: > + self._prepare_transmission(stream_ids=3Dstream_ids) > + self.__warm_up_pktgen(stream_ids, _options, delay) > + self._clear_streams() > # traffic parameters for dichotomy algorithm > loss_rate_table =3D [] > hit_result =3D None > @@ -527,16 +529,18 @@ class PacketGenerator(object): > self._set_stream_rate_percent(rate) >=20 > if not hit_result: > - msg =3D ('expected permit loss rate <{0}>' > + msg =3D ('expected permit loss rate <{0}> ' > 'not between rate {1} and rate {2}').format( > permit_loss_rate, max_rate, min_rate) > self.logger.error(msg) > self.logger.info(pformat(loss_rate_table)) > + ret_value =3D 0, result[0][1], result[0][2] > else: > self.logger.debug(pformat(loss_rate_table)) > + ret_value =3D rate, hit_result[0][1], hit_result[0][2] > self.logger.info("zero loss rate is %f" % rate) >=20 > - return hit_result > + return ret_value >=20 > def measure(self, stream_ids, traffic_opt): > ''' > -- > 2.21.0