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 396E0A3160 for ; Sat, 12 Oct 2019 07:50:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D9CB1EB88; Sat, 12 Oct 2019 07:50:34 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id D4D721EB82 for ; Sat, 12 Oct 2019 07:50:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2019 22:50:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,286,1566889200"; d="scan'208";a="346237143" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 11 Oct 2019 22:50:31 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 11 Oct 2019 22:50:31 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 11 Oct 2019 22:50:30 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 11 Oct 2019 22:50:30 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.166]) with mapi id 14.03.0439.000; Sat, 12 Oct 2019 13:50:29 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Wang, Yinan" , "Ma, LihongX" CC: "Chen, Zhaoyan" , "Mo, YufengX" Thread-Topic: [dts] [PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug Thread-Index: AQHVdDsUpIdEmhsX+0m8MyrBg1lGqadWmWbQ Date: Sat, 12 Oct 2019 05:50:28 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB3EB33@SHSMSX101.ccr.corp.intel.com> References: <20190926072317.19170-1-yufengx.mo@intel.com> <20190926072317.19170-2-yufengx.mo@intel.com> In-Reply-To: <20190926072317.19170-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-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTU2NDgzMGQtNzc3YS00YmIxLWJjODEtOTM4OTBhMjc1YTgzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVnQ3N256MHFJajJrMmlVRFd0bTd0NGpRUGJ1bU0zdU44VjZEc3NoK2xkK0Y2Zk9YSFdXaVwvZUYrQVBNeXdUMEcifQ== 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] dts/pktgen: fix rfc2544 rate percent bug 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: Thursday, September 26, 2019 3:23 PM > To: dts@dpdk.org; Wang, Yinan ; Ma, LihongX > > Cc: Chen, Zhaoyan ; Mo, YufengX > > Subject: [dts] [PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug >=20 >=20 > When do rfc2544, streams rate percent should be set a new rate percent an= d > stream attached on port should be cleared. >=20 > Signed-off-by: yufengmx > --- > framework/pktgen_base.py | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/framework/pktgen_base.py b/framework/pktgen_base.py index > cd541b0..7855f6f 100644 > --- a/framework/pktgen_base.py > +++ b/framework/pktgen_base.py > @@ -145,14 +145,14 @@ class PacketGenerator(object): > if not self.__streams: > return > for stream in self.__streams: > - stream['rate'] =3D rate_percent > + stream['options']['stream_config']['rate'] =3D rate_percent >=20 > def _set_stream_pps(self, pps): > ''' set all streams' pps ''' > if not self.__streams: > return > for stream in self.__streams: > - stream['pps'] =3D pps > + stream['options']['stream_config']['pps'] =3D pps >=20 > def reset_streams(self): > self.__streams =3D [] > @@ -265,12 +265,15 @@ class PacketGenerator(object): > tx_num, rx_num =3D result.values()[0][1:] > return rate_percent, tx_num, rx_num > _options =3D deepcopy(options) > + if 'rate' in _options: > + _options.pop('rate') > while not status and rate_percent > 0: > rate_percent =3D rate_percent - rate_step > if rate_percent <=3D 0: > msg =3D "rfc2544 run under zero rate" > self.logger.warning(msg) > break > + self._clear_streams() > # set stream rate percent to custom value > self._set_stream_rate_percent(rate_percent) > # run loss rate testing > -- > 2.21.0